Packaging product full-breadth quality detection method and device combining deep learning and image processing technology and computer equipment
By combining deep learning and image processing technology in packaging product quality detection, using CIELAB color space and improved YOLOv5s model, the problem of insufficient detection accuracy and stability in the complex background of packaging products is solved, and the surface color difference of packaging products is achieved. High-precision detection of defects.
Patent Information
- Application Number
- CN202411324835.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-09-23
- Publication Date
- 2025-01-10
AI Technical Summary
The existing packaging product quality inspection methods have strong subjectivity and high missed detection rate. Especially in the complex background, the YOLO series models are difficult to effectively detect surface defects of packaging products, resulting in insufficient detection accuracy and stability.
Combining deep learning and image processing technology, the ΔE color difference quantization method in CIELAB color space and the improved YOLOv5s defect detection model are used to achieve the accuracy of the surface color differences and defects of packaging products through EMO network, TFE module, SCP structure and decoupling head. Test.
It realizes accurate quantification of the surface color differences of packaging products and full-frame defect detection, improves detection accuracy and stability, reduces the small target leakage detection rate, and is suitable for packaging product inspection in complex backgrounds.
Smart Images

Figure CN119295390A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of packaging product inspection image processing technology, and in particular to a packaging product full-width quality inspection method, a quality inspection device and a quality inspection computer device that combine deep learning and image processing technology. Background Art
[0002] As the key to product appearance and anti-counterfeiting, the quality of packaging directly affects consumer choices and brand development. In high-speed production lines, factors such as materials, environment and equipment can easily lead to packaging surface quality problems. With the improvement of packaging material quality and printing process requirements, especially the widespread application of transfer and composite cardboard and hot stamping processes, the difficulty of detection has increased significantly. In order to ensure the quality of products circulating in the market, it is particularly urgent to develop high-precision, efficient and easy-to-deploy packaging product surface defect detection technology.
[0003] There are currently two main common methods for testing the quality of packaging products.
[0004] The first is the subjective visual inspection method, which is a traditional manual inspection method for packaging product quality inspection. Under specific light conditions, the inspector makes a subjective assessment of the sample to be tested, and evaluates whether the packaging has surface defects based on the inspector's vision. However, the subjective visual inspection method is a completely subjective evaluation method, which is easily affected by various factors such as the inspector's experience, psychology, and physiology. For example, long-term continuous inspection of packaging materials is very likely to cause visual fatigue, resulting in missed inspections and false inspections. It is also difficult to reach a unified inspection standard, and quantification is difficult.
[0005] The second is the machine learning method. Machine learning methods rely on artificial feature design in industrial defect detection. They face many challenges when faced with difficult tasks and are prone to false detections and missed detections.
[0006] With the advancement of technologies such as industrial imaging and computer vision, CNN-based deep learning technology has significantly improved the ability to detect surface defects. At present, this field is mainly divided into two-stage and single-stage detection methods. Two-stage methods, such as the R-CNN series, have high accuracy but slow speed; single-stage methods, such as the YOLO series models, are superior in speed and efficiency and have become popular in practical applications.
[0007] However, with the emergence of new specifications of packaging products, more technological and fashion elements are incorporated into packaging design. There are more and more packaging paper prints produced by transfer cardboard, composite cardboard materials and hot stamping technology, which has caused the complexity of packaging materials. The defect characteristics of packaging products of different specifications and brands are different. As the design of packaging products becomes more and more diversified, the problem is that surface defects are more difficult to separate from the background. At the same time, when performing surface quality inspection on packaging products, there are high requirements for inspection speed and stability. Although the YOLO series of models have been successful in tasks such as surface defect detection in various scenarios, there are still limitations in the scene of surface defect detection of packaging products. This is mainly due to the complexity and variability of the background of packaging product images, which brings major challenges to the target detection process, making it difficult for the YOLO series of models to achieve the expected detection effect when directly applied. Summary of the invention
[0008] In order to solve the problems of the prior art, the present invention provides a full-width quality inspection method, a quality inspection device and a quality inspection computer equipment for packaging products that combine deep learning and image processing technology, thereby improving the accuracy of color difference detection and defect detection of packaging products.
[0009] The technical solution adopted by the present invention to solve the above technical problems is: a method for full-width quality detection of packaging products combining deep learning and image processing technology, comprising the following steps:
[0010] S1, obtaining a template image, and setting a color difference detection area on the template image;
[0011] S2, obtaining a sample image to be detected and performing preprocessing;
[0012] S3, mapping the color difference detection area information to the CIELAB color space, and calculating the color difference value between the template image and the sample image in the color difference detection area to obtain the color difference detection result;
[0013] S4, using the pre-trained detection model to detect surface defects on the sample image, the detection model includes a head network, a neck network and a backbone network;
[0014] The backbone network is used to extract the image features of the sample image and obtain a plurality of feature maps, the neck network fuses the feature maps through an improved TFE module to obtain fused features, and the head network is used to enhance the fused features and output defect detection results;
[0015] S5. Map the color difference detection result and the defect detection result to the sample image.
[0016] As a further optimization of a full-width quality detection method for packaging products combining deep learning and image processing technology, the backbone network includes an EMO network, the EMO network includes four groups of iRMB modules connected in sequence, and the iRMB modules are used to extract image features of the sample image and obtain feature maps.
[0017] As a further optimization of the full-width quality detection method of packaging products combining deep learning and image processing technology, the backbone network also includes a downsampling module and an SPPF module. The downsampling module is used to downsample the feature map to obtain downsampled data, and the SPPF module transmits the downsampled data to the neck network for feature fusion to obtain the fused feature.
[0018] As a further optimization of the full-width quality detection method of packaging products combining deep learning and image processing technology, the specific method of fusing the feature map by the neck network through the improved TFE module to obtain the fusion feature includes:
[0019] The feature maps are divided into large-size feature maps, medium-size feature maps and small-size feature maps based on their sizes;
[0020] The TFE module includes an RFCBAM submodule and a CARAFE submodule;
[0021] The RFCBAM submodule is used to adjust the number of channels of the large-size feature map to 1C, and the first sampling data is obtained by downsampling through maximum pooling and average pooling;
[0022] Using a convolution module to extract features from the feature map of the medium size to obtain second sampling data;
[0023] The CARAFE submodule is used to adjust the number of channels of the small-sized feature map to 1C through convolution, and the third sampling data is obtained by upsampling;
[0024] The first sampling data, the second sampling data and the third sampling data are concatenated to obtain the fusion feature.
[0025] As a further optimization of a full-width quality detection method for packaging products combining deep learning and image processing technology, the head network includes an SCP structure and a decoupling head. The SCP structure includes a context aggregation block with residual connection. The context aggregation block is used to perform context aggregation on fused features. The decoupling head includes a fully connected head and a convolution head. The fully connected head is used to reduce the dimension of the fused features to obtain reduced dimension features, and to parallelly branch the reduced dimension features. The convolution head is used to locate the fused features and output defect detection results.
[0026] As a further optimization of the invention of a method for full-width quality detection of packaging products combining deep learning and image processing technology: the context aggregation method is as follows:
[0027]
[0028] Among them, P i and Q i represents the input and output feature maps of the i-th layer in the feature pyramid, P i and Q i Each contains N i pixels; j,m∈{1,N i} represents the index of each pixel; w k and w v is the linear projection matrix used to project the feature map.
[0029] As a further optimization of the invention of a full-width quality detection method for packaging products combining deep learning and image processing technology: the calculation method of the color difference is:
[0030] The RGB color value of the extracted color difference detection area is converted into XYZ color space through gamma correction;
[0031] The XYZ values are calculated through nonlinear transformation to obtain the L, a, and b values in the CIELAB color space;
[0032] The color difference is calculated by the ΔE calculation formula.
[0033] As a further optimization of the invention of a full-width quality detection method for packaging products combining deep learning and image processing technology: the specific method of preprocessing the sample image to be detected includes:
[0034] Cropping the sample image and removing irrelevant background information;
[0035] Obtain matching points between the sample image and the template image through SIFT feature matching and FLANN matcher, and calculate the homography matrix;
[0036] Align the sample image with the template image through perspective transformation.
[0037] The technical solution adopted by the present invention to solve the above technical problems is: a quality detection device, comprising:
[0038] The template selection module is used to select the template image and specify the color difference detection area;
[0039] A sample collection module is used to obtain a defect dataset on the surface of the packaged product;
[0040] The color difference detection module is used to quantify the color difference of the same area between the template image and the sample image through the ΔE calculation formula;
[0041] A defect detection module, used to detect the sample image using a pre-trained detection model;
[0042] The result output module is used to determine the defects of the sample image to be detected according to the color difference detection result and the defect detection result.
[0043] The technical solution adopted by the present invention to solve the above technical problems is: a computer device, including a memory, a processor and a computer program stored in the memory and executable on the processor, wherein the above quality detection method is implemented when the processor executes the program.
[0044] Beneficial effects: The present invention combines the ΔE color difference quantification method in the CIELAB color space with the improved YOLOv5s defect detection model to achieve accurate quantification of color differences on the surface of packaging products and full-width defect detection;
[0045] The ΔE calculation formula is used to perform a detailed comparison of the color of the packaged products in the CIELAB color space, effectively quantifying the color differences;
[0046] The improved YOLOv5s network detection model first uses lightweight EMO to form the backbone network, and adopts the inverted residual moving block to compress the model parameters without losing the detection accuracy; secondly, the neck network uses the improved TFE module to fuse feature maps of different scales to reduce the missed detection rate of small targets; finally, the design combining SCP structure and decoupling head is adopted to further improve the detection accuracy and realize full-width defect detection on the surface of packaging products. BRIEF DESCRIPTION OF THE DRAWINGS
[0047] Figure 1 is a flow chart of the present invention;
[0048] Figure 2 A schematic diagram of selecting a color difference detection area according to the present invention;
[0049] Figure 3 A flow chart of preprocessing of a sample image to be detected according to the present invention;
[0050] Figure 4 It is an image of surface defects of some packaged products of the present invention;
[0051] Figure 5 It is a diagram of the training process of the detection model of the present invention;
[0052] Figure 6 It is the overall framework diagram of the detection model of the present invention;
[0053] Figure 7 is a structural diagram of the iRMB module of the present invention;
[0054] Figure 8 It is a structural diagram of an improved TFE module of the present invention;
[0055] Fig. 9 It is a context aggregation block structure diagram of the present invention;
[0056] Fig.10 This is a diagram of the network structure of the detection model head of the present invention;
[0057] Fig.11 It is a schematic diagram of the quality detection results of the present invention;
[0058] Fig.12 It is a structural diagram of the quality detection device of the present invention. DETAILED DESCRIPTION
[0059] The technical solution of the present invention is further elaborated in detail below in conjunction with specific embodiments. The parts of the present invention that are not described and disclosed in detail in the following embodiments should be understood as the prior art known or should be known to those skilled in the art.
[0060] A method for full-width quality inspection of packaging products combining deep learning and image processing technology, such as Figure 1 As shown, the following steps are included:
[0061] S1, obtain a template image, set a color difference detection area on the template image, the selected template image is made by the standard sample confirmed by the manufacturer, and is stored as a digital image through an image acquisition device. The image acquisition device is a conventional technology in this field and will not be described in detail here. Different color difference detection areas are set for different packaging products. The detection area is a rectangular or circular area. The color difference detection area is as follows: Figure 2 shown.
[0062] S2, such as Figure 3 As shown, a sample image to be detected is obtained and preprocessed. The specific method for preprocessing the sample image to be detected includes: because color difference detection requires the template image and the sample image to be compared for color values at the same position, the sample image is cropped and irrelevant background information is removed; the matching points between the sample image and the template image are obtained through SIFT feature matching and FLANN matcher, and the homography matrix is calculated; the sample image is aligned with the template image through perspective transformation.
[0063] S3, mapping the color difference detection area information to the CIELAB color space, and calculating the color difference value between the template image and the sample image in the color difference detection area to obtain the color difference detection result. The color difference calculation method is: converting the RGB color value of the extracted color difference detection area into the XYZ color space through gamma correction; calculating the XYZ value through nonlinear transformation to obtain the L, a, and b values in the CIELAB color space; and calculating the color difference through the ΔE calculation formula.
[0064] The L component independently represents brightness information, while the a and b components are responsible for describing the changes in color in the red-green and yellow-blue directions respectively. This separation not only enhances the flexibility of color processing, but also allows independent adjustment of chromaticity without changing brightness. In order to quantify this color difference, the ΔE color difference evaluation formula is used. This formula fully considers the differences in the sensitivity of the human visual system to different color changes and provides a scientific and intuitive color difference metric. Through the ΔE value, we can accurately evaluate the similarity or difference between two colors in human eye perception. The specific calculation method is as follows:
[0065]
[0066] The smaller the ΔE value, the smaller the visual difference in color between the two areas. L1, a1, and b1 are obtained by extracting information from the color difference detection area of the template image and converting it to the CIELAB color space, while L2, a2, and b2 are data extracted from the corresponding color difference detection area of the sample image of the packaged product to be tested and converted to the same color space.
[0067] S4, such as Figure 5 and Figure 6 As shown, a pre-trained detection model is used to perform surface defect detection on a sample image, and the detection model includes a head network, a neck network, and a backbone network; the detection model used in the present invention selects a YOLOv5s network detection model.
[0068] The backbone network is used to extract the image features of the sample image and obtain multiple feature maps, which are P1, P2, P3, and P4. Figure 8 As shown, the neck network constructs a feature pyramid, and the neck network fuses the feature map through an improved TFE module to obtain a fusion feature, such as Fig.10 As shown, the head network is used to enhance the fused features and output defect detection results, and the fused features are used as inputs of the head network to generate prediction boxes;
[0069] The backbone network includes an EMO network, such as Figure 7As shown, the EMO network includes four groups of iRMB modules connected in sequence, and the iRMB modules are used to extract the image features of the sample image and obtain the feature map. The iRMB module is composed of only DW-Conv (Depthwise Separable Convolution) and MHSA (Multi-Head Self-Attention Mechanism), which respectively realize the static short-range modeling capability and the dynamic long-range feature interaction capability.
[0070] The backbone network also includes a downsampling module and an SPPF module. The downsampling module is used to downsample the feature map to obtain downsampled data. After downsampling the downsampled data to 4 times, 8 times, 16 times, and 32 times, the downsampled data is transmitted to the neck network through the SPPF module for feature fusion to obtain the fused feature.
[0071] By using feature pyramid (FPN) and path aggregation network (PAN), the multi-level and multi-scale fusion of deep semantic information extracted by the backbone network and shallow positioning information is realized through upsampling, lateral connection and bidirectional information propagation; the specific method of the neck network fusing the feature map through the improved TFE module to obtain the fusion feature includes:
[0072] like Figure 8 As shown in , based on the size of the feature map, the feature map is divided into a large-size feature map (denoted by Large in the figure), a medium-size feature map (denoted by Medium in the figure), and a small-size feature map (denoted by Small in the figure); as shown in Fig. 9 As shown, the TFE module includes an RFCBAM submodule and a CARAFE submodule; the RFCBAM submodule is used to adjust the number of channels of the large-size feature map to 1C, and down-sampling is performed through maximum pooling and average pooling to obtain the first sampling data; the convolution module is used to extract features from the medium-size feature map to obtain the second sampling data; the CARAFE submodule is used to adjust the number of channels of the small-size feature map to 1C through convolution, and up-sampling is performed to obtain the third sampling data; the first sampling data, the second sampling data and the third sampling data are spliced to obtain the fused feature.
[0073] The large-size feature map, medium-size feature map, and small-size feature map of the same size are concatenated in the channel dimension. The formula is as follows:
[0074] F TFE =Concat(F l ,F m ,F s ),
[0075] where F TFEis the feature map output by the TFE module, F l 、F m and F s They represent large-size feature maps, medium-size feature maps, and small-size feature maps, respectively. TFE It is by F l 、F m and F s Spliced together, F TFE Resolution and F m Same, it's F m Three times the number of channels.
[0076] S5. Map the color difference detection result and the defect detection result to the sample image.
[0077] The head network includes an SCP structure and a decoupling head. The SCP structure effectively aggregates global spatial background information into local areas, thereby significantly enhancing the representation ability of feature maps. The SCP structure includes a context aggregation block with residual connections, such as Fig. 9 As shown in the figure, the context aggregation block is used to perform context aggregation on the fused features, and the decoupled head replaces the original coupled detection head to process the positioning and classification tasks separately. The decoupled head includes a fully connected head and a convolutional head. The fully connected head is used to reduce the dimension of the fused features to obtain reduced dimension features, and the reduced dimension features are branched in parallel. The convolutional head is used to locate the fused features and output the defect detection results. The defect detection results include the category, predicted box coordinates and confidence of each defect.
[0078] The context aggregation is as follows:
[0079]
[0080] Among them, P i and Q i represents the input and output feature maps of the i-th layer in the feature pyramid, P i and Q i Each contains N i pixels; j,m∈{1,N i} represents the index of each pixel; w k and w v is the linear projection matrix used to project the feature map.
[0081] We apply a i , one with P i and Q i A reweighting matrix of the same shape is created to balance the degree of aggregation of global spatial context for each pixel. This matrix can also be simply generated from P i Linear projection to the activation function. The calculation formula is as follows:
[0082]
[0083] Before the pre-trained detection model performs surface defect detection on the sample image, the surface defect image of the packaging product is obtained through the image acquisition device. Common defects on the surface of packaging products include point defects, ink defects, scratch defects, text overprint defects, QR code offset and barcode offset.
[0084] The training process of the improved YOLOv5s network detection model is as follows Figure 5 As shown, the method includes: setting up an industrial camera device to collect images of packaged products, and the industrial camera device is a conventional prior art in this field and will not be described in detail here; using the LabelImg tool to perform data annotation on the location and type of surface defects of the packaged products; using the image annotation tool LabelImg to annotate the preprocessed packaged product images, and the label types are divided into six types: Spot, Ink, Scratch, Misprint, QR codeoffset, and Barcode offset, which correspond to point defects, ink defects, scratch defects, overprint defects, QR code offset, and barcode offset, respectively; when annotating, because there are some small target defects and irregularly shaped defects, it is necessary to ensure that the prediction frame is closely attached to the edge of the target object, and do not include too much background or omit parts of the target object, so as to construct a high-quality data set; data enhancement is performed on the annotated packaged product defect data set to enrich the samples and balance the defect types; in view of the complexity of the background of the packaged products, blindly performing image enhancement may increase the difficulty of model training. Therefore, a more cautious data enhancement strategy is adopted, and only horizontal flipping and vertical flipping are performed on the original data set to effectively expand the number of data samples while avoiding unnecessary interference and misleading; the enhanced data set is divided into training set, validation set and test set. The training set, validation set and test set are divided into training set, validation set and test set in a ratio of 8:1:1; the improved YOLOv5s network detection model is iteratively trained using the training data set. The model performance is evaluated on the validation set, the loss and measurement indicators are calculated, and the optimal model is saved.
[0085] The improved YOLOv5s network detection model (EMO, Improved-TFE, SCP-Decouped) built in the self-built packaging product surface defect data mAP@.5 and mAP@.5:.95 reached 94.7% and 58.2%, respectively, an increase of 6.1% and 4.4%. In addition, the model size is only 6.11MB, which is reduced by about 2.23 times, which is more conducive to deployment on devices with limited resources.
[0086] like Figure 4As shown in the figure, packaged product images often present high resolution and complex background characteristics, and industrial sites often lack high-performance computing units to support complex deep learning models. For the task of surface defect detection of packaged products, the YOLOv5s backbone network still has difficulty in balancing detection accuracy and lightness. Based on the efficient inverted residual block and the effective MHSA module in Transformer, an attention model is introduced in the single residual block IRB with inductive bias, making full use of the lightweight and efficient characteristics of IRB and the advantage of the MHSA module in capturing long-distance dependencies, and a simple and effective inverted residual mobile block (iRMB) is designed.
[0087] Based on the complex features of the packaging product background, a four-stage efficient feature extraction model is designed under the framework of the iRMB module to better integrate different long- and short-range features and enhance the ability to extract surface defect features of packaging products. The EMO network consists only of iRMB, without diverse modules, which reduces the complexity of the network modules. For specific modules, iRMB consists only of DW-Conv and MHSA, which respectively realize static short-range modeling capabilities and dynamic long-range feature interaction capabilities. In addition, benefiting from the DW-Conv technology, iRMB can adapt to downsampling operations through step size, and does not require any position embedding to introduce inductive bias for MHSA. Therefore, EMO constitutes a new target detection model backbone that maintains high detection accuracy while significantly reducing the number of model parameters.
[0088] Multi-scale object detection is often challenging. The application of feature pyramid in CNN model solves this difficulty well. The core of feature pyramid is the fusion of features of different scales, which can be mainly represented by traditional top-down FPN and PANet with additional bottom-up path. However, due to the lack of different receptive fields at each scale of different feature maps of the backbone network, the traditional FPN fusion mechanism only upsamples the feature maps of small sizes and then adds them to the feature maps of the previous layer, while ignoring the rich detail information of the larger feature layer. Therefore, if you want to enhance the robustness of multi-scale defect representation, the effective fusion of shallow features and deep features is the key. The present invention adopts TFE module to fuse feature maps of different scales.
[0089] Packaged products often have complex background features and large texture variation scales, which makes it difficult for the original detection head to accurately distinguish defects from background areas. As a model that combines spatial and channel modulation capabilities, the Global Context Network (GCNet) can generate accurate attention maps. However, when faced with packaged product images with small target areas and complex backgrounds, GCNet may generate too much redundant background information, which to some extent affects the feature extraction and recognition effects of the target area. In order to overcome this limitation, the present invention introduces the SCP structure. This innovative design adds an additional path to learn and strengthen the importance of each pixel in the image. Through this soft reweighting strategy, we can more effectively fuse global features, ensure rich feature information for each pixel, and reduce the confusion and redundancy of feature information.
[0090] like Fig.11 The figure shows a schematic diagram of the quality inspection result of the present invention. The present invention can accurately identify the defect location in the surface defect data set of the packaging product, and its detection performance shows stable performance under different types of defects, realizing full-width detection of surface defects of packaging products, fully meeting the actual needs of quality control, and embodying high practicality and reliability.
[0091] Quality inspection devices, such as Fig.12 As shown, including:
[0092] The template selection module is used to select the template image and specify the color difference detection area;
[0093] The sample collection module is used to obtain a defect dataset of the surface of the packaged product; the defect dataset includes different types of packaged product images, and the defect types include: point defects, ink defects, scratch defects, text overprint defects, QR code offset and barcode offset, etc.
[0094] The color difference detection module is used to quantify the color difference of the same area between the template image and the sample image through the ΔE calculation formula;
[0095] A defect detection module is used to detect the sample image through a pre-trained detection model; using an improved YOLOv5s network detection model, the sample image is predicted through feature extraction, feature fusion and prediction box non-maximum suppression;
[0096] The result output module is used to determine the defects of the sample image to be detected based on the color difference detection results and the defect detection results, complete the full-width quality detection task of the packaging product, and obtain the final detection result.
[0097] A computer device comprises a memory, a processor and a computer program stored in the memory and executable on the processor, wherein the above-mentioned quality detection method is implemented when the processor executes the program.
[0098] The above description of the disclosed embodiments enables one skilled in the art to implement or use the present invention. Various modifications to these embodiments will be apparent to one skilled in the art, and the general principles defined herein may be implemented in other embodiments without departing from the spirit or scope of the present invention. Therefore, the present invention will not be limited to the embodiments shown herein, but rather to the widest scope consistent with the principles and novel features disclosed herein.
Claims
1. A method for full-width quality detection of packaging products combining deep learning and image processing technology, characterized in that: The following steps are involved: S1, obtaining a template image, and setting a color difference detection area on the template image; S2, obtaining a sample image to be detected and performing preprocessing; S3, mapping the color difference detection area information to the CIELAB color space, and calculating the color difference value between the template image and the sample image in the color difference detection area to obtain the color difference detection result; S4, using the pre-trained detection model to detect surface defects on the sample image, the detection model includes a head network, a neck network and a backbone network; The backbone network is used to extract the image features of the sample image and obtain a plurality of feature maps, the neck network fuses the feature maps through an improved TFE module to obtain fused features, and the head network is used to enhance the fused features and output defect detection results; S5. Map the color difference detection result and the defect detection result to the sample image.
2. The method for full-width quality detection of packaging products combining deep learning and image processing technology as claimed in claim 1, characterized in that: The backbone network includes an EMO network, and the EMO network includes four groups of iRMB modules connected in sequence. The iRMB modules are used to extract image features of the sample image and obtain a feature map.
3. The method for full-width quality detection of packaging products combining deep learning and image processing technology as claimed in claim 2, characterized in that: The backbone network also includes a downsampling module and an SPPF module. The downsampling module is used to downsample the feature map to obtain downsampled data, and the SPPF module transmits the downsampled data to the neck network for feature fusion to obtain the fused feature.
4. The method for full-width quality detection of packaging products combining deep learning and image processing technology as claimed in claim 1, characterized in that: The specific method of fusing the feature map by the neck network through the improved TFE module to obtain the fusion feature includes: The feature maps are divided into large-size feature maps, medium-size feature maps and small-size feature maps based on their sizes; The TFE module includes an RFCBAM submodule and a CARAFE submodule; The RFCBAM submodule is used to adjust the number of channels of the large-size feature map to 1C, and the first sampling data is obtained by downsampling through maximum pooling and average pooling; Using a convolution module to extract features from the feature map of the medium size to obtain second sampling data; The CARAFE submodule is used to adjust the number of channels of the small-sized feature map to 1C through convolution, and the third sampling data is obtained by upsampling; The first sampling data, the second sampling data and the third sampling data are concatenated to obtain the fusion feature.
5. The method for full-width quality detection of packaging products combining deep learning and image processing technology as claimed in claim 1, characterized in that: The head network includes an SCP structure and a decoupling head. The SCP structure includes a context aggregation block with residual connection. The context aggregation block is used to perform context aggregation on fused features. The decoupling head includes a fully connected head and a convolutional head. The fully connected head is used to reduce the dimension of the fused features to obtain reduced dimension features, and to parallelly branch the reduced dimension features. The convolutional head is used to locate the fused features and output defect detection results.
6. The method for full-width quality detection of packaging products combining deep learning and image processing technology as claimed in claim 5, characterized in that: The context aggregation is as follows: Among them, P i and Q i represents the input and output feature maps of the i-th layer in the feature pyramid, P i and Q i Each contains N i pixels; j,m∈{1,N i } represents the index of each pixel; w k and w v is the linear projection matrix used to project the feature map.
7. The method for full-width quality detection of packaging products combining deep learning and image processing technology as claimed in claim 1, characterized in that: The color difference is calculated as follows: The RGB color value of the extracted color difference detection area is converted into XYZ color space through gamma correction; The XYZ values are calculated through nonlinear transformation to obtain the L, a, and b values in the CIELAB color space; The color difference is calculated by the ΔE calculation formula.
8. The method for full-width quality detection of packaging products combining deep learning and image processing technology as claimed in claim 1, characterized in that: The specific method for preprocessing the sample image to be detected includes: Cropping the sample image and removing irrelevant background information; Obtain matching points between the sample image and the template image through SIFT feature matching and FLANN matcher, and calculate the homography matrix; Align the sample image with the template image through perspective transformation.
9. The quality inspection device is characterized in that: include: The template selection module is used to select the template image and specify the color difference detection area; A sample collection module is used to obtain a defect dataset on the surface of the packaged product; The color difference detection module is used to quantify the color difference of the same area between the template image and the sample image through the ΔE calculation formula; A defect detection module, used to detect the sample image using a pre-trained detection model; The result output module is used to determine the defects of the sample image to be detected according to the color difference detection result and the defect detection result.
10. A computer device, characterized in that The method comprises a memory, a processor and a computer program stored in the memory and executable on the processor, wherein the processor implements the quality detection method according to any one of claims 1 to 8 when executing the program.
Citation Information
Cited By
Ink-jet printer real-time image calibration system and method based on edge calculation
CN120335394A
Edge computing-based inkjet printer real-time image calibration system and method
CN120335394B