Corrugated carton printing quality detection method based on incremental learning and feature synthesis

Through incremental learning and feature synthesis technology, the corrugated carton printing quality inspection model is constructed, which solves the problems of inefficiency and limited accuracy in the existing technology, and realizes efficient and accurate printing defect detection in complex backgrounds, and adapts to different production environments and process changes.

CN120339164APending Publication Date: 2025-07-18GUANGZHOU KESHENGLONG CARTON PACKING MACHINE
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202510223377.1
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-02-27
Publication Date
2025-07-18

AI Technical Summary

Technical Problem

The prior art is inefficient in the printing quality inspection of corrugated cartons, with limited accuracy, making it difficult to accurately identify and classify printing defects in complex backgrounds.

Method used

Using methods based on incremental learning and feature synthesis, a corrugated carton printing quality detection model is constructed through multi-layer feature extraction, incremental learning module, feature synthesis module, knowledge distillation module and deep supervision module, and a hybrid loss function optimization model is used to generate synthetic defect samples, maintain the ability to identify old defects and improve the ability to detect new defects.

Benefits of technology

It improves the accuracy and efficiency of printing quality inspection, can adapt to changes in complex backgrounds and production environments, effectively avoid catastrophic forgetting, and enhances the robustness and adaptability of the model.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120339164A_ABST
    Figure CN120339164A_ABST
Patent Text Reader

Abstract

The invention discloses a corrugated carton printing quality detection method based on incremental learning and feature synthesis, and the method comprises the steps: collecting a high-resolution corrugated carton image set, carrying out the preprocessing of the corrugated carton image set, and obtaining a sample image; constructing a corrugated carton printing quality detection model, wherein the corrugated carton printing quality detection model comprises a multi-layer feature extraction module, an incremental learning module, a feature synthesis module, a defect detection module, a knowledge distillation module and a depth supervision module; a corrugated carton printing quality detection model is trained, a mixed loss function is adopted to optimize the model in the network training process, and the mixed loss function is based on the sum of distillation loss, discrimination loss, defect detection loss and deep supervision loss; and detecting a to-be-detected corrugated carton printing image by using the trained corrugated carton printing quality detection model. According to the method, when a new printing defect type is introduced, the identification capability of old defects is kept, and disastrous forgetting is avoided.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of industrial defect detection, and in particular to a corrugated box printing quality detection method based on incremental learning and feature synthesis. Background Art

[0002] In the production and printing process of corrugated boxes, ensuring the printing quality of the outer packaging of the boxes is a key factor in ensuring product quality and brand image. As a widely used packaging material, the clarity, color consistency and pattern integrity of the printing on the surface of corrugated boxes directly affect the visual display and market competitiveness of the product. Therefore, it is particularly important to accurately detect printing quality defects (such as blurred text, color deviation, pattern defects, etc.) on the surface of corrugated boxes. Printing quality defects may be caused by printing equipment failure, uneven ink distribution, material defects or other problems in the production process. If these defects are not identified and handled in time, they may result in poor product appearance and reduce consumer satisfaction and brand loyalty.

[0003] Traditional printing quality inspection methods usually rely on manual visual inspection or simple machine vision technology. However, these methods are inefficient and their accuracy is limited by the operator's subjective judgment and external environmental factors such as light changes and color shift. In a high-speed production environment, relying on manual inspection is neither realistic nor able to meet the requirements of modern production for high efficiency and high precision. In addition, when dealing with printing defect detection, existing machine vision systems are easily disturbed by the complex texture and background of corrugated boxes, making it difficult to achieve accurate defect location and classification. Summary of the invention

[0004] The main purpose of the present invention is to overcome the shortcomings and deficiencies of the prior art. The present invention proposes a corrugated box printing quality detection method based on incremental learning and feature synthesis. The incremental learning technology is used to enhance the model's continuous detection capability of printing defects on the surface of corrugated boxes (such as color deviation, blurred text, pattern defects, etc.). The feature synthesis technology focuses on generating synthetic examples of different types of defects, so that the model can not only remember the old defects when introducing new defect types, but also more accurately identify and classify new defects. The application of this method can significantly improve the printing quality detection performance in complex backgrounds and different production environments, which is of great significance for improving the production quality and product consistency of corrugated boxes, and is expected to be widely used in the printing industry.

[0005] In order to achieve the above object, the present invention adopts the following technical solutions:

[0006] In a first aspect, the present invention provides a method for detecting printing quality of corrugated paper boxes based on incremental learning and feature synthesis, comprising the following steps:

[0007] Collect a high-resolution image set of corrugated boxes, preprocess the corrugated box image set to obtain sample images;

[0008] Construct a corrugated box printing quality detection model, which includes a multi-layer feature extraction module, an incremental learning module, a feature synthesis module, a defect detection module, a knowledge distillation module, and a deep supervision module; the multi-layer feature extraction module extracts low-level features F L 、medium-level features F M and high-level features F H of the input sample images; the incremental learning module maintains the recognition ability of old defects through knowledge distillation technology when introducing new types of printing defects, avoiding catastrophic forgetting; the feature synthesis module uses a generative adversarial network or a stable diffusion model to generate defect examples of different types to enhance the detection ability of the model; the defect detection module combines multi-layer features for detection, identifying and locating the printing defect area; the knowledge distillation module performs distillation processing by comparing the output features of the old and new models to further enhance the learning effect of the model; the deep supervision module performs multi-scale optimization on the detection results and calculates the output printing defect mask image;

[0009] Train the corrugated box printing quality detection model, and the network training process uses a hybrid loss function to optimize the model. The hybrid loss function is based on the sum of the distillation loss, discriminative loss, defect detection loss, and deep supervision loss;

[0010] Use the trained corrugated box printing quality detection model to detect the corrugated box printing image to be detected.

[0011] As a preferred technical solution, the multi-layer feature extraction module extracts features at different levels through a series of convolutional layers and pooling layers. For the input image I, after the convolutional operation at each stage, low-level features F L 、medium-level features F M and high-level features F H are obtained. Through multi-layer feature extraction, the edge information and printing quality features in the image I are separated and strengthened, enabling the selection of corresponding features for more effective processing during defect detection.

[0012] As a preferred technical solution, the incremental learning module adopts detector knowledge distillation technology to maintain the model's recognition ability for old defect categories. The incremental learning distillation loss function is defined as follows:

[0013]

[0014] where p j (c) represents the prediction probability of the new model for class c, represents the prediction probability of the old model for the same category, b j and represent the bounding box predictions of the new and old models respectively. SmoothL1 is a smooth L1 loss function used to calculate the difference between the bounding box predictions; by minimizing it ensures that when the new model learns new categories, it retains the knowledge of the old categories and avoids catastrophic forgetting by selecting the most important foreground predictions.

[0015] As a preferred technical solution, the feature synthesis module includes a generator G and a discriminator D;

[0016] The generator G helps the model identify rare or difficult-to-detect defects by generating features similar to actual defects;

[0017] The discriminator D distinguishes between the generated data and the real data. The discriminator D loss function is the sum of the expectation of the real data and the expectation of the generated data. The discriminator D loss function is expressed as follows:

[0018]

[0019] where the first term is the expectation of the real data, representing the ability of the discriminator D to correctly identify the real data; the second term is the expectation of the generated data, representing the ability of the discriminator D to identify the generated data.

[0020] As a preferred technical solution, the defect detection module adopts a feature fusion strategy. By fusing the low-level feature F L , the middle-level feature F M and the high-level feature F H , the detection accuracy is improved; the output F fused of the feature fusion is expressed as:

[0021] F fused = φ(W F *[F L , F M , F H )

[0022] where [F L , F M , F H represents the concatenation of features in the channel dimension, φ is a non-linear activation function, and W F is the weight matrix of the fusion network;

[0023] The defect detection loss function is composed of a classification loss and a bounding box regression loss:

[0024]

[0025] Among them, λ cls is the classification loss, is the bounding box regression loss, λ cls and λ bbox are loss weight coefficients, reflecting the importance of the classification and regression tasks.

[0026] As a preferred technical solution, in the knowledge distillation module, the knowledge distillation loss is defined as:

[0027]

[0028] Among them, is the soft label of the old model, q j (i) is the prediction probability of the new model, is the corresponding logits output, T is the distillation temperature parameter, used to smooth the soft label distribution, N is the number of samples, and C is the number of classes.

[0029] As a preferred technical solution, the deep supervision module optimizes the detection network by introducing multi-scale supervision loss, and the supervision loss is defined as follows:

[0030]

[0031] Among them, L is the number of layers of the network, α l is the weight coefficient of the l-th layer, is the loss of the l-th layer. By introducing multi-scale supervision, it is ensured that the model can obtain good detection effects at different scales.

[0032] As a preferred technical solution, the hybrid loss function is defined as follows:

[0033]

[0034] Among them, λ1, λ2, λ3, and λ4 are the weights of each loss term, reflecting their contributions to model optimization during training, represents the distillation loss, represents the discriminative loss, represents the defect loss, represents the deep supervision loss;

[0035] Using the Adam optimizer and setting the initial learning rate η0, after each training epoch, the learning rate decays exponentially:

[0036] η = η0·γ epoch

[0037] Among them, γ is the learning rate decay factor, and its value is usually between (0, 1).

[0038] In a second aspect, the present invention provides a corrugated cardboard printing quality detection system based on incremental learning and feature synthesis, which is applied to the corrugated cardboard printing quality detection method based on incremental learning and feature synthesis, and includes a data acquisition module, a quality detection model construction module, a model training module, and a quality detection module;

[0039] The data acquisition module is used to collect a high-resolution corrugated cardboard image set, preprocess the corrugated cardboard image set, and obtain sample images;

[0040] The quality detection model construction module is used to construct a corrugated cardboard printing quality detection model. The corrugated cardboard printing quality detection model includes a multi-layer feature extraction module, an incremental learning module, a feature synthesis module, a defect detection module, a knowledge distillation module, and a deep supervision module; the multi-layer feature extraction module extracts low-level features F L 、intermediate features F M and high-level features F H of the input sample images; when introducing new types of printing defects, the incremental learning module maintains the recognition ability of old defects through knowledge distillation technology to avoid catastrophic forgetting; the feature synthesis module uses a generative adversarial network or a stable diffusion model to generate defect examples of different types to enhance the detection ability of the model; the defect detection module combines multi-layer features for detection to identify and locate the printed defect area; the knowledge distillation module performs distillation processing by comparing the output features of the new and old models to further enhance the learning effect of the model; the deep supervision module performs multi-scale optimization on the detection results and calculates the output printed defect mask image;

[0041] The model training module is used to train the corrugated cardboard printing quality detection model. The network training process uses a hybrid loss function to optimize the model. The hybrid loss function is based on the distillation loss, the discriminant loss, the defect detection loss, and the deep supervision loss;

[0042] The quality detection module is used to detect the to-be-detected corrugated cardboard printing image by using the trained corrugated cardboard printing quality detection model.

[0043] In a third aspect, the present invention provides an electronic device, and the electronic device includes:

[0044] At least one processor; and,

[0045] A memory communicatively connected to the at least one processor; wherein,

[0046] The memory stores computer program instructions executable by the at least one processor, and the computer program instructions are executed by the at least one processor to enable the at least one processor to execute the corrugated carton printing quality detection method based on incremental learning and feature synthesis.

[0047] Compared with the prior art, the present invention has the following advantages and beneficial effects:

[0048] The method proposed by the present invention utilizes advanced incremental learning technology to ensure the recognition ability of existing defect types even when introducing new printing defects, effectively avoiding the phenomenon of catastrophic forgetting. In addition, by applying feature synthesis technology, the method can automatically generate synthetic samples of various defects, thereby improving the detection ability and robustness of the system for complex printing defects.

[0049] The present invention is specifically designed for the demand of corrugated carton surface printing quality detection, has the ability to accurately distinguish normal printing areas from various defect areas, and can adapt to different production environments and printing process changes. Through the application of this method, the accuracy and efficiency of printing quality detection have been significantly improved, demonstrating its great potential as an efficient, flexible and widely adaptable detection means. Therefore, it not only enhances the effectiveness of existing printed matter detection, but also provides a strong technical guarantee for coping with new challenges that may arise in the future. BRIEF DESCRIPTION OF THE DRAWINGS

[0050] In order to more clearly illustrate the technical solutions in the embodiments of the present application, the following will briefly introduce the drawings required for the description of the embodiments. Obviously, the following drawings are only some embodiments of the present application. For those of ordinary skill in the art, without creative efforts, other drawings can be obtained based on these drawings.

[0051] Figure 1 It is a flowchart of the corrugated carton printing quality detection method based on incremental learning and feature synthesis in the embodiment of the present invention;

[0052] Figure 2 It is a schematic diagram of the multi-layer feature extraction module in the embodiment of the present invention;

[0053] Figure 3 It is a schematic diagram of the incremental learning module in the embodiment of the present invention;

[0054] Figure 4 It is a schematic diagram of the feature synthesis module in the embodiment of the present invention;

[0055] Figure 5 It is a schematic diagram of the defect detection module in the embodiment of the present invention;

[0056] Figure 6 Schematic diagram of the knowledge distillation module in the embodiment of the present invention;

[0057] Figure 7 Schematic diagram of the deep supervision module in the embodiment of the present invention;

[0058] Figure 8 Experimental result graph of the overall solution in the embodiment of the present invention;

[0059] Figure 9 Block diagram of the corrugated carton printing quality detection system based on incremental learning and feature synthesis in the embodiment of the present invention;

[0060] Figure 10 Structural diagram of the electronic device in the embodiment of the present invention. Specific implementation manners

[0061] In order to enable those skilled in the art of the present technology to better understand the solution of the present application, the technical solutions in the embodiments of the present application will be clearly and completely described below in conjunction with the accompanying drawings in the embodiments of the present application. Obviously, the described embodiments are only a part of the embodiments of the present application, rather than all the embodiments. Based on the embodiments in the present application, all other embodiments obtained by those skilled in the art without creative efforts belong to the scope of protection of the present application.

[0062] Referring to "embodiment" in the present application means that the specific features, structures or characteristics described in connection with the embodiment may be included in at least one embodiment of the present application. The phrase appears in various positions in the specification does not necessarily refer to the same embodiment, nor is it an independent or alternative embodiment mutually exclusive with other embodiments. Those skilled in the art explicitly and implicitly understand that the embodiments described in the present application may be combined with other embodiments.

[0063] As Figure 1 shown, the corrugated carton printing quality detection method based on incremental learning and feature synthesis in this embodiment includes the following steps:

[0064] S1. Collect a high-resolution corrugated carton image set, and preprocess the corrugated carton image set to obtain sample images.

[0065] In the process of corrugated carton printing quality detection, the quality and diversity of the data set are crucial for the training and performance optimization of the model. The data set production process in this embodiment includes four main steps: data collection, data preprocessing, data augmentation, and data annotation. Specifically:

[0066] S1.1. Data collection: Use an industrial area scanning camera to obtain a high-resolution corrugated carton image set These images cover various printing defects in corrugated cardboard box production, such as color difference, blurring, incomplete patterns, etc., and can represent different printing quality problems. The original images collected have a resolution of H×W and are usually large, so cropping operations are required to meet the input requirements of the neural network.

[0067] S1.2. In data preprocessing, the original images are cropped to an appropriate size (e.g., 512×512 pixels) to ensure that the network can process these data efficiently.

[0068] S1.3. To improve the diversity of the dataset and the generalization ability of the model, data augmentation techniques are widely used. Data augmentation methods include rotation, scaling, translation, cropping, flipping, and color jittering, etc. These augmentation operations can generate an extended dataset so that the model can still maintain good detection performance when facing different production conditions and printing process variations.

[0069] S1.4. Data annotation is processed using professional annotation software (Labelme). By manually annotating each cropped image, the corresponding ground truth mask images are generated. These mask images identify the defect types and locations of each pixel point in the image, providing accurate supervision signals for the training of the model. To optimize the training process of the model, the dataset is usually divided into training data, validation data, and test data in a ratio of 7:2:1. The training data is used for model training, the validation data is used for hyperparameter tuning and implementation of the early stopping strategy, and the test data is used to evaluate the final detection performance of the model. Through the carefully crafted dataset, the present invention can ensure that the corrugated cardboard box printing quality detection model can obtain good generalization ability and detection accuracy under various complex backgrounds and printing defect types.

[0070] S2. Construct a corrugated cardboard box printing quality detection model, which includes a multi-layer feature extraction module 101, an incremental learning module 102, a feature synthesis module 103, a defect detection module 104, a knowledge distillation module 105, and a deep supervision module 106, as Figure 1 shown. The multi-layer feature extraction module 101 inputs the image information with an input size of H×W×3 into the network to extract the low-level feature F L of the input image, the intermediate feature F M and the high-level feature F H. When introducing new types of printing defects, the incremental learning module 102 maintains the recognition ability of old defects through knowledge distillation technology to avoid catastrophic forgetting. The feature synthesis module 103 uses a generative adversarial network (GAN) or a stable diffusion model to generate defect examples of different types to enhance the detection ability of the model. The defect detection module 104 combines multi-level features for detection to identify and locate the printing defect area. The knowledge distillation module 105 performs distillation processing by comparing the output features of the old and new models to further enhance the learning effect of the model. Finally, the deep supervision module 106 performs multi-scale optimization on the detection results and calculates the output printing defect mask image.

[0071] The structures and processing procedures of each model are further elaborated below:

[0072] S2.1. The multi-level feature extraction module extracts features at different levels through a series of convolutional layers and pooling layers, such as Figure 2 shown, the multi-level feature extraction module consists of three stages: The first stage 201 includes two convolutional layers and one max pooling layer. The first convolutional layer (Conv1) and the second convolutional layer (Conv2) both use convolutional operations with a kernel size of 3, the activation function is ReLU, and after the convolutional operation, a max pooling (Pooling1) with a kernel size of 2 is connected to obtain the low-level feature F of the input image L . The low-level feature F L After being processed, it enters the second stage 202. The second stage 202 is mainly used to extract the intermediate feature F M . This stage also consists of two convolutional layers (Conv3 and Conv4) and one max pooling layer (Pooling2). The kernel sizes of the convolutional layers are both 3, and the activation function is ReLU. After the convolutional and pooling operations, the intermediate feature F of the input image M is further separated and strengthened. The intermediate feature F M Subsequently enters the third stage 203. In the third stage 203, the intermediate feature F M is further processed to extract the high-level feature F H . This stage has two convolutional layers (Conv5 and Conv6) and one max pooling layer (Pooling3). The kernel size of the convolutional layer is 3, and the activation function is also ReLU. After the convolutional operation, a max pooling layer with a kernel size of 2 is used for downsampling, and finally the high-level feature F H is obtained. Through the feature extraction of the above three stages, the edge information and printing quality features in the image are effectively separated and enhanced, enabling the selection of corresponding features for more effective processing in the subsequent defect detection module. The mathematical model is expressed as follows:

[0073] F L = σ(WL *I + b L )

[0074] F M = σ(W M *I + b M )

[0075] F H = σ(W H *I + b H )

[0076] where σ is the activation function (ReLU), W L , W M , W H are the convolutional kernel weights of low-level, middle-level, and high-level features respectively, and b L , b M , b H are the corresponding bias terms. Through the design of the multi-level feature extraction module, it is ensured that the model can more accurately detect and identify printing defects when processing features at different levels, improving the robustness and accuracy of detection.

[0077] S2.2. The incremental learning module adopts the detector knowledge distillation technology to maintain the model's recognition ability for old defect categories; as Figure 3 shown, the main purpose of the incremental learning module 102 is to maintain the recognition ability for old defect categories and avoid catastrophic forgetting when introducing new printing defect types. This module is optimized through steps such as the knowledge distillation process 301, foreground prediction selection 302, loss minimization 303, and backpropagation 304. During the incremental learning process, first, the output features of the new model and the old model are input into the knowledge distillation module for processing. The core of the knowledge distillation process is to calculate the prediction difference between the new model and the old model, generating a knowledge distillation loss function This loss function consists of two parts: one part is the cross-entropy loss based on the class prediction probability, which is used to measure the difference in class prediction between the new and old models; the other part is the SmoothL1 loss, which is used to calculate the difference in bounding box prediction between the new and old models. Its mathematical expression is as follows:

[0078]

[0079] where p j (c) represents the prediction probability of the new model for class c, represents the prediction probability of the old model for the same class, b j and represent the bounding box predictions of the new and old models respectively, and SmoothL1 is the SmoothL1 loss function.

[0080] After calculating the knowledge distillation loss, the module performs foreground pre-selection on the prediction results. This step further enhances the new model's learning effect on new classes by selecting the most important foreground predictions, while ensuring that the recognition of old classes is not forgotten. The results of foreground pre-selection are used to update the knowledge distillation loss, making the new model's predictions more accurate for different classes. Then, the incremental learning module optimizes the new model by minimizing the loss function to ensure the consistency of the outputs between the new model and the old model, thus effectively preventing catastrophic forgetting. After minimizing the loss, the module adjusts the weights of the new model through the backpropagation algorithm to adapt to the newly introduced defect classes and maintain the recognition ability for old classes. Through this series of steps, the incremental learning module can effectively maintain the old knowledge and learn new knowledge, enabling the corrugated cardboard printing quality detection model to maintain efficient and robust detection performance in a changing production environment. The design of the incremental learning module makes it particularly suitable for complex scenarios in corrugated cardboard printing quality detection and can provide accurate detection results when the model faces various types of printing defects.

[0081] S2.3. The main function of the feature synthesis module 103 is to generate synthetic data for various defects to enhance the detection ability of the corrugated box printing quality detection model. As Figure 4 shown, this module uses the generative adversarial network (GAN) framework to generate synthetic data similar to real defects through adversarial training between the generator G401 and the discriminator D402.

[0082] The working process of the feature synthesis module is as follows: First, the generator g receives a random noise input and generates synthetic data G(Z) through a series of non-linear transformations. These synthetic data are designed to mimic the feature distribution of real defect data. At the same time, the discriminator d receives the real data x and the synthetic data G(z) generated by the generator G and tries to distinguish between the two. The goal of the discriminator d is to maximize the probability that it correctly distinguishes the real data and the synthetic data. During the adversarial training process, a game relationship is formed between the generator g and the discriminator D: the goal of the generator g is to generate data that the discriminator d cannot distinguish, while the goal of the discriminator d is to distinguish the real data and the synthetic data as accurately as possible. This adversarial training is achieved by optimizing the loss functions of the generator and the discriminator. The adversarial training process of the feature synthesis module can be represented by the following loss function:

[0083]

[0084] where the first term is the expectation of the real data, representing the discriminator d's ability to correctly identify the real data; the second term It is the expectation of the generated data, representing the ability of the discriminator D to recognize the generated data. The goal of the generator G is to minimize this loss, while the goal of the discriminator D is to maximize this loss.

[0085] During the training process, the feature synthesis module continuously iteratively optimizes the parameters of the generator G and the discriminator D. The optimization process of the generator G aims to improve the authenticity of the generated data, making the distribution of the generated data G(z) as close as possible to that of the real data x. The discriminator D continuously adjusts its discrimination ability, striving to accurately distinguish between real data and generated data. This adversarial training strategy enables the generated defective samples to not only effectively simulate the characteristics of actual printing defects but also cover various complex defect types, thus greatly enriching the training samples of the model and enhancing the detection ability and robustness of the model for various printing defects.

[0086] Through this feature synthesis method, the corrugated carton printing quality detection model can maintain high detection accuracy and stability in different production environments. The design of the feature synthesis module enables the model to have strong adaptability, be able to handle various types of printing defects, and provide a more abundant and diverse feature input for the subsequent detection module.

[0087] S2.4. The main function of the defect detection module 104 is to accurately identify and locate the printing defects of corrugated cartons through feature fusion and multi-task learning strategies. As Figure 5 shown, this module accepts the low-level feature F L , middle-level feature F M and high-level feature F H from the multi-layer feature extraction module as inputs, and fuses these features to improve the detection accuracy. The defect detection module first splices the features F L , F M and F H at different levels in the channel dimension through the feature splicing layer 501. The spliced features contain various scale information of the image and can effectively capture the comprehensive feature representation from low-level texture to high-level semantics. Then, these spliced features are passed to the convolutional layer 502, and the comprehensive features are further extracted through convolutional operations to enhance the representation ability of the target defects. After the convolutional operation, the features are processed by the non-linear activation layer 503 (ReLU). The role of the non-linear activation layer is to introduce non-linear characteristics, enabling the model to learn more complex feature relationships. After being processed by the activation layer, the fused features are passed to the feature fusion layer 504 for further feature fusion operations. The purpose of the feature fusion layer is to adaptively adjust the features in the spatial and channel dimensions to strengthen the attention to the target defect area. After feature fusion, the defect detection module calculates the classification loss and the bounding box regression loss Classification loss The cross - entropy loss is adopted to measure the accuracy of the model in class classification; the bounding box regression loss then uses the smooth L1 loss to accurately regress the bounding box position of the target defect. The weighted sum of these two losses constitutes the total loss function of the detection module

[0088]

[0089] Among them, λ cls and λ bbox are loss weight coefficients, reflecting the importance of the classification and regression tasks.

[0090] After calculating the total loss function, the module optimizes the model parameters through the backpropagation algorithm. The process of backpropagation includes calculating gradients and updating the model weights to minimize the total loss function Thereby improving the detection performance and accuracy of the model. Through this feature fusion and multi - task learning strategy, the defect detection module can effectively improve the detection ability of corrugated box printing defects, ensuring high - efficiency and accurate detection performance even under complex backgrounds and diverse defect types. The flexibility and robustness of the module design enable it to adapt to different production environments and printing process changes, providing reliable technical support for the quality control of corrugated boxes.

[0091] S2.5. The main function of the knowledge distillation module 105 is to enhance the performance of the new model in incremental learning through the distillation strategy. As Figure 6 shown, this module compares the outputs of the old and new models, transfers the knowledge of the old model 601 to the new model 602, thereby improving the generalization ability and robustness of the new model and avoiding catastrophic forgetting when introducing new classes. The knowledge distillation module first extracts output features from the old model These features represent the prediction information of the old model on sample i. Then, the module uses these features to generate soft labels The soft label is a probability distribution obtained by temperature - adjusting the output of the old model. The formula for generating the soft label is as follows:

[0092]

[0093] Among them, T is the distillation temperature parameter, usually greater than 1, which is used to smooth the output probability distribution of the old model, enabling the new model to better learn the decision boundary of the old model.

[0094] Subsequently, the soft label is passed to the core part of the knowledge distillation module and compared with the output feature z j (i) of the new model on sample i. Through this comparison, the module calculates the distillation loss function Used to measure the difference in predictions between the new model and the old model. The definition of the distillation loss function is as follows:

[0095]

[0096] where q j (i) is the class probability predicted by the new model, N is the number of samples, and C is the number of classes. The distillation loss is calculated by comparing the output of the new model with the soft labels of the old model to ensure that the new model can learn the knowledge of the old model. After calculating the distillation loss , the module uses the backpropagation algorithm to update and optimize the parameters of the new model. The process of backpropagation adjusts the weights of the new model by minimizing the distillation loss, enabling it to better retain the knowledge of the old model while adapting to the introduction of new classes. This process improves the new model's memory ability for old classes and still maintains high performance when facing new data. Through the above knowledge distillation strategy, the module can effectively transfer the knowledge of the old model to the new model, enabling it to maintain high-efficiency and accurate defect detection capabilities under changing production environments and data distributions. The design of this module is of great significance for enhancing the continuous learning ability of the corrugated cardboard printing quality detection model, helping to maintain the robustness and detection accuracy of the model when introducing new types of printing defects.

[0097] S2.6. The main function of the deep supervision module 106 is to optimize the performance of the detection network by introducing multi-scale supervision losses. As Figure 7 shown, this module supervises the feature outputs at different scales to ensure that the model can accurately detect printing defects at each scale, improving the overall detection performance and robustness of the model. The deep supervision module receives different-scale feature outputs from the multi-layer feature extraction module, including the small-scale output F L , the medium-scale output F M , and the large-scale output F H . These outputs represent image features from low-level to high-level, covering comprehensive information from detailed textures to global semantics. The module separately supervises the output of each scale and calculates its corresponding supervision loss. Specifically, the supervision loss of the small-scale output F L is L1, the supervision loss of the medium-scale output F M is L2, and the supervision loss of the large-scale output F H is L3. To provide a consistent supervision signal at all scales, the deep supervision module weights and sums up the supervision losses of each scale to calculate the multi-scale supervision loss The calculation formula of the multi-scale supervision loss is as follows:

[0098]

[0099] Among them, L is the number of layers of the network, and α l is the weight coefficient of the first layer, which is used to adjust the contribution degree of each scale in the total supervision. is the loss of the first layer. In addition to the multi-scale supervision loss, the detection network also includes a detection loss which is composed of a classification loss and a bounding box regression loss. To comprehensively consider the requirements of the detection task and multi-scale supervision, the deep supervision module combines the multi-scale supervision loss with the detection loss to form the final total loss function

[0100]

[0101] Among them, λ KD is the weight coefficient of knowledge distillation, and λ DS is the weight coefficient used to smooth the detection loss and the multi-scale supervision loss.

[0102] After obtaining the total loss function , the module is optimized by the backpropagation algorithm. Backpropagation calculates the gradient of the loss function with respect to the model parameters and gradually updates the model weights, so that the detection accuracy of the model at multiple scales is optimized. This process ensures that the model can maintain good detection performance in the feature spaces of different scales, thereby improving the stability and accuracy of detection. By introducing the deep supervision module, the corrugated cardboard printing quality detection model can maintain high robustness and detection accuracy in a complex production environment. The design of this module enables the model to make full use of multi-scale feature information, improve the detection effect of printing defects, and adapt to changes in different printing processes and production conditions.

[0103] S3. Train the corrugated cardboard printing quality detection model. The network training process uses a hybrid loss function to optimize the model. The hybrid loss function is based on the sum of the distillation loss, discriminative loss, defect detection loss, and deep supervision loss.

[0104] During the neural network training process, the selection and design of the loss function play a crucial role in optimizing the performance of the model. To improve the stability and detection accuracy of the corrugated cardboard printing quality detection model, the present invention uses a hybrid loss function to optimize the network. The definition of the hybrid loss function is as follows:

[0105]

[0106] Among them, is the detector knowledge distillation loss of the quantization learning module, which is used to maintain the recognition ability of old categories when introducing new categories; It is the GAN loss of the feature synthesis module, which is used to generate synthetic data to enhance the model's detection ability for various complex printing defects; It is the detection loss of the defect detection module, which consists of classification loss and bounding box regression loss, and is used to measure the model's performance in defect classification and localization; It is the multi-scale supervision loss of the deep supervision module, which is used to ensure the detection effect of the model at different scales. The weights λ1, λ2, λ3, and λ4 of each loss term reflect their contribution to the model optimization during the training process. By reasonably setting these weights, a balance can be achieved among different loss terms to ensure that the performance of the model in all aspects is fully optimized.

[0107] During the network training process, the Adam optimizer is used to update the model parameters. The Adam optimizer is widely used for its good convergence and adaptability. At the beginning of training, a relatively large initial learning rate η0 is set. After each training epoch, the learning rate is adjusted according to the exponential decay strategy to improve the training stability and convergence speed. The adjustment formula for the learning rate is as follows:

[0108] η = η0·γ epoch

[0109] where γ is the learning rate decay factor, usually taking values in the range of (0, 1). By gradually reducing the learning rate, it can be avoided that the model falls into local optimal solutions in the later stage of training and ensure that the model can achieve higher detection accuracy. By comprehensively considering the loss terms of each module and the training strategy, the corrugated cardboard box printing quality detection model of the present invention can achieve efficient and accurate defect detection in a complex industrial production environment, providing reliable technical support for the quality control of corrugated cardboard boxes.

[0110] The present invention utilizes advanced incremental learning technology to maintain the ability to recognize old defects and avoid catastrophic forgetting when introducing new types of printing defects. At the same time, the introduction of feature synthesis technology enables the system to automatically generate synthetic examples of different types of defects, improving the model's detection ability and robustness for various complex printing defects. This method is specifically designed for the printing quality detection requirements on the surface of corrugated cardboard boxes, can effectively distinguish normal printing areas and various defect areas, and adapt to different production environments and changes in printing processes. Through the application of this method, the accuracy and efficiency of printing quality detection are significantly improved, making it an efficient, flexible, and widely adaptable detection method.

[0111] It should be noted that for the foregoing method embodiments, for the sake of simplicity of description, they are all expressed as a series of action combinations. However, those skilled in the art should know that the present invention is not limited by the described action sequence, because according to the present invention, certain steps can be performed in other sequences or simultaneously.

[0112] Based on the same idea as the corrugated box printing quality detection method based on incremental learning and feature synthesis in the above embodiments, the present invention also provides a corrugated box printing quality detection system based on incremental learning and feature synthesis, which can be used to execute the above corrugated box printing quality detection method based on incremental learning and feature synthesis. For the sake of convenience of description, in the structural schematic diagram of the embodiment of the corrugated box printing quality detection system based on incremental learning and feature synthesis, only the parts related to the embodiments of the present invention are shown. Those skilled in the art can understand that the illustrated structure does not constitute a limitation on the device, and it may include more or fewer components than those illustrated, or combine certain components, or arrange different components.

[0113] Please refer to Figure 9 , in another embodiment of the present application, a corrugated box printing quality detection system 700 based on incremental learning and feature synthesis is provided. The system includes a data acquisition module 701, a quality detection model construction module 702, a model training module 703, and a quality detection module 704;

[0114] The data acquisition module 701 is used to collect a high-resolution corrugated box image set, preprocess the corrugated box image set, and obtain a sample image;

[0115] The quality detection model construction module 702 is used to construct a corrugated box printing quality detection model. The corrugated box printing quality detection model includes a multi-layer feature extraction module, an incremental learning module, a feature synthesis module, a defect detection module, a knowledge distillation module, and a deep supervision module; the multi-layer feature extraction module extracts low-level features F L , intermediate features F M , and high-level features F H of the input sample image; the incremental learning module maintains the recognition ability of old defects through knowledge distillation technology when introducing new types of printing defects, avoiding catastrophic forgetting; the feature synthesis module uses a generative adversarial network or a stable diffusion model to generate defect examples of different types to enhance the detection ability of the model; the defect detection module combines multi-layer features for detection to identify and locate the printing defect area; the knowledge distillation module performs distillation processing by comparing the output features of the new and old models to further enhance the learning effect of the model; the deep supervision module performs multi-scale optimization on the detection result and calculates the output printed defect mask image;

[0116] The model training module 703 is used to train the corrugated box printing quality detection model. The network training process uses a mixed loss function to optimize the model. The mixed loss function is based on the distillation loss, the discriminant loss, the defect detection loss, and the deep supervision loss;

[0117] The quality inspection module 704 is configured to use the trained corrugated box printing quality inspection model to inspect the corrugated box printing image to be inspected.

[0118] It should be noted that the corrugated box printing quality inspection system based on incremental learning and feature synthesis of the present invention corresponds one-to-one with the corrugated box printing quality inspection method based on incremental learning and feature synthesis of the present invention. The technical features and their beneficial effects described in the embodiments of the above corrugated box printing quality inspection method based on incremental learning and feature synthesis are applicable to the embodiments of the corrugated box printing quality inspection based on incremental learning and feature synthesis. For specific content, reference can be made to the description in the method embodiments of the present invention, which will not be elaborated here. This is hereby declared.

[0119] In addition, in the implementation manner of the corrugated box printing quality inspection system based on incremental learning and feature synthesis in the above embodiments, the logical division of each program module is only for illustration. In actual applications, according to needs, for example, considering the configuration requirements of the corresponding hardware or the convenience of software implementation, the above functions can be assigned to different program modules to complete, that is, the internal structure of the corrugated box printing quality inspection system based on incremental learning and feature synthesis is divided into different program modules to complete all or part of the functions described above.

[0120] Please refer to Figure 10 , in an embodiment, an electronic device for implementing a corrugated box printing quality inspection method based on incremental learning and feature synthesis is provided. The electronic device 800 may include a first processor 801, a first memory 802, and a bus, and may further include a computer program stored in the first memory 802 and executable on the first processor 801, such as a corrugated box printing quality inspection program 803 based on incremental learning and feature synthesis.

[0121] Among them, the first memory 802 includes at least one type of readable storage medium, and the readable storage medium includes flash memory, mobile hard disk, multimedia card, card-type memory (such as SD or DX memory, etc.), magnetic memory, magnetic disk, optical disc, etc. In some embodiments, the first memory 802 may be an internal storage unit of the electronic device 800, such as the mobile hard disk of the electronic device 800. In some other embodiments, the first memory 802 may also be an external storage device of the electronic device 800, such as a plug-in mobile hard disk, Smart Media Card (SMC), Secure Digital (SD) card, Flash Card, etc. equipped on the electronic device 800. Further, the first memory 802 may also include both the internal storage unit and the external storage device of the electronic device 800. The first memory 802 can be used not only to store application software installed on the electronic device 800 and various types of data, such as the code of the corrugated cardboard printing quality detection program 803 based on incremental learning and feature synthesis, but also to temporarily store data that has been output or will be output.

[0122] In some embodiments, the first processor 801 may be composed of integrated circuits. For example, it may be composed of a single packaged integrated circuit, or may be composed of multiple integrated circuits with the same or different functions, including the combination of one or more Central Processing Units (CPUs), microprocessors, digital processing chips, graphics processors, and various control chips. The first processor 801 is the control core (Control Unit) of the electronic device, connecting various components of the entire electronic device through various interfaces and circuits, and executing various functions of the electronic device 800 and processing data by running or executing programs or modules stored in the first memory 802 and calling data stored in the first memory 802.

[0123] Figure 10 Only the electronic device with components is shown. Those skilled in the art can understand that Figure 10 the shown structure does not constitute a limitation on the electronic device 800, and it may include fewer or more components than shown, or combine some components, or have a different component arrangement.

[0124] The corrugated cardboard printing quality detection program 803 stored in the first memory 802 of the electronic device 800 is a combination of multiple instructions. When running in the first processor 801, it can achieve:

[0125] Collect a high-resolution corrugated cardboard box image set, preprocess the corrugated cardboard box image set to obtain sample images;

[0126] Construct a corrugated cardboard box printing quality detection model, the corrugated cardboard box printing quality detection model includes a multi-layer feature extraction module, an incremental learning module, a feature synthesis module, a defect detection module, a knowledge distillation module, and a deep supervision module; the multi-layer feature extraction module extracts the low-level feature F of the input sample image L , intermediate feature F M and high-level feature F H ; when the incremental learning module introduces new types of printing defects, it maintains the recognition ability of old defects through knowledge distillation technology to avoid catastrophic forgetting; the feature synthesis module uses a generative adversarial network or a stable diffusion model to generate defect examples of different types to enhance the detection ability of the model; the defect detection module combines multi-layer features for detection to identify and locate the printing defect area; the knowledge distillation module performs distillation processing by comparing the output features of the old and new models to further enhance the learning effect of the model; the deep supervision module performs multi-scale optimization on the detection result and calculates the output printing defect mask image;

[0127] Train the corrugated cardboard box printing quality detection model, and the network training process uses a hybrid loss function to optimize the model. The hybrid loss function is based on the sum of the distillation loss, discriminant loss, defect detection loss, and deep supervision loss;

[0128] Use the trained corrugated cardboard box printing quality detection model to detect the corrugated cardboard box printing image to be detected.

[0129] Furthermore, if the modules / units integrated in the electronic device 800 are implemented in the form of software function units and sold or used as independent products, they can be stored in a non-volatile computer-readable storage medium. The computer-readable medium may include: any entity or device capable of carrying the computer program code, recording medium, USB flash drive, mobile hard disk, magnetic disk, optical disc, computer memory, read-only memory (ROM, Read-Only Memory).

[0130] Those of ordinary skill in the art can understand that all or part of the processes in the methods of the above embodiments can be completed by instructing relevant hardware through a computer program. The program can be stored in a non-volatile computer-readable storage medium. When the program is executed, it can include the processes of the embodiments of the above methods. Among them, any reference to a memory, storage, database, or other medium used in the embodiments provided in the present application can include non-volatile and / or volatile memories. Non-volatile memory can include read-only memory (ROM), programmable ROM (PROM), electrically programmable ROM (EPROM), electrically erasable programmable ROM (EEPROM), or flash memory. Volatile memory can include random access memory (RAM) or external cache memory. By way of illustration and not limitation, RAM is available in many forms, such as static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), double data rate SDRAM (DDR SDRAM), enhanced SDRAM (ESDRAM), synchronous link DRAM (SLDRAM), Rambus direct RAM (RDRAM), direct memory bus dynamic RAM (DRDRAM), and Rambus dynamic RAM (RDRAM), etc.

[0131] The technical features of the above embodiments can be combined arbitrarily. For the sake of brevity of description, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, it should be considered as the scope recorded in this specification.

[0132] The above embodiments are preferred embodiments of the present invention, but the embodiments of the present invention are not limited to the above embodiments. Any other changes, modifications, substitutions, combinations, and simplifications made without departing from the spirit and principle of the present invention should be equivalent replacement methods and are all included in the protection scope of the present invention.

Claims

1. A corrugated carton printing quality detection method based on incremental learning and feature synthesis, characterized in that Including the following steps: Collect a high-resolution corrugated cardboard image set, preprocess the corrugated cardboard image set to obtain sample images; Build a corrugated cardboard box printing quality detection model. The corrugated cardboard box printing quality detection model includes a multi-layer feature extraction module, an incremental learning module, a feature synthesis module, a defect detection module, a knowledge distillation module, and a deep supervision module. The multi-layer feature extraction module extracts low-level features F L , intermediate-level features F M , and high-level features F H of the input sample image. The incremental learning module maintains the recognition ability of old defects through knowledge distillation technology when introducing new types of printing defects, avoiding catastrophic forgetting. The feature synthesis module uses a generative adversarial network or a stable diffusion model to generate defect examples of different types to enhance the detection ability of the model. The defect detection module combines multi-layer features for detection to identify and locate the printing defect area. The knowledge distillation module performs distillation processing by comparing the output features of the old and new models to further enhance the learning effect of the model. The deep supervision module performs multi-scale optimization on the detection results and calculates the output printing defect mask image. Train a corrugated cardboard printing quality detection model. During the network training process, a hybrid loss function is used to optimize the model. The hybrid loss function is based on the sum of the distillation loss, discriminative loss, defect detection loss, and deep supervision loss; Use the trained corrugated cardboard printing quality detection model to detect the corrugated cardboard printing images to be detected.

2. The corrugated cardboard box printing quality detection method based on incremental learning and feature synthesis according to claim 1, characterized in that, The multi-layer feature extraction module extracts features at different levels through a series of convolutional layers and pooling layers. For the input image I, after the convolutional operations at each stage, low-level features F L , intermediate-level features F M and high-level features F H are obtained. Through multi-layer feature extraction, the edge information and printing quality features in the image I are separated and enhanced, enabling the selection of corresponding features for more effective processing during defect detection.

3. The corrugated cardboard box printing quality detection method based on incremental learning and feature synthesis according to claim 1, wherein The incremental learning module adopts the detector knowledge distillation technique to maintain the model's recognition ability for old defect categories. The incremental learning distillation loss function is defined as follows: Among them, p j (C) represents the predicted probability of the new model for class c, represents the predicted probability of the old model for the same class, B j and respectively represent the bounding box predictions of the new and old models. SmoothL1 is the smooth L1 loss function, which is used to calculate the difference between the bounding box predictions; by minimizing it is ensured that when the new model learns new classes, it retains the knowledge of the old classes and avoids catastrophic forgetting by selecting the most important foreground predictions.

4. The corrugated cardboard box printing quality detection method based on incremental learning and feature synthesis according to claim 1, characterized in that, The feature synthesis module includes a generator G and a discriminator D; The generator G helps the model identify rare or difficult-to-detect defects by generating features similar to actual defects; The discriminator D distinguishes between the generated data and the real data. The loss function of the discriminator D is the sum of the expectation of the real data and the expectation of the generated data. The loss function of the discriminator D is expressed as follows: Among them, the first term is the expectation of the real data, representing the ability of the discriminator d to correctly identify the real data; the second term is the expectation of the generated data, representing the ability of the discriminator d to identify the generated data.

5. The corrugated cardboard box printing quality detection method based on incremental learning and feature synthesis according to claim 1, characterized in that, The defect detection module adopts a feature fusion strategy. By fusing the low-level feature f L , the intermediate-level feature f M , and the high-level feature f H , the detection accuracy is improved. The output F fused of the feature fusion is expressed as: F fused = φ(W F *[F L , F M , F H ) Among them, [F L , F M , F H represents the concatenation of features in the channel dimension, φ is a non-linear activation function, and W F is the weight matrix of the fusion network; Defect Detection Loss Function It consists of classification loss and bounding box regression loss: Among them, is the classification loss, is the bounding box regression loss, λ cls and λ bbox are loss weight coefficients, reflecting the importance of the classification and regression tasks.

6. The corrugated cardboard box printing quality detection method based on incremental learning and feature synthesis according to claim 1, characterized in that In the knowledge distillation module, the knowledge distillation loss is defined as: Among them, is the soft label of the old model, q j (i) is the predicted probability of the new model, and is the corresponding logits output, T is the distillation temperature parameter for smoothing the soft label distribution, N is the number of samples, and C is the number of classes.

7. The corrugated cardboard box printing quality detection method based on incremental learning and feature synthesis according to claim 1, characterized in that, The deep supervision module optimizes the detection network by introducing multi-scale supervision loss, and the supervision loss is defined as follows: Among them, L is the number of layers of the network, and α l is the weight coefficient of the l-th layer, is the loss of the l-th layer. By introducing multi-scale supervision, it is ensured that the model can obtain good detection effects at different scales.

8. The corrugated cardboard box printing quality detection method based on incremental learning and feature synthesis according to claim 1, characterized in that Mixed loss function is defined as follows: Among them, λ1, λ2, λ3, and λ4 are the weights of each loss term, reflecting their contributions to model optimization during training. represents the distillation loss, represents the discriminative loss, represents the defect loss, represents the deep supervision loss; Use the Adam optimizer and set the initial learning rate η0. After each training epoch, the learning rate decays exponentially: η = η0·γ epoch where γ is the learning rate decay factor, usually taking values in the range of (0, 1).

9. A corrugated cardboard box printing quality detection system based on incremental learning and feature synthesis, characterized in that Applied to the corrugated cardboard printing quality detection method based on incremental learning and feature synthesis according to any one of claims 1-8, including a data acquisition module, a quality detection model construction module, a model training module, and a quality detection module; The data acquisition module is used to collect a high-resolution corrugated cardboard image set, preprocess the corrugated cardboard image set to obtain sample images; The quality inspection model construction module is used to construct a corrugated carton printing quality inspection model. The corrugated carton printing quality inspection model includes a multi-layer feature extraction module, an incremental learning module, a feature synthesis module, a defect detection module, a knowledge distillation module, and a deep supervision module. The multi-layer feature extraction module extracts low-level features F L , intermediate features F M , and high-level features F H of the input sample image. The incremental learning module maintains the recognition ability of old defects through knowledge distillation technology when introducing new types of printing defects, avoiding catastrophic forgetting. The feature synthesis module uses a generative adversarial network or a stable diffusion model to generate defect examples of different types to enhance the detection ability of the model. The defect detection module combines multi-layer features for detection, identifying and locating the printing defect area. The knowledge distillation module performs distillation processing by comparing the output features of the old and new models to further enhance the learning effect of the model. The deep supervision module performs multi-scale optimization on the detection results and calculates the output printing defect mask image. The model training module is used to train a corrugated cardboard printing quality detection model. During the network training process, a hybrid loss function is used to optimize the model. The hybrid loss function is based on the distillation loss, discriminative loss, defect detection loss, and deep supervision loss; The quality detection module is used to use the trained corrugated cardboard printing quality detection model to detect the corrugated cardboard printing images to be detected.

10. An electronic device, characterized in that, The electronic device includes: At least one processor; and, A memory communicatively connected to the at least one processor; wherein, The memory stores computer program instructions executable by the at least one processor. The computer program instructions are executed by the at least one processor so that the at least one processor can execute the corrugated cardboard printing quality detection method based on incremental learning and feature synthesis according to any one of claims 1-8.