Gear defect detection is a practical machine vision challenge: defects can be small, surface appearance varies with lighting, and a single flaw may determine whether a complete part is acceptable. A deep convolutional neural network (CNN) can classify gear images automatically, but the way images are prepared for classification affects both inspection performance and processing time. A comparison of two CNN workflows illustrates the trade-off between analyzing a complete image and first isolating the regions that carry defect information.
Why gear inspection is difficult to automate
In the inspection task examined, each gear image contains eight rectangular regions. The gear is considered defective if any one of those regions shows a defect; otherwise, it is classified as non-defective. This whole-part decision depends on examining multiple areas, not simply recognizing the gear as an object.
The visual differences between acceptable and defective parts can be subtle. The study considered five defect characteristics: edge holes, horizontal or vertical scratches, bumps, small breakages or chunks, and asymmetrical shapes. Lighting and perspective add complexity. Reflections from metal surfaces can change apparent brightness, while regions near the center of a front-facing image can appear larger than those near the corners.
For a production operation, classification errors have different consequences. A false positive rejects a good part, reducing usable output; a false negative passes a defective part. Inspection design therefore needs to consider both error types, alongside the time required to process each image.
Two CNN approaches to gear defect detection
Classifying the complete image
The first workflow, called the Naïve approach in the study, sends the full gear image directly to a binary CNN classifier. The network learns image features through convolutional layers and uses fully connected layers to assign one of two labels: defective or non-defective. Its architecture included three convolutional layers followed by fully connected layers, with the final layer representing the two classes.
Because the model receives the entire image, it must learn to distinguish relevant defects amid all the other visual information, including the gear’s overall shape, the eight inspection regions, and variations in brightness and scale. The advantage is a simpler image-processing pipeline: there is no separate box-detection and cropping stage before classification.
Preprocessing and classifying each region
The fine-grained workflow first prepares the image, then classifies the eight rectangular regions. It applies gamma correction to normalize image brightness and contrast, followed by Canny edge detection to locate and crop the boxes. The CNN then evaluates each cropped region. If any region is classified as defective, the overall gear is labeled defective.
This approach uses image processing to focus classification on the areas that determine the inspection result. Canny detection identifies edges through a sequence that includes noise reduction, gradient calculation, edge thinning, and thresholding. In the reported workflow, gamma correction helped make the boxes easier to detect under differing light intensities; the study identified a gamma parameter of 3 as its best setting for this task.
What the reported results show
The comparison used 400 gear images: 200 defective and 200 non-defective, with original image dimensions of 1024 by 724 pixels. The results favored the fine-grained method on the reported classification measures, while the direct whole-image approach processed images faster.
- Naïve approach: 92% accuracy, 90.5% precision, 93.3% recall, 91.9% F-score and 90.8% specificity. Average processing time was 0.09 seconds per image.
- Fine-grained approach: 96.5% accuracy, 95.5% precision, 97.4% recall, 96.5% F-score and 95.6% specificity. Average processing time was 0.67 seconds per image.
In this experiment, the fine-grained method produced fewer false positives and false negatives. It correctly identified more defective gears while also more reliably recognizing non-defective ones. Its additional image-processing steps came with a longer average processing time: the Naïve workflow was reported to be roughly seven times faster.
These results describe a specific dataset and inspection setup, not a universal performance guarantee. The dataset contained an equal number of defective and non-defective images, and the reported figures should be understood in that context. Before applying either workflow to a production line, engineers would need to assess it using images representative of their own parts, imaging conditions, and defect criteria.
Choosing an inspection workflow
The practical choice depends on the priorities of the inspection station. Where cycle time is the main constraint, direct classification offers a simpler, faster path in the reported comparison. Where classification quality is the priority and additional processing time is acceptable, region-based preprocessing may be more suitable.
Engineers and integrators should also consider how the system handles the full decision rule: one defective box makes the gear defective. The fine-grained approach expresses that rule directly by classifying each region and combining the results. The whole-image model must learn the same relationship from complete images. In either case, testing should pay particular attention to false negatives, false positives, and lighting variation, since each affects production outcomes differently.
Conclusion
CNN-based machine vision can support automated gear inspection, but model selection is only part of the design. Image preparation and classification strategy influence the balance between accuracy and processing speed. In the reported comparison, cropping and classifying the eight inspection regions improved the measured classification results, while direct whole-image classification was faster. For automation teams, the key is to match the workflow to the station’s throughput requirements and quality risks, then validate it against representative production images.