Interpretable convolutional neural network structure redundancy assessment method based on linear separability measurement

By using the Minkowski difference linear separability measure (MD-LSM) to evaluate the hidden channel contribution of deep neural networks and pruning redundant channels, the problem of uninterpretable evaluation results in existing methods is solved, and highly reliable network redundancy evaluation and optimization are achieved.

CN120705524APending Publication Date: 2025-09-26DIGITAL SOURCE ZHIYONG (DALIAN) TECHNOLOGY CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202510781618.4
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-06-12
Publication Date
2025-09-26

AI Technical Summary

Technical Problem

Existing neural network structural redundancy assessment methods lack interpretability and are unable to provide objective, reliable, and fair assessment results in task scenarios with high reliability requirements, and are unable to effectively evaluate the local structure of the network.

Method used

The Minkowski difference-based linear separability measure (MD-LSM) is used as an evaluation tool to analyze the contribution of the network's hidden layer channels. Through an interpretable network pruning method, channels with lower importance are pruned to achieve quantitative evaluation and optimization of the network structure redundancy.

Benefits of technology

It realizes multi-level, fully objective and interpretable structural redundancy evaluation of deep neural networks, enhances the reliability and adaptability of the evaluation results, and ensures the credibility and guidance of the evaluation results.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120705524A_ABST
    Figure CN120705524A_ABST
Patent Text Reader

Abstract

The invention provides an interpretable convolutional neural network structure redundancy assessment method based on linear separability measurement, and belongs to the technical field of neural network testing. The Minkowski difference linear separability measurement MD-LSM is adopted as an interpretable tool of the network, the contribution of each channel in the hidden layer (block) in the deep neural network to the overall performance of the network is analyzed, and the importance degree of each channel in the hidden layer of the network to the classification capability of the hidden layer (block) is determined; explainable network pruning is realized by pruning a network channel with a relatively low importance degree; through an interpretable network hidden layer redundancy analysis and network pruning method, the structure redundancy of the network is measured, the applicability credibility evaluation of the network in a time and computing resource limited task scene is realized, and guidance is provided for the subsequent redundancy optimization of the network. According to the method, the reliability of the evaluation result can be ensured, and the adaptability of the network structure redundancy evaluation method to different task scenes can be enhanced.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention belongs to the technical field of neural network testing, and provides an interpretable convolutional neural network structure redundancy evaluation method based on linear separability measurement, and in particular relates to an interpretable convolutional neural network structure redundancy evaluation method based on linear separability measurement. Background Art

[0002] With the widespread application of deep neural networks, especially large models, large-scale neural networks have come to suffer from slow execution, large storage requirements, and poor interpretability, hindering their applicability in scenarios with stringent requirements for storage size and computational speed. Therefore, evaluating the structural redundancy of deep neural networks and determining whether they can meet the time and space complexity requirements of the task scenario has become a pressing issue for neural network applications.

[0003] Existing structured or unstructured network pruning methods, or model distillation and model quantization methods, can be used directly or indirectly to evaluate the redundancy of deep neural networks and analyze unnecessary storage space and running time expenditures during network operation. Taking the structured pruning of convolutional neural networks as an example, He et al. [Y. He, G. Kang, X. Dong, Y.Fu, and Y. Yang, “Soft filter pruning for accelerating deep convolutional neural networks,” in IJCAI, 2018, pp.2234–2240] proposed using regularization technology to automatically sparse the network, thereby achieving network pruning; Lee et al. [N. Lee, T. Ajanthan, and PH Torr, “Snip: Single-shot network pruning based on connection sensitivity,” in ICLR, 2019.] analyzed the gradient of network back propagation to extract sub-networks whose parameters changed significantly during training; Guan et al. [Y. Guan, N. Liu, P. Zhao, et al. Dais: Automatic channel pruning via differentiable annealing indicator search[J]. IEEE Transactions on NeuralNetworks and Learning Systems, 2022, 34(12): 9847-9858.] The final pruning result is obtained by adding connection weights after the channel and other structures and optimizing the connection weights.

[0004] For tasks like autonomous driving or industrial production, neural networks with low structural redundancy are required to reduce deployment costs and increase response speed. However, these tasks still require highly reliable neural networks. If a low-redundancy neural network is misidentified as a high-redundancy one and its structural redundancy is optimized, the severe performance degradation caused by the structural redundancy optimization can lead to a significant increase in the neural network's error rate, and even cause serious personal injury and property damage. Therefore, how to reliably evaluate the structural redundancy of neural networks, ensure the interpretability of the evaluation results, and obtain convincing neural network structural redundancy evaluation results has become the key to solving this problem.

[0005] However, current methods for assessing or optimizing network redundancy cannot directly identify the network's redundant structure based on its operating mechanism. Their assessments of network redundancy lack interpretability, and their results only provide a generalized assessment of the network's overall redundancy, failing to provide a targeted assessment of local network structures. These methods struggle to guarantee the objectivity, reliability, and fairness of their assessment results, and are also difficult to adapt to diverse task scenarios, raising questions about the credibility of existing network redundancy assessment results.

[0006] Therefore, based on the theory of neural network interpretability, the present invention develops a set of evaluation methods for the structural redundancy of deep neural networks, which realizes multi-level, fully objective and interpretable structural redundancy evaluation of deep neural networks, and enhances the objectivity, reliability and fairness of the evaluation results. Summary of the Invention

[0007] This paper provides an interpretable evaluation method for structural redundancy, a key performance characteristic of deep neural networks, to address the need for highly reliable network evaluation results in application scenarios such as industrial production and autonomous driving. This method can provide an interpretable evaluation of the structural redundancy of deep neural networks, yielding reliable results and providing guidance for subsequent improvements. The present invention uses Zhang's Minkowski difference-based linear separability measure (MD-LSM) [C. Zhang, X. Chen, W. Li, L. Liu, W. Wu, and D. Tao, “Understanding deep neural networks via linear separability of hidden layers,” arXiv preprint arXiv:2307.13962, 2023.] as a network interpretability tool to analyze the contribution of each channel in the hidden layer (block) of a deep neural network to the overall network performance and determine the importance of each channel in the network's hidden layer to the classification ability of the hidden layer (block). By pruning the network channels with lower importance, interpretable network pruning is achieved. Through interpretable network hidden layer redundancy analysis and network pruning methods, the structural redundancy of the network is measured, and a reliable assessment of the network's applicability is achieved in task scenarios with limited time and computing resources, providing guidance for subsequent redundancy optimization of the network.

[0008] In order to achieve the above object, the technical solution adopted by the present invention is:

[0009] This paper presents an interpretable convolutional neural network structural redundancy assessment method based on linear separability metrics. This method is an interpretable assessment method for deep neural network structural redundancy. It is suitable for deep neural network or intelligent algorithm developers, users, or third-party testers to conduct objective and interpretable assessments of deep neural networks, and to guide subsequent improvements to the network through interpretable assessment results. Specifically, it includes the following steps:

[0010] The first step is to set the parameters, dataset, hyperparameters and optimizer used by the algorithm;

[0011] 1.1) Obtain the training set input data and labels used by the evaluation method 、 (in is the number of samples), test set input data and labels 、 , the optimizer used and hyperparameters .

[0012] 1.2) Set algorithm parameters: Based on the task requirements and the existing experience of structured pruning on similar structured networks, set the set of pruning parameters used by the algorithm , the transformation parameters of the linear separability measure MD-LSM and fine-tune the number of repetitions .

[0013] The second step is to obtain the network to be evaluated and determine the category and network grouping method of the network;

[0014] 2.1) Input the trained convolutional network to be detected , the convolutional network to be detected Referred to as the original network, it contains Convolutional layers, each of which contains multiple convolution kernels, which have the same size, usually length and width. or Each convolutional layer of the convolutional network contains multiple channels, where The convolutional layer contains channels.

[0015] 2.2) For the convolutional network to be detected obtained in 2.1) , according to the following three parallel network classification methods, determine which category the convolutional network to be tested belongs to:

[0016] Classification method 1: Convolutional network to be detected Is it a network with or without skip connection structure? Convolutional Network Is there a structure in which the outputs of different convolutional layers are directly added together as the input to the subsequent hidden layer, that is, is there a skip-connect structure?

[0017] Classification method 2: Convolutional network to be detected Is it a binary classification network or a multi-class classification network? Can the convolutional network classify more than 2 categories of input data?

[0018] Classification method three: convolutional network to be detected Whether the network contains blocks or does not contain blocks. Whether the convolutional network contains blocks consisting of multiple hidden layers.

[0019] 2.3) For the convolutional network to be detected containing a skip connection structure , analyze the connection mode of each convolutional layer output, find the convolutional layers whose outputs are directly merged by addition, and divide these convolutional layers into the same group If no other convolutional layer output is merged with the output of this convolutional layer, then this convolutional layer itself is a separate group, until all convolutional layers are divided into corresponding groups, and the grouping of all convolutional layers is obtained. ,in Represents the number of groups in the network. In addition, we need to find the number of groups for each convolutional layer. The length and width of all convolution kernels in The output of the convolutional layer is obtained to obtain the corresponding grouping of the convolutional layer output.

[0020] The third step is to test the convolutional network obtained in the second step. , starting from its first convolutional layer or the first group of the network structure containing skip connections, using the training set obtained in the first step 、 Compute the linear separability measure for each channel output, specifically:

[0021] 3.1) Evaluate the binary classification convolutional network without skip connection structure. The convolutional layers contain channels, using the training set to calculate the Convolutional layer The output of each channel is , and its category one (i.e., the sample label corresponding to the input data ) and category two (i.e., the sample labels corresponding to the input data )’s hidden channel output 、 , calculate the MD-LSM of the two:

[0022] (1)

[0023] (2)

[0024] in, Represents the number of samples of the two categories respectively; yes , Minkowski difference of 、 yes , Elements in express dimensional vector space; Represents the optimization parameters.

[0025] In order to simplify the calculation, the present invention usually uses the linear separability metric when calculating Approximation Calculate, where ,in is by transforming the matrix The matrix obtained by replacing the non-diagonal elements with 0 and taking the inverse of the non-zero diagonal elements is , indicating that The matrix composed of Minkowski differences.

[0026] 3.2) Linear separability measure for each channel calculated in 3.1) , truncate it to the left , and used as pruning threshold In the calculation of:

[0027] (2)

[0028] (3)

[0029] in, is the pruning index, , which means the smallest value in the hidden layer ; is the MD-LSM transformation parameter, is a pruning parameter in the pruning parameter set.

[0030] 3.3) For binary convolutional neural networks with skip connection structures, pruning should be performed one by one according to the order in which all convolutional layers are grouped in 2.3), and the following formula should be used instead of the pruning index calculation formula in 3.2) to calculate the pruning index of the group, and the adjusted channel Group pruning index :

[0031] (4)

[0032] in It is a set of hidden layer outputs that contains all the hidden layer outputs used to calculate the set of pruning indicators. l represents The hidden layer labels contained in . Then the pruning threshold of each group in the convolutional layer grouping is Obtained by the following formula:

[0033] (5)

[0034] in , indicating the smallest , Indicates the number of channels of a single convolutional layer in the group, is the channel label.

[0035] 3.4) For pruning multi-classification networks with or without skip connections, the pruning method is basically the same as the methods in 3.1)-3.3). Just replace the MD-LSM calculation formula in 3.1) with the multi-classification MD-LSM shown in the following formula:

[0036] (6)

[0037] in, Representative Convolutional layer Different categories of output for each channel; Represents the linear separability measure of the hidden layer output between each two different categories; 、 Represents two different categories of hidden layer output sets; 、 represents the category label, Indicates the number of categories.

[0038] In the fourth step, parameters of the hidden layers and blocks of the network are pruned according to the pruning index and pruning threshold calculated in the third step;

[0039] 4.1) For the original network without skip connection structure , according to the pruning index and pruning threshold ,Will All convolutional layers The channels connected to these channels are cut off and The convolution kernel of the convolution layer is pruned. The convolution kernel of the convolution layer is calculated The convolutional layer outputs and the channel pruning of the layer is performed until all convolutional layers are pruned to obtain the pruned network. .

[0040] 4.2) For the original network containing the skip connection structure , according to the pruning index and pruning threshold ,Will All in group The channels of the network are pruned, and the hidden convolution kernels connected to these channels are pruned. Then the hidden layer output of the next group is calculated by the pruned convolution kernel, and the channel pruning of the group is performed until all groups are pruned to obtain the pruned network. .

[0041] Step 5: Get the original network from step 2 Calculate the local structural redundancy index of each hidden layer or block. Specifically:

[0042] 5.1) To calculate the structural redundancy index of the hidden layer, it is necessary to first calculate the pruning index calculation method of all channels of the hidden layer using 3.1). , and then calculate the corresponding hidden layer evaluation index by the following formula :

[0043] (7)

[0044] in ,express The mean of Indicates the number of channels of this layer.

[0045] 5.2) For the calculation of the neural network containing the block to be detected, the block must be considered as a whole to evaluate the structural redundancy. First, all convolutional layers in the block (excluding The structural redundancy evaluation index of the convolutional layer is then calculated as the structural redundancy evaluation index of the block. .

[0046] (8)

[0047] It is calculated The indicator set of the required hidden layer output; l represents The hidden layer indicators in .

[0048] Step 6: Based on the original network obtained in step 2 And the pruned network obtained in the fourth step , calculate the evaluation results of the structural redundancy evaluation index of the entire network.

[0049] 6.1) Evaluate the change in the storage size required for the network before and after pruning: Assume that the number of parameters of the network before and after pruning (including all parameters of the convolutional layer, fully connected layer and batch normalization layer (BN layer)) is and , then the parameter number index for:

[0050] (9)

[0051] 6.2) Evaluate the changes in network computational efficiency before and after pruning: Assume that the number of floating-point operations (FLOPs) of the network before and after pruning is and , then the network FLOPs index for:

[0052] (10)

[0053] 6.3) Evaluate the changes in network classification performance before and after pruning: Use the original network's optimizer on the pruned network and hyperparameters conduct Fine-tuning (usually 1-5 times), assuming that the accuracy of the network test set before pruning is , after pruning The mean accuracy of the test set after fine-tuning is , then the network performance index for:

[0054] (11)

[0055] In the seventh step, based on the evaluation results of the fifth and sixth steps, the structural redundancy score of the network is calculated to determine the redundant structure of the network.

[0056] 7.1) Under different pruning parameters, the overall structural redundancy evaluation index in step 6 is used , and calculate the structural redundancy score of the network according to the following formula:

[0057] (12)

[0058] in and The value range of ,and . It is the indicator score weight; and is the score control function, and its value range is The highest score calculated under different pruning parameters is taken as the final score of the network structure redundancy.

[0059] 7.2) According to the structural redundancy index of the hidden layer or block in step 5 、 , determine the network hidden layers or blocks with a large number of redundant channels, and make them the priority objects for subsequent network structured redundancy optimization.

[0060] Compared with the network structure redundancy evaluation method based on the traditional method, the beneficial effects of the present invention are:

[0061] (1) This method uses MD-LSM as the theoretical core of the evaluation method. Through the structured pruning method in the third and fourth steps, a pruned network with redundant structures removed is obtained, which makes the structural redundancy evaluation method interpretable, thereby ensuring the reliability of the evaluation results and enabling the evaluation algorithm to be used in tasks with high reliability requirements.

[0062] (2) This method realizes the quantitative evaluation of the structural redundancy of local structures such as hidden layers and blocks of the network. According to the structural redundancy evaluation index of the hidden layer or block in the fifth step, the redundant local network structures are determined, so that the evaluation results can directly guide the subsequent improvement of the network structure redundancy.

[0063] (3) This method establishes an objective and interpretable convolutional neural network structure redundancy evaluation framework, standardizes the network structure redundancy evaluation process, and enhances the adaptability of the network structure redundancy evaluation method to different task scenarios. BRIEF DESCRIPTION OF THE DRAWINGS

[0064] Figure 1 This is a schematic diagram of the convolutional hidden layer and hidden layer output grouping results of the ResNet network with a skip connection structure; the colored points in the figure represent the hidden layer outputs of the corresponding groups.

[0065] Figure 2 Schematic diagram of the process of interpretable deep neural network structured pruning method; in the interpretable network structured pruning diagram, colored squares represent retained convolution kernels, and colorless squares represent pruned convolution kernels; colored rectangles represent retained channel outputs, and colorless rectangles represent deleted channel outputs.

[0066] Figure 3 Flowchart for redundancy evaluation of interpretable deep neural network architectures. DETAILED DESCRIPTION

[0067] The following will take the binary classification convolutional neural network VGGNet-11 as an example (to avoid overfitting, the number of channels of the network is reduced to 1 / 4 of the original network), and combine specific embodiments and drawings to further illustrate the technical solution of the present invention.

[0068] A method for evaluating the structural redundancy of interpretable convolutional neural networks based on linear separability metrics is proposed. The steps are as follows:

[0069] The first step is to set the parameters used by the algorithm, data set, hyperparameters and optimizer

[0070] 1.1) Obtain the training set input data and labels used by the evaluation method 、 (Randomly sampled from the training set of airplanes and cars in CIFAR-10, where is the number of samples), test set input data and labels 、 (Test set of airplanes and cars in CIFAR-10), the stochastic gradient descent optimizer used and hyperparameters .

[0071] 1.2) Set algorithm parameters: Based on the task requirements and the existing experience of structured pruning on similar structured networks, set the set of pruning parameters used by the algorithm , linear separability measure (MD-LSM) transformation parameters and fine-tune the number of repetitions .

[0072] The second step is to obtain the VGGNet-11 network to be evaluated and determine the category and network grouping method of the network;

[0073] 2.1) Input the trained convolutional network to be detected , the convolutional network to be detected Referred to as the original network, it contains Convolutional layers, each of which contains multiple convolution kernels, which have the same size, usually length and width. or The 8 convolutional layers of the VGGNet-11 convolutional network contain channels of 16, 16, 32, 32, 64, 64, 128, and 128 respectively.

[0074] 2.2) For the convolutional network to be detected obtained in 2.1) , according to the following three parallel network classification methods, determine which category the convolutional network to be tested belongs to:

[0075] Classification method 1: Convolutional network to be detected Is it a network with or without skip connection structure? Convolutional Network Is there a structure where the outputs of different convolutional layers are directly added together as the input to the subsequent hidden layer? That is, is there a skip-connect structure? The VGGNet-11 network does not have a skip-connect structure.

[0076] Classification method 2: Convolutional network to be detected Is it a binary classification network or a multi-class classification network? Can the convolutional network classify more than two categories of input data? The VGGNet-11 network we use is a binary classification network.

[0077] Classification method three: convolutional network to be detected Whether the network contains blocks or does not contain blocks. Whether the convolutional network contains blocks consisting of multiple hidden layers. The VGGNet-11 network does not contain blocks consisting of multiple hidden layers.

[0078] The third step is to use the training set obtained in the first step to train the VGGNet-11 network from the first convolutional layer (or the first group of the network structure containing skip connections) 、 Compute the linear separability measure for each channel output, specifically:

[0079] 3.1) Starting from the first layer of VGGNet-11, its The convolutional layers contain channels, using the training set to calculate the Convolutional layer The output of each channel is , and its category one (i.e., the sample label corresponding to the input data ) and category two (i.e., the sample labels corresponding to the input data )’s hidden channel output 、 , calculate the MD-LSM of the two:

[0080] (1)

[0081] in, Represents the number of samples of the two categories respectively; yes , Minkowski difference of 、 yes , Elements in express dimensional vector space; Represents the optimization parameters.

[0082] In order to simplify the calculation, the present invention usually uses the linear separability metric when calculating Approximation Calculate, where ,in The matrix The matrix obtained by replacing the non-diagonal elements with 0 and taking the inverse of the non-zero diagonal elements is , indicating that The matrix composed of Minkowski differences.

[0083] Take the first convolutional layer of VGGNet as an example (assuming that the pruning threshold parameter is ), input the training set data into the network, get the hidden layer output of the first convolutional layer, and calculate the pruning index of the 16 channels in the convolutional layer respectively The value is [0.110, 0.085, 0.134, 0.083, 0.000, 0.227, 0.034, 0.011, 0.406, 0.147, 0.001, 0.002, 0.175, 0.398, 0.210, 0.251].

[0084] 3.2) Linear separability measure for each channel calculated in 3.1) , truncate it to the left , and used as pruning threshold In the calculation of:

[0085] (2)

[0086] (3)

[0087] in, is the pruning index, , which means the smallest value in the hidden layer ; is the MD-LSM transformation parameter, is a pruning parameter in the pruning parameter set.

[0088] Take the first convolutional layer of VGGNet as an example (assuming that the pruning threshold parameter is ), according to the pruning results in 3.1), its pruning threshold .

[0089] The fourth step is to prune the parameters of the hidden layer of the network according to the pruning index and pruning threshold calculated in the third step. For the VGGNet-11 network without skip connection structure, according to the pruning index and pruning threshold ,Will All convolutional layers The channels connected to these channels are cut off and The convolution kernel of the convolution layer is pruned. The convolution kernel of the convolution layer is calculated The convolutional layer outputs and the channel pruning of the layer is performed until all convolutional layers are pruned to obtain the pruned network. .

[0090] Taking the first layer of VGGNet-11 as an example, based on the calculation results in step 3, the pruning indicators of eight channels (channels 1, 2, 4, 5, 7, 8, 11, and 12) are less than the pruning threshold and should be pruned. The other eight channels are retained. Furthermore, for each channel in the second layer, the convolution kernels (kernels 1, 2, 4, 5, 7, 8, 11, and 12) should be pruned, while the remaining convolution kernels are retained. Repeat steps 2 and 3 to perform structured pruning on subsequent convolutional layers of the convolutional network until all convolutional layers are pruned, resulting in the pruned VGGNet-11 network.

[0091] The fifth step is to obtain the original VGGNet-11 network in the second step Calculate the local structure redundancy index of each hidden layer. First, calculate the hidden layer by the pruning index calculation method in 3.1). All channels , and then calculate the corresponding hidden layer evaluation index by the following formula :

[0092] (4)

[0093] in ,express The mean of Indicates the number of channels of this layer.

[0094] Taking the first convolutional layer of VGGNet-11 as an example, the pruning indicators of each channel are The mean . So there are 9 channels is less than the mean, Similarly, we can prune the subsequent hidden layers of the VGGNet-11 network to obtain the evaluation indicators corresponding to the other 7 hidden layers , , , .

[0095] Step 6: Based on the VGGNet-11 original network obtained in step 2 And the VGGNet-11 pruned network obtained in the fourth step , calculate the evaluation results of the structural redundancy evaluation index of the entire network.

[0096] 6.1) Evaluate the change in the storage size required for the network before and after pruning: Assume that the number of parameters of the network before and after pruning (including all parameters of the convolutional layer, fully connected layer and batch normalization layer (BN layer)) is and , then the parameter number index for:

[0097] (5)

[0098] 6.2) Evaluate the changes in network computational efficiency before and after pruning: Assume that the number of floating-point operations (FLOPs) of the network before and after pruning is and , then the network FLOPs index for:

[0099] (6)

[0100] 6.3) Evaluate the changes in network classification performance before and after pruning: Use the original network's optimizer on the pruned network and hyperparameters conduct Fine-tuning (3 times in this example), assuming that the accuracy of the network test set before pruning is , after pruning The mean accuracy of the test set after fine-tuning is , then the network performance index for:

[0101] (7)

[0102] The pruning threshold parameter Take the example to calculate the structural redundancy evaluation index of the network. The number of network parameters before and after pruning is respectively and , the network FLOPs are and ; The test set accuracy of the network before pruning is , the accuracy of the network test set after pruning for 3 times of fine-tuning is 0.9355, 0.9285, and 0.9340 respectively, and the average is The overall evaluation index of the network is , , Similarly, we can also The pruned network is evaluated as a whole and the corresponding evaluation indicators are obtained, as shown in the following table:

[0103] In the seventh step, based on the evaluation results of the fifth and sixth steps, the structural redundancy score of the network is calculated to determine the redundant structure of the network.

[0104] 7.1) Under different pruning parameters, the overall structural redundancy evaluation index in step 6 is used , and calculate the network's structural redundancy score according to the following formula

[0105] (8)

[0106] in and The value range of ,and . It is the indicator score weight; and is the score control function, and its value range is The highest score calculated under different pruning parameters is taken as the final score of the network structure redundancy.

[0107] Table 1 shows the structural redundancy evaluation index of the entire network.

[0108]

[0109] 7.2) According to the structural redundancy index of the hidden layer or block in step 5 、 , determine the network hidden layers or blocks with a large number of redundant channels, and make them the priority objects for subsequent network structured redundancy optimization.

[0110] The data in the above table are used to calculate the network structure redundancy evaluation score, assuming that = ,

[0111] (9)

[0112] Calculation shows that the overall structural redundancy score of the network is , it can be considered to have high structural redundancy and should be subjected to structured pruning or other structural redundancy optimization methods.

[0113] In addition, according to the hidden layer structure redundancy evaluation index calculated in the sixth step, if As a criterion for judging the low redundancy of the hidden layer structure, it can be seen that the structural redundancy of the 1st to 4th layers of the network is low and should be targeted for improvement.

[0114] The above-described embodiments merely express the implementation methods of the present invention, but should not be understood as limiting the scope of the present invention. It should be pointed out that those skilled in the art can make several modifications and improvements without departing from the concept of the present invention, which all fall within the scope of protection of the present invention.

Claims

1. A method for evaluating the structural redundancy of an interpretable convolutional neural network based on linear separability metrics, characterized in that: The present invention discloses an interpretable convolutional neural network structural redundancy assessment method, which uses the linear separability measure of Minkowski difference (MD-LSM) as an interpretable tool to determine the importance of each channel in the network hidden layer to the classification ability of the hidden layer or block; and implements interpretable network pruning by pruning the less important network channels. The method measures the structural redundancy of the network through interpretable network hidden layer redundancy analysis and network pruning methods, and implements a credible assessment of the applicability of the network in time- and computing resource-constrained task scenarios. The method specifically comprises the following steps: The first step is to set the parameters, dataset, hyperparameters and optimizer used by the algorithm; 1.1) Obtain the training set input data and labels used by the evaluation method 、 ,in is the number of samples, test set input data and labels 、 , the optimizer used and hyperparameters ; 1.2) Set algorithm parameters: Set the pruning parameter set used by the algorithm , the transformation parameters of the linear separability measure MD-LSM and fine-tune the number of repetitions ; The second step is to obtain the network to be evaluated and determine the category and network grouping method of the network; 2.1) Input the trained convolutional network to be detected , the convolutional network to be detected Referred to as the original network, it contains convolutional layers; 2.2) Determine the type of convolutional network to be detected; 2.3) Based on the network categories obtained in 2.2), the network is grouped to obtain groups of all convolutional layers; The third step is to test the convolutional network obtained in the second step. , starting from its first convolutional layer or the first group of the network structure containing skip connections, using the training set obtained in the first step 、 Compute the linear separability measure of each channel output; The fourth step is to prune the hidden layers and blocks of the convolutional network according to the pruning index and pruning threshold calculated in the third step to obtain the pruned network. ; Step 5: Calculate the convolutional network to be detected The local structural redundancy index of each hidden layer or block in ; specifically: 5.1) For the calculation of the structural redundancy index of the hidden layer, the pruning index calculation method in 3.1) is used to calculate the redundancy of all channels in the hidden layer. , and then calculate the corresponding hidden layer evaluation index ; 5.2) For the calculation of the neural network containing the block to be tested, the block is regarded as a whole to evaluate the structural redundancy; the mean of the structural redundancy evaluation index of the hidden layer is calculated as the structural redundancy evaluation index of the block ; The sixth step is to detect the convolutional network And the pruned network obtained in the fourth step , obtain the evaluation results of the overall structural redundancy evaluation index of the network; 6.1) Evaluate the change in the network storage size before and after pruning to obtain the parameter number index ; 6.2) Evaluate the changes in network computational efficiency before and after pruning to obtain the network FLOPs index ; 6.3) Evaluate the changes in network classification performance before and after pruning to obtain network performance indicators ; Step 7: Based on the evaluation results, the structural redundancy score of the network is calculated to determine the redundant structure of the network; 7.1) Under different pruning parameters, the overall structural redundancy evaluation index in step 6 is used , calculate the structural redundancy score of the network: (12), among which, and The value range of ; is the score control function; The highest score calculated under different pruning parameters is used as the final score of the network structure redundancy; 7.2) According to the structural redundancy index of the hidden layer or block in step 5 、 , determine the network hidden layers or blocks with a large number of redundant channels, and make them the priority objects for subsequent network structured redundancy optimization.

2. The method for evaluating the structural redundancy of an interpretable convolutional neural network based on linear separability metrics according to claim 1, wherein: In the second step: In 2.1), each convolution layer contains multiple convolution kernels, which have the same size, and the length and width are usually or ; Each convolutional layer of the convolutional network contains multiple channels, where The convolutional layer contains channels; In 2.2), the method for determining the category of the convolutional network to be detected is as follows: Classification method 1: Convolutional network to be detected Whether there is a skip connection structure, classified into networks with skip connection structure and networks without skip connection structure; Classification method 2: Convolutional network to be detected Whether the number of categories for classifying input data exceeds 2, it is classified as a binary classification network or a multi-classification network; Classification method three: convolutional network to be detected Whether it contains a block consisting of multiple hidden layers, classified as a network containing a block or a network not containing a block; In 2.3), for the convolutional network to be detected containing a skip connection structure , analyze the connection mode of each convolutional layer output, and divide the convolutional layers whose outputs are directly merged by addition into the same group If no other convolutional layer output is merged with the output of this convolutional layer, then this convolutional layer is grouped separately until all convolutional layers are divided into corresponding groups, and the grouping of all convolutional layers is obtained. ,in Represents the number of groups in the network; and is grouped according to each convolutional layer The output of all convolutional layers in , and obtain the corresponding grouping of convolutional layer outputs.

3. The method for evaluating the structural redundancy of an interpretable convolutional neural network based on linear separability metrics according to claim 2, wherein: The third step is specifically as follows: 3.1) Evaluate the binary classification convolutional network without skip connection structure. The convolutional layers contain channels, using the training set to calculate the Convolutional layer The output of each channel is , and its hidden channel outputs of category one and category two 、 , calculate the MD-LSM of the two: (1), (2), where Represents the number of samples of the two categories respectively; yes , Minkowski difference of 、 yes , Elements in express dimensional vector space; represents the optimization parameters; Category 1 is the sample label corresponding to the input data , Category 2 is the sample label corresponding to the input data ; 3.2) The linear separability measure of each channel obtained in 3.1) is Perform left truncation , and used as pruning threshold In the calculation of: (2), (3), where is the pruning index, , which means the smallest value in the hidden layer ; is the MD-LSM transformation parameter, is a pruning parameter in the pruning parameter set; 3.3) For the binary classification convolutional neural network with skip connection structure, the pruning is performed one by one according to the order of grouping all convolutional layers in 2.3), and the pruning index calculation formula in 3.2) is replaced by formula (4) to calculate the pruning index of the group, and the adjusted channel is obtained. Group pruning index : (4), where It is a set of hidden layer outputs that contains all the hidden layer outputs used to calculate the set of pruning indicators. l represents The hidden layer labels contained in ; then the pruning threshold of each group in the convolutional layer grouping is Obtained by the following formula: (5), where , indicating the smallest , Indicates the number of channels of a single convolutional layer in the group, is the channel label; 3.4) For pruning multi-classification networks with or without skip connections, the pruning method is basically the same as the methods in 3.1)-3.3). Just replace the MD-LSM calculation formula in 3.1) with the multi-classification MD-LSM shown in the following formula: (6), where Representative Convolutional layer Different categories of output for each channel; Represents the linear separability measure of the hidden layer output between each two different categories; 、 Represents two different categories of hidden layer output sets; 、 represents the category label, Indicates the number of categories.

4. The method for evaluating the structural redundancy of an interpretable convolutional neural network based on linear separability metrics according to claim 3, wherein: In 3.2), when calculating the linear separability measure, use Approximation Calculate, where ,in is by transforming the matrix The matrix obtained by replacing the non-diagonal elements with 0 and taking the inverse of the non-zero diagonal elements is , indicating that The matrix composed of Minkowski differences.

5. The method for evaluating the structural redundancy of an interpretable convolutional neural network based on linear separability metrics according to claim 3, wherein: The fourth step is specifically as follows: 4.1) For the original network without skip connection structure , according to the pruning index and pruning threshold ,Will All convolutional layers Cut off the channels and trim the channels connected to these channels The convolution kernel of the convolution layer; after being pruned The convolution kernel of the convolution layer is calculated The convolutional layer outputs and the channel pruning of the layer is performed until all convolutional layers are pruned to obtain the pruned network. ; 4.2) For the original network containing the skip connection structure , according to the pruning index and pruning threshold ,Will All in group The channels of the network are pruned, and the hidden convolution kernels connected to these channels are pruned; then the hidden layer output of the next group is calculated by the pruned convolution kernel, and the channel pruning of the group is performed until all groups are pruned to obtain the pruned network. .

6. The method for evaluating the structural redundancy of an interpretable convolutional neural network based on linear separability metrics according to claim 5, wherein: In the fifth step: In 5.1), the corresponding hidden layer evaluation index is calculated using formula (7) : (7), where ,express The mean of Indicates the number of channels in this layer; In 5.2), the structural redundancy evaluation index of the block is calculated using formula (8): : (8), It is calculated The indicator set of the required hidden layer output; l represents The hidden layer indicators in .

7. The method for evaluating the structural redundancy of an interpretable convolutional neural network based on linear separability metrics according to claim 6, wherein: The sixth step is specifically as follows: 6.1) Evaluate the change in the storage size required for the network before and after pruning: Assume that the number of parameters of the network before and after pruning is and , then the parameter number index for: (9) 6.2) Evaluate the changes in network computational efficiency before and after pruning: Assume that the floating-point operations FLOPs of the network before and after pruning are and , then the network FLOPs index for: (10) 6.3) Evaluate the changes in network classification performance before and after pruning: Use the original network's optimizer on the pruned network and hyperparameters conduct Fine-tuning, assuming that the accuracy of the network test set before pruning is , after pruning The mean accuracy of the test set after fine-tuning is , then the network performance index for: (11)。 8. The method for evaluating the structural redundancy of an interpretable convolutional neural network based on linear separability metrics according to claim 7, wherein: The number of fine-tuning in 6.3) 1-5 times.

9. The method for evaluating the structural redundancy of an interpretable convolutional neural network based on linear separability metrics according to claim 1, wherein: In 7.1), , is the indicator score weight; The value range is between.