Overview
An automated visual inspection system that detects surface defects on
CFRP composite parts. Upload an image of a composite surface — the system
identifies scratches, dents/porosity, and delamination using thresholding,
contour analysis, and shape classification. PASS/FAIL verdict with annotated
output and detailed defect report. 95%+ accuracy on synthetic test data.
Inspired by Airbus's AVIA system.

Defective composite surface inspected — 2 defects found. Scratch identified
by red contour (area: 231px, circularity: 0.051), dent/porosity by orange
contour (area: 5027px, circularity: 0.723). Total defect area: 5258 pixels.
Verdict: ❌ FAIL. Left panel shows raw input, right panel shows annotated
result with bounding boxes and labels.
What It Does
Feature | Detail |
|---|---|
🔍 3 Defect Types | Scratches (high aspect ratio → red), dents/porosity (high circularity → orange), delamination (irregular shape → yellow). Classified by contour geometry. |
🖼️ Upload & Inspect | Drag-and-drop any composite surface image. Gradio web interface with side-by-side input/output view. Works on any browser. |
⚙️ Adjustable Sensitivity | Detection threshold slider (30–120) and minimum defect area filter (10–200 px). Lower threshold = more sensitive. |
📋 Detailed Report | Per-defect breakdown: type, area in pixels, XY location, circularity score. Total defect area and PASS/FAIL verdict. |
🧪 Synthetic Test Data | 40 generated images (20 good, 20 defective) with carbon fiber weave texture. Scratches, dents, delaminations injected programmatically. |
🌐 Live Deployment | Hosted on HuggingFace Spaces (free). Anyone can try it — no install required. |
Detection Results
Clean Surface — PASS

No defects detected. Output image matches input with no annotation
overlays. Verdict: ✅ PASS. Report confirms "Surface is clean. No defects
detected." The dark carbon fiber weave pattern is correctly identified
as normal texture, not flagged as defects.
Adjusted Sensitivity — Delamination + Dent

Threshold raised to 80, minimum area to 100px — filtering out smaller
noise while still catching significant defects. Delamination detected
(yellow box, 204px, circularity 0.037) and dent/porosity (orange box,
404px, circularity 0.929). Note: one smaller dent in the lower area
was filtered out by the higher min-area threshold — demonstrating how
the sliders let operators tune sensitivity for their use case.
Defect | Color | Shape Feature | Real-World Cause |
|---|---|---|---|
Scratch | 🔴 Red | Aspect ratio > 4 | Tool marks, handling damage |
Dent / Porosity | 🟠 Orange | Circularity > 0.6 | Impact damage, trapped air |
Delamination | 🟡 Yellow | Irregular shape | Ply separation, moisture ingress |
