Reinforcement learning based iterative convolutional neural network pruning method

By employing an iterative convolutional neural network pruning method based on reinforcement learning, this approach utilizes higher-order singular value decomposition and the global minimum cut algorithm to calculate network layer cohesion. Combined with a reinforcement learning framework, it performs multi-stage pruning, thus addressing the problem of unreasonable pruning strategies in existing technologies and achieving higher compression rates while preserving accuracy.

CN121168539BActive Publication Date: 2026-02-03QUANZHOU INST OF EQUIP MFG +1
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202511704955.X
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2025-11-20
Publication Date
2026-02-03
Estimated Expiration
2045-11-20

AI Technical Summary

Technical Problem

Existing structured pruning techniques ignore the static differences and dynamic changes between different layers of a neural network, which makes it impossible for pruning strategies to achieve the optimal balance between model accuracy and compression ratio, thus limiting the effectiveness of pruning techniques in practical applications.

Method used

An iterative convolutional neural network pruning method based on reinforcement learning is adopted. The structural cohesion measure of the network layer is calculated by high-order singular value decomposition and global minimum cut algorithm. Multi-stage pruning is carried out in combination with reinforcement learning framework, and the pruning strategy is dynamically adjusted to adapt to changes in network state.

Benefits of technology

It achieves higher compression ratio and inference speedup with the same model accuracy loss, or maintains higher model accuracy with the same compression ratio, avoiding blind equalization and protection of redundant layers, and improving pruning effect.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121168539B_ABST
    Figure CN121168539B_ABST
Patent Text Reader

Abstract

The present application relates to the field of computer vision, and more particularly to a reinforcement learning-based iterative convolutional neural network pruning method, S1: according to the task type, the historical image of the task type is acquired, the historical image is preprocessed and labeled, a data set is constructed, and the data set is divided into a training set, a validation set and a test set according to a preset ratio; S2: an initial convolutional neural network model is constructed, the training set is used to train the initial convolutional neural network model, and a pre-training converged model is output; S3: a multi-stage pruning operation is performed on the pre-training converged model; S4: a convolutional neural network model trained through performance recovery in the last pruning stage is output; the present application combines scientific quantification of inter-layer redundancy and dynamic adjustment of pruning strategies, effectively improves the compression efficiency and precision retention capability of the neural network model, and optimizes the model performance while significantly reducing the parameter quantity and computational quantity.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present application relates to the field of computer vision, and in particular to a method for iterative pruning of convolutional neural networks based on reinforcement learning. BACKGROUND

[0002] In recent years, deep neural networks represented by convolutional neural networks (CNN) have achieved outstanding performance in various computer vision tasks such as image classification, object detection and image segmentation. In order to improve the feature extraction and expression ability of the model, the depth and width of the neural network are constantly increasing, resulting in a sharp increase in the number of model parameters and computational complexity. On the one hand, the huge parameter size brings huge storage overhead; on the other hand, the complex calculation process causes significant inference delay. These problems greatly limit the deployment and application of high-performance neural networks on edge devices with limited computing resources and storage space such as mobile terminals and embedded systems. Therefore, under the premise of not losing too much model accuracy, effectively compressing the neural network model has become a key technical problem to be solved in this field.

[0003] Model pruning is a mainstream model compression technique that removes redundant parameters in the network to reduce its complexity. Existing pruning techniques can be generally divided into two categories: unstructured pruning and structured pruning. Unstructured pruning removes independent weight parameters, resulting in a sparse and irregular weight matrix. Although this method can achieve a very high compression ratio, the sparse model generated often requires special hardware or sparse computing library support to achieve effective inference acceleration, and its generalizability is poor. Structured pruning, on the other hand, removes entire filters or neurons and other regular structures, generating a smaller but structured dense subnetwork. This subnetwork can run efficiently on general computing platforms without any special hardware or software libraries, making it more practical. The present application is developed on the technical route of structured pruning.

[0004] A common problem with existing structured pruning techniques is the unreasonable inter-layer allocation of pruning strategies. Different layers of a neural network have different contributions to the overall performance of the model and different sensitivities to pruning operations due to their different positions and functions in the network. However, most existing pruning methods tend to set the same fixed pruning rate for all layers to be pruned. This pruning strategy ignores two key issues. First, it ignores the inherent and static importance differences between different layers of a neural network, which can easily lead to excessive pruning of key layers and insufficient pruning of redundant layers, making it difficult to achieve an optimal balance between model accuracy and compression ratio. Second, it ignores the dynamics of the pruning process, i.e., the relative importance of the remaining layers evolves after some network structures are removed. The fixed pruning strategy cannot adapt to this dynamic change, causing the pruning decision to deviate from the optimal path in the subsequent stages.

[0005] Therefore, the prior art cannot adapt to the inherent static differences between network layers and cannot respond to the dynamic changes in the importance between layers during the pruning process due to the use of fixed and uniform inter-layer pruning rates, resulting in a difficult balance between model accuracy and compression rate, which greatly limits the effect of pruning technology in practical applications. SUMMARY

[0006] The application aims to provide a reinforcement learning-based iterative convolutional neural network pruning method with better pruning effect.

[0007] To achieve the above-mentioned purpose, the application adopts the following technical solution:

[0008] The reinforcement learning-based iterative convolutional neural network pruning method comprises the following steps executed in sequence:

[0009] S1: According to the task type, a historical image of the task type is obtained, the historical image is preprocessed and labeled, a data set is constructed, and the data set is divided into a training set, a validation set and a test set according to a preset ratio;

[0010] S2: Based on the task type of step S1, an initial convolutional neural network model is constructed or obtained, and the training set is used to train the initial convolutional neural network model until it reaches a convergence state on the validation set, and a pre-training convergence model is output;

[0011] S3: The pre-training convergence model is subjected to a multi-stage pruning operation, and the multi-stage pruning operation specifically comprises the following steps executed iteratively:

[0012] S3-1: Set the macro parameters of the pruning strategy, which include the single pruning granularity and the total number of pruning stages;

[0013] S3-2: Obtain the to-be-pruned neural network model and the target network layer set of the current pruning stage, and the target network layer set includes all convolutional layers and fully connected layers in the to-be-pruned neural network model except the output layer;

[0014] S3-3: Calculate the structural cohesion measure of each target convolutional layer based on high-order singular value decomposition and global minimum cut algorithm;

[0015] S3-4: Estimate the structural cohesion measure of each target fully connected layer;

[0016] S3-5: Summarize the structural cohesion measures of all target network layers to form a measure vector, and perform sum normalization processing on the measure vector to obtain an initial inter-layer pruning proportion vector of the current pruning stage, and each element of the initial inter-layer pruning proportion vector represents the initial weight of the corresponding network layer in the pruning task of the current pruning stage.

[0017] S3-6: performing multi-round reinforcement learning-based inter-layer pruning ratio dynamic optimization and pruning execution of the current pruning stage to obtain an optimal pruned model;

[0018] S3-7: performing performance recovery training on the optimal pruned model obtained in step S3-6;

[0019] S3-8: taking the optimal pruned model obtained in step S3-7 as the input of the next pruning stage, repeating steps S3-2 to S3-8 until all pruning stages are executed and the total pruning rate reaches the preset global target value;

[0020] S4: outputting the convolutional neural network model after performance recovery training in the last pruning stage.

[0021] Preferably, the specific calculation steps of step S3-3 are as follows: for each filter in the layer, apply high-order singular value decomposition to decompose it into a set of low-dimensional two-dimensional tensors as the structured representation of the filter;

[0022] Based on the structured representation, the similarity between any two filters in the layer is calculated;

[0023] Construct a weighted undirected complete graph model of the convolutional layer, where the nodes of the graph correspond to the filters, and the weight of the edge connecting any two nodes is the similarity between the two filters;

[0024] On the weighted undirected complete graph, apply a global minimum cut algorithm to calculate the minimum cost of dividing the weighted undirected complete graph into two subgraphs, which is defined as the structural cohesion measure of the convolutional layer.

[0025] Preferably, in step S3-4, the calculation method of the structural cohesion measure of the target fully connected layer is: identifying several convolutional layers adjacent to the fully connected layer and having the same output dimension, and calculating the arithmetic mean of the structural cohesion measures of these convolutional layers as the structural cohesion measure of the target fully connected layer.

[0026] Preferably, the specific steps of step S3-6 are as follows:

[0027] S3-6-1: defining the state of the neural network model to be pruned in the current pruning stage as the state of reinforcement learning;

[0028] S3-6-2: adopting A greedy strategy is used to generate an inter-layer pruning ratio vector, which is defined as an action:

[0029] Exploration: with an exploration rate An exploratory interlayer pruning ratio vector is generated. In the first round of exploration, this interlayer pruning ratio vector is generated by superimposing a preset distribution of random noise on the initial baseline interlayer pruning ratio vector generated in S3-5. In subsequent explorations, it is perturbed based on the baseline interlayer pruning ratio updated in the previous round.

[0030] Utilize: using probability The best inter-layer pruning ratio in history is selected from the experience replay pool as a benchmark, and random noise is superimposed on it to generate an inter-layer pruning ratio vector that performs a fine search in the vicinity of the current best solution.

[0031] S3-6-3: Based on the currently generated inter-layer pruning ratio vector and the pruning granularity of this stage, calculate the number of filters or neurons that need to be removed from each target network layer.

[0032] S3-6-4: Within each target network layer, a preset structural importance evaluation criterion is used to rank the importance of all filters or neurons within the target network layer, and the lowest importance is removed according to the number of filters to be removed calculated in S3-6-3.

[0033] S3-6-5: After performing the pruning operation, evaluate the performance of the pruned model on the validation set and calculate the reward value for this action according to the preset reward function.

[0034] S3-6-6: Store the inter-layer pruning ratio vector, reward value and performance information of the pruned model in this round of optimization as an experience unit in the experience replay pool;

[0035] S3-6-7: Update the relevant parameters for reinforcement learning. The specific steps are as follows:

[0036] Update exploration rate The threshold is gradually lowered as training progresses, transitioning from extensive exploration in the early stages to precise utilization in the later stages.

[0037] Update the baseline ratio for the next round of exploration. The update method is: New baseline ratio = Old baseline ratio + Learning rate × (Optimal ratio in the experience replay pool - Old baseline ratio).

[0038] S3-6-8: Use the updated parameters in step S3-6-7 as the new parameters for the next round of dynamic optimization, and repeat steps S3-6-2 to S3-6-8 until the preset number of optimizations is completed. Obtain the optimal pruning model for the current pruning stage from the experience replay pool.

[0039] By adopting the aforementioned design scheme, the beneficial effects of this invention are: This application provides a novel and scientific quantification method for the redundancy of network layers from the perspective of the intrinsic structure of the filter and the strength of intra-layer connections through higher-order singular value decomposition and global minimum cut algorithm, making the allocation of the initial pruning ratio more based on evidence and avoiding blind equal distribution;

[0040] This application introduces a reinforcement learning framework to model the pruning process as a dynamic decision-making process. It not only considers the initial static differences of the network layers, but also responds in real time to the changes in the network state caused by the pruning operation through exploration and experience replay mechanisms, and dynamically adjusts the pruning strategy so that it always approaches the optimal solution throughout the entire pruning process.

[0041] Through the aforementioned scientific initialization and dynamic adaptive adjustment, this application can more accurately allocate pruning pressure to the network layer with the highest redundancy, while effectively protecting the critical layers. This results in higher compression ratio and inference speedup with the same loss of model accuracy, or higher model accuracy with the same compression ratio. Attached Figure Description

[0042] Figure 1 This is a schematic diagram of the method for calculating the similarity between any two filters within a convolutional layer according to the present invention;

[0043] Figure 2 This is a schematic diagram of the method for calculating the cohesion measure of convolutional layer structure using the global minimum cut algorithm according to the present invention;

[0044] Figure 3 This is a schematic diagram of the dynamic optimization of inter-layer pruning ratio and pruning execution based on reinforcement learning in this invention;

[0045] Figure 4 This is the flowchart of the core method of the model pruning module of this invention. Detailed Implementation

[0046] To make the objectives, technical solutions, and advantages of this invention clearer, the invention will be further described in detail below with reference to the accompanying drawings. Obviously, the described embodiments are merely some embodiments of this invention, and not all embodiments. Based on the embodiments of this invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this invention.

[0047] The terms "first," "second," "third," etc., used in the specification, claims, and accompanying drawings of this invention are used to distinguish different objects, not to describe a specific order. Furthermore, the terms "comprising" and "having," and any variations thereof, are intended to cover non-exclusive inclusion. For example, a process, method, system, product, or apparatus that includes a series of steps or units is not limited to the listed steps or units, but may optionally include steps or units not listed, or may optionally include other steps or units inherent to these processes, methods, products, or apparatuses.

[0048] Iterative convolutional neural network pruning methods based on reinforcement learning, such as Figure 4 As shown, the steps are executed sequentially as follows:

[0049] S1: Based on the task type, such as image classification or object detection, acquire a large number of historical images of that task type, preprocess and label the historical images, construct a dataset, and divide the dataset into training set, validation set, and test set according to a preset ratio. In this embodiment, the preprocessing of historical images needs to be set according to the specific task type: for classification tasks, denoising and normalization can be used, while for detection or segmentation tasks, geometric correction and edge enhancement can be added. The data partitioning ratio can be flexibly set according to the sample size. When the data volume is sufficient, it is 7:2:1; when the data volume is small, it can be adjusted to 8:1:1; and for small sample scenarios, a 9:1 partitioning or cross-validation scheme can be used.

[0050] S2: Based on the task type in step S1, construct or obtain an initial convolutional neural network model, use the training set to train the initial convolutional neural network model until it reaches convergence on the validation set, and output the pre-trained converged model.

[0051] S3: The weight parameters of each neural network layer in the pre-trained convergent model have learned the image features of the dataset. The weight parameters and network structure of each network layer are used as input to the pruning module for pruning operations. That is, a multi-stage pruning operation is performed on the pre-trained convergent model. The specific pruning operation includes the following iterative steps:

[0052] S3-1: Set the macro parameters of the pruning strategy, which include the granularity of a single pruning and the total number of pruning stages; for example, if the global total pruning rate is set to 80% and the pruning granularity of each stage is 5%, then the entire process will be divided into 16 pruning stages.

[0053] S3-2: Obtain the neural network model to be pruned and the target network layer set in the current pruning stage. The target network layer set includes all convolutional layers and fully connected layers in the neural network model to be pruned, except for the output layer.

[0054] S3-3: Calculate the structural cohesion measure of each target convolutional layer based on high-order singular value decomposition and global minimum cut algorithm;

[0055] The specific calculation steps of step S3-3 are as follows: For each filter in this layer, apply High-Order Singular Value Decomposition (HOSVD) to decompose it into a set of low-dimensional two-dimensional tensors, which serve as the structured representation of the filter.

[0056] like Figure 1 As shown, based on this structured representation, the similarity between any two filters in this layer is calculated. In a specific embodiment, this similarity measure is obtained by calculating the cosine similarity of the two-dimensional tensor components corresponding to the two filters and taking the arithmetic mean.

[0057] Construct a weighted undirected complete graph model for this convolutional layer, where the nodes of the graph correspond to filters, and the weight of the edge connecting any two nodes is the similarity between the two filters.

[0058] like Figure 2 As shown, on the weighted undirected complete graph, the global minimum cut algorithm is applied to calculate the minimum cost of dividing the graph into two subgraphs. This minimum cost is defined as a measure of the structural cohesion of the convolutional layer; a higher value indicates higher redundancy of the layer's filters. In a specific embodiment, the Stoer-Wagner algorithm can be used to calculate the minimum cut cost.

[0059] S3-4: Estimate the structural cohesion metric of each target fully connected layer; in the convolutional neural network, identify several convolutional layers that are adjacent to the fully connected layer and have the same output dimension, and calculate the arithmetic mean of the structural cohesion metrics of these convolutional layers as the structural cohesion metric of the fully connected layer.

[0060] S3-5: Summarize the structural cohesion measures of all target network layers to form a measurement vector. Perform summation and normalization on the measurement vector to obtain the initial baseline inter-layer pruning ratio vector for the current pruning stage. Each element of the initial baseline inter-layer pruning ratio vector represents the initial weight of the pruning task that the corresponding network layer should undertake in the current pruning stage.

[0061] S3-6: As Figure 3 As shown, multiple rounds of reinforcement learning-based dynamic optimization of inter-layer pruning ratios and pruning execution are performed in the current pruning stage to obtain the optimal pruning model;

[0062] The specific steps of step S3-6 are as follows:

[0063] S3-6-1: Define the state of the neural network model to be pruned in the current pruning stage as the reinforcement learning state.

[0064] S3-6-2: Adopt A greedy strategy generates an inter-layer pruning ratio vector to balance exploration and exploitation. This inter-layer pruning ratio vector is defined as an action.

[0065] Exploration: based on the exploration rate An exploratory interlayer pruning ratio vector is generated. In the first round of exploration, this interlayer pruning ratio vector is generated by superimposing a preset distribution of random noise on the initial baseline interlayer pruning ratio vector generated in S3-5. In subsequent explorations, it is perturbed based on the baseline ratio updated in the previous round.

[0066] Utilize: using probability The best inter-layer pruning ratio in history is selected from the experience replay pool as a benchmark, and random noise is superimposed on it to generate an inter-layer pruning ratio vector that performs a fine search in the vicinity of the current best solution.

[0067] S3-6-3: Based on the currently generated inter-layer pruning ratio vector and the pruning granularity of this stage, calculate the number of filters or neurons that need to be removed from each target network layer.

[0068] S3-6-4: Within each target network layer, a preset structural importance evaluation criterion is used to rank the importance of all filters or neurons within the target network layer, and the lowest importance is removed according to the number of removals calculated in S3-6-3; in a specific embodiment, a gradient importance evaluation method based on Taylor expansion can be used as the structural importance evaluation criterion.

[0069] S3-6-5: After performing the pruning operation, the performance of the pruned model is evaluated on the validation set, and the reward value of this action is calculated according to the preset reward function. The reward function is a weighted sum of the accuracy change rate, parameter compression rate and computational cost reduction rate evaluated on the validation set, thereby calculating the reward value of the current action.

[0070] S3-6-6: Store the inter-layer pruning ratio vector (the action of this round of optimization), reward value and performance information of the model after pruning as an experience unit in the Experience Replay Buffer.

[0071] S3-6-7: Update the relevant parameters for reinforcement learning. The specific steps are as follows:

[0072] Update exploration rate The threshold is gradually lowered as training progresses, transitioning from extensive exploration in the early stages to precise utilization in the later stages.

[0073] The baseline ratio used for the next round of exploration is updated, which is the initial baseline inter-layer pruning ratio. The update method is: new baseline ratio = old baseline ratio + learning rate × (optimal ratio in the experience replay pool - old baseline ratio). In this way, subsequent explorations can dynamically focus on the currently discovered optimal solution region, thereby accelerating convergence.

[0074] S3-6-8: Use the updated parameters from step S3-6-7 as the new parameters for the next round of dynamic optimization, and repeat steps S3-6-2 to S3-6-8 until the preset number of optimization attempts is completed. Obtain the optimal pruning model for the current pruning stage from the experience replay pool. The number of dynamic optimization attempts can be set according to the actual network requirements.

[0075] S3-7: Perform performance recovery training on the optimal pruned model obtained in step S3-6-8 to compensate for the decrease in accuracy caused by parameter removal. In a preferred embodiment, knowledge distillation is used, with the model before pruning as the teacher model and the model after pruning as the student model, and several rounds of recovery training are performed using the training set and the validation set.

[0076] S3-8: Use the optimal pruning model obtained from the performance recovery training in step S3-7 as the input for the next pruning stage. Repeat steps S3-2 to S3-8 until all pruning stages are completed and the total pruning rate reaches the preset global target value.

[0077] S4: Output the convolutional neural network model trained for performance recovery in the last pruning stage, and output the comparison data of the pruned convolutional neural network model in terms of key indicators such as accuracy, number of parameters, computational cost, and storage requirements before and after pruning.

[0078] To demonstrate the effectiveness and general applicability of the proposed reinforcement learning-based iterative convolutional neural network pruning method in neural networks, this invention uses the CIFAR-10 dataset to implement the method on three widely used neural network models for classification tasks and evaluate their performance: ResNet18, GoogleNet, and VGG16. These models cover various architectural features, such as residual connections, cascaded connections, and squeeze and reward modules, effectively demonstrating the robustness of this invention. Experimental results are as follows:

[0079]

[0080] Where Top1-acc represents the probability that the highest confidence category predicted by the model matches the true label; Top5-acc represents the probability that the top five confidence categories predicted by the model contain the true label;

[0081] GFLOPs stands for one billion floating-point operations per second, which measures the computational complexity of a model.

[0082] Para (MB) represents the storage space occupied by the model parameters, in MB. The Fil-Neu number represents the total number of convolutional kernels and fully connected neurons in the model, excluding the output layer.

[0083] Mem (GB) represents the memory resources consumed by the model during inference or training, expressed in GB.

[0084] File Size (MB) represents the space occupied by the model weight file on the disk, expressed in MB.

[0085] Unlike traditional one-time large-scale pruning methods, this application adopts a stepwise pruning strategy. At each stage, the reinforcement learning agent makes decisions based on the importance distribution between model layers, thereby dynamically and finely adjusting the pruning ratio of different layers. This design avoids the imbalance problem of inter-layer pruning caused by a globally uniform threshold or fixed ratio, making the compression of redundant parameters more reasonable and efficient. Experimental results show that stepwise pruning can maintain the stability of model performance at a high compression rate. On ResNet18 and GoogLeNet, even when the cumulative pruning rate reaches 60%, the decrease in Top-1 accuracy is still controlled at around 1%; on VGG16, the first 40% pruning even brings a slight improvement in accuracy, exhibiting a similar effect to regularization. This phenomenon fully demonstrates that, compared to traditional one-time large-scale pruning which easily leads to a sharp drop in accuracy, stepwise pruning can gradually adapt to changes in network structure at each stage, allowing the model to gradually adjust the parameter distribution during convergence, thereby mitigating performance degradation. Even with a cumulative pruning rate of 80%, the Top1 accuracy of the three models remained above 92%, demonstrating that the stepwise pruning strategy still maintains strong robustness under extreme compression conditions.

[0086] Meanwhile, computational complexity and storage costs decreased significantly with iterative pruning. After 80% pruning, ResNet18 reduced GFLOPs by 93.31%, parameter compression by 96.43%, and model file size and GPU memory requirements to approximately 3.7% and 3.6% of their original values, respectively. GoogleNet and VGG16 showed similar trends, both achieving over 90% parameter and storage compression while maintaining accuracy. Compared to traditional methods, this gradual compression process better aligns with the adaptive nature of models: replacing large-scale, one-time destruction with small, phased adjustments allows the network to gradually eliminate redundant computations while preserving its core feature representation capabilities.

[0087] The specific embodiments described above further illustrate the purpose, technical solution, and beneficial effects of the present invention. It should be understood that the above description is only a specific embodiment of the present invention and is not intended to limit the scope of protection of the present invention. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of the present invention should be included within the scope of protection of the present invention.

Claims

1. An iterative convolutional neural network pruning method based on reinforcement learning, characterized in that: The steps are as follows, performed sequentially: S1: Based on the task type, obtain historical images of that task type, preprocess and label the historical images, construct a dataset, and divide the dataset into training set, validation set and test set according to a preset ratio; S2: Based on the task type in step S1, construct or obtain an initial convolutional neural network model, use the training set to train the initial convolutional neural network model until it reaches convergence on the validation set, and output the pre-trained converged model. S3: Perform multi-stage pruning on the pre-trained converged model. The multi-stage pruning operation specifically includes the following iterative steps: S3-1: Set the macroscopic parameters of the pruning strategy, including the single pruning granularity and the total number of pruning stages; S3-2: Obtain the neural network model to be pruned and the target network layer set in the current pruning stage; the target network layer set includes all convolutional layers and fully connected layers in the neural network model to be pruned, except for the output layer; S3-3: Calculate the structural cohesion measure of each target convolutional layer based on high-order singular value decomposition and global minimum cut algorithm; S3-4: Estimate the structural cohesion measure of each target fully connected layer; S3-5: Summarize the structural cohesion measures of all target network layers to form a measurement vector. Perform summation and normalization on the measurement vector to obtain the initial baseline inter-layer pruning ratio vector for the current pruning stage. Each element of the initial baseline inter-layer pruning ratio vector represents the initial weight of the pruning task that the corresponding network layer should undertake in the current pruning stage. S3-6: Perform multiple rounds of reinforcement learning-based dynamic optimization of inter-layer pruning ratios and pruning execution in the current pruning stage to obtain the optimal pruning model; Steps S3-6 include using The greedy strategy generates an inter-layer pruning ratio vector and defines this inter-layer pruning ratio vector as an action. After performing the pruning operation, the performance of the pruned model is evaluated on the validation set, and the reward value for this action is calculated according to the preset reward function. The inter-layer pruning ratio vector, reward value, and performance information of the pruned model in this round of optimization are stored as an experience unit in the experience replay pool. S3-7: Perform performance recovery training on the optimal pruning model obtained from the pruning operation in step S3-6; S3-8: Use the optimal pruning model trained for performance recovery in step S3-7 as the input for the next pruning stage, and repeat steps S3-2 to S3-8 until all pruning stages are completed and the total pruning rate reaches the preset global target value. S4: Output the convolutional neural network model trained for performance recovery during the last pruning stage.

2. The iterative convolutional neural network pruning method based on reinforcement learning as described in claim 1, characterized in that: The specific calculation steps of step S3-3 are as follows: For each filter in this layer, apply higher-order singular value decomposition to decompose it into a set of low-dimensional two-dimensional tensors, which serve as the structured representation of the filter. Based on this structured representation, the similarity between any two filters within this layer is calculated; Construct a weighted undirected complete graph model for this convolutional layer, where the nodes of the graph correspond to filters, and the weight of the edge connecting any two nodes is the similarity between the two filters. On the weighted undirected complete graph, the global minimum cut algorithm is applied to calculate the minimum cost of dividing the weighted undirected complete graph into two subgraphs. This minimum cost is defined as the structural cohesion measure of the convolutional layer.

3. The iterative convolutional neural network pruning method based on reinforcement learning as described in claim 2, characterized in that: In steps S3-4, the calculation method for the structural cohesion metric of the target fully connected layer is as follows: identify several convolutional layers that are adjacent to the fully connected layer and have the same output dimension, and calculate the arithmetic mean of the structural cohesion metrics of these convolutional layers as the structural cohesion metric of the target fully connected layer.

4. The iterative convolutional neural network pruning method based on reinforcement learning as described in claim 3, characterized in that: The specific steps of step S3-6 are as follows: S3-6-1: Define the state of the neural network model to be pruned in the current pruning stage as the state of reinforcement learning; S3-6-2: Adopt The greedy strategy generates an inter-level pruning ratio vector, and the specific steps of defining this inter-level pruning ratio vector for one action are as follows: Exploration: Based on exploration rate An exploratory interlayer pruning ratio vector is generated. In the first round of exploration, this interlayer pruning ratio vector is generated by superimposing a preset distribution of random noise on the initial baseline interlayer pruning ratio vector generated in S3-5. In subsequent explorations, it is perturbed based on the baseline interlayer pruning ratio updated in the previous round. Utilize: using probability The best inter-layer pruning ratio in history is selected from the experience replay pool as a benchmark, and random noise is superimposed on it to generate an inter-layer pruning ratio vector that performs a fine search in the vicinity of the current best solution. S3-6-3: Based on the currently generated inter-layer pruning ratio vector and the pruning granularity of this stage, calculate the number of filters or neurons that need to be removed from each target network layer. S3-6-4: Within each target network layer, a preset structural importance evaluation criterion is used to rank all filters or neurons within the target network layer by importance, and the least important ones are removed until the required number of removals is reached. S3-6-5: After performing the pruning operation, evaluate the performance of the pruned model on the validation set and calculate the reward value for this action according to the preset reward function. S3-6-6: Store the inter-layer pruning ratio vector, reward value and performance information of the pruned model in this round of optimization as an experience unit in the experience replay pool; S3-6-7: Update the relevant parameters for reinforcement learning. The specific steps are as follows: Update exploration rate The threshold is gradually lowered as training progresses, transitioning from extensive exploration in the early stages to precise utilization in the later stages. Update the baseline ratio for the next round of exploration. The update method is: New baseline ratio = Old baseline ratio + Learning rate × (Optimal ratio in the experience replay pool - Old baseline ratio). S3-6-8: Use the updated parameters in step S3-6-7 as the new parameters for the next round of dynamic optimization, and repeat steps S3-6-2 to S3-6-8 until the preset number of optimizations is completed. Obtain the optimal pruning model for the current pruning stage from the experience replay pool.

Citation Information

Patent Citations

  • Pruning method and device for convolutional neural network, equipment and medium

    CN113011588A

  • Deep convolutional neural network quantization pruning joint optimization method and system

    CN116167413A