A convolutional neural network that classifies facial emotions in real time. Click any photo below to run the model.
Built for COMP 472 at Concordia University. The goal was to design, train, and evaluate a convolutional neural network for facial emotion recognition from scratch, with no pretrained weights and no transfer learning. The model classifies faces into four categories: Angry, Engaged, Happy, and Neutral.
The CNN was trained on the FER2013 benchmark dataset with over 35,000 grayscale 48x48 facial images. The architecture uses three convolutional blocks with BatchNorm and LeakyReLU activations, followed by fully connected layers with dropout. Three variants were evaluated; this one performed best on validation.
The trained PyTorch model was exported to ONNX format for serving. This cuts the runtime footprint from around 500MB to 50MB without changing model behaviour. The backend runs on Flask via Render and this frontend is hosted on Netlify.
The model performs most reliably on images from the FER2013 distribution it was trained on. The sample grid pulls directly from that dataset. You can still upload your own photo, but results will naturally be less consistent for real-world images.