CN115861736B - High-speed corrugated case printing defect detection method, system and storage medium based on knowledge distillation - Google Patents

High-speed corrugated case printing defect detection method, system and storage medium based on knowledge distillation Download PDF

Info

Publication number
CN115861736B
CN115861736B CN202211608962.6A CN202211608962A CN115861736B CN 115861736 B CN115861736 B CN 115861736B CN 202211608962 A CN202211608962 A CN 202211608962A CN 115861736 B CN115861736 B CN 115861736B
Authority
CN
China
Prior art keywords
network model
training
knowledge distillation
student
teacher
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.)
Active
Application number
CN202211608962.6A
Other languages
Chinese (zh)
Other versions
CN115861736A (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

Landscapes

  • Image Analysis (AREA)

Abstract

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

Description

High-speed corrugated case printing defect detection method, system and storage medium based on knowledge distillation
Technical Field
The invention belongs to the technical field of defect detection, and particularly relates to a high-speed corrugated case printing defect detection method, system and storage medium based on knowledge distillation.
Background
With the rapid development of deep learning in recent years, many deep learning algorithms are introduced to various industries. Quality inspection is an important part of industrial automation in industry, and deep learning-based defect inspection techniques have been applied to many industrial scenes instead of human visual inspection, including electronics, packaging, and printing industries.
Most current deep learning-based methods require training models on large-scale data sets 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 intelligent applications involving the deployment of edge devices, such as mobile or embedded devices. The knowledge distillation deep learning method can be simply realized on different depth models, model compression of the different depth models can be easily realized through knowledge distillation, and meanwhile, the performance of the depth models can be well improved. Therefore, the high-speed corrugated case printing defect detection method based on knowledge distillation 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 aims to overcome the defects and shortcomings of the prior art and provide a high-speed corrugated carton printing defect detection method, a system and a storage medium based on knowledge distillation, wherein the traditional deep learning method generally requires large-scale data set training in industrial image defect detection, and the obtained complex and large-scale parameter network model is deployed in edge equipment to consume a large amount of memory resources and limit industrial detection speed; according to the invention, a lightweight deep model is obtained through training, and high real-time performance can be maintained while defect detection accuracy is not lost.
In order to achieve the above purpose, the present invention adopts the following technical scheme:
The invention provides a high-speed corrugated case printing defect detection method based on knowledge distillation, which comprises the following steps of:
Obtaining a tested target image of the corrugated box printing area, constructing a sample data set based on the tested target image,
Constructing a knowledge distillation network model, wherein the knowledge distillation network model comprises a teacher network model and a student network model;
Training the teacher network model and the student network model respectively, 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 feature diagram of the sample data set, performing regression operation on each point of the feature diagram, and performing network training to obtain a teacher network model; the training of the student network model specifically comprises the following steps: inducing training through the trained teacher network model, inputting a low-resolution image into a backbone network to obtain a feature diagram of the input image, performing regression operation on each point of the feature diagram, 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 using the student network model only in practical application;
And detecting the printing defects of the high-speed corrugated case by using the trained knowledge distillation network model.
As a preferable technical solution, the training process of the teacher network model is as follows:
GIT=FT(Ih,heads1)
Wherein, F T (·) is a neural network function, which represents a teacher network model, heads 1 is a result parameter of network prediction, and I h represents an input image of a training teacher network model.
As a preferred technical solution, the low resolution image is obtained by:
The object image I h having a size of n ch ×h×w is downsampled and divided into sub-images of 4n ch ×h/2×w/2 to obtain a low resolution image I l.
As an preferable technical scheme, the training process of the student network model is as follows:
wherein F S (·) is a neural network function representing a student network model, heads 2 is a result parameter predicted by the student network model, I l represents an input image of a training student network model, Representing teacher network model training parameters.
As a preferred technical solution, the feature graphs input into the knowledge distillation module by the student network model and the teacher network model should be consistent, and since the training student network model downsamples the input pictures to reduce the scale of the images, feature adaptation needs to be performed on the feature graphs of the result parameters in the training process of the student network model, and the mathematical model is expressed as:
FAd=Adap(IFA)
Wherein I FA is the original size characteristic parameter, F Ad is the characteristic parameter after self-adaption, adap (DEG) is the characteristic self-adaption process, and the formula is reversed To achieve feature adaptation.
As a preferred technical solution, in the process of knowledge distillation, the "Softmax" output layer of the neural network converts the predicted result obtained by the previous model into a probability value p, and the output layer generates a softened probability vector q i for the calculation of Loss, and the calculation process is as follows:
in the above formula, q i is a probability vector after softening, t=0.5 is a temperature coefficient, z i is a natural logarithm of a prediction result to obtain a logic value of a certain class, and z j is a natural logarithm of a prediction result to obtain logic values of all classes.
As an preferable technical solution, in the network training process, the MSE loss function of the student network model is L mse, and the process is as follows:
Wherein q i is a probability vector after softening, H and W respectively represent the length and width of the feature map, N represents the number of pixel values contained in the feature map, c=3 represents the number of channels, F T (-) represents a teacher network model, and F S (-) represents a student network model.
In a second aspect, the invention provides a high-speed corrugated case printing defect detection system based on knowledge distillation, which is applied to the high-speed corrugated case printing defect detection method based on knowledge distillation, 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 tested target image of the corrugated case printing area, constructing a sample data set based on the tested target image,
The model construction module is used for constructing 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 is specifically as follows: inputting the sample data set into a backbone network to obtain a feature diagram of the sample data set, performing regression operation on each point of the feature diagram, and performing network training to obtain a teacher network model; the training of the student network model specifically comprises the following steps: inducing training through the trained teacher network model, inputting a low-resolution image into a backbone network to obtain a feature diagram of the input image, performing regression operation on each point of the feature diagram, 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 using the student network model only in practical application;
The defect detection module is used for detecting 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, including:
At least one processor; and
A memory communicatively coupled to the at least one processor; wherein,
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 knowledge distillation based corrugated box printing defect detection method.
In a fourth aspect, the present invention provides a computer readable storage medium storing a program which, when executed by a processor, implements the method for detecting printing defects of a high-speed corrugated box based on knowledge distillation.
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 can cause performance degradation, and knowledge in a large-capacity teacher model is transferred to the lightweight deep model by adopting a deep learning method of knowledge distillation, so that the performance of the lightweight deep model can be improved. The method improves the accuracy of defect detection and simultaneously maintains higher real-time performance. The lightweight deep model is favorable for popularization in the deployment of edge equipment such as embedded equipment for industrial defect detection. The invention is very favorable for 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 of the embodiments of the present application, the drawings required for the description of the embodiments will be briefly described below, and it is apparent that the drawings in the following description are only some embodiments of the present application, and other drawings may be obtained according to these drawings without inventive effort for a person skilled in the art.
FIG. 1 is a flow chart of a method for detecting printing defects of a high-speed corrugated case 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 the teacher network model backhaul and FPN network in fig. 1 according to an embodiment of the present invention.
Fig. 4 is a schematic diagram of the student network model Feature Adatation in fig. 1 according to an embodiment of the present invention.
FIG. 5 is a Block diagram illustrating the 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 in accordance with an embodiment of the present invention.
Fig. 7 is a block diagram of an electronic device according to an embodiment of the present invention.
Detailed Description
In order to enable those skilled in the art to better understand the present application, the following description will make clear and complete descriptions of the technical solutions according to the embodiments of the present application with reference to the accompanying drawings. It will be apparent that the described embodiments are only some, but not all, embodiments of the application. All other embodiments, which can be made by those skilled in the art based on the embodiments of the application without making any inventive effort, are intended to be within the scope of the application.
Reference in the specification to "an embodiment" means that a particular feature, structure, or characteristic described in connection with the embodiment may be included in at least one embodiment of the application. The appearances of such phrases 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. Those of skill in the art will explicitly and implicitly appreciate that the described embodiments of the application may 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 this embodiment includes the following steps:
s1, acquiring a tested target image of a corrugated case printing area, and constructing a sample data set based on the tested target image.
Illustratively, an industrial camera captures an image of the object under test, and an industrial sample dataset I h=[Ih1,Ih2,...Ih5000 is constructed, with the total number of elements in dataset I h being 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 small-scale simplified network model with small parameter quantity;
As shown in fig. 3, the teacher network model includes a convolution 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 complex network model with large scale and large parameter quantity.
As shown in fig. 4, the student network model includes a convolution layer, an activation layer and an up-sampling layer, performs feature extraction on the feature map, and up-samples the feature map to obtain a feature map with a certain magnification, where the student network model is used for training a small-scale and small-parameter simple network model.
Further, as shown in fig. 5, the Block module includes a convolution layer, a normalization layer and an activation layer, and performs feature extraction on the feature map twice, adds the two feature maps, and performs feature extraction.
S3, training the teacher network model and the student network model respectively; inputting the sample data set into a backbone network to obtain a feature diagram of the sample data set, performing regression operation on each point of the feature diagram, and performing network training to obtain a teacher network model; the training of the student network model specifically comprises the following steps: inducing training through the trained teacher network model, inputting a low-resolution image into a backbone network to obtain a feature diagram of the input image, performing regression operation on each point of the feature diagram, 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 using the student network model only in practical application;
s31, training of a teacher network model specifically comprises the following steps: inputting a sample data set into a backbone network to obtain a feature map of the sample data set, performing regression operation on each point of the feature map, and performing network training to obtain a teacher network model, wherein the model is expressed as follows:
GIT=FT(Ih,heads1)
Wherein, F T (·) is a neural network function, which represents a teacher network model, heads 1 is a result parameter of network prediction, and I h represents an input image of a training teacher network model.
S32, training of 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, carrying out regression operation on each point of the feature map, and obtaining training parameters of a teacher network model for guiding training, wherein the model is expressed as follows:
wherein F S (·) is a neural network function representing a student network model, heads 2 is a result parameter predicted by the student network model, I l represents an input image of a training student network model, Representing teacher network model training parameters.
Still further, the low resolution image is obtained by:
The object image I h having a size of n ch ×h×w is downsampled and divided into sub-images of 4n ch ×h/2×w/2 to obtain a low resolution image I l.
The feature graphs input into the knowledge distillation module by the student network model and the teacher network model should be consistent, and the training of the student network model downsamples the input pictures to reduce the scale of the images, so that feature self-adaption needs to be performed on the feature graphs of the result parameters in the training process of the student network model, and the mathematical model is expressed as follows:
FAd=Adap(IFA)
Wherein I FA is the original size characteristic parameter, F Ad is the characteristic parameter after self-adaption, adap (DEG) is the characteristic self-adaption process, and the formula is reversed To achieve feature adaptation.
During knowledge distillation, the "Softmax" output layer of the neural network converts the predicted results from the previous model into probability values p. The output layer generates a "softened" probability vector q i for Loss calculation, which is expressed as follows:
in the above formula, q i is a probability vector after softening, t=0.5 is a temperature coefficient, z i is a natural logarithm of a prediction result to obtain a logic value of a certain class, and z j is a natural logarithm of a prediction result to obtain logic values of all classes.
In the network training process, the MSE loss function of the student network model is L mse, and the process is expressed as follows:
In the above formula, q i is a probability vector after softening, H and W respectively represent the length and the width of the feature map, N represents the number of pixel values contained in the feature map, c=3 represents the number of channels, F T (-) represents a teacher network model, and F S (-) represents a student network model.
After x=2000 training, a teacher network model and a student network model can be obtained.
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 captured during an industrial process, a target object image I h of size 3×320×240 is downsampled and divided into 12×160×120 sub-images, resulting in a low resolution image I l. Performing defect detection to obtain an anomaly Score map score_m of the picture to be detected, wherein the anomaly Score map score_m is represented by the following steps:
in the above equation, c=3 indicates the number of channels, and upsample indicates the upsampling process.
The invention adopts a twin network to calculate the color difference similarity of the corrugated case printing standard pattern and the tested pattern, and respectively trains the teacher network model and the student network model, wherein the training of the teacher network model is specifically as follows: inputting the sample data set into a backbone network to obtain a feature diagram of the sample data set, performing regression operation on each point of the feature 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 image of the input image, performing regression operation on each point of the feature image, and obtaining training parameters of a teacher network model 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 of description, the foregoing method embodiments are all expressed as a series of combinations of actions, but it should be understood by those skilled in the art that the present invention is not limited by the order of actions described, as some steps may be performed in other order or simultaneously in accordance with the present invention.
Based on the same ideas the high-speed corrugated case printing defect detection method based on knowledge distillation in the embodiment, the invention also provides a high-speed corrugated case printing defect detection system based on knowledge distillation, which can be used for executing the high-speed corrugated case printing defect detection method based on knowledge distillation. For ease of illustration, only those portions relevant to embodiments of the present invention are shown in the schematic structural diagram of an embodiment of a high-speed corrugated box printing defect detection system based on knowledge distillation, and it will be understood by those skilled in the art that the illustrated structure is not limiting of the apparatus and may include more or fewer components than illustrated, or certain components may be combined, or a different arrangement of components.
Referring to fig. 6, in another embodiment of the present application, a high-speed corrugated box printing defect detection system 100 based on knowledge distillation is provided, and the system 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 a measured target image of the printed area of the corrugated case, construct a sample data set based on the measured target image,
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 is: inputting the sample data set into a backbone network to obtain a feature diagram of the sample data set, performing regression operation on each point of the feature diagram, and performing network training to obtain a teacher network model; the training of the student network model specifically comprises the following steps: inducing training through the trained teacher network model, inputting a low-resolution image into a backbone network to obtain a feature diagram of the input image, performing regression operation on each point of the feature diagram, 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 using the student network model only in practical application; the defect detection module 104 is configured to detect a printing defect of the high-speed corrugated case by using the trained knowledge distillation network model.
It should be noted that, the system for detecting the printing defect of the high-speed corrugated case based on the knowledge distillation and the method for detecting the printing defect of the high-speed corrugated case based on the knowledge distillation according to the present invention are in one-to-one correspondence, and the technical features and the beneficial effects described in the embodiments of the method for detecting the printing defect of the high-speed corrugated case based on the knowledge distillation are applicable to the embodiments of the method for detecting the printing defect of the high-speed corrugated case based on the knowledge distillation, and specific content can be found in the embodiments of the method according to the present invention, which are not repeated herein.
In addition, in the implementation of the high-speed corrugated case printing defect detection system based on knowledge distillation according to the foregoing embodiment, the logic division of each program module is merely illustrative, and in practical application, the functional allocation may be performed by different program modules according to needs, for example, in view of configuration requirements of corresponding hardware or convenience of implementation of software, that is, the internal structure of the high-speed corrugated case printing defect detection system based on knowledge distillation is divided into different program modules to perform all or part of the functions described above.
Referring to fig. 7, in one embodiment, an electronic device for implementing a method for detecting defects in high-speed corrugated cardboard printing based on knowledge distillation is provided, where the electronic device 200 may include a first processor 201, a first memory 202, and a bus, and may further include a computer program stored in the first memory 202 and executable on the first processor 201, such as the high-speed corrugated cardboard printing defect detection program 203 based on knowledge distillation.
The first memory 202 includes at least one type of readable storage medium, which includes flash memory, a mobile hard disk, a multimedia card, a card memory (e.g., SD or DX memory, etc.), a magnetic memory, a magnetic disk, an optical disk, etc. The first memory 202 may in some embodiments be an internal storage unit of the electronic device 200, such as a mobile 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 memory card (SMART MEDIA CARD, SMC), a secure digital (SecureDigital, SD) card, a flash memory card (FLASH CARD), etc. that are provided on the electronic device 200. Further, the first memory 202 may also include both an internal memory unit and an external memory 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 data, such as codes of the high-speed corrugated cardboard box printing defect detection program 203 based on knowledge distillation, but also temporarily store data that has been output or is to be output.
The first processor 201 may be comprised of an integrated circuit in some embodiments, for example, a single packaged integrated circuit, or may be comprised of multiple integrated circuits packaged with the same or different functions, including one or more central processing units (Central Processing unit, CPU), microprocessors, digital processing chips, graphics processors, and various combinations of control chips, etc. The first processor 201 is a Control Unit (Control Unit) of the electronic device, connects various components of the entire electronic device using various interfaces and lines, and executes various functions of the electronic device 200 and processes data 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 with components, and it will be understood by those skilled in the art that the structure shown in fig. 5 is not limiting of the electronic device 200 and may include fewer or more components than shown, or may combine certain components, or a different arrangement of components.
The high-speed corrugated cardboard printing defect detection program 203 based on knowledge distillation stored in the first memory 202 in the electronic device 200 is a combination of a plurality of instructions, which when executed in the first processor 201, can implement:
obtaining a tested target image of the printing defect of the corrugated case, constructing a sample data set based on the tested target image,
Constructing a knowledge distillation network model, wherein the knowledge distillation network model comprises a teacher network model and a student network model;
Training the teacher network model and the student network model respectively, 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 feature diagram of the sample data set, performing regression operation on each point of the feature diagram, and performing network training to obtain a teacher network model; the training of the student network model specifically comprises the following steps: inducing training through the trained teacher network model, inputting a low-resolution image into a backbone network to obtain a feature diagram of the input image, performing regression operation on each point of the feature diagram, 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 using the student network model only 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 may be stored in a non-volatile computer readable storage medium if implemented in the form of software functional units and sold or used as a stand-alone product. The computer readable medium may include: any entity or device capable of carrying the computer program code, a recording medium, a U disk, a removable hard disk, a magnetic disk, an optical disk, a computer Memory, a Read-Only Memory (ROM).
Those skilled in the art will appreciate that all or part of the processes in the methods of the above embodiments may be implemented by a computer program for instructing relevant hardware, where the program may be stored in a non-volatile computer readable storage medium, and where the program, when executed, may include processes in the embodiments of the methods described above. Any reference to memory, storage, database, or other medium used in embodiments provided herein may include non-volatile and/or volatile memory. The nonvolatile 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 (SYNCHLINK) DRAM (SLDRAM), memory bus (Rambus) direct RAM (RDRAM), direct memory bus dynamic RAM (DRDRAM), and memory bus dynamic RAM (RDRAM), among others.
The technical features of the above embodiments may be arbitrarily combined, and all possible combinations of the technical features in the above embodiments are not described for brevity of description, however, as long as there is no contradiction between the combinations of the technical features, they should be considered as the scope of the description.
The above examples are preferred embodiments of the present invention, but the embodiments of the present invention are not limited to the above examples, and any other changes, modifications, substitutions, combinations, and simplifications that do not depart from the spirit and principle of the present invention should be made in the equivalent manner, and the embodiments are included in the protection scope of the present invention.

Claims (8)

1. The high-speed corrugated case printing defect detection method based on knowledge distillation is characterized by comprising the following steps of:
Obtaining a tested target image of the corrugated box printing area, constructing a sample data set based on the tested target image,
Constructing a knowledge distillation network model, wherein the knowledge distillation network model comprises a teacher network model and a student network model;
Training the teacher network model and the student network model respectively, 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 feature diagram of the sample data set, performing regression operation on each point of the feature diagram, and performing network training to obtain a teacher network model; the training of the student network model specifically comprises the following steps: inducing training through the trained teacher network model, inputting a low-resolution image into a backbone network to obtain a feature diagram of the input image, performing regression operation on each point of the feature diagram, 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 using the student network model only in practical application;
In the knowledge distillation process, the output layer of the "Softmax" of the neural network converts the predicted result obtained by the previous model into a probability value p, and the output layer generates a softened probability vector q i for the calculation of Loss, wherein the calculation process is expressed as follows:
In the above formula, q i is a probability vector after softening, t=0.5 is a temperature coefficient, z i is a natural logarithm of a prediction result to obtain a logic value of a certain class, and z j is a natural logarithm of a prediction result to obtain logic values of all classes;
In the network training process, the MSE loss function of the student network model is L mse, and the process is expressed as follows:
Wherein q i is a probability vector after softening, H and W respectively represent the length and the width of the feature map, N represents the number of pixel values contained in the feature map, C=3 represents the number of channels, F T (-) represents a teacher network model, and F S (-) represents a student network model;
And detecting the printing defects of the high-speed corrugated case by using the trained knowledge distillation network model.
2. The method for detecting printing defects of high-speed corrugated paper based on knowledge distillation according to claim 1, wherein the training process of the teacher network model is represented as follows:
GIT=FT(Ih,heads1)
Wherein, F T (·) is a neural network function, which represents a teacher network model, heads 1 is a result parameter of network prediction, and I h represents an input image of a training teacher network model.
3. The high-speed corrugated box printing defect detection method based on knowledge distillation according to claim 1 wherein the low resolution image is obtained by:
The object image I h having a size of n ch ×h×w is downsampled and divided into sub-images of 4n ch ×h/2×w/2 to obtain a low resolution image I l.
4. The method for detecting printing defects of high-speed corrugated paper based on knowledge distillation according to claim 1, wherein the training process of the student network model is represented as follows:
wherein F S (·) is a neural network function representing a student network model, heads 2 is a result parameter predicted by the student network model, I l represents an input image of a training student network model, Representing teacher network model training parameters.
5. The method for detecting the printing defects of the high-speed corrugated case based on the knowledge distillation according to claim 1, wherein the feature graphs input into the knowledge distillation module by the student network model and the teacher network model are consistent, and the training of the student network model downsamples the input pictures to reduce the scale of the images, so that feature adaptation is required to the feature graphs of the result parameters in the training process of the student network model, and the mathematical model is expressed as follows:
FAd=Adap(IFA)
Wherein I FA is the original size characteristic parameter, F Ad is the characteristic parameter after self-adaption, adap (DEG) is the characteristic self-adaption process, and the formula is reversed To achieve feature adaptation.
6. The high-speed corrugated case printing defect detection system based on knowledge distillation is characterized by being applied to the high-speed corrugated case printing defect detection method based on knowledge distillation as claimed in any one of claims 1-5, 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 tested target image of the corrugated case printing area, constructing a sample data set based on the tested target image,
The model construction module is used for constructing 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 is specifically as follows: inputting the sample data set into a backbone network to obtain a feature diagram of the sample data set, performing regression operation on each point of the feature diagram, and performing network training to obtain a teacher network model; the training of the student network model specifically comprises the following steps: inducing training through the trained teacher network model, inputting a low-resolution image into a backbone network to obtain a feature diagram of the input image, performing regression operation on each point of the feature diagram, 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 using the student network model only in practical application;
The defect detection module is used for detecting printing defects of the high-speed corrugated case by using the trained knowledge distillation network model.
7. An electronic device, the electronic device comprising:
At least one processor; and
A memory communicatively coupled to the at least one processor; wherein,
The memory stores computer program instructions executable by the at least one processor to enable the at least one processor to perform the knowledge distillation based high speed corrugated box printing defect detection method of any one of claims 1-5.
8. 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-5.
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 CN115861736A (en) 2023-03-28
CN115861736B true 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)

Families Citing this family (1)

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

Citations (9)

* 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
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

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20210383521A1 (en) * 2020-06-08 2021-12-09 Georgia-Pacific Corrugated Llc Quality defect marking systems and methods in packaging product manufacturing

Patent Citations (9)

* 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
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 (5)

* Cited by examiner, † Cited by third party
Title
基于对抗学习与全局指针生成网络的实体关系抽取研究;胡佳;《中国优秀硕士学位论文全文数据库 信息科技辑》;20221115;I138-307 *
基于机器视觉的洁具自动化包装系统设计;颜远思;《中国优秀硕士学位论文全文数据库 工程科技II辑》;20200715;C028-117 *
基于深度神经网络模型压缩的引水隧洞表面缺陷检测;黄继爽;《中国优秀硕士学位论文数据库 工程科技II辑》;第2章,第3.2节,第4.1节,图2-16,图3-8 *
基于知识蒸馏的多模态融合行为识别方法;詹健浩等;《开发研究与工程应用》;第1节 *
黄继爽.基于深度神经网络模型压缩的引水隧洞表面缺陷检测.《中国优秀硕士学位论文数据库 工程科技II辑》.2021,第2章,第3.2节,第4.1节,图2-16,图3-8. *

Also Published As

Publication number Publication date
CN115861736A (en) 2023-03-28

Similar Documents

Publication Publication Date Title
Wang et al. Learning feature descriptors using camera pose supervision
CN111369581B (en) Image processing method, device, equipment and storage medium
Zavrtanik et al. Dsr–a dual subspace re-projection network for surface anomaly detection
CN112115783A (en) Human face characteristic point detection method, device and equipment based on deep knowledge migration
CN111833237B (en) Image registration method based on convolutional neural network and local homography transformation
CN111291629A (en) Method and device for recognizing text in image, computer equipment and computer storage medium
CN112287820A (en) Face detection neural network, face detection neural network training method, face detection method and storage medium
CN115861736B (en) High-speed corrugated case printing defect detection method, system and storage medium based on knowledge distillation
CN112669323A (en) Image processing method and related equipment
Hou et al. BSNet: Dynamic hybrid gradient convolution based boundary-sensitive network for remote sensing image segmentation
CN114241377A (en) Ship target detection method, device, equipment and medium based on improved YOLOX
CN114612402A (en) Method, device, equipment, medium and program product for determining object quantity
CN111753729B (en) False face detection method and device, electronic equipment and storage medium
CN115810005B (en) Corrugated case defect detection acceleration method, system, equipment and storage medium based on parallel computing
CN111914949A (en) Zero sample learning model training method and device based on reinforcement learning
CN116012307A (en) Corrugated case printing pattern color difference detection method, system and storage medium based on twin network
CN116363656A (en) Image recognition method and device containing multiple lines of text and computer equipment
Yu et al. Surface Defect inspection under a small training set condition
CN113034432A (en) Product defect detection method, system, device and storage medium
CN111461060A (en) Traffic sign identification method based on deep learning and extreme learning machine
CN111814594A (en) Logistics violation identification method, device, equipment and storage medium
CN108875929B (en) Font code generation method and apparatus, font code, storage medium
CN115760670B (en) Unsupervised hyperspectral fusion method and device based on network implicit priori
CN114882292B (en) Remote sensing image ocean target identification method based on cross-sample attention mechanism graph neural network
CN110852102B (en) Chinese part-of-speech tagging method and device, storage medium and electronic equipment

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
GR01 Patent grant