Visual technology-based method and system for classifying and identifying defective parts of clock parts

Through the defective parts classification and identification method based on visual technology, the adaptive illumination correction and DualPathNet neural network are used to extract features, combined with MobileNetV3 and GANs to generate adversarial networks, the problems of missed detection and false detection in traditional detection are solved, and efficient and accurate defect detection is achieved to meet the needs of modern production lines.

CN120808037AActive Publication Date: 2025-10-17HENGYANG COUNTY JINMEISHI TECHNOLOGY CO LTD
View PDF 7 Cites 0 Cited by

Patent Information

Application Number
CN202511033607.4
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-07-25
Publication Date
2025-10-17
Estimated Expiration
2045-07-25

AI Technical Summary

Technical Problem

Traditional defect detection for watch parts is affected by the experience and fatigue of inspectors, and is prone to missed detections and false detections. It is also inefficient and cannot meet the inspection needs of modern production lines.

Method used

A defective parts classification and identification method based on visual technology is adopted. The adaptive illumination correction algorithm is used to eliminate reflective interference. The DualPathNet neural network is used to extract local texture and global geometric features. The MobileNetV3 lightweight classifier and GANs generative adversarial network are combined to calculate the posterior probability for classification through the Bayesian algorithm.

Benefits of technology

It achieves comprehensive capture of defect characteristics, improves the accuracy and completeness of detection, reduces missed detection and false detection rates, and can achieve millisecond-level real-time detection on industrial production lines to adapt to dynamic changes in production lines.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120808037A_ABST
    Figure CN120808037A_ABST
Patent Text Reader

Abstract

The invention discloses a method and a system for classifying and identifying defective parts of clock parts based on a visual technology, and the method comprises the steps: obtaining the image data of the clock parts, introducing a self-adaptive illumination correction algorithm, eliminating the reflection interference through a histogram equalization and enhancement technology, and achieving the classification and recognition of defective parts of the clock parts. Establishing a dual-path convolutional neural network to respectively extract local texture features and global geometric features in the processed image data, and performing weighted fusion of the features through an SEBlock attention mechanism to obtain fused feature data; establishing a lightweight classifier based on a neural network, inputting the fused feature data into the lightweight classifier for classification, and outputting a preliminary classification result; and generating a defect sample by using a GANs generative adversarial network according to the preliminary classification result, calculating a posterior probability through a Bayesian algorithm, and outputting a target classification result. And the accuracy and integrity of classification identification are improved.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present application relates to the technical field of image recognition, in particular to a watch spare part defect classification method and system based on visual technology. BACKGROUND

[0002] Traditional watch spare part defect detection is greatly influenced by the experience and fatigue degree of the detection personnel, and is prone to missed detection and false detection. For some extremely subtle scratches, spots and other defects, the detection personnel cannot concentrate after long-time work, and cannot accurately identify. Moreover, the artificial detection is low in efficiency, and it is difficult to meet the high-speed detection demand of modern watch production line, which seriously restricts the improvement of production efficiency. SUMMARY

[0003] The present application relates to the technical field of image recognition, in particular to a watch spare part defect classification method and system based on visual technology.

[0004] To achieve the above purpose, the technical scheme of the present application is as follows: further, in the watch spare part defect classification method based on visual technology, the watch spare part defect classification method comprises the following steps: Obtain the watch spare part image data, introduce the adaptive light correction algorithm, eliminate the reflection interference through histogram equalization and Retinex enhancement technology, and obtain the processed image data; Establish a DualPathNet double-path convolutional neural network to extract local texture features and global geometric features in the processed image data respectively, and perform weighted fusion of the features through SEBlock attention mechanism to obtain fusion feature data; Based on MobileNetV3 neural network, a lightweight classifier is established, the fusion feature data is input into the lightweight classifier for classification, and a preliminary classification result is output; According to the preliminary classification result, a GANs generative adversarial network is used to generate a defect sample, a posterior probability is calculated through a Bayesian algorithm, and a target classification result is output.

[0005] Further, in the watch spare part defect classification method based on visual technology, the watch spare part image data is obtained, the adaptive light correction algorithm is introduced, the reflection interference is eliminated through histogram equalization and Retinex enhancement technology, and the processed image data is obtained, which comprises: Obtain the watch spare part image data, calculate the number of pixels of each gray level in the image in the watch spare part image data; Calculate the cumulative distribution function, map the gray value of the original image to a new gray value range, and obtain the equalized image data; The original image is logarithmically transformed to convert multiplication operation into addition operation, a Gaussian filtering method is used to estimate the illumination component, a logarithmic form of the reflection component is obtained by calculation, and the reflection component is obtained by exponential transformation to obtain processed image data.

[0006] Further, in the above-mentioned clock component defect classification and identification method based on visual technology, the DualPathNet dual-path convolutional neural network is established to extract local texture features and global geometric features in the processed image data, and the features are weighted and fused through the SEBlock attention mechanism to obtain fusion feature data, including: The DualPathNet dual-path convolutional neural network is established to perform convolution operation through a convolution kernel to extract preliminary features of the processed image data to obtain a preliminary feature image; The preliminary feature image is sequentially subjected to three convolution blocks, batch normalization and ReLU activation function are added in the middle, and local texture details in the image are captured by reducing the receptive field, including surface scratches and spots; The processed image data is subjected to convolution operation through the convolution kernel of the DualPathNet dual-path convolutional neural network, the first convolution reduces the number of feature channels; the middle convolution extracts medium-scale geometric features, and the last convolution restores the number of channels; By increasing the receptive field, the global geometric features of the clock component are captured, including at least the overall shape and contour.

[0007] Further, in the above-mentioned clock component defect classification and identification method based on visual technology, the DualPathNet dual-path convolutional neural network is established to extract local texture features and global geometric features in the processed image data, and the features are weighted and fused through the SEBlock attention mechanism to obtain fusion feature data, including: The DualPathNet dual-path convolutional neural network is established to perform convolution operation through a convolution kernel to extract preliminary features of the processed image data to obtain a preliminary feature image; The preliminary feature image is sequentially subjected to three convolution blocks, batch normalization and ReLU activation function are added in the middle, and local texture details in the image are captured by reducing the receptive field, including surface scratches and spots; The processed image data is subjected to convolution operation through the convolution kernel of the DualPathNet dual-path convolutional neural network, the first convolution reduces the number of feature channels; the middle convolution extracts medium-scale geometric features, and the last convolution restores the number of channels; By increasing the receptive field, the global geometric features of the clock component are captured, including at least the overall shape and contour.

[0008] Further, in the above-mentioned clock component defect classification method based on visual technology, the MobileNetV3 neural network is used to establish a lightweight classifier, the fusion feature data is input into the lightweight classifier for classification, and a preliminary classification result is output, including: The fusion feature data is input into the lightweight classifier, and the convolution layer extracts deep patterns in the fusion feature through convolution kernels of different sizes, thereby amplifying the difference between the scratch texture feature and the surrounding normal texture; The pooling layer selects the maximum value and the average value of the local region, compresses the feature map size while retaining the key information, and obtains a high-dimensional feature region; The fully connected layer maps the high-dimensional feature to a preset classification space, and outputs a preliminary classification result, including at least qualified parts, scratch parts, deformation parts, and spot parts.

[0009] Further, in the above-mentioned clock component defect classification method based on visual technology, the MobileNetV3 neural network is used to establish a lightweight classifier, the fusion feature data is input into the lightweight classifier for classification, and a preliminary classification result is output, including: The discriminator extracts the feature details of the sample through multi-layer convolution operation, and analyzes whether the defect features in the image conform to the real physical law; The real samples of rare defects are given higher weights, and the generator preferentially generates diversified samples of defects.

[0010] Further, in the above-mentioned clock component defect classification method based on visual technology, the MobileNetV3 neural network is used to establish a lightweight classifier, the fusion feature data is input into the lightweight classifier for classification, and a preliminary classification result is output, including: The classification confidence of each type of defect is quantified based on the probability of the occurrence of each type of defect calculated by the Bayesian algorithm based on the preliminary classification result, and the target classification result is output.

[0011] Further, in the clock component defect classification system based on visual technology, the clock component defect classification system includes the following modules: An image data acquisition module is used to acquire clock component image data, introduce an adaptive illumination correction algorithm, eliminate glare interference through histogram equalization and Retinex enhancement technology, and obtain processed image data; An image feature fusion module is used to establish a DualPathNet double-path convolutional neural network to extract local texture features and global geometric features in the processed image data, and perform weighted fusion of the features through an SEBlock attention mechanism to obtain fusion feature data; The flaw preliminary classification module is configured to establish a lightweight classifier based on a MobileNetV3 neural network, input the fusion feature data into the lightweight classifier for classification, and output a preliminary classification result. The flaw target classification module is configured to generate a defect sample by using a GANs generative adversarial network according to the preliminary classification result, calculate a posterior probability by using a Bayesian algorithm, and output a target classification result.

[0012] Further, in the watch spare part flaw piece classification and identification system based on the visual technology, the flaw target classification module comprises the following submodules: The discriminator submodule is configured to extract feature details of a sample by a multi-layer convolution operation, and analyze whether a defect feature in an image conforms to a real physical law. The generator submodule is configured to give a higher weight to a real sample of a rare defect, and the generator preferentially generates diversified samples of the defect.

[0013] Further, in the watch spare part flaw piece classification and identification system based on the visual technology, the flaw target classification module comprises the following submodules: The output submodule is configured to calculate a classification confidence of each type of defect based on a probability of occurrence of the defect calculated by the preliminary classification result by using a Bayesian algorithm, and output a target classification result.

[0014] The beneficial effects are as follows: 1. The comprehensive capture of flaw features is realized, and the accuracy and integrity of the features are improved. The classification result based thereon is more reliable, and the missed detection and false detection rates are greatly reduced. 2. The technical solution can be deployed on an edge computing device of an industrial production line, realize millisecond-level real-time detection response, meet the detection needs of a high-speed assembly line of the watch manufacturing industry, and improve the production efficiency. 3. The system can quickly learn and generate related samples, include new defects in the classification system, continuously improve the identification capability of new defects, adapt to the dynamic changes of the production line, and has strong flexibility and adaptability. BRIEF DESCRIPTION OF DRAWINGS

[0015] Various other advantages and benefits will become apparent to those of ordinary skill in the art upon reading the following detailed description of the preferred embodiments with reference made to the accompanying drawings. The drawings are for purposes of illustration only and are not considered as limiting the application.

[0016] Figure 1 A first embodiment schematic diagram of a watch spare part flaw piece classification and identification method based on a visual technology in an embodiment of the application; Figure 2 A second embodiment schematic diagram of a watch spare part flaw piece classification and identification method based on a visual technology in an embodiment of the application; Figure 3A first embodiment schematic diagram of a watch spare part defect piece classification and identification system based on a visual technology in an embodiment of the present application. DETAILED DESCRIPTION

[0017] In order to make the purpose, technical solutions and advantages of the present application clearer, the present application is further described in detail below in combination with the drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present application and do not limit the present application.

[0018] It can be understood by those skilled in the art that the singular forms "a", "an" and "the" used herein include plural forms, unless specifically stated otherwise. It should be further understood that the use of the word "comprise" in the specification of the present application means that a feature, integer, step, operation, element and / or component exists, but does not exclude the existence or addition of one or more other features, integers, steps, operations, elements, components and / or groups thereof.

[0019] The present application will be described in detail below in combination with the drawings, Figure 1 As shown, the watch spare part defect piece classification and identification method based on a visual technology includes the following steps: Step 101, acquiring watch spare part image data, introducing an adaptive light correction algorithm, eliminating reflection interference through histogram equalization and Retinex enhancement technology to obtain processed image data; Specifically, in the present embodiment, the watch spare part image data is acquired, and the number of pixels of each gray level in the image data is calculated. The cumulative distribution function is calculated, and the gray value of the original image is mapped to a new gray value range; the equalized image data is obtained. The original image is logarithmically transformed, the multiplication operation is converted into an addition operation, the illumination component is estimated by using a Gaussian filtering method, the logarithmic form of the reflection component is obtained by calculation, and the reflection component is obtained by exponential transformation, and the processed image data is obtained.

[0020] Specifically, (I) Image data acquisition High-resolution industrial cameras (Basler acA2040-90uc cameras with a resolution of 12 million pixels) are used to acquire watch spare part image data. The camera parameter settings are as follows: exposure time is 5-10 ms, frame rate is 30 fps, lens focal length is adjusted according to the size of the spare part to ensure that the image clearly presents the details of the spare part. In order to ensure the stability of the image quality, the camera is fixed on a precision guide rail, and the camera is controlled automatically to capture watch spare parts at different angles and different positions to obtain multi-dimensional image data.

[0021] (ii) Adaptive light correction processing Histogram equalization: First, count the gray histogram of the image, that is, calculate the number of pixels of each gray level in the image. Then calculate the cumulative distribution function to map the original image gray value to a new gray value range, so that the gray distribution of the new image is more uniform. The specific formula is: let the original image gray level be r_k, the pixel number be n_k, the total number of image pixels be N, and the cumulative distribution function be CDF(r_k)=∑(n_j / N) (j from 0 to k), then the mapped gray value s_k=round((L-1)*CDF(r_k)), where L is the total number of gray levels (usually 256). Adjust the gray distribution of the image in this way to enhance the contrast of the image and make the details in the image clearer.

[0022] Retinex enhancement technology: This technology is based on the characteristics of the human visual system, which believes that an image can be decomposed into a light component and a reflection component, where the reflection component contains the essential information of the image, and the light component causes the non-uniformity and reflection of the image. In operation, first, the original image is logarithmically transformed to convert the multiplication operation into an addition operation, that is, log(I(x,y))=log(L(x,y))+log(R(x,y)), where I(x,y) is the original image, L(x,y) is the light component, and R(x,y) is the reflection component. Then estimate the light component L(x,y) using Gaussian filtering and other methods. Finally, the logarithmic form of the reflection component is obtained by log(R(x,y))=log(I(x,y))-log(L(x,y)), and then the exponential transformation is performed to obtain the reflection component R(x,y), thereby eliminating the reflection interference and obtaining the processed image data.

[0023] Step 102, establish DualPathNet dual-path convolutional neural network to extract and process local texture features and global geometric features in image data, and perform weighted fusion of features through SEBlock attention mechanism to obtain fused feature data; Specifically, in this embodiment, DualPathNet dual-path convolutional neural network is established, and convolution kernels are used for convolution operation to extract and process preliminary features of image data to obtain preliminary feature images; The preliminary feature images are sequentially passed through 3 convolution blocks, batch normalization and ReLU activation functions are added in the middle, and local texture details including surface scratches and spots are captured by reducing the receptive field; The processed image data is convolved by the convolution kernels of the DualPathNet dual-path convolutional neural network, the first convolution reduces the number of feature channels; the middle convolution extracts medium-scale geometric features, and the last convolution restores the number of channels; By increasing the receptive field, the global geometric features of the clock parts are captured, including at least the overall shape, contour.

[0024] The global average pooling operation is performed on the local texture features and the global geometric features, and the features of each channel are compressed into a scalar to obtain a channel descriptor. The channel descriptor is processed by a fully connected layer, and after the ReLU activation function, the dimension is restored by a fully connected layer, and the weight of each channel is obtained by using the Sigmoid activation function. The obtained weight is multiplied by the corresponding feature map, and the features of each channel are adjusted by weighting, and important features are given higher weights to obtain fused feature data.

[0025] Specifically, (I) Local texture feature extraction path This path is specially designed for the fine flaws on the surface of the clock parts, such as micron-level scratches, pinhole-like spots, and fine color differences.

[0026] In the initial stage, a 3x3 convolution kernel is used for the first feature extraction, and this size of convolution kernel can accurately cover the small-scale defect area, and the step is set to 1 and the edge pixels are preserved (padding=1), to ensure that the position information of the details of the original image is not lost.

[0027] Enter the intermediate processing stage, which contains 5 convolution blocks in series. Each convolution block is composed of two 3x3 convolution layers, the first layer is responsible for capturing basic texture features, and the second layer deepens the selection of features. Batch normalization processing is added between the two layers to stabilize the data distribution and avoid parameter fluctuations during network training, and then the ReLU activation function is connected to enable the network to capture nonlinear features - this design can effectively distinguish the differences between normal texture and abnormal flaw texture on the surface of the parts.

[0028] As the network level deepens, the number of channels of the feature map doubles after passing through two convolution blocks, and the description ability of complex texture is improved by increasing the feature dimension. The final output of the local feature map can clearly present the position and shape characteristics of various small flaws, providing accurate local basis for subsequent classification.

[0029] (II) Global geometric feature extraction path This path focuses on the integrity of the overall shape of the parts, such as whether there are deformations, edge defects, structural misplacement, etc.

[0030] First, a 7x7 large-size convolution kernel is used for preliminary feature extraction, and the step is set to 2 to moderately compress the image size while preserving enough global information (padding=3), which can quickly capture the overall contour framework of the parts.

[0031] The subsequent contains four residual blocks, each of which adopts a three-stage structure of "1x1 convolution-3x3 convolution-1x1 convolution". The first 1x1 convolution is responsible for reducing the number of feature channels and reducing the amount of calculation; the middle 3x3 convolution focuses on extracting medium-scale geometric features, such as the corner radius of the part, the position of the hole, etc.; and the last 1x1 convolution restores the channel number to ensure the consistency of the feature dimension. The jump connection between residual blocks (directly superimposing the input to the output) solves the problem of gradient attenuation in deep networks, allowing the network to effectively learn the overall structure of the part.

[0032] With the stacking of residual blocks, the receptive field of the network is continuously expanded, and finally it can cover the entire part area. The output global feature map can completely describe the shape, proportion, structure layout, and other macro information of the part.

[0033] II. SEBlock attention mechanism fusion process (1) Squeeze operation: focus on key information The feature maps output by the local texture feature path and the global geometric feature path are processed respectively. Through global average pooling, the two-dimensional feature map of each channel is converted into a numerical value, which represents the overall intensity of the channel feature. For example, the channel containing scratch features will get a higher value, while the channel value of the irrelevant background is lower. This step can condense the core information of each channel, providing a basis for subsequent weight allocation.

[0034] (2) Excitation operation: precise weight allocation The numerical value obtained by squeezing is input into a small neural network for processing. First, the channel dimension is reduced to 1 / 16 through the fully connected layer, reducing the computational complexity while focusing on the correlation between channels; after the ReLU activation function enhances the non-linear expression, another fully connected layer is used to restore the original channel dimension, and finally the Sigmoid function is used to compress the output value to 0-1, obtaining the weight coefficient of each channel.

[0035] For watch parts, channels containing defect features (local channels corresponding to scratches, global channels corresponding to deformations) will be given higher weights, while channels corresponding to background or normal areas will have lower weights, achieving focused attention on important features.

[0036] (3) Scaling operation: feature enhancement fusion The weight coefficients obtained by the excitation operation are multiplied with the feature maps of the corresponding channels one by one, the feature signals of high weight channels are strengthened, and the interference information of low weight channels is weakened. Then, the local texture features and the global geometric features are spliced according to the channel dimension to form the fusion feature data. This fusion mode not only retains the local details of the fine flaws, but also integrates the macro information of the overall structure of the part, providing more comprehensive feature support for subsequent classification.

[0037] Step 103, based on the MobileNetV3 neural network, a lightweight classifier is established, the fusion feature data is input into the lightweight classifier for classification, and a preliminary classification result is output; Specifically, in this embodiment, the fusion feature data is input into the lightweight classifier, and the convolution layer extracts the deep patterns in the fusion features through different sizes of convolution kernels, amplifying the differences between the texture features of the scratches and the surrounding normal texture; The pooling layer selects the maximum and average values of the local region, compresses the feature map size while retaining the key information, and obtains a high-dimensional feature region; The fully connected layer maps the high-dimensional features to a pre-set classification space, and outputs a preliminary classification result, including at least qualified parts, scratch parts, deformation parts and spot parts.

[0038] Specifically, (I) Application logic of depth separable convolution The depth separable convolution technology adopted by MobileNetV3 divides the traditional convolution operation into two steps: depth convolution and pointwise convolution. When processing the fusion features of clock parts, depth convolution will separately perform convolution operation on each input channel to accurately capture unique information of different feature channels, such as texture channels of local scratches and contour channels of global deformation. Pointwise convolution recombines these separated channel features through 1x1 convolution kernel to form more representative integrated features. This allows the classifier to efficiently operate under the real-time requirements of industrial detection. For clock part images with a size of usually 200-500 pixels, the processing speed can be improved by 3-5 times.

[0039] (II) Reinforcing effect of Squeeze-and-Excitation module The module is embedded in the key network layer of MobileNetV3, which dynamically adjusts the weight of the feature channel to further highlight the features that are crucial to defect recognition. For example, when processing a part image with a small spot, the module will automatically enhance the channel weight containing the spot feature, while suppressing irrelevant background channels, so that the network focuses more on the discrimination of the defect area. This mechanism complements the feature fusion of SEBlock in step 2, with the former focusing on the selection of global features after fusion, and the latter focusing on the preliminary weighting of double-path features.

[0040] Advantages of h-swish activation function Compared with traditional activation functions, the h-swish function reduces the computational loss while maintaining the feature discrimination through a smoother nonlinear transformation. In watch part detection, this characteristic is particularly suitable for handling subtle gray differences, such as slight color difference flaws in the plating layer of the part surface, which can be more accurately converted into distinguishable feature signals through this function, avoiding the loss of details due to activation value saturation.

[0041] II. Hierarchical processing flow of the classifier (1) Feature input and preprocessing The fused feature data (including local texture and global geometric features) first enter the input layer of the classifier, and the size of the feature map has been compressed to a size suitable for network operation (usually 32x32 or 64x64) through previous processing. The input layer will perform standardization processing on the feature data to eliminate the differences in numerical range of different batches of features, ensuring the stability of network training and inference.

[0042] (2) Progressive processing of convolution and pooling The network layers are composed of multiple "convolution-pooling" units: the convolution layer further extracts deep patterns in the fused features through different sizes of convolution kernels (mainly 3x3, considering local details and medium-scale features), such as amplifying the difference between the texture features of scratches and the surrounding normal texture; the pooling layer selects the maximum or average value of the local region to compress the feature map size while preserving key information, gradually focusing on the most discriminative feature area (the core position of the defect).

[0043] (3) Classification decision of the fully connected layer After multiple rounds of convolution and pooling, the feature data is converted into a one-dimensional vector and input into the fully connected layer. The fully connected layer maps high-dimensional features to a pre-set classification space through dense connections between neurons - for the watch part scenario, the classification space usually includes categories such as "qualified parts", "scratched parts", "deformed parts", "spotted parts", etc. Finally, the output is converted into probability values for each classification through the softmax function, and the class with the highest probability is the preliminary classification result.

[0044] Step 104, generating defect samples using GANs according to the preliminary classification result, calculating posterior probability through Bayesian algorithm, and outputting target classification result.

[0045] Specifically, in this embodiment, the discriminator extracts the feature details of the sample through multiple convolution operations, and analyzes whether the defect features in the image conform to the real physical law; Rare defect real samples are given higher weights, and the generator preferentially generates diverse samples of defects.

[0046] The classification confidence is quantified by the Bayesian algorithm based on the probability of each type of defect appearing in the preliminary classification results, and the target classification result is output.

[0047] Specifically, (I) Design logic of the generator The generator, as one of the core components of GANs, is mainly responsible for creating virtual samples that are highly similar to real defect samples. Its input is a randomly generated noise signal, which is gradually transformed through multiple layers of neural networks to map the disordered noise into image data with clear defect characteristics. In view of the defect characteristics of watch parts, the network structure of the generator adopts a progressive growth design: the initial layer focuses on generating the basic outline of the defect, such as the linear form of scratches and the circular base of spots; the deep network is responsible for adding detailed features, such as the roughness of the scratch edge and the light difference on the spot surface, so that the generated defect samples are consistent with the real samples in terms of texture and light response.

[0048] (II) Discrimination mechanism of the discriminator The role of the discriminator is to distinguish whether the input sample is a real defect sample (from the images of defective parts in actual production) or a virtual sample created by the generator. It extracts the feature details of the sample through multiple convolution operations, layer by layer analyzes whether the defect features in the image conform to the real physical laws, for example, judges whether the direction of the scratch is consistent with the stress direction in the part processing process, and whether the distribution of the spot conforms to the random characteristics of the electroplating defect. The output of the discriminator is a credibility score, which is used to feedback to the generator to optimize the generation effect.

[0049] (III) Dynamic process of adversarial training The generator and the discriminator achieve common optimization through continuous confrontation. In the early stage of training, the samples generated by the generator may have obvious defects, such as blurred outline or distorted features, which can be easily identified by the discriminator; as the training progresses, the generator adjusts the parameters according to the feedback from the discriminator, gradually improving the authenticity of the samples; at the same time, the discriminator also continuously learns the differences between real samples and optimized virtual samples, and improves the discrimination ability.

[0050] II. Targeted optimization of defect sample generation (I) Generation strategy focusing on rare defects For rare defects (edge collapse at a specific angle, small aperture offset) that appear infrequently but have a serious impact in watch part production, the generator will focus on learning the characteristics of these defects through reinforcement learning mechanism. During training, real samples of rare defects are given higher weights to guide the generator to generate diversified samples of this type of defect first, such as edge collapse of different lengths and aperture defects of different offset degrees, to make up for the lack of this type of data in the real sample library.

[0051] (II) Linkage mechanism with preliminary classification results The generated defect samples are not randomly generated, but are linked with the preliminary classification results output in step 3. When the recognition accuracy of a certain type of defect in the preliminary classification is low (the misjudgment rate of "deformed parts" exceeds 5%), the generator will increase the sample generation amount of this type of defect, and the generated samples will simulate the characteristics of the misjudgment in the preliminary classification.

[0052] (III) Evaluation criteria for sample quality To ensure the effectiveness of the generated samples, quality evaluation is conducted from three dimensions: first, feature consistency, the defect features (visual representation of scratch depth, geometric proportion of deformation) of the generated samples need to be consistent with the physical characteristics of the real samples; second, diversity, covering different forms of the same defect type (scratches of different lengths and widths); third, fidelity, through manual judgment and feature similarity analysis (comparing the feature distribution of real samples and generated samples), to ensure that the generated samples can be integrated into the original sample library for joint analysis.

[0053] III. Quantification process of Bayesian algorithm (I) Collection and application of prior information The quantification basis of Bayesian algorithm is prior probability, that is, the probability of the occurrence of each type of defect based on historical production data or preliminary classification results statistics.

[0054] (II) Feature matching logic of likelihood function The likelihood function is used to measure the possibility of the occurrence of sample features (including original image features and generated sample features) under a certain defect type. For example, for "spot parts", the likelihood function will analyze the matching degree of features such as spot size and distribution density in the sample with the typical features of this type of defect: if the spot features of a certain sample are highly consistent with the features of historical "spot parts", the likelihood value is higher; if there is a significant difference (abnormal spot shape), the likelihood value is lower.

[0055] (III) Comprehensive calculation of posterior probability By combining the results of prior probability and likelihood function, the posterior probability is obtained, that is, the final quantified classification confidence. For example, a certain part is preliminarily classified as "scratch part", combined with the prior probability (historical proportion of scratch defects) and the likelihood value (matching degree of scratch features of this part with typical scratch), the posterior probability of belonging to "scratch part" is calculated as 92%, and the probability of belonging to "qualified part" is 8%. This probability value quantifies the reliability of the classification result, providing a basis for subsequent decision-making.

[0056] IV. Output and application of target classification results (I) Hierarchical presentation of quantification results The final output target classification result not only contains the defect type ("scratched part" "deformed part"), but also carries the corresponding posterior probability value, and is divided into different confidence levels according to the probability size: high confidence (probability >= 90%), medium confidence (70%-90%), and low confidence (<70%). For example, the part labeled as "scratched part (high confidence)" can be directly judged as a defective part; the part labeled as "deformed part (low confidence)" needs to be manually reviewed to avoid misjudgment.

[0057] The beneficial effects are that 1. The comprehensive capture of defect features is realized, and the accuracy and integrity of classification and identification are improved. The classification result based on this is more reliable, and the miss detection and false detection rates are greatly reduced. 2. The technical scheme can be deployed on the edge computing device of the industrial production line to realize millisecond-level real-time detection response, meet the detection needs of the high-speed assembly line of the watch manufacturing industry, and improve the production efficiency. 3. The system can quickly learn and generate related samples, and include new defects into the classification system, continuously improve the identification ability of new defects, adapt to the dynamic changes of the production line, and have strong flexibility and adaptability.

[0058] Please refer to Figure 2 In the watch parts defect classification and identification method based on visual technology, a DualPathNet double-path convolutional neural network is established to extract and process local texture features and global geometric features in image data, and the features are weighted and fused through an SEBlock attention mechanism to obtain fused feature data including the following steps: Step 201, a DualPathNet double-path convolutional neural network is established, and a convolution kernel is used for convolution operation to extract and process the preliminary features of image data to obtain a preliminary feature image; Step 202, the preliminary feature image is sequentially passed through three convolution blocks, and batch normalization and ReLU activation functions are added in the middle to capture local texture details in the image, including surface scratches and spots, by reducing the receptive field; Step 203, the processed image data is convolved by the convolution kernel of the DualPathNet double-path convolutional neural network, the first convolution reduces the number of feature channels; the middle convolution extracts medium-scale geometric features, and the last convolution restores the number of channels; Step 204, the global geometric features of the watch parts are captured by increasing the receptive field, including the overall shape and contour.

[0059] The above describes the embodiments of the watch parts defect classification and identification method based on visual technology of the present application, please refer to Figure 3 , the watch parts defect classification and identification system based on visual technology includes the following modules: The image data acquisition module is configured to acquire watch accessory image data, introduce an adaptive light correction algorithm, eliminate reflection interference through histogram equalization and Retinex enhancement technology, and obtain processed image data; The image feature fusion module is configured to establish a DualPathNet double-path convolutional neural network to extract local texture features and global geometric features in the processed image data, perform weighted fusion of the features through an SEBlock attention mechanism, and obtain fused feature data. The flaw preliminary classification module is configured to establish a light-weight classifier based on a MobileNetV3 neural network, input the fused feature data into the light-weight classifier for classification, and output a preliminary classification result. The flaw target classification module is configured to generate a defect sample using a GANs generative adversarial network according to the preliminary classification result, calculate a posterior probability through a Bayesian algorithm, and output a target classification result.

[0060] The basic principles, main features and advantages of the present application are shown and described above. It should be understood by those skilled in the art that the present application is not limited by the above examples, and the above examples and descriptions in the specification are only preferred examples of the present application and are not intended to limit the present application. Without departing from the spirit and scope of the present application, various changes and improvements can be made to the present application, and these changes and improvements all fall within the scope of the claimed present application. The scope of protection of the present application is defined by the appended claims and their equivalents.

Claims

1. A method for classifying and identifying defective watch parts based on visual technology, characterized in that: The method for classifying and identifying defective watch parts comprises the following steps: Acquire image data of watch parts, introduce an adaptive illumination correction algorithm, and eliminate reflection interference through histogram equalization and Retinex enhancement technology to obtain processed image data; Establishing a DualPathNet dual-path convolutional neural network to respectively extract local texture features and global geometric features from the processed image data, and performing weighted fusion of features through the SEBlock attention mechanism to obtain fused feature data; Establish a lightweight classifier based on the MobileNetV3 neural network, input the fused feature data into the lightweight classifier for classification, and output a preliminary classification result; Based on the preliminary classification results, GANs is used to generate adversarial networks to generate defect samples, the posterior probability is calculated through the Bayesian algorithm, and the target classification results are output.

2. The method for classifying and identifying defective watch parts based on vision technology according to claim 1, characterized in that: The method of acquiring image data of watch parts and components, introducing an adaptive illumination correction algorithm, and eliminating reflection interference through histogram equalization and Retinex enhancement technology to obtain processed image data includes: Acquire image data of watch parts and components, and calculate the number of pixels in the image at each gray level in the image data of watch parts and components; Calculate the cumulative distribution function and map the grayscale value of the original image to a new grayscale value range to obtain the equalized image data; Perform logarithmic transformation on the original image, convert the multiplication operation into addition operation, use Gaussian filtering method to estimate the illumination component, obtain the logarithmic form of the reflection component by calculation, and then perform exponential transformation to obtain the reflection component to obtain the processed image data.

3. The method for classifying and identifying defective watch parts based on vision technology according to claim 1, characterized in that: The DualPathNet dual-path convolutional neural network is established to extract local texture features and global geometric features from the processed image data respectively, and weighted fusion of features is performed through the SEBlock attention mechanism to obtain fused feature data, including: Establish a DualPathNet dual-path convolutional neural network, perform convolution operations through convolution kernels, extract and process preliminary features of image data, and obtain preliminary feature images; The preliminary feature image is passed through three convolution blocks in sequence, with batch normalization and ReLU activation function added in between to capture local texture details in the image, including surface scratches and spots, by reducing the receptive field; The processed image data is convolved through the convolution kernel of the DualPathNet dual-path convolutional neural network. The first convolution reduces the number of feature channels; the middle convolution extracts medium-scale geometric features, and the final convolution restores the number of channels. By enlarging the receptive field, the global geometric features of watch parts are captured, including at least the overall shape and outline.

4. The method for classifying and identifying defective watch parts based on vision technology according to claim 1, characterized in that: The DualPathNet dual-path convolutional neural network is established to respectively extract local texture features and global geometric features from the processed image data, and weightedly fuse the features through the SEBlock attention mechanism to obtain fused feature data, further comprising: Perform global average pooling on local texture features and global geometric features to compress the features of each channel into a scalar to obtain a channel descriptor; The channel descriptor is reduced in dimension through the fully connected layer, and the dimension is restored after the ReLU activation function through the fully connected layer. The weight of each channel is obtained using the Sigmoid activation function. The obtained weight is multiplied by the corresponding feature map, the features of each channel are weighted and adjusted, important features are given higher weights, and fused feature data is obtained.

5. The method for classifying and identifying defective watch parts based on vision technology according to claim 1, characterized in that: The lightweight classifier is established based on the MobileNetV3 neural network, the fused feature data is input into the lightweight classifier for classification, and a preliminary classification result is output, including: The fused feature data is input into the lightweight classifier. The convolution layer extracts the deep pattern in the fused feature through convolution kernels of different sizes, amplifying the difference between the texture features of the scratch and the surrounding normal texture. The pooling layer selects the maximum and average values ​​of the local area to compress the feature map size while retaining key information to obtain a high-dimensional feature area; The fully connected layer maps high-dimensional features to a preset classification space and outputs preliminary classification results, which include at least qualified parts, scratched parts, deformed parts, and spotted parts.

6. The method for classifying and identifying defective watch parts based on vision technology according to claim 1, characterized in that: The method of generating defect samples using a GANs generative adversarial network based on the preliminary classification results, calculating the posterior probability using a Bayesian algorithm, and outputting the target classification results includes: The discriminator extracts the characteristic details of the sample through multi-layer convolution operations and analyzes whether the defect features in the image conform to the real physical laws; Higher weights are given to real samples of rare defects, and the generator prioritizes generating diverse samples of defects.

7. The method for classifying and identifying defective watch parts based on vision technology according to claim 1, characterized in that: The method further comprises: generating defect samples using a GANs generative adversarial network based on the preliminary classification results, calculating the posterior probability using a Bayesian algorithm, and outputting the target classification results. The Bayesian algorithm is used to quantify the probability of occurrence of various defects based on the preliminary classification results, and the target classification results are output.

8. A system for classifying and identifying defective watch parts based on vision technology, characterized by: The system for classifying and identifying defective watch parts includes the following modules: The image data acquisition module is used to acquire image data of watch parts and components, introduce an adaptive illumination correction algorithm, and eliminate reflection interference through histogram equalization and Retinex enhancement technology to obtain processed image data; An image feature fusion module is used to establish a DualPathNet dual-path convolutional neural network to extract local texture features and global geometric features from the processed image data, and perform weighted fusion of features through the SEBlock attention mechanism to obtain fused feature data; A defect preliminary classification module is used to establish a lightweight classifier based on the MobileNetV3 neural network, input the fused feature data into the lightweight classifier for classification, and output a preliminary classification result; The defect target classification module is used to generate defect samples using the GANs generative adversarial network based on the preliminary classification results, calculate the posterior probability through the Bayesian algorithm, and output the target classification results.

9. The system for classifying and identifying defective watch parts based on vision technology according to claim 8, characterized in that: The defective object classification module includes the following submodules: The discriminator submodule is used to extract the characteristic details of the sample through multi-layer convolution operations and analyze whether the defect features in the image conform to the real physical laws; The generator submodule is used to give higher weights to real samples of rare defects, and the generator prioritizes generating diverse samples of defects.

10. The system for classifying and identifying defective watch parts based on vision technology according to claim 8, characterized in that: The defective object classification module includes the following submodules: The output submodule is used to output the target classification result by using the Bayesian algorithm to quantify the classification credibility based on the probability of occurrence of various defects statistically analyzed based on the preliminary classification results.

Citation Information

Patent Citations

  • Through-the-wall radar human body behavior identification method and device based on multi-link information decision

    CN115184890A

  • Image-based big data analysis method

    CN117333409A

  • Cloth defect real-time detection method based on machine vision

    CN117495814A

  • Polarized SAR image classification method based on Diffusion model

    CN118115803A

  • Packing material defect detection method and system based on machine vision

    CN120356002A