US 11,966,847 B2
Method for constructing efficient product surface defect detection model based on network collaborative pruning
Jie Zhang, Shanghai (CN); Junliang Wang, Shanghai (CN); Xin Liu, Shanghai (CN); and Jinsong Bao, Shanghai (CN)
Assigned to DONGHUA UNIVERSITY, Shanghai (CN)
Filed by Donghua University, Shanghai (CN)
Filed on Nov. 16, 2020, as Appl. No. 17/098,468.
Claims priority of application No. 202010193038.0 (CN), filed on Mar. 18, 2020.
Prior Publication US 2021/0295165 A1, Sep. 23, 2021
Int. Cl. G06N 20/00 (2019.01); G06F 17/15 (2006.01); G06N 3/04 (2023.01); G06N 3/082 (2023.01); G06T 7/00 (2017.01)
CPC G06N 3/082 (2013.01) [G06F 17/15 (2013.01); G06N 3/04 (2013.01); G06T 7/0004 (2013.01); G06T 2207/20081 (2013.01); G06T 2207/20084 (2013.01); G06T 2207/30108 (2013.01)] 4 Claims
OG exemplary drawing
 
1. A method for constructing an efficient product surface defect detection model based on a network collaborative pruning, comprising the following steps:
step 1) building an initial product surface defect detection model based on a convolutional neural network by using product surface defect data;
step 2) evaluating an importance of each convolution kernel of convolution kernels in the initial product surface defect detection model obtained in step 1, determining the importance of the each convolution kernel of the convolution kernels in the initial product surface defect detection model for a final detection result, and finding less important convolution kernels to form a candidate convolution kernel subset for pruning operations;
step 3) transforming an evaluation of the importance of one convolution kernel for the final detection result into an evaluation of an importance of a convolution circuit of convolution circuits for the final detection result; approximately considering a selection of the convolution circuit as a search problem for an optimal architecture; encoding the convolution kernels in the candidate convolution kernel subset obtained in step 2 by using a genetic algorithm; continuously optimizing a network architecture to search for network redundant circuits by using the genetic algorithm; determining an impact of a synergy between the convolution kernels on the final detection result; deleting the network redundant circuits in the initial product surface defect detection model obtained in step 1 to achieve a lightweighting of the initial product surface defect detection model to obtain a new product surface defect detection model; and
step 4: performing a micro-training on the new product surface defect detection model after the network collaborative pruning in step 3 by using a small amount of product sample data to improve an accuracy of the initial product defect detection model and to ensure a high-precision detection of product surface defects by the new product surface defect detection model;
wherein in step 2, an evaluation method based on a Taylor expansion is used to evaluate the importance of the each convolution kernel of the convolution kernels in the initial product surface defect detection model obtained in step 1;
wherein step 2 comprises the following sub-steps:
step 201) setting an evaluation criterion of the convolution kernel as expression (1):

OG Complex Work Unit Math
wherein, D represents an input image data sample, W represents a weight of the convolution kernel of the initial product surface defect detection model, and W′— represents a weight of the convolution kernel of the new product surface defect detection model after the network redundant circuits are deleted, C(D|W) represents an output result of the initial product surface defect detection model, and C(D|W′—) represents an output result of the new product surface defect detection model after the network redundant circuits deleted;
step 202) assuming hi represents whether an i-th convolution kernel is deleted, and C(D, hi) represents an output result of an unpruned product surface defect detection model, wherein a difference ΔC(hi) between output results before and after an evaluation of the convolution kernel is expressed as the following equation (2):
C(hi)|=|C(D,hi=0)−C(D,hi)|  (2);
wherein, C(D, hi=0) represents an output result of the initial product surface defect detection model after removing the i-th convolution kernel hi;
step 203) approximately expressing an operation process of the initial product surface defect detection model as a function, using the convolution kernel in the initial product surface defect detection model as a function input, and approximately expressing a function of the initial product surface defect detection model by the Taylor expansion;
calculating ΔC(hi) by using a method based on a first-order Taylor expansion and expressing a function f(x) of the convolutional neural network as the Taylor expansion at the convolution kernel x=a as shown in equation (3):

OG Complex Work Unit Math
wherein, p represents an expansion order of the function, P represents a total order of the Taylor expansion, f(p)(a) represents a p-order derivative of the function f(x) at the convolution kernel x=a; and Rp(x) represents a p-order remainder term of the Taylor expansion;
step 204) evaluating the convolution kernel in the initial product surface defect detection model, wherein a corresponding output result of the convolution kernel is calculated by using the first-order Taylor expansion C(D, hi=0) as shown in the following equation (4):

OG Complex Work Unit Math
wherein, C represents the output result of the initial product surface defect detection model, and R1(hi=0) represents a remainder term, and the remainder term is expressed as the following equation (5) by using a Lagrange interpolation formula:

OG Complex Work Unit Math
wherein, ξ is a number between 0 and hi;
step 205) ignoring an impact of the remainder term on output result, and obtaining the evaluation criterion ΘTE(hi) of the i-th convolution kernel hi as shown in equation (6):

OG Complex Work Unit Math
obtaining an evaluation criterion of an impact degree of the i-th convolution kernel hi in the initial product surface defect detection model on a result according to equation (6); and
step 206) calculating a product of a feature map parameter hi corresponding to the each convolution kernel of the convolution kernels and a gradient of the feature map parameter of a loss function by using the evaluation criterion of formula (6); and determining an impact on the result to evaluate the importance of the each convolution kernel of the convolution kernels in the initial product surface defect detection model, finding the less important convolution kernels, and forming the candidate convolution kernel subset for the pruning operations.