← Back to Projects
Computer Vision · Deep Learning · Apple Silicon

MLX Fish Species Classifier

A custom CNN for fish species recognition, trained and deployed locally on Apple Silicon using MLX.

MLXCNNFLASKPYTHONCOMPUTER VISION
Blue Tang Fish
Model4-Block VGG CNN
Inference APPLE MLX
Species DetectedBlue Tang
Confidence0.0%
Funny Fish

What Is It?

This project is an end-to-end, hardware-accelerated deep learning pipeline built from scratch using Apple's MLX framework. This project trains a custom VGG-style Convolutional Neural Network (CNN) to classify 9 distinct species of fish with extremely high accuracy.

By leveraging MLX, the model takes full advantage of unified memory architecture on Apple Silicon (M-series chips). This allows for near-instant memory access between the CPU and GPU without the traditional PCIe bottleneck, enabling extremely fast training and inference directly on a MacBook without cloud compute.

The Experiment

The project's true story isn't just about training a CNN—it's about overcoming data challenges and fighting overfitting.

PHASE 1: THE PROBLEM

Initial Dataset23 Classes
↓
Training Accuracy97%
↓
Validation Perf.50%
↓
OVERFITTING

PHASE 2: THE SOLUTION

Batch Normalization
+
AdamW (L2 Weight Decay 1e-4)
+
Dynamic Early Stopping
+
50% Dropout Layer
↓
ROBUST GENERALIZATION

Architecture

Input Image 224x224x3
→
Conv Block 1
Batch Norm
ReLU
MaxPool
→
Conv Block 2
Batch Norm
ReLU
MaxPool
→
Conv Block 3
Batch Norm
ReLU
MaxPool
→
Classifier (Dense layers)
→
Fish Species

Technology Stack

PythonApple MLXFlaskNumPyOpenCVReact