Skip to main content

Scratch Detection Demo

Try it yourself

To try the AI, simply click on the Try Demo button below. If you don't have an account yet, you will be prompted to sign up. Afterwards, the quick start projects overview will open where you can select the Scratch Detection project. After installing ONE WARE Studio, the project will open automatically.

About this demo

This demo showcases an industrial inspection scenario where scratches on metal bottle opener keychains are detected automatically.

The setup simulates a typical production quality control system. A bottle opener is placed on a rotating platform under a webcam while the AI continuously analyzes the surface for defects.

The demo was presented live at Embedded World, running on a NUC with an Intel CPU. Despite changes in lighting and environment compared to the original dataset, the ONE AI model remained stable and consistently detected the scratches during the rotation.

Detecting scratches on reflective metal surfaces is challenging because defects are often:

  • extremely thin and irregular
  • influenced by reflections and lighting
  • easily confused with engraved text or texture

ONE AI Model

The dataset was created by recording a short video of the rotating bottle opener and extracting frames. A total of 246 images were used, with scratches visible on roughly 30% of the frames.

All labels were generated in ONE WARE Studio using SAM3-assisted segmentation, followed by manual refinement. The dataset was split into 70% training, 20% validation, and 10% testing at a resolution of 505 × 256 pixels.

Comparison: YOLO26n vs. Custom CNN

To evaluate the performance, we compared a lightweight YOLO26n model with a custom architecture automatically generated by ONE AI. Because this demo should run smooth on an Intel CPU, we could not use bigger YOLO model.

The Challenge with YOLO

While YOLO is a powerful general-purpose object detection model, several issues appeared in this defect detection scenario:

  • Overlapping predictions were often produced for the same scratch.
  • The engraved text on the bottle opener was sometimes detected as a defect.
  • Predictions flickered between frames as the object rotated.
  • Patterns from previously seen defects in the dataset were sometimes hallucinated in new scenes.

These problems made the predictions unreliable for a real inspection workflow.

The Solution with ONE AI

ONE AI Model

Using ONE WARE Studio, ONE AI generated a task-specific segmentation model optimized for this inspection setup.

Instead of using a generic detection architecture, the model was automatically built for this controlled environment and specialized task:

  • The defects are relatively small and don't need much context from the surrounding image
  • The background is always similar
  • The defects always look similar and the model only needs to focus on the defects

Results

ONE AI Model

The task-specific architecture generated by ONE AI produced stable and consistent scratch detections while the object rotated on the turntable. Unlike YOLO that produced no viable solution. Both models could run smooth on the intel CPU. The ONE AI model was smaller with just 0.26 million parameters, but for this application, the accuracy was the main bottleneck.

Data Processing

Augmentation Settings

The images were processed at 505 × 256 resolution and converted to grayscale during preprocessing. This reduces computational complexity while preserving the structural information needed to detect scratches on reflective metal surfaces.

Model Settings

The model was trained using segmentation masks to accurately capture the thin and irregular shape of scratches. The output resolution was set to at least 60% of the input resolution to ensure that small defects remain visible in the predicted masks.

Christopher - Development Support

Need Help? We're Here for You!

Christopher from our development team is ready to help with any questions about ONE AI usage, troubleshooting, or optimization. Don't hesitate to reach out!

Our Support Email:support@one-ware.com