Orus Studio
Manufacturing

Built a custom AI defect detection system from the ground up

A pen-tip manufacturer

A computer vision system built from scratch to spot defects in a specialised manufacturing process, where no off-the-shelf product fitted the client's needs.

Client
A pen-tip manufacturer
Industry
Manufacturing

The situation

The client makes pen tips, and needed to catch specific defects in the winding stage of production. The defect types were particular to their process.

Generic inspection products are built for common defect types and standard layouts. Nothing readily available suited this use case, so the work had to start from the client's own images.

Inspection sheets contain several spools side by side, and the number of lanes varies between machines, so the system had to handle more than one layout.

What we did

01

Training data from the client's own process

We collected images from the production line and prepared and annotated them by defect type, including the 'skipping' and 'gooping' defects the client needed to catch. The model can only be as good as this data, so this step got as much attention as the model itself.

02

A custom image classification model

We trained a convolutional neural network (EfficientNet-B0, in PyTorch) on the annotated images. Starting from a proven architecture and training it on the client's data was faster and more reliable than designing a network from scratch.

03

Computer vision around the model

Before anything reaches the model, an OpenCV pipeline enhances contrast, finds each spool lane on the sheet, and cuts the image into consistent patches. Adaptive image features then cross-check what the model flags, so a decision rests on more than one signal.

04

Inference that fits the line

The pipeline takes a photo of a full sheet, works out the lanes (10 by default, configurable for other layouts, or a single pre-cropped spool), and writes out a labelled image showing where each defect was found.

The parts that were actually hard

Problem

Sheets do not always have the same number of spools.

How we handled it

Lane detection is driven by a configurable lane count, and a safeguard recognises a single cropped spool by its shape and skips lane splitting.

Problem

Lighting and contrast vary from image to image.

How we handled it

Every image is normalised with adaptive contrast enhancement (CLAHE) before patches are taken, so the model sees consistent input.

Problem

A model on its own can be confidently wrong.

How we handled it

A hybrid design pairs the neural network with adaptive OpenCV feature checks, and overlapping detections are merged before results are reported.

What we built

  • Annotated training dataset of the client's defect types
  • Custom-trained EfficientNet-B0 defect classification model
  • OpenCV pre-processing: contrast enhancement, lane detection and patch extraction
  • Hybrid decision engine combining model output with image-feature checks
  • Inference pipeline producing labelled output images per sheet

Built with

PythonPyTorchEfficientNet-B0OpenCVNumPy

Have a unique business problem? Let's build a solution around it.

Tell us what you are dealing with. We reply within one business day with questions, a suggested approach and how we would scope it.

Explore