Inspiration
Visual quality inspection is critical in manufacturing, yet detecting subtle defects is not simply a matter of comparing two images pixel by pixel. Differences in alignment, lighting, and image registration can make a correct part appear defective or conceal a genuine anomaly. We built LoopCheck to explore a more transparent approach: an inspection system that compares a reference part with an inspected part, makes its decision through explicit stages, and can defer ambiguous cases for human review rather than forcing a potentially unreliable binary decision.
What it does
LoopCheck is an agentic visual inspection prototype powered by OpenCV 5. Users can select a bundled synthetic test case or upload a reference image and an inspection image. The system registers the images, compares them, and returns an inspection decision: APPROVE, DEFECT, or HUMAN_REVIEW.
The application exposes intermediate visual evidence, including aligned images, heatmaps, and overlays, alongside the agent's tool-call sequence and termination rule. This makes the decision process easier to inspect instead of presenting only a final label.
How we built it
We built the inspection pipeline in Python, using OpenCV 5 and NumPy for computer vision and image processing. The agent follows an explicit tool-driven workflow: registration (R0) followed by comparison (R1), with decision and termination logic governing the outcome.
We packaged the application for AWS Lambda using Linux-compatible Python 3.13 x86-64 dependencies, verified the deployment archive, and deployed the backend through AWS SAM. API Gateway exposes the HTTP endpoint, while a Streamlit frontend provides the interactive demonstration. We also implemented API throttling, configurable CORS, structured inspection outputs, and deployment preflight checks.
Challenges we ran into
One major challenge was packaging native computer-vision dependencies for AWS Lambda from an Apple Silicon Mac. macOS binaries cannot run in the Linux x86-64 Lambda environment, so we had to build against the correct Linux wheels and verify the compiled binaries, dependency versions, and archive size.
Least-privilege AWS deployment was another challenge. The deployment identity encountered permission failures involving CloudFormation and API Gateway stage tagging. We diagnosed the failures from AWS error messages, refined the IAM policies, and added local policy checks and deployment safeguards.
We also had to account for ambiguity in visual inspection. A system that always returns a confident binary answer can be misleading, so the decision workflow includes a human-review outcome.
Accomplishments that we're proud of
- Built and deployed a working end-to-end visual inspection application.
- Integrated OpenCV 5 into a reproducible AWS Lambda deployment.
- Made intermediate visual evidence and agent tool calls visible in the interface.
- Implemented three distinct outcomes: approval, defect detection, and human review.
- Added archive verification, preflight checks, and a dedicated deployment identity to make deployment more reliable and secure.
- Successfully ran a live backend smoke test that returned the expected
DEFECTresult, followed by launching the interactive Streamlit application.
What we learned
We learned that a useful AI inspection system requires more than an image-comparison algorithm. Alignment, evidence presentation, decision boundaries, and explicit handling of uncertainty are all important to making the output interpretable.
We also gained practical experience deploying native machine-learning and computer-vision dependencies to serverless infrastructure, debugging IAM permissions, and separating local development from the target runtime environment.
Most importantly, we learned to distinguish a functioning prototype from a validated production system. Successful synthetic tests demonstrate that the pipeline works on the tested cases, but they do not establish real-world manufacturing accuracy.
What's next for LoopCheck
Our next steps are to evaluate the system on representative real-world inspection datasets, measure false-accept and false-reject rates, calibrate anomaly thresholds, and test robustness to lighting, alignment, and imaging variations. We also want to improve the evidence behind human-review decisions, expand the range of defect types, and investigate how LoopCheck could integrate with manufacturing quality-assurance workflows.
Log in or sign up for Devpost to join the conversation.