Latex glove quality detection method based on deep learning
Through deep learning technology combined with latex glove quality detection, multi-angle image acquisition and category balanced sampling technology are used for annotation, and CNN and spatial attention mechanism are introduced to optimize the model, solving the problems of data annotation and model optimization in latex glove quality detection, achieving more efficient and accurate quality detection.
Patent Information
- Application Number
- CN202411347338.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-09-26
- Publication Date
- 2025-02-28
AI Technical Summary
The existing latex glove quality detection methods have problems with data labeling and model optimization, which leads to insufficient detection accuracy and adaptability, making it difficult to meet the needs of large-scale production.
The latex glove quality detection method based on deep learning is adopted, and image annotation is performed through multi-angle image acquisition and active learning technology based on category balanced sampling, and a convolutional neural network (CNN) and spatial attention mechanism are introduced to optimize the deep learning model to improve detection accuracy.
It improves the accuracy and efficiency of latex glove quality inspection, enhances attention to important features, reduces quality risks and production costs, and improves product quality.
Smart Images

Figure FDA0005061333630000011 
Figure FDA0005061333630000013 
Figure FDA0005061333630000021
Abstract
Description
Technical Field
[0001] The present invention belongs to the technical field of latex glove quality detection, and in particular relates to a latex glove quality detection method based on deep learning. Background Art
[0002] In the production process of latex gloves, it is crucial to ensure their quality. Traditional quality inspection methods mainly rely on manual visual inspection, which is not only inefficient, but also prone to missed inspections and misjudgments, making it difficult to meet the needs of large-scale production. With the development of science and technology, machine vision technology has gradually been applied to the field of quality inspection, but the existing machine vision inspection methods still have certain limitations in accuracy and adaptability. In recent years, deep learning technology has made significant progress, and it has powerful feature extraction and pattern recognition capabilities. Combining deep learning with machine vision technology provides a new idea for latex glove quality inspection. However, there are still some challenges in applying deep learning to latex glove quality inspection, such as the accuracy of data annotation, model optimization, and training efficiency. Therefore, an innovative method is needed to solve these problems and achieve more efficient and accurate latex glove quality inspection to improve production efficiency and product quality, and reduce production costs and quality risks. Summary of the invention
[0003] The present invention aims at the problems of data annotation accuracy and model optimization in the above-mentioned quality inspection, and proposes a method which is simple, easy to operate and can effectively solve the problems.
[0004] In order to achieve the above object, the technical solution adopted by the present invention comprises the following steps:
[0005] S1. First, a shooting device on a latex glove mold is used to collect multi-angle and all-round images of the latex gloves;
[0006] S2. Secondly, the active learning technology based on class balanced sampling is used to annotate the images, and the type of quality problem of latex gloves in each image is clearly marked;
[0007] S3. Then, a convolutional neural network (CNN) is used to build a deep learning model, and a spatial attention mechanism is introduced. The model is trained using labeled images, and the accuracy and generalization ability of the model are improved by adjusting the model parameters.
[0008] S4. Finally, use the trained deep learning model to automatically collect images and perform quality inspection on the gloves, and output the inspection results in a timely manner. According to the inspection results, gloves with quality problems are classified and processed to improve production efficiency and product quality.
[0009] The specific operation of step S3 using the convolutional neural network CNN for training is:
[0010] S31. First, the convolution layer performs a convolution operation with the input image through the convolution kernel to extract the features of the image. The convolution operation is: in represents the output value of the i-th row and j-th column of the l-th layer, f is the activation function, N l-1 is the number of feature maps in the previous layer, f h ,f w are the height and width of the convolution kernel, respectively. is the input value of the previous layer, is the bias term of the lth layer, m and n are the indices used to traverse the convolution kernel;
[0011] S32, the second pooling layer is used to reduce the resolution of the feature map, reduce the amount of calculation and the number of parameters, using the maximum pooling and average pooling methods;
[0012] S33. Then the spatial attention mechanism is introduced to make the model pay more attention to the areas on the latex gloves that may have quality problems. The calculation formula of the spatial attention mechanism is: M s (F) = σ(f 7×7 ([AvgPool(F); MaxPool(F)])), where F is the input feature map, AvgPool and Maxpool represent average pooling and maximum pooling operations respectively, and f 7×7 represents the convolution operation with a convolution kernel size of 7×7, σ represents the Sigmoid activation function, and M s (F) is the calculated spatial attention map;
[0013] S34. Finally, the labeled images are used to train the model. By adjusting the model parameters, the accuracy and generalization ability of the model are improved. During the training process, an improved loss function is used. By adjusting the weight factor, the model can pay more attention to important quality issues and improve the accuracy and pertinence of detection: Where N is the number of samples, C is the number of categories, and y i,j is the true category label of the i-th sample, which is 1 if it belongs to category j, otherwise it is 0. i,j is the probability that the model predicts that the i-th sample belongs to category j, w j is the weight assigned to class j.
[0014] Preferably, the shooting device in step S1 includes a high-resolution industrial camera for capturing multi-angle and omnidirectional images of latex gloves and a lighting device that can provide stable and uniform lighting to ensure clear quality of the captured images.
[0015] Preferably, the image annotation in step S2 is specifically to annotate the types of quality problems of the collected latex glove images, and clearly distinguish different states such as the presence of wrinkles, holes, impurities and no quality problems.
[0016] Preferably, the step S2 uses active learning based on class balanced sampling to annotate the latex glove images. Since different types of problems such as wrinkles, holes, and impurities may be unevenly distributed in the data, the accuracy of identifying rare problem categories will be reduced. Class balanced sampling is introduced, which is specifically implemented as follows:
[0017] S21. First, a small number of images are randomly selected from the unlabeled latex glove images, and the types of quality problems are manually labeled. The remaining images are retained as unlabeled data for selection in the active learning process.
[0018] S22. Use the labeled initial training set to train an initial classification model M0. For each individual x in the unlabeled dataset, calculate the prediction uncertainty of model M0. Where C is the number of categories, P(y i |x) is the model for category y i The predicted probability of
[0019] S23, then calculate the sample ratio w of each category c in the initial training set c , and calculate the class balance weight Where ε is a very small number to prevent the denominator from being zero;
[0020] S24, then for each unlabeled sample x, according to the category predicted by the model and its uncertainty U(x), calculate the weighted uncertainty score For the selected high-scoring sample x, manual labeling is performed to clearly mark the quality problem type of latex gloves;
[0021] S25. Finally, add the newly labeled samples to the training set and continuously update the model until the model reaches the expected accuracy of more than 95%.
[0022] Preferably, the implementation process of classifying the gloves with quality problems in step S4 is that first, when the deep learning model outputs the detection results, it is determined whether the gloves have quality problems according to the results; if the gloves have quality problems, the types of quality problems are further analyzed, such as wrinkles, holes or impurities; different treatment methods can be adopted for gloves with different types of quality problems. For gloves with less wrinkle problems, they are repaired or reworked, and for gloves with serious holes or impurities, they need to be scrapped.
[0023] Compared with the prior art, the advantages and positive effects of the present invention are that the spatial attention mechanism is introduced to make the model pay more attention to the areas on the latex gloves that may have quality problems, increase the focus on important features, and thus improve the accuracy of detection. The active learning technology based on class balanced sampling is used to annotate images, which improves the accuracy of data annotation, especially the recognition accuracy of rare problem categories, and provides more reliable training data for deep learning models. DETAILED DESCRIPTION
[0024] In order to more clearly understand the above-mentioned purpose, features and advantages of the present invention, the present invention is further described below in conjunction with embodiments. It should be noted that the embodiments of the present application and the features in the embodiments can be combined with each other without conflict.
[0025] In the following description, many specific details are set forth to facilitate a full understanding of the present invention. However, the present invention may also be implemented in other ways than those described herein. Therefore, the present invention is not limited to the specific embodiments of the following disclosure.
[0026] Embodiment, in the production process of latex gloves, quality inspection is a crucial link. In order to accurately detect quality problems of latex gloves and improve production efficiency and product quality, the present invention adopts effective image annotation technology, optimized deep learning model and accurate quality inspection and classification processing flow to achieve efficient and accurate detection of latex glove quality.
[0027] First, in order to obtain clear images from multiple angles and in all directions, a shooting device on the latex glove mold is used, including a high-resolution industrial camera and a lighting device. The high-resolution industrial camera can accurately capture the details of the gloves, and the lighting device provides stable and uniform lighting to ensure the quality of the collected images is clear, providing an accurate data basis for subsequent quality inspections.
[0028] Secondly, in order to accurately label the type of quality problem of latex gloves in each image, active learning technology is used. In active learning technology, considering that different types of problems such as wrinkles, holes, and impurities may be unevenly distributed in the data, which will lead to a decrease in the accuracy of identifying rare problem categories, class balanced sampling is introduced. First, a small number of images are randomly selected from the unlabeled latex glove images, and the types of quality problems are manually labeled. The remaining images are retained as unlabeled data for selection in the active learning process; an initial classification model M0 is trained using the labeled initial training set. For each individual x in the unlabeled data set, the prediction uncertainty of model M0 is calculated. Where C is the number of categories, P(y i |x) is the model for category y iThe predicted probability; then calculate the sample proportion w of each category c in the initial training set c , and calculate the class balance weight Where ε is a very small number to prevent the denominator from being zero; then for each unlabeled sample x, according to the category predicted by the model and its uncertainty U(x), calculate the weighted uncertainty score For the selected high-scoring samples x, they are manually labeled to clearly mark the quality problem types of latex gloves; finally, the newly labeled samples are added to the training set, and the model is continuously updated until the model reaches the expected accuracy of more than 95%. The above data labeling measures improve the accuracy of data labeling, especially for the recognition accuracy of rare problem categories, thereby providing more reliable training data for the deep learning model.
[0029] Next, we need to train the labeled images and use the convolutional neural network (CNN) to build a deep learning model. Considering that the convolutional neural network may not pay enough attention to important features and interfere with background information in the image when making predictions, the spatial attention mechanism is introduced. S31. First, the convolution layer performs a convolution operation with the input image through the convolution kernel to extract the features of the image. The convolution operation is: in represents the output value of the i-th row and j-th column of the l-th layer, f is the activation function, N l-1 is the number of feature maps in the previous layer, f h ,f w are the height and width of the convolution kernel, respectively. is the input value of the previous layer, is the bias term of the lth layer, m and n are the indices used to traverse the convolution kernel; secondly, the pooling layer is used to reduce the resolution of the feature map, reduce the amount of calculation and the number of parameters, and use the maximum pooling and average pooling methods; then the spatial attention mechanism is introduced to make the model pay more attention to the areas on the latex gloves that may have quality problems. The calculation formula of the spatial attention mechanism is: M s (F) = σ(f 7×7 ([AvgPool(F); MaxPool(F)])), where F is the input feature map, AvgPool and Maxpool represent average pooling and maximum pooling operations respectively, and f 7×7 represents the convolution operation with a convolution kernel size of 7×7, σ represents the Sigmoid activation function, and M s (F) is the calculated spatial attention map; finally, the labeled images are used to train the model. By adjusting the model parameters, the accuracy and generalization ability of the model are improved. The improved loss function is used in the training process. By adjusting the weight factor, the model can pay more attention to important quality issues and improve the accuracy and pertinence of detection: Where N is the number of samples, C is the number of categories, and y i,j is the true category label of the i-th sample, which is 1 if it belongs to category j, otherwise it is 0. i,j is the probability that the model predicts that the i-th sample belongs to category j, w j is the weight assigned to class j.
[0030] Finally, for the predicted results, if there are quality problems with the gloves, further analyze the type of quality problems, such as wrinkles, holes, or impurities; different treatment methods can be adopted for gloves with different quality problems. For gloves with less wrinkle problems, repair or rework is performed, and for gloves with serious holes or impurities, scrapping is required. Through the above embodiments, the quality detection of latex gloves based on deep learning can be effectively realized, so as to improve the detection efficiency and accuracy and ensure product quality.
[0031] The above description is only a preferred embodiment of the present invention and does not limit the present invention in other forms. Any technician familiar with the profession may use the technical content disclosed above to change or modify it into an equivalent embodiment with equivalent changes and apply it to other fields. However, any simple modification, equivalent change and modification made to the above embodiment based on the technical essence of the present invention without departing from the content of the technical solution of the present invention still falls within the protection scope of the technical solution of the present invention.
Claims
1. A method for quality detection of latex gloves based on deep learning, characterized in that: The following steps are involved: S1. First, a shooting device on a latex glove mold is used to collect multi-angle and all-round images of the latex gloves; S2. Secondly, the active learning technology based on class balanced sampling is used to annotate the images, and the type of quality problem of latex gloves in each image is clearly marked; S3. Then, a convolutional neural network (CNN) is used to build a deep learning model, and a spatial attention mechanism is introduced. The model is trained using labeled images, and the accuracy and generalization ability of the model are improved by adjusting the model parameters. S4. Finally, the trained deep learning model is used to automatically collect images and detect the quality of the gloves, and the test results are output in a timely manner. According to the test results, gloves with quality problems are classified and processed to improve production efficiency and product quality; The specific operation of step S3 using the convolutional neural network CNN for training is: S31. First, the convolution layer performs a convolution operation with the input image through the convolution kernel to extract the features of the image. The convolution operation is: in represents the output value of the i-th row and j-th column of the l-th layer, f is the activation function, N l-1 is the number of feature maps in the previous layer, f h ,f w are the height and width of the convolution kernel, respectively. is the input value of the previous layer, is the bias term of the lth layer, m and n are the indices used to traverse the convolution kernel; S32, the second pooling layer is used to reduce the resolution of the feature map, reduce the amount of calculation and the number of parameters, using the maximum pooling and average pooling methods; S33. Then the spatial attention mechanism is introduced to make the model pay more attention to the areas on the latex gloves that may have quality problems. The calculation formula of the spatial attention mechanism is: M s (F) = σ(f 7×7 ([AvgPool(F); MaxPool(F)])), where F is the input feature map, AvgPool and Maxpool represent average pooling and maximum pooling operations respectively, and f 7×7 represents the convolution operation with a convolution kernel size of 7×7, σ represents the Sigmoid activation function, and M s (F) is the calculated spatial attention map; S34. Finally, the labeled images are used to train the model. By adjusting the model parameters, the accuracy and generalization ability of the model are improved. During the training process, an improved loss function is used. By adjusting the weight factor, the model can pay more attention to important quality issues and improve the accuracy and pertinence of detection: Where N is the number of samples, C is the number of categories, and y i,j is the true category label of the i-th sample, which is 1 if it belongs to category j, otherwise it is 0. i,j is the probability that the model predicts that the i-th sample belongs to category j, w j is the weight assigned to class j.
2. The method for quality detection of latex gloves based on deep learning according to claim 1, characterized in that: The shooting device in step S1 includes a high-resolution industrial camera for capturing multi-angle and all-round images of latex gloves and a lighting device that can provide stable and uniform lighting to ensure that the captured images are clear in quality.
3. The method for latex glove quality detection based on deep learning according to claim 1, characterized in that: The step S2 of image annotation specifically annotates the types of quality problems of the collected latex glove images, and clearly distinguishes different states such as the presence of wrinkles, holes, impurities and no quality problems.
4. The method for quality detection of latex gloves based on deep learning according to claim 1, characterized in that: The step S2 uses active learning based on class balanced sampling to annotate the latex glove images. Since different types of problems such as wrinkles, holes, and impurities may be unevenly distributed in the data, the accuracy of identifying rare problem categories will be reduced. Class balanced sampling is introduced, which is specifically implemented as follows: S21. First, a small number of images are randomly selected from the unlabeled latex glove images, and the types of quality problems are manually labeled. The remaining images are retained as unlabeled data for selection in the active learning process. S22. Use the labeled initial training set to train an initial classification model M0. For each individual x in the unlabeled dataset, calculate the prediction uncertainty of model M0. Where C is the number of categories, P(y i |x) is the model for category y i The predicted probability of S23, then calculate the sample ratio w of each category c in the initial training set c , and calculate the class balance weight Where ε is a very small number to prevent the denominator from being zero; S24, then for each unlabeled sample x, according to the category predicted by the model and its uncertainty U(x), calculate the weighted uncertainty score For the selected high-scoring sample x, manual labeling is performed to clearly mark the quality problem type of latex gloves; S25. Finally, add the newly labeled samples to the training set and continuously update the model until the model reaches the expected accuracy of more than 95%.
5. The method for quality detection of latex gloves based on deep learning according to claim 1, characterized in that: The implementation process of step S4 for classifying and processing gloves with quality problems is that first, after the deep learning model outputs the detection results, the system determines whether the gloves have quality problems based on the results; if the gloves have quality problems, further analyze the type of quality problems, such as wrinkles, holes or impurities; different treatment methods can be adopted for gloves with different types of quality problems. For gloves with less wrinkle problems, repair or rework treatment is carried out, and for gloves with serious holes or impurities, scrapping is required.
Citation Information
Patent Citations
Industrial detection method combining active learning and deep learning technologies
CN114627076A
OSA detection method based on attention and Transform
CN115089123A
Silicon wafer surface defect detection method based on deep convolutional neural network
CN115409824A
Textile surface defect detection method based on deep learning
CN116883333A
SAR (Synthetic Aperture Radar) target open set identification method and device based on category separability enhancement
CN118172775A
Cited By
Cerebral arterial thrombosis prediction system based on big data
CN120260924A
Ischemic stroke prediction system based on big data
CN120260924B