The text discusses the challenges of building anomaly detection models using high-resolution imagery and proposes a two-stage approach to overcome these challenges. It describes the training process for a Rekognition Custom Labels model and presents the results of experiments conducted using one-stage and two-stage models to detect missing holes in PCBs. The two-stage model outperformed the one-stage model. The text also provides an overview of the inference pipeline architecture and suggests ways to expand the solution.
Defect Detection in High-Resolution Imagery using Two-Stage Amazon Rekognition Custom Labels Models
High-resolution imagery, such as satellite imagery, drones, and DSLR cameras, is widely used today. However, building anomaly detection models using high-resolution imagery can be challenging due to the loss of visual information when resizing images. To overcome this challenge, a two-stage model approach can be used.
Solution Overview
For this use case, we use a dataset of images of printed circuit boards (PCBs) with missing hole pins. We demonstrate that a one-stage approach using object detection results in subpar detection performance. Therefore, we propose a two-stage model approach.
One-Stage Model Approach
In the one-stage model approach, we train an object detection model to identify missing holes on full images of PCBs. However, this approach has low recall and misses some missing holes. To improve performance, we explore splitting the image into cropped images and labeling both healthy and missing holes. This approach significantly improves precision and recall but still misses some missing holes.
Two-Stage Model Approach
In the two-stage model approach, we train two models: one for detecting pins and one for detecting if the pin is missing or not. The first model detects pins perfectly, and the second model accurately classifies pins as healthy or having missing holes. Combining these two models results in a high-performing defect detection system.
Inference Pipeline
To deploy the models, an architecture involving Amazon API Gateway, AWS Lambda, and an Amazon Rekognition custom endpoint is used. For one-stage models, the image is sent to the API Gateway, preprocessed by Lambda, and then routed to the Rekognition Custom Labels endpoint. For two-stage models, Lambda first calls the object detection model to generate the region of interest, crops the image, and then sends it to the classification model.
Conclusion
In this post, we trained one- and two-stage models to detect missing holes in PCBs using Amazon Rekognition Custom Labels. Two-stage models outperformed other variants and provide an effective solution for defect detection in high-resolution imagery. To implement AI in your company, consider using these models and follow the recommended steps for AI adoption.
Discover how AI can redefine your way of work
AI can help your company stay competitive and identify automation opportunities. Define measurable KPIs, select AI solutions that align with your needs, and implement AI gradually. For AI KPI management advice, connect with us at hello@itinai.com. Stay updated on leveraging AI by following us on Telegram t.me/itinainews or Twitter @itinaicom.
Spotlight on a Practical AI Solution: AI Sales Bot
Consider using the AI Sales Bot from itinai.com/aisalesbot to automate customer engagement and manage interactions across all customer journey stages. Discover how AI can redefine your sales processes and customer engagement. Explore solutions at itinai.com.