Compressed Defect Detection Training for Tiny Appearance Defects
Find Innovative SolutionsGenerate Solutions
Solution Overview
Problem
Existing lightweight deep learning-based defect detection models for mobile devices have reduced accuracy in detecting complex product appearance micro-defects, especially in low-computing environments, due to limited product appearance defect samples and micro-defect dimensions.
Innovation Solution
A compression training method that incorporates segmentation labeling factors to enhance feature sensitivity by correcting distances between feature vectors using a segmentation labeling factor matrix, aligning feature maps, and performing iterative training to improve accuracy in detecting product appearance micro-defects.
Engineering Contradictions & Design Principles
Engineering Contradiction Analysis
1Adaptability or versatility
If model compression techniques (pruning, quantification, knowledge distillation) are applied to deploy deep learning models on mobile devices, then the model can be deployed in low-computing environments, but the accuracy in detecting product appearance micro-defects is reduced
Solution Approach 1:
The patent applies local quality by introducing a segmentation labeling factor matrix that assigns different weights to different regions of the feature maps. Specifically, regions containing micro-defects are assigned higher weights while normal regions are assigned lower weights, allowing the model to focus computational attention on critical defect areas rather than treating all regions uniformly. This resolves the contradiction by enabling the compressed model to maintain high detection accuracy for micro-defects while operating in low-computing environments.
Solution Approach 2:
The patent changes the parameter space by modifying the loss function computation through the segmentation labeling factor matrix. Instead of using standard uniform loss computation, the patent transforms the distance calculation between teacher and student model feature maps by multiplying with the factor matrix, effectively changing how feature discrepancies are measured and weighted. This parameter transformation allows the compressed model to learn more discriminative features for micro-defect detection despite the constraints of model compression.
2Device complexity
If standard knowledge distillation is used to train the lightweight model, then the model size is reduced for mobile deployment, but the feature sensitivity to micro-defects is insufficient
Solution Approach 1:
The patent enhances feature sensitivity in the lightweight model by applying local quality through the segmentation labeling factor matrix during knowledge distillation. The factor matrix selectively emphasizes feature discrepancies in defect-containing regions while suppressing discrepancies in normal regions. This allows the student model to learn more sensitive and discriminative features for micro-defect detection, resolving the contradiction between model size reduction and maintaining feature sensitivity.
Solution Approach 2:
The segmentation labeling factor matrix acts as an intermediary that mediates the knowledge transfer process from teacher to student model. Instead of directly copying features, the factor matrix transforms and weights the feature maps, guiding the student model to focus on discriminative defect features. This intermediary mechanism enables the lightweight model to achieve better feature sensitivity than standard knowledge distillation while maintaining its compact size.
Data Source
AI summary
Disclosed in the present application are a compression and training method and apparatus for a defect detection model. The method comprises: obtaining, by means of segmentation labeling, a segmentation labeling factor matrix of each sample image; inputting each sample image into both a first defect detection model and a second defect detection model, and extracting first feature maps outputted by target convolutional layers in the first defect detection model and second feature maps outputted by corresponding target convolutional layers in the second defect detection model; and calculating, by using the segmentation labeling factor matrix, corrected distances between corresponding feature vectors of the first feature maps and the second feature maps, and calculating, as a first loss function, the sum of the corrected distances between all the feature vectors of the first feature maps and the second feature maps. The present embodiment can improve the accuracy of detecting tiny product appearance defects by means of a compressed defect detection model.


