University project · Computer Vision coursework
Gender Classification Application
A Windows Blazor Hybrid app that classifies uploaded face images with a Python model and displays confidence scores.
Overview
Gender Classification Application is a computer vision coursework project that connects a Windows desktop interface to a Python image classifier. Users can upload face images, process them, and review the model’s predicted labels and confidence scores together.
Key features
- Batch image input. Select or drag in multiple PNG or JPG images.
- Review results. See each image alongside its predicted label and confidence score in a results table.
- Track processing. A custom loading overlay, total processing time, and result count provide feedback during classification.
- Clear and repeat. Reset the selected images and results for another batch.
My contribution
In our three-person team, I handled training the image-classification model and integrating the trained Python model into the Blazor Hybrid application.
How it was built
.NET MAUI hosts a Blazor Hybrid interface with MudBlazor upload and table components. Python.NET passes image data from C# to Python and returns classification results.
The Python pipeline uses PyTorch and torchvision, loads a saved ResNet-18 classifier, resizes images to 224 × 224 pixels, and returns a class label with a softmax score. The coursework model classifies images using the dataset labels Female and Male.
Training & evaluation
The recovered train.py configures transfer learning with a pretrained ResNet-18. It freezes the backbone and trains a replacement final classification layer for the two dataset classes. Training uses batches of 32, cross-entropy loss, and SGD with a learning rate of 0.001 and momentum of 0.9.
The script saves best.pt when validation loss improves and stops after 10 epochs without improvement. The recovered data folders contain 47,009 training images and 11,649 validation images. The dataset’s original source and the exact training-run history are not yet confirmed.
The recovered folder’s best.pt has the same SHA-256 hash as the checkpoint bundled with the desktop app, linking the recovered training materials to the model used for inference. Its evaluate.py evaluates images from a separate test folder and generates a confusion matrix and classification report.
Results & findings
The project delivered a desktop image-classification workflow connecting the .NET interface to Python inference, with batch uploads, processing feedback, and per-image results.
The saved classification report records 88% accuracy on 200 test images, with 100 images per dataset class. It reports an F1 score of 0.88 for each class. These figures come from the saved report; the evaluation has not been rerun for this portfolio.
The screenshots show the original desktop UI and its prediction output. The per-image confidence score displayed by the app is a model output, separate from the test-set accuracy recorded in the report.
Project journal
Stories, decisions, and discoveries along the way.
No journal entries published yet.







