# Facial Emotion Recognition – SimpleCNN A lightweight convolutional neural network (CNN) for **facial emotion recognition**. The model is trained to classify grayscale facial images into **7 emotion categories**. ## Model Details - **Model type:** SimpleCNN (custom lightweight CNN) - **Framework:** PyTorch - **Task:** Image Classification - **Input shape:** 1 × 48 × 48 (grayscale image) - **Number of classes:** 7 - **Classes:** - 0 → Angry - 1 → Disgust - 2 → Fear - 3 → Happy - 4 → Sad - 5 → Surprise - 6 → Neutral ## Intended Uses & Limitations - ✅ Educational projects, demos, prototypes. - ❌ Not suitable for medical, psychological, or safety-critical applications. - ❌ May not generalize well outside datasets like FER2013. ## How to Use ```python from huggingface_hub import hf_hub_download import torch import json from facial_emotion import SimpleCNN # your model class # Load config config = json.load(open("config.json")) # Build model model = SimpleCNN(num_classes=config["num_classes"], in_channels=config["in_channels"]) # Load weights checkpoint = hf_hub_download(repo_id="sreenathsree1578/facial_emotion", filename="pytorch_model.bin") model.load_state_dict(torch.load(checkpoint, map_location="cpu")) model.eval() # Example inference dummy = torch.randn(1, 1, 48, 48) # dummy grayscale image with torch.no_grad(): out = model(dummy) pred = torch.argmax(out, dim=1).item() print("Predicted emotion:", config["labels"][str(pred)])