--- library_name: keras tags: - tensorflow - keras - face-shape-classification - cnn pipeline_tag: image-classification license: apache-2.0 --- # FaceShape Model ## Model Description This model classifies facial shapes into categories such as oval, square, round, etc. It is designed for applications in virtual try-ons and eyeglass frame recommendations. - **Framework:** TensorFlow (Keras) - **Model Format:** `.h5` - **Purpose:** Face shape classification. ## How to Use To use this model, you can load it with TensorFlow and Keras. Below is an example: ```python from tensorflow.keras.models import load_model # Load the model model = load_model("path_to_your_model.h5") # Example input input_data = ... # Replace with your preprocessed input output = model.predict(input_data) print(output) ## Training Details The model was trained using a Convolutional Neural Network (CNN) architecture on the [Face Shape Classification Dataset](https://www.kaggle.com/datasets/lucifierx/face-shape-classification). ### Preprocessing Steps - **Image Size**: All input images were resized to 224x224 pixels. - **Normalization**: Pixel values were normalized to the range [0, 1]. - **Data Augmentation**: Techniques like rotation, flipping, and zooming were applied to improve generalization. ### Training Configuration - **Framework**: TensorFlow (Keras) - **Optimizer**: Adam - **Loss Function**: Categorical Crossentropy - **Batch Size**: 32 - **Epochs**: 50 - **Validation Accuracy**: Achieved 85% on the validation set. ### Hardware The model was trained on an NVIDIA GPU for faster computation. ## Limitations - The model may not perform well with low-resolution or occluded images. - The dataset may not represent all possible face shapes, which could limit generalization. ## Example Predictions Here are some example predictions: | Input Image | Predicted Class | |--------------------|-----------------| | ![example1](https://via.placeholder.com/100) | Oval | | ![example2](https://via.placeholder.com/100) | Square |