03 · Machine Learning for Manufacturing

Casting Defect
Inspection System

Independent project · Python / PyTorch · github.com/raghavsingh1234

Visual inspection of cast parts is slow and inconsistent between operators. I built a system that classifies a casting from a single image and returns a severity score and an accept or reject call, with a saliency overlay so an inspector can see what the model reacted to rather than taking the label on trust.

Inspection dashboard: original image, Grad-CAM heatmap, and results panel
FIG 1 · Inspection dashboard. Left: input casting. Centre: Grad-CAM activation, concentrated on the surface flaw rather than the background or part edges. Right: class, confidence, severity score, and disposition.
Model data
TaskBinary classification, defective or acceptable
Dataset7,000+ labeled cast-metal images (public)
BackboneResNet18, ImageNet pretrained
TrainingTwo-stage: frozen backbone, then unfrozen final block
Test accuracy96%
OutputsClass, confidence, severity score, accept/reject
StackPython · PyTorch · Streamlit
Engineering decisions