Skip to content
RH★RYAN
HANGRALIMDEVELOPER / BALI, ID

ML / COMPUTER VISION

Face Expression Classification

An image-classification app that combines facial landmarks, texture features, and a neural network to label uploaded expressions as happy, neutral, or sad.

From pixels to expressions.
THE ROLE
Machine Learning Developer · University Project
THE WHEN
2024
BUILT WITH
PythonOpenCVdlibGLCMKerasStreamlit

My first end-to-end ML application

A university project introduced me to the complete path from an image dataset to a usable prediction interface. The result is a Streamlit app that accepts multiple PNG or JPG files, classifies each expression as happy, neutral, or sad, and shows the predicted label alongside all three class scores.

Turning a face into features

The pipeline resizes each image, converts it to grayscale, and equalizes the histogram before detecting a face. A dlib facial-landmark model identifies the eyes, eyebrows, and mouth, which are combined into a mask for feature extraction.

Instead of feeding the full image directly into the classifier, the project calculates Gray Level Co-occurrence Matrix (GLCM) texture features. Six statistics, including contrast, correlation, and homogeneity, are measured across four angles. A saved scaler transforms those features before a Keras neural network makes its prediction.

Making it usable

The interface pairs the results table with a gallery of the uploaded images. It also reports specific failures, such as an unreadable file or an image without a detected face, so the user has something actionable when preprocessing cannot complete.

The lesson I kept

The model file is only one part of an ML application. The landmark detector, feature extraction, and fitted scaler are all part of the same prediction pipeline. Learning to preserve and reuse that preprocessing state was as important as tuning the network itself.

This project became my foundation for later work on audio classification and mobile image recognition.

CASE FILE / 07THAT'S THE STORY.

LET'S BUILD THE NEXT ONE ↗
UP NEXT / CASE FILE 01

Bobby

An agent with a day job.

← THE COMPLETE LINEUPBACK TO BASE ↑
YOU'VE GOT A DIRECT LINE.

RYAN'S GUIDE

The inside story on the work.

AI PORTFOLIO GUIDEASK AWAY
THIS IS WHERE THE CONVERSATION STARTS.
Ryan's guide

Hey! I'm Ryan's AI portfolio guide. Want the story behind a project, his background, or what he builds? You're in the right place.

PICK A CONVERSATION STARTER

ENTER: SEND SHIFT + ENTER: NEW LINE

Have something personal to discuss? Email Ryan ↗