Visual detection algorithm for printed patterns of color box printed matters

Through a lightweight multi-scale attention convolution neural network and self-learning mechanism, combined with color normalization and geometric correction preprocessing, a significant defect map is generated, which solves the misjudgment problem in complex printing pattern detection and achieves high-precision and real-time print quality monitoring.

CN120472131AInactive Publication Date: 2025-08-12SHENZHEN KEYANG PAPER PACKAGING CO LTD
View PDF 0 Cites 4 Cited by

Patent Information

Application Number
CN202510692067.4
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-05-27
Publication Date
2025-08-12
Estimated Expiration
Not applicable · inactive patent

AI Technical Summary

Technical Problem

Existing printed defect detection methods are prone to misjudgment when facing complex printing patterns, especially color gradients and subtle defects are difficult to accurately identify, resulting in low detection accuracy and requires manual intervention.

Method used

A lightweight multi-scale attention convolution neural network and self-learning mechanism are adopted, combining color normalization and geometric correction preprocessing to generate significant defects, and the model is optimized by online misjudgment cache and incremental learning strategy to achieve high-precision detection of complex printing patterns.

Benefits of technology

It improves the accuracy and real-time detection of defects of complex printing patterns, reduces the rate of misjudgment, reduces manual intervention, adapts to changes in printed patterns or processes, and maintains long-term high detection accuracy.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120472131A_ABST
    Figure CN120472131A_ABST
Patent Text Reader

Abstract

The invention relates to the technical field of printed matter quality detection and computer vision and the technical field of artificial intelligence systems in the production field, in particular to a color box printed matter printed pattern visual detection algorithm. The invention discloses a visual detection algorithm for a printing pattern of a color box printed matter. The visual detection algorithm comprises the following steps of image acquisition, preprocessing, feature extraction, reference comparison, defect evaluation and defect classification. According to the scheme, the accuracy and the real-time performance of complex printing pattern defect detection are improved. A light-weight multi-scale attention convolutional neural network and a self-learning mechanism are combined, defects in various printing patterns such as block colors, fine characters and graph gradient are effectively detected, and human intervention and misjudgment are reduced. A defect saliency map is generated through color normalization, geometric correction preprocessing and reference map comparison, an online misjudgment cache and incremental learning strategy is introduced, self-adaptive optimization of a model along with time is kept, and real-time high-precision quality monitoring of an offset printing color box production line is achieved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the fields of printed matter quality detection, computer vision technology, and the technical field of artificial intelligence systems in the production field, and in particular to a visual detection algorithm for printed patterns on color box printed matter. Background Art

[0002] During the production process, printed packaging, such as color boxes, is prone to quality defects due to process deviations. These defects, such as color difference, misregistration, missing prints, ink spots, and scratches, result in substandard products. Traditionally, printing companies rely primarily on manual spot checks and visual inspection to detect these defects, but manual inspection is inefficient, costly, and unreliable. With the development of machine vision technology, systems have emerged that utilize digital image processing to automatically detect defects in printed products, improving production efficiency and reducing labor costs.

[0003] Existing automated printing defect detection methods are mostly based on template comparison and threshold determination. A typical approach involves capturing an image of the printed product being inspected, comparing it pixel by pixel with a pre-stored standard reference image, and calculating the difference. The difference is then determined to determine whether the print is defective. After determining the defect area through differential analysis, the system further scans the differential image to locate the defect's location and size. This image-based detection method can, to a certain extent, replace manual labor, enabling rapid and accurate detection and determination of cosmetic defects.

[0004] However, image difference methods based on fixed thresholds have limitations when faced with complex printed patterns. For highly complex printed patterns such as color gradients and subtle patterns, there may be large differences between the normal image and the reference image. Even if there are no real defects, they may exceed the simple threshold and lead to misjudgment. In addition, some subtle defects such as color deviation or misregistration are difficult to effectively distinguish using a single threshold. In these cases, the accuracy of traditional machine vision inspection is not high, and experienced manual inspection is still required to handle unpredictable defect variations. In particular, when the inspected surface has complex patterns or light reflections, conventional algorithms can easily confuse normal variations with defect characteristics.

[0005] This shows that the existing technology lacks a defect detection solution that can adapt to diverse printing patterns, reduce misjudgments, and support continuous learning and improvement. Summary of the Invention

[0006] The purpose of the present invention is to provide a visual detection algorithm for printed patterns on color box printed products to address the deficiencies in the existing technology, aiming to improve the accuracy and real-time performance of complex printed pattern defect detection.

[0007] The present invention achieves the above-mentioned objectives through the following technical solutions: a visual inspection algorithm and device for printed patterns on color box printed products. The overall process includes the following steps: first, an industrial camera is used to capture a digital image of the printed pattern to be inspected. The image is then preprocessed with color normalization and geometric correction to eliminate the effects of ambient lighting and camera distortion. The preprocessed image is then fed into a lightweight multi-scale attention convolutional neural network for feature extraction, generating a fused feature map representing the pattern content. Simultaneously, a standard reference image of the printed pattern is provided and subjected to the same preprocessing and feature extraction process as the image to be inspected to generate a reference feature map. The fused feature map of the image to be inspected is then compared pixel by pixel or feature by feature with the reference feature map, and the differences are calculated to generate a residual feature map. A defect saliency map is then generated to highlight the areas of difference. Next, the defect saliency map is analyzed to calculate a defect score to quantify the severity of potential defects in the pattern. Defects are then classified and judged according to preset classification rules, and a specific defect category or judgment result (e.g., acceptable or defective) is output. The entire inspection process can be completed in real time on an edge computing device.

[0008] This algorithm, combining a lightweight multi-scale attention convolutional neural network with a self-learning mechanism, can effectively detect defects in various printed patterns, including block color, fine text, and graphic gradients, while reducing human intervention and misjudgment. It generates a defect saliency map through color normalization, geometric correction preprocessing, and comparison with a reference image. It also incorporates an online misjudgment cache and incremental learning strategy to maintain adaptive optimization of the model over time, enabling real-time, high-precision quality monitoring of offset color box production lines.

[0009] In detail: A visual detection algorithm for printed patterns on color box printed products, comprising the following steps: S1, image acquisition step: using an industrial camera to obtain an image of the color box printing pattern to be inspected, and inputting the image into the defect detection system for processing; S2, preprocessing step: color normalization and geometric correction are performed on the collected color box image to correct imaging illumination differences and perspective distortion, and obtain a standardized and aligned image to be inspected; S3, feature extraction step: input the preprocessed image to be inspected into a lightweight multi-scale attention convolutional neural network to extract a multi-level fusion feature map to represent the image features of the color box pattern; S4, reference comparison step: providing a defect-free standard reference image corresponding to the pattern to be inspected, performing the same preprocessing and feature extraction on the reference image as for the image to be inspected, and obtaining a reference feature map; performing a comparison operation on the fused feature map of the image to be inspected and the reference feature map to generate a residual feature map, and based on the residual feature map, obtaining a defect saliency map to highlight the difference areas in the image to be inspected relative to the reference image; The phrase "derive a defect saliency map based on this to highlight areas of difference in the image under inspection relative to the reference image" refers to the residual feature map (ResidualFeatureMap) calculated in the previous step. Each position in the residual feature map stores the difference in depth features between the image under inspection and the reference image. The system then processes these differences using absolute values, normalization, and noise filtering to produce a new single-channel image or heat map, known as the DefectSaliencyMap. The saliency map displays high grayscale / brightness or thermal colors at locations with significant differences, visually highlighting areas that differ significantly from the reference image. For the detection algorithm, this saliency map serves as the basis for subsequent calculations of defect area, intensity, and scoring. It also provides intuitive results that facilitate human review: at a glance, it can be seen which areas of the printed product are "lit up" and suspected of having defects. In short, the residual feature map is like the original data after "subtracting" two images, while the defect significance map is a readable version of these differences after "contrast enlargement, noise reduction, and making it into a heat map." The purpose is to clearly highlight the truly suspicious defect areas for subsequent algorithm and manual processing.

[0010] S5, defect assessment step: calculating at least one defect score based on the defect saliency map, for quantifying the severity of the defect in the image to be inspected; S6, defect classification step: comparing the defect score with a preset threshold and classification rules, classifying and judging the detected defects, and outputting the defect detection result of the color box printing pattern.

[0011] Furthermore, the convolutional neural network adopts a multi-scale feature extraction structure, including multiple convolution layers for extracting image features of different spatial scales, and fusing the features of each scale to form the fused feature map.

[0012] Furthermore, the convolutional neural network includes an attention mechanism module for performing weighted processing on the extracted feature map to highlight defect-related feature signals; the attention mechanism includes channel attention and / or spatial attention for adaptively adjusting the weights of different channels or regions in the feature map.

[0013] Furthermore, in the reference comparison step, a residual feature map is obtained by subtracting the fusion feature map of the image to be inspected from the reference feature map pixel by pixel or feature vector by feature vector, and the residual feature map is subjected to absolute value conversion, noise filtering and normalization to generate the defect saliency map.

[0014] Furthermore, in the defect assessment step, the defect score is calculated based on the area ratio and difference intensity of the defect area in the defect saliency map; when there are multiple defect areas in the same image to be inspected, the individual score of each defect area and the comprehensive score of all defects are also calculated.

[0015] Furthermore, the defect classification divides defects into different types according to preset rules, including but not limited to color deviation, printing omissions / missing, foreign matter stains, overprint inaccuracies, etc.; the classification rules are based on the shape characteristics, position and defect score threshold of the defect area in the defect significance map to determine the category to which the defect belongs and the product judgment result.

[0016] Furthermore, the algorithm also includes an online self-learning step: caching and storing the misjudgment sample images generated during the detection process, and using the cached misjudgment samples to incrementally train and update the convolutional neural network under predetermined conditions, thereby optimizing the defect detection model to improve long-term detection accuracy.

[0017] The present invention also provides a device for visually inspecting printed patterns on color box printed materials, comprising various functional modules and components for executing the aforementioned method steps, such as an image acquisition module, a preprocessing module, a feature extraction module, a reference comparison module, and a defect assessment module. These modules work collaboratively to automatically detect and classify defects in printed patterns on color box printed materials. The device can be integrated into an embedded edge computing platform (such as Jetson Orin) and interfaced with production line equipment for online, real-time inspection. The device's hardware includes an industrial camera, a processor, memory, and necessary light sources and communication interfaces. The software includes a program that implements the algorithm of the present invention.

[0018] Beneficial effects of the present invention: 1. Improved Detection Accuracy: Leveraging the deep feature learning capabilities of convolutional neural networks, this method automatically extracts complex textures and subtle differences in patterns, more accurately distinguishing normal printing variations from true defects than traditional simple thresholding methods. This algorithm can reliably identify anomalies even on highly patterned or gradient-effect packaging surfaces. The introduction of multi-scale convolution and an attention mechanism enables the model to focus on both overall color differences across large areas and subtle defects in smaller areas, thereby reducing missed and false detection rates.

[0019] 2. Real-time and lightweight: This invention utilizes a lightweight neural network model to reduce the number of parameters and computational complexity. This model is compatible with edge computing hardware such as embedded GPUs, achieving millisecond-level image processing speeds and meeting the real-time requirements of full online inspection on a typical offset color box production line. Compared to traditional solutions that rely on manual labor or heavy servers, this algorithm can run stably on edge devices such as Jetson Orin, achieving both accuracy and efficiency.

[0020] 3. Robust preprocessing: Color normalization corrects for lighting and printing color casts, while geometric correction eliminates camera perspective distortion and displacement, ensuring precise alignment and comparison between the image under inspection and the reference image. Preprocessing improves detection consistency and robustness, even in the presence of changes in ambient lighting or slight camera position shifts, and reduces false positives caused by external factors.

[0021] 4. Comprehensive defect assessment and classification: The algorithm generates a quantitative defect score based on the defect saliency map and categorizes defects into different levels or types (e.g., slight color difference, severe missing print, ink splatter, etc.) based on the score and defect area morphology. This multi-level classification rule helps to implement differentiated treatment measures for different defect types during production and facilitates statistical analysis of common defect types to improve processes.

[0022] 5. Adaptive Learning Capability: This invention innovatively incorporates online false positive caching and rapid incremental learning mechanisms. Images suspected of false positives or new defects identified during the inspection process are automatically cached and used for subsequent incremental model training, enabling timely updates of inspection model parameters without interrupting production. This self-learning strategy enables the model to continuously optimize over time, adapting to changes in printed product patterns or processes, and maintaining high inspection accuracy over the long term without the need for frequent manual recalibration or offline training.

[0023] In summary, the defect detection algorithm provided by the present invention significantly improves the intelligence level of online quality inspection of color box printed products, can reduce manual participation, reduce the missed detection rate, and effectively solve the problems of easy misjudgment and difficult maintenance in the existing technology for complex printed pattern detection, and has good industrial application value. BRIEF DESCRIPTION OF THE DRAWINGS

[0024] Figure 1 Schematic diagram of the flow of the color box printing pattern visual defect detection algorithm according to an embodiment of the present invention; DETAILED DESCRIPTION The following will clearly and completely describe the technical solutions in the embodiments of the present invention in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without making creative work are within the scope of protection of the present invention. It will be understood that the drawings are only provided for reference and illustration purposes and are not intended to limit the present invention. The connection relationship shown in the drawings is only for the convenience of clear description and does not limit the connection method.

[0025] It should be noted that if an element is referred to as being "fixed to" or "disposed on" another element, it may be directly on the other element or there may be an intermediate element. If an element is considered to be "connected to" another element, it may be directly connected to the other element or there may be an intermediate element. If any, the terms "vertical", "horizontal", "upper", "lower", "left", "right" and similar expressions used in this application are for illustrative purposes only and do not represent the only embodiment.

[0026] Example 1: This example provides a basic process of a method for detecting visual defects in a color box printing pattern. Figure 1 . First, S1, use an industrial camera to obtain a digital image of the printed pattern of the color box to be inspected. The industrial camera can be a surface array or linear array CCD / CMOS camera, depending on the specific printed product and the detection accuracy requirements. During acquisition, the synchronous controller triggers the camera to take pictures when the color box passes the specified detection position to obtain a clear image of the color box pattern. Then, S2, the collected color box image is preprocessed, including color normalization and geometric correction. Color normalization refers to adjusting the color distribution of the image to a standard state, such as eliminating the overall color deviation caused by ambient light intensity or printing batch differences through white balance correction, color space transformation, etc. Geometric correction uses calibration data to perform perspective transformation or distortion correction on the image so that the pattern in the image is aligned with the reference coordinate system. For a regular rectangular color box pattern, the image can be transformed to a size and angle consistent with the reference image by detecting its edges or locating mark points and calculating the projective transformation matrix. After the above preprocessing steps, a standardized and aligned color box image to be inspected is obtained.

[0027] Example 2: Building on Example 1, this example further defines the convolutional neural network architecture used in the feature extraction step. The lightweight multi-scale attention convolutional neural network, the core of this invention, is used to extract fused feature maps from preprocessed images. This network utilizes a multi-layer convolutional neural network architecture, but has been optimized to control model scale. The network comprises multiple convolutional layer groups, each extracting features at different receptive field scales, thereby forming a representation of multi-scale image information. For example, parallel 3×3 convolutions, 5×5 convolutions, or pyramid pooling modules can be implemented within the network to extract features that include both text edge details and large color background areas. Furthermore, an attention mechanism is introduced to enhance the response to key defect features. The attention module can combine channel attention (e.g., SE module) and spatial attention (e.g., CBAM module) to reweight the feature maps output by the convolutional layers. In this example, an SE attention module is added after each convolutional layer group to adaptively adjust the weights of each channel feature, allowing the network to focus more on characteristic patterns that may indicate defects. To maintain the model's lightweight nature, the network extensively utilizes depthwise separable convolutions, batch normalization, and ReLU6 activation to reduce parameters and computational complexity. This structural design allows the proposed CNN model to have millions of parameters, while still running in real time on embedded GPUs. Furthermore, it achieves high feature extraction performance on a dataset of typical printing defect samples.

[0028] The network performs forward inference on the preprocessed color box image, outputting a high-dimensional fused feature map that encodes deep feature representations of each region in the image. For example, for a color box pattern containing color blocks, text, and gradient shapes, the network's different convolutional layers will extract features at corresponding levels: bottom-level convolutions may activate text edges, while higher-level convolutions respond to large differences in color block regions. The attention mechanism will highlight unusual areas, giving them higher feature values in the fused feature map.

[0029] Example 3: This example combines Example 1 and Example 2 to further illustrate the introduction of reference images and the residual feature calculation process. For each color box product to be inspected, its design standard reference image (i.e., an ideal printing effect image without defects) is obtained before production begins. The reference image can be obtained by scanning a sample or from a digital preprint. In the inspection process, the reference image and the image to be inspected undergo the same preprocessing and feature extraction process to generate a reference feature map. To ensure the effectiveness of the comparison, the reference image is also color normalized (can be corrected according to a printing standard color card) and subjected to the same geometric transformation as the image to be inspected before being input into the network, so that the feature maps of the two have a corresponding relationship.

[0030] Then, the fused feature map of the image to be inspected is compared element by element with the reference feature map to calculate a residual feature map. Preferably, a pixel-by-pixel difference method is used, that is, for each channel and each spatial position of the feature map, the difference between the feature value to be inspected and the reference feature value is calculated. If necessary, more complex difference metrics (such as cosine distance or structural similarity) can be calculated for high-dimensional feature vectors, but in this embodiment, direct difference is sufficient to effectively reflect most differences. The value of the residual feature map reflects the degree of deviation of the pattern to be inspected from the standard template at each location: a value close to zero indicates consistency with the standard, and a larger positive or negative deviation indicates a more significant difference. Based on the residual feature map, a defect saliency map is further generated for human observation and subsequent processing. The defect saliency map can be obtained by appropriately normalizing and projecting the residual features in each channel dimension. For example, the absolute value of the residual feature map can be taken and then summed or maximized in the depth direction to obtain a single-channel grayscale image. Then, through histogram equalization or threshold segmentation, the significantly different areas are highlighted as a binary or thermal image. Figure 1 In the flowchart, a saliency map generation step is added after the residual calculation. The map visually marks the areas suspected of being defects and can be used for operator reference or for further algorithm processing.

[0031] Example 4: This example describes the quantitative assessment of defects, namely the calculation method of defect scores. After obtaining the defect saliency map, the system analyzes the defect areas identified in the map and calculates the score for each defect. The defect score is used to measure the severity of the defect, and typically takes into account factors such as the size of the defect area, shape complexity, and difference intensity. For example, the scoring formula can be set as: Score = α*Area+β*Intensity+γ*ShapeComplexity. Among them, Area is the ratio of the number of pixels in the defect area to the entire image, Intensity can be taken as the average grayscale or maximum value of the area on the defect saliency map (indicating the degree of difference from the normal reference), and ShapeComplexity can be approximately estimated based on the degree of tortuosity of the edge of the defect area or the number of small holes contained. α, β, and γ are weighting coefficients, determined based on experience or through machine learning methods. In this example, we mainly focus on the two indicators of defect area and intensity, so γ is taken as 0, and only the weighted sum of area and intensity is calculated as the score. The specific steps are as follows: traverse the defect saliency map, identify all independent defect regions through connected domain analysis, calculate the total number of pixels (area) and the average pixel grayscale intensity (intensity) for each region, and then calculate the score for each defect using the aforementioned linear model. Small defects with only scattered points may have a small area and average intensity, resulting in a low score; defects with large areas or significant grayscale differences will receive a higher score. Finally, a total defect score for the entire image (e.g., the sum or maximum value of all defect scores) can optionally be calculated to quantitatively evaluate the overall quality of the printed product.

[0032] Example 5: Based on the defect scores obtained, this example introduces a set of rules for defect classification and determination. Figure 1 As shown, the defect classification module uses the scoring results and defect saliency map to automatically classify defects. The classification rules can be configured according to the actual product quality standards and defect type classification requirements. Generally speaking, the defect classification of the present invention includes at least the following two levels of judgment: Pass / Fail Determination: Set a total defect score threshold, T, and a single defect score threshold, t. If the total score for the entire image or the score of any single defect exceeds thresholds T or t, the product is deemed unqualified and requires rejection or rework. Otherwise, the product is considered acceptable. The threshold settings can be adjusted based on the company's internal control standards and customer quality requirements. For example, for strict requirements for food and pharmaceutical packaging, a lower threshold can be set to increase the detection rate.

[0033] Defect type classification: Defects deemed unqualified are further classified by their cause or manifestation. In this embodiment, based on the defect saliency map and image analysis results, defect types are categorized into color deviation, missing / blurred content, foreign matter stains, and print registration misregistration. Specific criteria include: if the defect area exhibits a large, uniform color difference with blurred edges, it is classified as color deviation (possibly caused by unstable ink ratio or printing pressure); if the defect area has a regular shape and corresponds to the location of a known pattern element (such as a font or logo) but exhibits a significant intensity difference, it is classified as missing content (possibly due to a missing portion of the print); if the defect area consists of a small, localized, high-contrast spot, it is classified as a foreign matter stain (possibly caused by ink impurities or dust); and if the reference line provided by the reference image shows an overall offset from the defect saliency map, it is classified as a misregistration defect. This classification can be achieved using thresholds and rules, or a simple classifier (such as an SVM or decision tree) can be trained to output a category based on the defect feature vector. In this invention, due to the accurate comparison with the reference image, defect type determination is more reliable, helping to pinpoint the problematic link in the printing process. For example, color cast defects indicate problems with ink supply or color management, and irregular overprinting indicates problems with the registration process.

[0034] After classification is complete, the system records and outputs the results, including the location, type, score, and final product qualification of each defect. This not only automatically eliminates defective products but also provides a data foundation for subsequent quality analysis.

[0035] Example 6: This example focuses on the present invention's online false positive caching and rapid incremental learning mechanism. As production progresses, the printing environment and materials may change, or new defect types may emerge, potentially reducing the accuracy of fixed detection models. To address this, the present invention incorporates a self-learning module into the system software, enabling continuous model updates. The workflow is as follows: When the inspection system determines a printed product is unacceptable, the sample typically undergoes a manual review process. If the system's judgment is confirmed to be correct, the defect is established. However, if a false positive is detected (i.e., the algorithm incorrectly labels the sample as defect-free), this result is fed back to the system via the human-computer interface. Upon receiving the false positive feedback, the system stores the sample image and its false positives in an online false positive cache. This cache stores and manages recent false positives (for example, retaining the most recent N false positives). Furthermore, the system periodically triggers incremental learning, either when a certain number of false positives accumulates, to update the model using the false positives in the cache. For example, a transfer learning strategy can be employed to freeze most of the parameters of the original CNN, fine-tuning only the last few layers or incrementally training a corrected model. Alternatively, the model can be retrained during idle time by simply adding misclassified samples to the existing training set, assigning them a high weight, and then retraining the model during idle time. In this embodiment, a fast incremental update method is employed: a small number of adjustable parameters are pre-set in the model (such as the scaling factor of the attention module or the output threshold adjustment factor). When a recent increase in the misclassification rate is detected, the gradients are calculated by backpropagating the cached samples, and only these reserved parameters are adjusted, correcting the model's output for misclassified samples while leaving most of the original weights unchanged. The entire incremental update process can be completed in tens of seconds without requiring system downtime. The updated model is immediately used for subsequent detection tasks. This online learning mechanism ensures the long-term accuracy of the model and enables the system to adapt to dynamic changes such as ink batch changes and the introduction of new background patterns. It is important to note that to prevent catastrophic forgetting or the introduction of new biases, the system can limit the size of each incremental learning step and maintain a rollback mechanism (to restore the original model if the new model performs poorly). Through these measures, the detection algorithm of the present invention achieves adaptive optimization, becoming increasingly "smarter" with use in actual production, significantly outperforming existing fixed-model solutions.

[0036] Example 7: This example describes the hardware composition and deployment method of the visual defect detection system of the present invention. The system is mainly composed of an image acquisition unit, a defect detection device, and a control unit integrated with the production line. The image acquisition unit includes an industrial camera, a high-resolution lens, and an adjustable light source, which is installed at an appropriate position on the color box production line to capture the image of the printed surface of each color box passing by in real time. In order to eliminate motion blur, the acquisition unit is equipped with a high-brightness pulse light source and a high-speed shutter camera, and is triggered synchronously with the conveyor belt through a photoelectric sensor or encoder. The collected image is transmitted to the defect detection device via a gigabit Ethernet or a high-speed USB interface. The detection device integrates an embedded GPU module and the software algorithm module described in the above embodiment, and is the core processing unit of the system. The device's software architecture can be divided into several functional modules: an image preprocessing module performs color normalization and geometric correction; a deep feature extraction module encapsulates a lightweight convolutional neural network to generate a fused feature map; a feature comparison module loads reference features or images of the corresponding product and calculates a residual feature map compared to the current feature map; a defect assessment module generates a defect saliency map, calculates scores, and implements classification logic; a result output and alarm module transmits the final judgment result via a signal or network to the production line's rejection mechanism or higher-level control system, and triggers an audible and visual alarm to alert human attention when a defect is detected; and a learning and update module monitors system misjudgments, manages the misjudgment cache, and performs incremental model updates. Each of these modules can be implemented in software or as independent circuits or components in hardware. In actual engineering implementation, to simplify the system architecture, all modules and functions, except for the camera acquisition unit, are integrated into a single embedded industrial computer.

[0037] In the system deployment, the defect detection device (an industrial computer) is connected to equipment such as the conveyor drive and the rejection robot via an I / O interface. When a product is identified as defective and requires rejection, the device outputs a control signal to the rejection mechanism, automatically sorting and removing the defective product from the production line when it reaches a designated location. The device is also connected to the factory information system via Ethernet, allowing real-time upload of inspection data and statistical results for easy review and analysis by production managers. When switching to a different color box variety, the system can load reference images and detection model parameters for the corresponding product, ensuring that the detection algorithm is adaptable to the new pattern, thus providing excellent flexibility.

[0038] Beneficial effects of the present invention: 1. Improved Detection Accuracy: Leveraging the deep feature learning capabilities of convolutional neural networks, this method automatically extracts complex textures and subtle differences in patterns, more accurately distinguishing normal printing variations from true defects than traditional simple thresholding methods. This algorithm can reliably identify anomalies even on highly patterned or gradient-effect packaging surfaces. The introduction of multi-scale convolution and an attention mechanism enables the model to focus on both overall color differences across large areas and subtle defects in smaller areas, thereby reducing missed and false detection rates.

[0039] 2. Real-time and lightweight: This invention utilizes a lightweight neural network model to reduce the number of parameters and computational complexity. This model is compatible with edge computing hardware such as embedded GPUs, achieving millisecond-level image processing speeds and meeting the real-time requirements of full online inspection on a typical offset color box production line. Compared to traditional solutions that rely on manual labor or heavy servers, this algorithm can run stably on edge devices such as Jetson Orin, achieving both accuracy and efficiency.

[0040] 3. Robust preprocessing: Color normalization corrects for lighting and printing color casts, while geometric correction eliminates camera perspective distortion and displacement, ensuring precise alignment and comparison between the image under inspection and the reference image. Preprocessing improves detection consistency and robustness, even in the presence of changes in ambient lighting or slight camera position shifts, and reduces false positives caused by external factors.

[0041] 4. Comprehensive defect assessment and classification: The algorithm generates a quantitative defect score based on the defect saliency map and categorizes defects into different levels or types (e.g., slight color difference, severe missing print, ink splatter, etc.) based on the score and defect area morphology. This multi-level classification rule helps to implement differentiated treatment measures for different defect types during production and facilitates statistical analysis of common defect types to improve processes.

[0042] 5. Adaptive Learning Capability: This invention innovatively incorporates online false positive caching and rapid incremental learning mechanisms. Images suspected of false positives or new defects identified during the inspection process are automatically cached and used for subsequent incremental model training, enabling timely updates of inspection model parameters without interrupting production. This self-learning strategy enables the model to continuously optimize over time, adapting to changes in printed product patterns or processes, and maintaining high inspection accuracy over the long term without the need for frequent manual recalibration or offline training.

[0043] In summary, the defect detection algorithm provided by the present invention significantly improves the intelligence level of online quality inspection of color box printed products, can reduce manual participation, reduce the missed detection rate, and effectively solve the problems of easy misjudgment and difficult maintenance in the existing technology for complex printed pattern detection, and has good industrial application value.

[0044] In the description and claims of this application, the words "include / comprise" and the words "have / include" and their variations are used to specify the existence of stated features, values, steps or components, but do not exclude the existence or addition of one or more other features, values, steps, components or their combinations.

[0045] Some features of the present invention are described in separate embodiments for clarity of explanation, however, these features may also be described in combination in a single embodiment. Conversely, some features of the present invention are described in a single embodiment for brevity, however, these features may also be described in different embodiments individually or in any suitable combination.

[0046] Finally, it should be noted that those skilled in the art can cross-reference or superimpose the various embodiments of this solution, which still falls within the original disclosure scope of this solution. In addition, the above description is only a preferred embodiment of the present invention and is not intended to limit the present invention. Although the present invention has been described in detail with reference to the aforementioned embodiments, those skilled in the art can still modify the technical solutions described in the aforementioned embodiments or replace some of the technical features therein with equivalents. Any modifications, equivalent replacements, improvements, etc. made within the spirit and principles of the present invention shall be included in the scope of protection of the present invention.

Claims

1. A visual detection algorithm for printed patterns on color box printed products, characterized in that: The following steps are involved: Image acquisition step: obtaining an image of the color box printing pattern to be inspected, and inputting the image into the defect detection system for processing; Preprocessing step: perform color normalization and geometric correction on the collected color box image to obtain a standardized and aligned image to be inspected; Feature extraction step: The preprocessed image to be inspected is input into a lightweight multi-scale attention convolutional neural network to extract a multi-level fusion feature map to represent the image features of the color box pattern; Reference comparison step: providing a defect-free standard reference image corresponding to the pattern to be inspected, performing the same preprocessing and feature extraction on the reference image as that of the image to be inspected, and obtaining a reference feature map; Compare the fused feature map of the image to be inspected with the reference feature map to generate a residual feature map, and obtain a defect saliency map to highlight the difference area in the image to be inspected relative to the reference image; Defect assessment step: calculating at least one defect score based on the defect saliency map, for quantifying the severity of defects in the image to be inspected; Defect classification step: comparing the defect score with a preset threshold and classification rules, classifying and judging the detected defects, and outputting the defect detection result of the color box printing pattern.

2. The visual detection algorithm for printed patterns on color box printed matter according to claim 1, characterized in that: The convolutional neural network adopts a multi-scale feature extraction structure, including a convolution layer for extracting image features of different spatial scales, and fuses the features of each scale to form the fused feature map.

3. The visual detection algorithm for printed patterns on color box printed matter according to claim 1, characterized in that: The convolutional neural network includes an attention mechanism module for performing weighted processing on the extracted feature map to highlight defect-related feature signals; the attention mechanism includes channel attention and / or spatial attention for adaptively adjusting the weights of different channels or regions in the feature map.

4. The visual detection algorithm for printed patterns on color box printed matter according to claim 1, characterized in that: In the reference comparison step, a residual feature map is obtained by subtracting the fusion feature map of the image to be inspected from the reference feature map pixel by pixel or feature vector by feature vector, and the residual feature map is subjected to absolute value conversion, noise filtering and normalization to generate the defect saliency map.

5. The visual detection algorithm for printed patterns on color box printed matter according to claim 1, characterized in that: In the defect assessment step, the defect score is calculated based on the area ratio and difference intensity of the defect area in the defect saliency map; when there are multiple defect areas in the same image to be inspected, the individual score of each defect area and the comprehensive score of all defects are also calculated.

6. The visual detection algorithm for printed patterns on color box printed matter according to claim 5, characterized in that: The defect classification classifies defects into different types according to preset rules, including at least one of color deviation, printing omissions / missing spots, foreign matter stains, and overprint inaccuracies; the classification rules determine the defect category and product judgment results based on the shape characteristics, position, and defect score threshold of the defect area in the defect significance map.

7. The visual detection algorithm for printed patterns on color box printed matter according to claim 6, characterized in that: It also includes an online self-learning step: caching and storing the misjudgment sample images generated during the detection process, and using the cached misjudgment samples to perform incremental training and update of the convolutional neural network under predetermined conditions.

Citation Information

Cited By

  • Ink-jet printing defect detection method and device, terminal equipment and storage medium

    CN121353111A

  • A method and device for detecting defects in inkjet printing, a terminal device and a storage medium

    CN121353111B

  • Thermal printing quality detection method and system based on image recognition and OCR

    CN121685541A

  • Printing quality monitoring method and system based on artificial intelligence

    CN121861004A