A deep-learning system that inspects a metal surface image and classifies it into one of nine common defect types — bridging my materials background with applied AI.
What it detects
Trained on common steel-surface defects, the models classify a surface image into the category it most resembles.
How it works
The project implements and compares several architectures for the same task — each attacking defect recognition from a different angle.
An additive angular-margin loss that pulls each defect class into a tighter, better-separated cluster in feature space — sharper decision boundaries between look-alike defects.
One network trained to classify, segment, and localize defects at once, so shared features are richer than any single task would learn alone.
A SimCLR-style self-supervised stage that learns defect representations from unlabeled images before fine-tuning — useful when labeled data is scarce.
An encoder–decoder that segments the defect region pixel-by-pixel while classifying it, giving a spatial map of where the flaw sits on the surface.
An architecture specialized for the fine-grained texture cues that distinguish metal defects, where the pattern matters more than the shape.
The trained models can be combined into an ensemble at inference — pooling their predictions for a more robust final call.
Built with
Try it
The detector serves a Flask web app; trained models download automatically on first launch.
# clone and set up git clone https://github.com/Akshaay1/metal-defect-detector cd metal-defect-detector pip install -r requirements.txt # launch the web app (models auto-download on first run) python app.py # then open http://localhost:5000
This is a TensorFlow-powered app, so the live detector runs on a Python backend rather than static hosting. Grab the code above to run the full interactive tool, or explore the source on GitHub.