Inspiration
Manual visual inspection on factory floors is slow, inconsistent, and expensive. Operators get tired, standards drift between shifts, and defects slip through. I wanted to build a system that could give any plant a fast, consistent, and auditable way to catch defects — without requiring a data science team or expensive hardware.
The HackFW: MADE Challenge's "AI for Manufacturing" track was the perfect opportunity to turn this idea into a working prototype.
What it does
InspectAI uses three specialized AI agents working together to inspect industrial parts from a single photo:
- Vision Agent (Qwen 3.8 27B) — examines the image and objectively describes every visible defect: scratches, dents, stains, deformations, missing components.
- Classifier Agent (GPT OSS 20B) — reads the vision report and classifies the part as CONFORMING, MINOR_DEFECT, or REJECTED, with a confidence score and recommended action.
- Report Writer Agent (GPT OSS 20B) — generates a clear, professional inspection report that any factory floor operator can read and act on immediately.
A supervisor layer checks consistency between agents — if confidence is below 50%, the system automatically flags the part for human review instead of guessing.
Every inspection is logged to a local SQLite database, giving plant managers full audit history and pass/fail statistics over time.
How I built it
The stack is intentionally lightweight:
- Python 3.13 as the core language
- Gradio for the web interface
- SQLite for persistent inspection history
- Groq API for inference — no heavy SDKs like LangChain, just direct HTTP calls via the
requestslibrary
I chose Groq specifically because it offers fast, free access to strong open-source models (Qwen for vision, GPT-OSS for reasoning) without requiring any local GPU or complex setup. This makes InspectAI genuinely deployable on a standard plant floor laptop.
The three-agent architecture was a deliberate choice to reduce hallucination: each agent has one narrow job, with low temperature settings, and the supervisor cross-checks confidence before finalizing a verdict — so the system never confidently reports a defect it isn't sure about.
Challenges I ran into
- Avoiding hallucination: early single-prompt approaches either missed real defects or invented ones. Splitting the task across three agents with strict, narrow responsibilities (and a confidence-based override) solved this.
- Classical computer vision limitations: my first prototype used raw OpenCV pixel thresholding (edge detection, contour analysis) to find defects. On real factory images, it flagged 50+ "defects" that were just shadows, cables, and reflections — completely unusable. Switching to a vision-language model instead of pixel math was the turning point.
- Environment and deployment hygiene: making sure the API key was never hardcoded or exposed in the public GitHub repo, using
.env+.gitignoreproperly, and recovering from an accidentally exposed key mid-build.
What I learned
That a multi-agent pipeline with narrow, well-scoped responsibilities beats a single large prompt for reliability — especially in a domain like quality control where false positives and false negatives both have real costs. I also learned how much a thin, dependency-light stack (no SDKs, just HTTP calls) helps when the goal is something a plant engineer could actually clone and run, not just a research notebook.
What's next for InspectAI
- Add a "Part Reference" field so each inspection ties to a specific SKU or batch
- PDF export of inspection reports for compliance archiving
- Overhead/station camera integration for continuous, real-time line monitoring rather than single-photo uploads
Log in or sign up for Devpost to join the conversation.