CN115861736A - Knowledge distillation-based high-speed corrugated carton printing defect detection method and system and storage medium - Google Patents

Knowledge distillation-based high-speed corrugated carton printing defect detection method and system and storage medium Download PDF

Info

Publication number
CN115861736A
CN115861736A CN202211608962.6A CN202211608962A CN115861736A CN 115861736 A CN115861736 A CN 115861736A CN 202211608962 A CN202211608962 A CN 202211608962A CN 115861736 A CN115861736 A CN 115861736A
Authority
CN
China
Prior art keywords
network model
training
defect detection
teacher
student
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Granted
Application number
CN202211608962.6A
Other languages
Chinese (zh)
Other versions
CN115861736B (en
Inventor
吴衡
张伟文
曾伟军
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Guangzhou Keshenglong Carton Packing Machine Co Ltd
Original Assignee
Guangzhou Keshenglong Carton Packing Machine Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Guangzhou Keshenglong Carton Packing Machine Co Ltd filed Critical Guangzhou Keshenglong Carton Packing Machine Co Ltd
Priority to CN202211608962.6A priority Critical patent/CN115861736B/en
Publication of CN115861736A publication Critical patent/CN115861736A/en
Application granted granted Critical
Publication of CN115861736B publication Critical patent/CN115861736B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Abstract

The invention discloses a knowledge distillation-based high-speed corrugated case printing defect detection method, a knowledge distillation-based high-speed corrugated case printing defect detection system, high-speed corrugated case printing defect detection equipment and a storage medium, wherein the method comprises the following steps of: acquiring a detected target image of a printing defect of a corrugated case, constructing a sample data set based on the detected target image, and constructing a knowledge distillation network model, wherein the knowledge distillation network model comprises a teacher network model and a student network model; respectively training the teacher network model and the student network model, inputting the sample data set into a backbone network to obtain a feature map of the sample data set, and performing regression operation on each point of the feature map; and detecting the printing defects of the high-speed corrugated case by using the trained knowledge distillation network model. The invention improves the precision of the printing defect detection of the high-speed corrugated case by using the knowledge distillation network.

Description

Knowledge distillation-based high-speed corrugated carton printing defect detection method and system and storage medium
Technical Field
The invention belongs to the technical field of defect detection, and particularly relates to a knowledge distillation-based high-speed corrugated carton printing defect detection method and system and a storage medium.
Background
With the rapid development of deep learning in recent years, many deep learning algorithms are introduced into various industries. In the industry, quality inspection is an important part in industrial automation, and a defect detection technology based on deep learning has been applied to many industrial scenes to replace artificial visual inspection, including industries such as electronics, packaging and printing.
Most current deep learning-based methods require training of models on large-scale datasets to achieve specific industrial intelligence applications. The large amount of computing power and memory resource consumption limits the popularization and advancement of deep learning based methods in industrial intelligence applications involving edge device deployment such as mobile or embedded devices. The knowledge distillation deep learning method can be simply realized on different depth models, model compression of different depth models can be easily realized through knowledge distillation, and meanwhile, the performance of the depth models can be well improved. Therefore, the knowledge distillation-based high-speed corrugated case printing defect detection method is extremely important, solves the problem of limitation of deep learning in industrial image defect detection to a certain extent, and has very wide market application prospect.
Disclosure of Invention
The invention mainly aims to overcome the defects of the prior art and provide a high-speed corrugated case printing defect detection method, a system and a storage medium based on knowledge distillation, wherein the traditional deep learning method usually needs large-scale data set training in industrial image defect detection, and the obtained complex and large-scale parameter network model needs to consume a large amount of memory resources and limit the industrial detection speed when being deployed in edge equipment; according to the invention, a lightweight deep model is obtained through training, so that high real-time performance can be maintained without losing defect detection accuracy.
In order to achieve the purpose, the invention adopts the following technical scheme:
the invention provides a knowledge distillation-based high-speed corrugated carton printing defect detection method, which comprises the following steps:
acquiring a target image to be detected of the printing shortage of the corrugated case, constructing a sample data set based on the target image to be detected,
constructing a knowledge distillation network model, wherein the knowledge distillation network model comprises a teacher network model and a student network model;
the teacher network model and the student network model are respectively trained, and the training of the teacher network model specifically comprises the following steps: inputting the sample data set into a backbone network to obtain a characteristic graph of the sample data set, performing regression operation on each point of the characteristic graph, and performing network training to obtain a teacher network model; the training of the student network model specifically comprises the following steps: performing induction training through the trained teacher network model, inputting the low-resolution images into a backbone network to obtain a feature map of the input images, performing regression operation on each point of the feature map, taking the predicted output of the teacher network model as a label, taking the predicted output of the student network model as a soft label, taking a real label as a hard label, calculating the loss of the student network model, updating network parameters, and only using the student network model in practical application;
and detecting the printing defects of the high-speed corrugated case by using the trained knowledge distillation network model.
As a preferred technical solution, the training process of the teacher network model is represented as follows:
G IT =F T (I h ,heads 1 )
wherein, F T (. Is a neural network function representing a teacher network model, heads 1 For the result parameter of the network prediction, I h Representing input images of a network model of a training teacher.
As a preferred technical solution, the low resolution image is obtained by:
will obtain a size of n ch X h x w target object image I h Further down-sampling and dividing into 4n ch Sub-image of x h/2 x w/2 to obtain low-resolution image I l
As a preferred technical solution, the training process of the student network model is represented as follows:
Figure BDA0003998643380000031
wherein, F S (. Cndot.) is a neural network function representing student network models, heads 2 Result parameters predicted for student network model, I l Representing input images for training a student network model,
Figure BDA0003998643380000032
representing teacher network model training parameters.
As a preferred technical solution, the feature maps input into the knowledge distillation module by the student network model and the teacher network model should be consistent, and since the student network model is trained to downsample the input picture to reduce the scale of the image, feature adaptation needs to be performed on the result parameter feature map in the student network model training process, and the mathematical model is expressed as:
F Ad =Adap(I FA )
wherein, I FA As a characteristic parameter of the original dimension, F Ad Adap (-) is a feature adaptation process for adapted feature parameters, by inverting the formula
Figure BDA0003998643380000033
To enable feature adaptation.
As a preferred technical scheme, in the knowledge distillation process, a 'Softmax' output layer of a neural network converts a prediction result obtained by a previous model into a probability value p, and the output layer generates a 'softened' probability vector q i For the calculation of Loss, the calculation process is represented as follows:
Figure BDA0003998643380000034
in the above formula q i T =0.5 is the probability vector after "softening", temperature coefficient, z i Taking the natural logarithm of the prediction result to obtain a certain class of logit value, z j The logit values for all classes are obtained by taking the natural logarithm of the prediction result.
As a preferred technical solution, in the network training process, the MSE loss function of the student network model is L mse The process is represented as follows:
Figure BDA0003998643380000041
wherein q is i For the probability vector after "softening", H and W represent the length and width of the feature map, respectively, N represents the number of pixel values included in the feature map, C =3 represents the number of channels, F T (. Represents a teacher network model, F S (. -) represents the student network model.
In a second aspect, the invention provides a knowledge distillation-based high-speed corrugated case printing defect detection system, which is applied to the knowledge distillation-based high-speed corrugated case printing defect detection method and comprises a data acquisition module, a model construction module, a model training module and a defect detection module;
the data acquisition module is used for acquiring a detected target image of the corrugated case with printing missing, constructing a sample data set based on the detected target image,
the model building module is used for building a knowledge distillation network model, and the knowledge distillation network model comprises a teacher network model and a student network model;
the model training module is used for respectively training the teacher network model and the student network model, and the training of the teacher network model specifically comprises the following steps: inputting the sample data set into a backbone network to obtain a characteristic graph of the sample data set, performing regression operation on each point of the characteristic graph, and performing network training to obtain a teacher network model; the training of the student network model specifically comprises the following steps: performing induction training through the trained teacher network model, inputting the low-resolution images into a backbone network to obtain a feature map of the input images, performing regression operation on each point of the feature map, taking the predicted output of the teacher network model as a label, taking the predicted output of the student network model as a soft label, taking a real label as a hard label, calculating the loss of the student network model, updating network parameters, and only using the student network model in practical application;
and the defect detection module is used for detecting the printing defects of the high-speed corrugated case by using the trained knowledge distillation network model.
In a third aspect, the present invention provides an electronic device, comprising:
at least one processor; and the number of the first and second groups,
a memory communicatively coupled to the at least one processor; wherein the content of the first and second substances,
the memory stores computer program instructions executable by the at least one processor to enable the at least one processor to perform the high speed corrugated box print defect detection method based on knowledge distillation.
In a fourth aspect, the present invention provides a computer-readable storage medium, which stores a program, and when the program is executed by a processor, the method for detecting printing defects of corrugated cartons based on knowledge distillation is implemented.
Compared with the prior art, the invention has the following advantages and beneficial effects:
the invention provides an industrial image defect detection method based on knowledge distillation. Generally, the lightweight model causes performance reduction, and the deep learning method of knowledge distillation is adopted to transfer knowledge in a large-capacity teacher model to the lightweight deep model, so that the performance of the lightweight deep model can be improved. The method improves the accuracy of defect detection and simultaneously keeps higher real-time performance. The obtained lightweight deep model is beneficial to popularization in the deployment of edge equipment such as embedded equipment for industrial defect detection. The invention is very beneficial to the application research of the deep learning method of knowledge distillation in industrial defect detection.
Drawings
In order to more clearly illustrate the technical solutions in the embodiments of the present application, the drawings required to be used in the description of the embodiments are briefly introduced below, and it is obvious that the drawings in the description below are only some embodiments of the present application, and it is obvious for those skilled in the art to obtain other drawings without creative efforts.
Fig. 1 is a flow chart of a high-speed corrugated box printing defect detection method based on knowledge distillation according to an embodiment of the invention;
FIG. 2 is a schematic diagram of the neural network architecture of FIG. 1 according to an embodiment of the present invention;
fig. 3 is a schematic diagram of teacher network models backhaul and FPN network in fig. 1 according to the present invention.
Fig. 4 is a schematic diagram of the student network model Feature addition in fig. 1 according to the embodiment of the present invention.
FIG. 5 is a Block module of FIG. 3 according to an embodiment of the present invention.
Fig. 6 is a block diagram of a high-speed corrugated box printing defect detection system based on knowledge distillation according to an embodiment of the present invention.
Fig. 7 is a block diagram of an electronic device according to an embodiment of the invention.
Detailed Description
In order to make the technical solutions better understood by those skilled in the art, the technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the drawings in the embodiments of the present application. It is to be understood that the embodiments described are only a few embodiments of the present application and not all embodiments. All other embodiments obtained by a person skilled in the art based on the embodiments in the present application without making any creative effort belong to the protection scope of the present application.
Reference in the specification to "an embodiment" means that a particular feature, structure, or characteristic described in connection with the embodiment can be included in at least one embodiment of the specification. The appearances of the phrase in various places in the specification are not necessarily all referring to the same embodiment, nor are separate or alternative embodiments mutually exclusive of other embodiments. It is explicitly and implicitly understood by one skilled in the art that the embodiments described herein can be combined with other embodiments.
As shown in fig. 1, the method for detecting printing defects of a high-speed corrugated case based on knowledge distillation in the embodiment includes the following steps:
s1, obtaining a detected target image of a corrugated case lacking in printing, and constructing a sample data set based on the detected target image.
Illustratively, an industrial camera shoots an image of a measured target object to construct an industrial sample data set I h =[I h1 ,I h2 ,...I h5000 ]Data set I h Total number of medium elements K =5000.
S2, constructing a knowledge distillation network model; as shown in fig. 2, the knowledge distillation network model includes a teacher network model and a student network model; the teacher network model is used for training a large-scale complex network model with large parameter quantity; the student network model is used for training a compact network model with small scale and small parameter quantity;
as shown in fig. 3, the teacher network model includes a convolutional layer, a normalization layer, an activation layer, and a pooling layer, and performs feature extraction and feature compression on an input image for multiple times to obtain a feature map containing global features; the teacher network model is used for training a large-scale complex network model with large parameter quantity.
As shown in fig. 4, the student network model includes a convolutional layer, an activation layer, and an up-sampling layer, and performs feature extraction on the feature map, and performs up-sampling on the feature map to obtain a feature map amplified by a certain factor.
Further, as shown in fig. 5, the Block module includes a convolution layer, a normalization layer, and an activation layer, and performs feature extraction twice on the feature map, adds the two feature maps, and then performs feature extraction.
S3, respectively training the teacher network model and the student network model; inputting the sample data set into a backbone network to obtain a characteristic graph of the sample data set, performing regression operation on each point of the characteristic graph, and performing network training to obtain a teacher network model; the training of the student network model specifically comprises the following steps: performing induction training through the trained teacher network model, inputting a low-resolution image into a backbone network to obtain a feature map of the input image, performing regression operation on each point of the feature map, taking the predicted output of the teacher network model as a label, taking the predicted output of the student network model as a soft label, taking a real label as a hard label, calculating the loss of the student network model, updating network parameters, and only using the student network model in practical application;
s31, training the teacher network model specifically comprises the following steps: inputting the sample data set into a backbone network to obtain a characteristic graph of the sample data set, performing regression operation on each point of the characteristic graph, performing network training to obtain a teacher network model, wherein the model is expressed as follows:
G IT =F T (I h ,heads 1 )
wherein, F T (. Cndot.) is a neural network function representing a teacher network model, heads 1 For the result parameter of the network prediction, I h Representing input images of a network model of a training teacher.
S32, training a student network model specifically comprises the following steps: inputting the low-resolution image into a backbone network to obtain a feature map of the input image, performing regression operation on each point of the feature map, and obtaining a teacher network model training parameter for guiding training, wherein the model is expressed as follows:
Figure BDA0003998643380000081
wherein, F S (. Is a neural network function representing a student network model, heads 2 Result parameters predicted for student network model, I l Representing input images for training a student network model,
Figure BDA0003998643380000082
representing teacher network model training parameters.
Further, the low resolution image is obtained by:
will obtain a size of n ch X h x w target object image I h Down-sampling and dividing into 4n ch Sub-image of x h/2 x w/2 to obtain low-resolution image I l
The characteristic diagrams input into the knowledge distillation module by the student network model and the teacher network model are consistent, and because the student network model is trained to downsample the input images to reduce the scale of the images, the result parameter characteristic diagrams need to be subjected to characteristic self-adaptation in the training process of the student network model, and the mathematical model is expressed as follows:
F Ad =Adap(I FA )
wherein, I FA As a characteristic parameter of the original dimension, F Ad Adap (-) is a feature adaptation process for the adapted feature parameters, by inverting the formula
Figure BDA0003998643380000083
To enable feature adaptation.
During the knowledge distillation process, the 'Softmax' output layer of the neural network converts the prediction result obtained by the previous model into a probability value p. The output layer will generate a "softened" probability vector q i For the calculation of Loss, the calculation process is as follows:
Figure BDA0003998643380000091
in the above formula q i T =0.5 is the probability vector after "softening", temperature coefficient, z i Taking natural logarithm of prediction result to obtain a certain class of logit value, z j And obtaining the logit values of all classes by taking the natural logarithm of the prediction result.
MSE loss function of the student network model in the network training processIs L mse The process is represented as follows:
Figure BDA0003998643380000092
in the above formula q i For the probability vector after "softening", H and W represent the length and width of the feature map, respectively, N represents the number of pixel values included in the feature map, C =3 represents the number of channels, F T (. Represents a teacher network model, F S (. -) represents the student network model.
After X =2000 training, a teacher network model and a student network model can be obtained.
And S4, detecting the printing defects of the high-speed corrugated case by using the trained knowledge distillation network model.
In another embodiment, for corrugated paper images shot in the industrial production process, an object image I with the size of 3 x 320 x 240 is taken h Down-sampling and dividing into 12 × 160 × 120 sub-images to obtain a low-resolution image I l . And detecting the defects of the images to obtain an abnormal Score map Score _ m of the image to be detected, wherein the representation process is as follows:
Figure BDA0003998643380000093
in the above formula, C =3 represents the number of channels, and upsample represents the upsampling process.
The invention adopts a twin network to calculate the color difference similarity of the printing standard pattern and the tested pattern of the corrugated case, and respectively trains the teacher network model and the student network model, wherein the training of the teacher network model specifically comprises the following steps: inputting the sample data set into a backbone network to obtain a characteristic diagram of the sample data set, performing regression operation on each point of the characteristic diagram, and performing network training to obtain a teacher network model; the training of the student network model specifically comprises the following steps: inputting the low-resolution image into a backbone network to obtain a feature map of the input image, performing regression operation on each point of the feature map, and obtaining a teacher network model training parameter to conduct guiding training; the printing defect detection precision of the high-speed corrugated case is effectively improved.
It should be noted that, for the sake of simplicity, the foregoing method embodiments are described as a series of acts or combinations, but those skilled in the art should understand that the present invention is not limited by the described order of acts, as some steps may be performed in other orders or simultaneously according to the present invention.
Based on the same idea as that of the knowledge-based distillation high-speed corrugated case printing defect detection method in the above embodiment, the present invention also provides a knowledge-based distillation high-speed corrugated case printing defect detection system, which can be used to execute the above knowledge-based distillation high-speed corrugated case printing defect detection method. For convenience of illustration, the structure of the embodiment of the high-speed printing defect detecting system for corrugated containers based on knowledge distillation is only shown in the schematic diagram, and those skilled in the art will understand that the structure shown in the figure does not limit the device, and may include more or less components than those shown in the figure, or combine some components, or arrange different components.
Referring to fig. 6, in another embodiment of the present application, there is provided a high-speed corrugated box printing defect detection system 100 based on knowledge distillation, which includes a data acquisition module 101, a model construction module 102, a model training module 103, and a defect detection module 104;
the data acquisition module 101 is configured to acquire an image of a target to be detected of a printing defect of a corrugated carton, construct a sample data set based on the image of the target to be detected,
the model building module 102 is configured to build a knowledge distillation network model, where the knowledge distillation network model includes a teacher network model and a student network model;
the model training module 103 is configured to train the teacher network model and the student network model respectively, where the training of the teacher network model specifically includes: inputting the sample data set into a backbone network to obtain a characteristic graph of the sample data set, performing regression operation on each point of the characteristic graph, and performing network training to obtain a teacher network model; the training of the student network model specifically comprises the following steps: performing induction training through the trained teacher network model, inputting the low-resolution images into a backbone network to obtain a feature map of the input images, performing regression operation on each point of the feature map, taking the predicted output of the teacher network model as a label, taking the predicted output of the student network model as a soft label, taking a real label as a hard label, calculating the loss of the student network model, updating network parameters, and only using the student network model in practical application; the defect detection module 104 is configured to detect a printing defect of the high-speed corrugated carton by using the trained knowledge distillation network model.
It should be noted that, the knowledge-distillation-based high-speed corrugated carton printing defect detection system of the present invention corresponds to the knowledge-distillation-based high-speed corrugated carton printing defect detection method of the present invention one to one, and the technical features and the beneficial effects thereof described in the embodiments of the knowledge-distillation-based high-speed corrugated carton printing defect detection method are all applicable to the embodiments of the knowledge-distillation-based high-speed corrugated carton printing defect detection method.
In addition, in the implementation of the knowledge-based distillation high-speed corrugated box printing defect detection system according to the above embodiment, the logical division of each program module is only an example, and in practical applications, the above function allocation may be performed by different program modules according to needs, for example, due to configuration requirements of corresponding hardware or convenience of implementation of software, that is, the internal structure of the knowledge-based distillation high-speed corrugated box printing defect detection system is divided into different program modules so as to perform all or part of the above-described functions.
Referring to fig. 7, in an embodiment, an electronic device for implementing the method for detecting printing defects of corrugated containers based on knowledge distillation is provided, and the electronic device 200 may include a first processor 201, a first memory 202, and a bus, and may further include a computer program, such as a high-speed printing defect detection program 203 based on knowledge distillation, stored in the first memory 202 and executable on the first processor 201.
The first memory 202 includes at least one type of readable storage medium, which includes flash memory, removable hard disk, multimedia card, card-type memory (e.g., SD or DX memory, etc.), magnetic memory, magnetic disk, optical disk, etc. The first memory 202 may in some embodiments be an internal storage unit of the electronic device 200, e.g. a removable hard disk of the electronic device 200. The first memory 202 may also be an external storage device of the electronic device 200 in other embodiments, such as a plug-in mobile hard disk, a Smart Media Card (SMC), a Secure Digital (SD) Card, a Flash memory Card (Flash Card), and the like, provided on the electronic device 200. Further, the first memory 202 may also include both an internal storage unit and an external storage device of the electronic device 200. The first memory 202 may be used to store not only application software installed in the electronic device 200 and various types of data, such as codes of the high-speed corrugated box printing defect detection program 203 based on knowledge distillation, but also temporarily store data that has been output or will be output.
The first processor 201 may be composed of an integrated circuit in some embodiments, for example, a single packaged integrated circuit, or may be composed of a plurality of integrated circuits packaged with the same function or different functions, and includes one or more Central Processing Units (CPUs), microprocessors, digital Processing chips, graphics processors, and combinations of various control chips. The first processor 201 is a Control Unit (Control Unit) of the electronic device, connects various components of the whole electronic device by using various interfaces and lines, and executes various functions and processes data of the electronic device 200 by running or executing programs or modules stored in the first memory 202 and calling data stored in the first memory 202.
Fig. 7 shows only an electronic device having components, and those skilled in the art will appreciate that the structure shown in fig. 5 does not constitute a limitation of the electronic device 200, and may include fewer or more components than those shown, or some components may be combined, or a different arrangement of components.
The knowledge-distillation-based high-speed corrugated box printing defect detection program 203 stored in the first memory 202 of the electronic device 200 is a combination of instructions, and when executed in the first processor 201, can realize:
acquiring a target image to be detected of the printing shortage of the corrugated case, constructing a sample data set based on the target image to be detected,
constructing a knowledge distillation network model, wherein the knowledge distillation network model comprises a teacher network model and a student network model;
the teacher network model and the student network model are respectively trained, and the training of the teacher network model specifically comprises the following steps: inputting the sample data set into a backbone network to obtain a characteristic graph of the sample data set, performing regression operation on each point of the characteristic graph, and performing network training to obtain a teacher network model; the training of the student network model specifically comprises the following steps: performing induction training through the trained teacher network model, inputting a low-resolution image into a backbone network to obtain a feature map of the input image, performing regression operation on each point of the feature map, taking the predicted output of the teacher network model as a label, taking the predicted output of the student network model as a soft label, taking a real label as a hard label, calculating the loss of the student network model, updating network parameters, and only using the student network model in practical application; and detecting the printing defects of the high-speed corrugated case by using the trained knowledge distillation network model.
Further, the modules/units integrated with the electronic device 200, if implemented in the form of software functional units and sold or used as independent products, may be stored in a non-volatile computer-readable storage medium. The computer-readable medium may include: any entity or device capable of carrying said computer program code, recording medium, U-disk, removable hard disk, magnetic disk, optical disk, computer Memory, read-Only Memory (ROM).
It will be understood by those skilled in the art that all or part of the processes of the methods of the embodiments described above may be implemented by a computer program, which may be stored in a non-volatile computer readable storage medium, and when executed, may include the processes of the embodiments of the methods described above. Any reference to memory, storage, database, or other medium used in the embodiments provided herein may include non-volatile and/or volatile memory, among others. 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 a variety of forms such as Static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), double Data Rate SDRAM (DDRSDRAM), enhanced SDRAM (ESDRAM), synchronous Link DRAM (SLDRAM), rambus (Rambus) direct RAM (RDRAM), direct memory bus dynamic RAM (DRDRAM), and memory bus dynamic RAM (RDRAM).
All possible combinations of the technical features in the above embodiments may not be described for the sake of brevity, but should be considered as being within the scope of the present disclosure as long as there is no contradiction between the combinations of the technical features.
The above embodiments are preferred embodiments of the present invention, but the present invention is not limited to the above embodiments, and any other changes, modifications, substitutions, combinations, and simplifications which do not depart from the spirit and principle of the present invention should be construed as equivalents thereof, and all such changes, modifications, substitutions, combinations, and simplifications are intended to be included in the scope of the present invention.

Claims (10)

1. The knowledge distillation-based high-speed corrugated carton printing defect detection method is characterized by comprising the following steps of:
acquiring a detected target image of the printing defect of the corrugated case, constructing a sample data set based on the detected target image,
constructing a knowledge distillation network model, wherein the knowledge distillation network model comprises a teacher network model and a student network model;
the teacher network model and the student network model are respectively trained, and the training of the teacher network model specifically comprises the following steps: inputting the sample data set into a backbone network to obtain a characteristic graph of the sample data set, performing regression operation on each point of the characteristic graph, and performing network training to obtain a teacher network model; the training of the student network model specifically comprises the following steps: performing induction training through the trained teacher network model, inputting a low-resolution image into a backbone network to obtain a feature map of the input image, performing regression operation on each point of the feature map, taking the predicted output of the teacher network model as a label, taking the predicted output of the student network model as a soft label, taking a real label as a hard label, calculating the loss of the student network model, updating network parameters, and only using the student network model in practical application;
and detecting the printing defects of the high-speed corrugated case by using the trained knowledge distillation network model.
2. The knowledge-distillation-based high-speed corrugated box printing defect detection method according to claim 1, wherein the training process of the teacher network model is represented as follows:
G IT =F T (I h ,heads 1 )
wherein, F T (. Is a neural network function representing a teacher network model, heads 1 For the result parameter of the network prediction, I h Representing input images of a network model of a training teacher.
3. The knowledge-based distillation high-speed corrugated box printing defect detection method according to claim 1, wherein the low-resolution image is obtained by:
will obtain a size of n ch ×h×wObject image I of h Further down-sampling and dividing into 4n ch Sub-image of x h/2 x w/2 to obtain low-resolution image I l
4. The knowledge-distillation-based high-speed corrugated box printing defect detection method according to claim 1, wherein the training process of the student network model is represented as follows:
Figure FDA0003998643370000011
wherein, F S (. Is a neural network function representing a student network model, heads 2 Result parameters predicted for student network model, I l Representing input images for training a student network model,
Figure FDA0003998643370000021
representing teacher network model training parameters.
5. The method for detecting the printing defects of the corrugated case based on the knowledge distillation as claimed in claim 1, wherein the student network model and the teacher network model are consistent with the feature graph input into the knowledge distillation module, and since the student network model is trained to downsample the input picture to reduce the scale of the image, the result parameter feature graph needs to be subjected to feature adaptation in the training process of the student network model, and the mathematical model is represented as:
F Ad =Adap(I FA )
wherein, I FA As original dimensional characteristic parameter, F Ad Adap (-) is a feature adaptation process for the adapted feature parameters, by inverting the formula
Figure FDA0003998643370000022
To enable feature adaptation.
6. Root of herbaceous plantThe knowledge distillation-based high-speed corrugated case printing defect detection method as claimed in claim 1, wherein during the knowledge distillation process, the 'Softmax' output layer of the neural network converts the prediction result obtained by the previous model into the probability value p, and the output layer generates a 'softened' probability vector q i For the calculation of Loss, the calculation process is as follows:
Figure FDA0003998643370000023
in the above formula q i T =0.5 is the probability vector after "softening", temperature coefficient, z i Taking natural logarithm of prediction result to obtain a certain class of logit value, z j The logit values for all classes are obtained by taking the natural logarithm of the prediction result.
7. The knowledge-distillation-based high-speed corrugated box printing defect detection method as claimed in claim 6, wherein during network training, MSE loss function of the student network model is L mse The process is represented as follows:
Figure FDA0003998643370000024
wherein q is i For the probability vector after "softening", H and W represent the length and width of the feature map, respectively, N represents the number of pixel values included in the feature map, C =3 represents the number of channels, F T (. Represents a teacher network model, F S (. Cndot.) represents the student network model.
8. The knowledge distillation-based high-speed corrugated carton printing defect detection system is characterized by being applied to the knowledge distillation-based high-speed corrugated carton printing defect detection method in any one of claims 1 to 7, and comprising a data acquisition module, a model construction module, a model training module and a defect detection module;
the data acquisition module is used for acquiring a detected target image of the corrugated case with printing missing, constructing a sample data set based on the detected target image,
the model building module is used for building a knowledge distillation network model, and the knowledge distillation network model comprises a teacher network model and a student network model;
the model training module is used for respectively training the teacher network model and the student network model, and the training of the teacher network model specifically comprises the following steps: inputting the sample data set into a backbone network to obtain a characteristic graph of the sample data set, performing regression operation on each point of the characteristic graph, and performing network training to obtain a teacher network model; the training of the student network model specifically comprises the following steps: performing induction training through the trained teacher network model, inputting a low-resolution image into a backbone network to obtain a feature map of the input image, performing regression operation on each point of the feature map, taking the predicted output of the teacher network model as a label, taking the predicted output of the student network model as a soft label, taking a real label as a hard label, calculating the loss of the student network model, updating network parameters, and only using the student network model in practical application;
and the defect detection module is used for detecting the printing defects of the high-speed corrugated case by using the trained knowledge distillation network model.
9. An electronic device, characterized in that the electronic device comprises:
at least one processor; and the number of the first and second groups,
a memory communicatively coupled to the at least one processor; wherein the content of the first and second substances,
the memory stores computer program instructions executable by the at least one processor to enable the at least one processor to perform the high-speed corrugated box printing defect detection method based on knowledge distillation according to any one of claims 1 to 7.
10. A computer-readable storage medium storing a program, wherein the program, when executed by a processor, implements the high-speed corrugated box printing defect detection method based on knowledge distillation of any one of claims 1 to 7.
CN202211608962.6A 2022-12-14 2022-12-14 High-speed corrugated case printing defect detection method, system and storage medium based on knowledge distillation Active CN115861736B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202211608962.6A CN115861736B (en) 2022-12-14 2022-12-14 High-speed corrugated case printing defect detection method, system and storage medium based on knowledge distillation

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202211608962.6A CN115861736B (en) 2022-12-14 2022-12-14 High-speed corrugated case printing defect detection method, system and storage medium based on knowledge distillation

Publications (2)

Publication Number Publication Date
CN115861736A true CN115861736A (en) 2023-03-28
CN115861736B CN115861736B (en) 2024-04-26

Family

ID=85672950

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202211608962.6A Active CN115861736B (en) 2022-12-14 2022-12-14 High-speed corrugated case printing defect detection method, system and storage medium based on knowledge distillation

Country Status (1)

Country Link
CN (1) CN115861736B (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN116630286A (en) * 2023-05-31 2023-08-22 博衍科技(珠海)有限公司 Method, device, equipment and storage medium for detecting and positioning image abnormality

Citations (10)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US5978499A (en) * 1996-06-05 1999-11-02 International Paper Box Machine Company, Inc. Apparatus and method for inspecting box blanks
CN112288700A (en) * 2020-10-23 2021-01-29 西安科锐盛创新科技有限公司 Rail defect detection method
US10990850B1 (en) * 2018-12-12 2021-04-27 Amazon Technologies, Inc. Knowledge distillation and automatic model retraining via edge device sample collection
CN113284122A (en) * 2021-05-31 2021-08-20 五邑大学 Method and device for detecting roll paper packaging defects based on deep learning and storage medium
CN113570571A (en) * 2021-07-27 2021-10-29 深圳大学 Industrial edge end power battery defect detection method and system
US20210383521A1 (en) * 2020-06-08 2021-12-09 Georgia-Pacific Corrugated Llc Quality defect marking systems and methods in packaging product manufacturing
CN113935988A (en) * 2021-11-18 2022-01-14 湖北中烟工业有限责任公司 Box body surface defect detection and identification method and device based on machine vision
CN113947590A (en) * 2021-10-26 2022-01-18 四川大学 Surface defect detection method based on multi-scale attention guidance and knowledge distillation
CN114757954A (en) * 2022-06-16 2022-07-15 南通人民彩印有限公司 Carton printing color difference defect detection method based on artificial intelligence system
CN114782475A (en) * 2022-06-16 2022-07-22 南通金石包装印刷有限公司 Corrugated carton line pressing defect detection optimization method based on artificial intelligence system

Patent Citations (10)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US5978499A (en) * 1996-06-05 1999-11-02 International Paper Box Machine Company, Inc. Apparatus and method for inspecting box blanks
US10990850B1 (en) * 2018-12-12 2021-04-27 Amazon Technologies, Inc. Knowledge distillation and automatic model retraining via edge device sample collection
US20210383521A1 (en) * 2020-06-08 2021-12-09 Georgia-Pacific Corrugated Llc Quality defect marking systems and methods in packaging product manufacturing
CN112288700A (en) * 2020-10-23 2021-01-29 西安科锐盛创新科技有限公司 Rail defect detection method
CN113284122A (en) * 2021-05-31 2021-08-20 五邑大学 Method and device for detecting roll paper packaging defects based on deep learning and storage medium
CN113570571A (en) * 2021-07-27 2021-10-29 深圳大学 Industrial edge end power battery defect detection method and system
CN113947590A (en) * 2021-10-26 2022-01-18 四川大学 Surface defect detection method based on multi-scale attention guidance and knowledge distillation
CN113935988A (en) * 2021-11-18 2022-01-14 湖北中烟工业有限责任公司 Box body surface defect detection and identification method and device based on machine vision
CN114757954A (en) * 2022-06-16 2022-07-15 南通人民彩印有限公司 Carton printing color difference defect detection method based on artificial intelligence system
CN114782475A (en) * 2022-06-16 2022-07-22 南通金石包装印刷有限公司 Corrugated carton line pressing defect detection optimization method based on artificial intelligence system

Non-Patent Citations (4)

* Cited by examiner, † Cited by third party
Title
胡佳: "基于对抗学习与全局指针生成网络的实体关系抽取研究", 《中国优秀硕士学位论文全文数据库 信息科技辑》, 15 November 2022 (2022-11-15), pages 138 - 307 *
詹健浩等: "基于知识蒸馏的多模态融合行为识别方法", 《开发研究与工程应用》, vol. 49, no. 10, pages 1 *
颜远思: "基于机器视觉的洁具自动化包装系统设计", 《中国优秀硕士学位论文全文数据库 工程科技II辑》, 15 July 2020 (2020-07-15), pages 028 - 117 *
黄继爽: "基于深度神经网络模型压缩的引水隧洞表面缺陷检测", 《中国优秀硕士学位论文数据库 工程科技II辑》, pages 2 - 16 *

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN116630286A (en) * 2023-05-31 2023-08-22 博衍科技(珠海)有限公司 Method, device, equipment and storage medium for detecting and positioning image abnormality
CN116630286B (en) * 2023-05-31 2024-02-13 博衍科技(珠海)有限公司 Method, device, equipment and storage medium for detecting and positioning image abnormality

Also Published As

Publication number Publication date
CN115861736B (en) 2024-04-26

Similar Documents

Publication Publication Date Title
CN108647694B (en) Context-aware and adaptive response-based related filtering target tracking method
CN111369581B (en) Image processing method, device, equipment and storage medium
CN111275107A (en) Multi-label scene image classification method and device based on transfer learning
CN111784673A (en) Defect detection model training and defect detection method, device and storage medium
CN110245683B (en) Residual error relation network construction method for less-sample target identification and application
CN115861736A (en) Knowledge distillation-based high-speed corrugated carton printing defect detection method and system and storage medium
CN114782355A (en) Gastric cancer digital pathological section detection method based on improved VGG16 network
CN114544172A (en) Rotary machine fault diagnosis method, system and medium based on deep confidence network
CN114444565A (en) Image tampering detection method, terminal device and storage medium
CN115810005B (en) Corrugated case defect detection acceleration method, system, equipment and storage medium based on parallel computing
CN113408418A (en) Calligraphy font and character content synchronous identification method and system
CN112966676A (en) Document key information extraction method based on zero sample learning
CN116205881A (en) Digital jet printing image defect detection method based on lightweight semantic segmentation
CN110659724A (en) Target detection convolutional neural network construction method based on target scale range
CN113793267B (en) Self-supervision single remote sensing image super-resolution method based on cross-dimension attention mechanism
CN115909378A (en) Document text detection model training method and document text detection method
CN116363656A (en) Image recognition method and device containing multiple lines of text and computer equipment
CN110852102B (en) Chinese part-of-speech tagging method and device, storage medium and electronic equipment
CN113222100A (en) Training method and device of neural network model
CN112580658B (en) Image semantic description method, device, computing equipment and computer storage medium
CN115690416A (en) Knowledge distillation-based BEV semantic segmentation model training method, system, equipment and medium
CN115829983B (en) High-speed industrial scene visual quality detection method based on knowledge distillation
Wang et al. Neuron-level selective context aggregation for scene segmentation
CN113095319B (en) Multidirectional scene character detection method and device based on full convolution angular point correction network
CN108875929B (en) Font code generation method and apparatus, font code, storage medium

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant