Convolutional neural network compression method based on evolution multi-objective optimization
By automatically pruning the convolutional neural network based on the method of evolutionary multi-objective optimization, it solves the high overhead and local optimal problems of manual dependence in the existing technology, achieves efficient neural network model compression, and is suitable for a variety of devices and scene.
Patent Information
- Application Number
- CN202410522400.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-04-28
- Publication Date
- 2024-09-24
AI Technical Summary
Existing neural network model compression methods rely on manual supervision and guidance, and have problems such as high manpower and time overhead, easy to fall into local optimality, and difficulty in unifying, sharing and reusing pruning standards, especially when facing multiple resource devices and scenarios. leading to poor generalization.
The convolutional neural network compression method based on evolutionary multi-objective optimization is used to generate the initial network population by encoding the convolutional layer and fully connected layer in the trained convolutional neural network, and the evolutionary multi-objective pruning optimization model is used to perform non-linear compression. Dominate sorting and crowding distance measurement, perform genetic operations to generate new individuals, iteratively update the network population, obtain a sparse network structure, and realize automatic pruning.
It effectively solves the problem of pruning tasks easily falling into local optimality, improves the effect of automatic pruning, avoids the cost increase of repeated calculations, realizes the identification and retention of important structures in the network, and is suitable for the deployment of different devices and scenarios.
Smart Images

Figure CN118690799A
Abstract
Description
Technical Field
[0001] The present invention belongs to the field of network model compression, and in particular relates to a convolutional neural network compression method based on evolutionary multi-objective optimization. Background Art
[0002] In recent years, thanks to the development of powerful computing devices, deep neural networks (DNNs) have demonstrated excellent representation, learning and interpretation capabilities for massive and complex data, becoming a research hotspot in academia and industry. With the help of learning features such as hierarchical feature extraction, layer-by-layer processing, and built-in feature transformation, deep neural networks can build higher-dimensional and more complex models, thereby mining the deep knowledge contained in the data. However, in practical applications, existing neural network models still rely on humans to organize and arrange models and data, and it is difficult to run independently without human supervision and guidance. In particular, when facing unknown data, the neural network model structure needs to be set in advance, and there are problems with model complexity and excessive number of parameters, resulting in high storage, high power consumption, and unnecessary high requirements for training samples.
[0003] Neutral Network Pruning (NNP) is a model compression technology that reduces the size of a model by pruning redundant structures. Pruning has become one of the important research directions in the field of deep learning due to its simple and effective operation and strong generalization. Sietsma and Reed et al. found that pruning is an effective way to reduce model complexity and reduce model size, and proposed a general framework of training first and then pruning. On this basis, Castellano et al. proposed an iterative pruning method for feedforward neural networks. Through repeated training and pruning, the biological phenomenon of neural connection construction and deletion in the learning process of the brain is simulated, the network structure is dynamically optimized, and the network model complexity is reduced while ensuring the learning ability of the network. Compared with the traditional gradient-based development system, the natural heuristic optimization algorithm with stronger robustness and adaptability is more suitable for dealing with the pruning problem of neural networks. Miller and Kitano et al. used evolutionary algorithms to directly design the connection structure of neural networks, and obtained a sparse network structure with good performance from the artificially set large network structure. Whitley proposed an evolutionary algorithm for optimizing the connection and weight parameters of feedforward neural networks. This method simulates biological intelligence by fully perceiving the role of network connections, discarding redundant structures, and reducing the complexity and size of network models, thereby obtaining a new sparse network structure. As neural networks enter the deep learning stage, in 2015, Srinivas et al. proposed a new pruning method that does not rely on training data and back-propagation algorithms. This method directly sorts the network weight parameters by significance, deletes redundant connections and nodes, and quickly completes network compression.
[0004] However, existing weight pruning methods rely on manual supervision and guidance, and require expert knowledge and experienced manual operation during pruning. In view of the problem that a certain device designer cannot estimate the degree of network compression and the performance of the network after sparseness, the effect after each fine-tuning is judged to gradually decide whether to continue pruning to achieve a satisfactory sparse network result; therefore, this manual pruning method has the defects of high manpower and time overhead, and the network model optimization is prone to fall into local optimality. In addition, the pruning standards in the manual pruning process are difficult to unify, share and reuse, and in reality, it is necessary to face a variety of resource devices and scenarios (such as IOT, embedded, servers, etc.) for deployment. Repeated design by domain experts for different devices will undoubtedly be inefficient and have poor generalization.
[0005] Therefore, providing a network model compression method that can ensure certain accuracy requirements and achieve adaptive pruning of the neural network structure has become an urgent problem to be solved. Summary of the invention
[0006] In order to solve the above problems existing in the prior art, the present invention provides a convolutional neural network compression method based on evolutionary multi-objective optimization. The technical problem to be solved by the present invention is achieved through the following technical solutions:
[0007] In a first aspect, the present invention provides a convolutional neural network compression method based on evolutionary multi-objective optimization, comprising:
[0008] Encode the convolutional layers and fully connected layers in the trained convolutional neural network, and randomly generate multiple encoding individuals according to the sparse structure of the convolutional layers and fully connected layers to form the initial network population;
[0009] Decode each individual in the initial network population, and calculate the fitness function value of the convolutional neural network model accuracy and the fitness function value of the convolutional neural network parameter pruning ratio corresponding to each individual after decoding according to the evolutionary multi-objective pruning optimization model; perform non-dominated sorting and crowding distance measurement based on the fitness function value of the model accuracy and the fitness function value of the parameter pruning ratio to determine the selection probability of each individual in the initial network population;
[0010] The initial network population is used as the parent network population, and the parent individuals are randomly selected according to the selection probability of individuals in the parent network population. Genetic operations are performed to generate new offspring individuals, and the offspring individuals are stored in the offspring network population until a offspring network population of size N is generated;
[0011] The parent network population is merged with the child network population. According to the fitness function value of the model accuracy and the fitness function value of the parameter pruning ratio, non-dominated sorting, crowding distance measurement and elite retention strategy are performed to select the best top N individuals to complete a network population update.
[0012] Iterate in sequence until the maximum number of iterations is reached, complete multiple network population updates, and obtain an updated network population. According to the individuals in the updated network population, a sparse network structure is obtained as the optimal convolutional neural network model set;
[0013] Each convolutional neural network model in the optimal convolutional neural network model set is fine-tuned to achieve the best classification result for a specific input data set, and finally a group of convolutional neural network models with high classification accuracy and small network parameters are obtained.
[0014] Beneficial effects of the present invention:
[0015] The present invention provides a convolutional neural network compression method based on evolutionary multi-objective optimization, constructs an evolutionary multi-objective convolutional neural network model compression analysis framework, and the population-based evolutionary search method effectively solves the problem that the pruning task is prone to fall into local optimality. The iterative search of the population ensures the recognition and retention of important structures in the network, effectively avoids the cost increase caused by repeated calculations, and thus improves the effect of automatic pruning.
[0016] The present invention will be further described in detail below with reference to the accompanying drawings and embodiments. BRIEF DESCRIPTION OF THE DRAWINGS
[0017] Figure 1 It is a flow chart of a convolutional neural network compression method based on evolutionary multi-objective optimization provided by an embodiment of the present invention;
[0018] Figure 2 is another schematic diagram of a convolutional neural network compression method based on evolutionary multi-objective optimization provided by an embodiment of the present invention;
[0019] Figure 3 MNIST is a schematic diagram of an experimental test data set provided by an embodiment of the present invention;
[0020] Figure 4 Schematic diagram of the CIFAR-10 dataset, an experimental test dataset provided by an embodiment of the present invention;
[0021] Figure 5 is a schematic diagram of a network model encoding method based on a pruning threshold vector provided by an embodiment of the present invention;
[0022] Figure 6 is a schematic diagram of expert knowledge in the encoding method provided by an embodiment of the present invention;
[0023] Figure 7 is a schematic diagram of population initialization provided by an embodiment of the present invention;
[0024] Figure 8 is a schematic diagram of a crossover operation provided by an embodiment of the present invention;
[0025] Fig. 9 is a schematic diagram of a mutation operation provided by an embodiment of the present invention;
[0026] Fig.10 is a schematic diagram of congestion distance calculation provided by an embodiment of the present invention;
[0027] Fig.11 is a schematic diagram of an elite retention strategy provided by an embodiment of the present invention;
[0028] Fig.12 Schematic diagram of a Pareto optimal solution set for minimizing the MOP problem provided by an embodiment of the present invention;
[0029] Fig.13 1 is a schematic diagram of the Pareto frontier surface of the LeNet-300-100 model after pruning provided by an embodiment of the present invention, the left figure is the Pareto frontier surface without fine-tuning, and the right figure is the Pareto frontier surface after fine-tuning;
[0030] Fig.14 1 is a schematic diagram of the Pareto frontier surface after pruning the CONV1 model provided in an embodiment of the present invention, the left figure is the Pareto frontier surface without fine-tuning, and the right figure is the Pareto frontier surface after fine-tuning;
[0031] Fig.15 1 is a schematic diagram of the Pareto frontier surface after pruning the LeNet-5 model provided in an embodiment of the present invention, the left figure is the Pareto frontier surface without fine-tuning, and the right figure is the Pareto frontier surface after fine-tuning;
[0032] Fig.16 1 is a schematic diagram of the Pareto frontier surface after pruning the CONV3 model provided in an embodiment of the present invention, the left figure is the Pareto frontier surface without fine-tuning, and the right figure is the Pareto frontier surface after fine-tuning;
[0033] Fig.17 1 is a schematic diagram of the Pareto frontier surface after pruning the AlexNet model provided in an embodiment of the present invention, the left figure is the Pareto frontier surface without fine-tuning, and the right figure is the Pareto frontier surface after fine-tuning;
[0034] Fig.18 It is a schematic diagram of hypervolume convergence curves of five network models provided in an embodiment of the present invention. DETAILED DESCRIPTION
[0035] The present invention is further described in detail below with reference to specific embodiments, but the embodiments of the present invention are not limited thereto.
[0036] See also Figure 1 As shown, Figure 1 It is a flow chart of a convolutional neural network compression method based on evolutionary multi-objective optimization provided by an embodiment of the present invention. The convolutional neural network compression method based on evolutionary multi-objective optimization provided by the present invention includes:
[0037] S101. Obtain a trained convolutional neural network.
[0038] Specifically, in this implementation, obtaining a trained convolutional neural network includes:
[0039] Get the training dataset;
[0040] The preset convolutional neural network is trained to obtain a trained convolutional neural network, so that the trained convolutional neural network has a strong representation learning ability and interpretation ability; wherein, the trained convolutional neural network model accuracy is f(D,W n (x)), D represents the input data of the convolutional neural network, W n (x) represents the sparse network after decoding the network sparse structure x.
[0041] S102, encoding the convolutional layers and fully connected layers in the trained convolutional neural network. According to the sparse structure of the convolutional layers and the fully connected layers, a plurality of coding individuals are randomly generated to form an initial network population.
[0042] Specifically, in this embodiment, the convolutional layer and the fully connected layer in the trained convolutional neural network are encoded, and the encoding randomly generates multiple encoding individuals according to the sparse structure of the convolutional layer and the fully connected layer to form an initial network population, including:
[0043] The convolutional layer and the fully connected layer in the trained convolutional neural network are encoded. The encoding is performed layer by layer according to the sparsity of the convolutional layer and the fully connected layer. After selecting the real number encoding, a one-dimensional vector x=[t1,...,t i ,...,t n ], which is an individual p in the initial network population, n represents the sum of the number of convolutional layers and fully connected layers in the trained convolutional neural network, t i Represents the pruning threshold (i.e., sparsity) of the i-th layer of the trained convolutional neural network.
[0044] A value between 0 and 1 is randomly generated for each position in the one-dimensional vector to determine the initial sparsity of each layer of the network;
[0045] Generate an initial network population consisting of N individuals P0 = {p1, p2, ..., p N}.
[0046] S103, decoding each individual in the initial network population, calculating the fitness function value of the convolutional neural network model accuracy and the fitness function value of the convolutional neural network parameter pruning ratio corresponding to each individual after decoding according to the evolutionary multi-objective pruning optimization model, performing non-dominated sorting and crowding distance measurement according to the fitness function value of the model accuracy and the fitness function value of the parameter pruning ratio, and determining the selection probability of each individual in the initial network population;
[0047] Specifically, in this embodiment, the decoded expression is:
[0048] W n (x) = decod(x(ub-lb)+lb);
[0049] Among them, lb represents the lower limit of the threshold, ub represents the upper limit of the threshold, and decod(·) means decoding each individual in the population from a vector into a corresponding network model.
[0050] Specifically, in this embodiment, the function expression based on the multi-objective pruning model is:
[0051]
[0052] F1(x)=f(D,W n (x))x∈X n ;
[0053]
[0054] Among them, F1(x) represents the accuracy of the convolutional neural network model, D represents the input data of the convolutional neural network, x represents the sparse structure of the convolutional neural network, and X n represents the non-negative real solution space, and n represents the number of convolutional layers in the trained convolutional neural network. conv With the number of fully connected layers n fc The sum of W n (x) represents the sparse network after decoding x, F2(x) represents the pruning ratio of the convolutional neural network model, ||W n (x)|| represents the total number of weight connections in the convolutional neural network model, ||W n (x)|| l0 Represents the total number of unpruned weight connections in the convolutional neural network model.
[0055] In this embodiment, the process of non-dominated sorting includes:
[0056] For individual p in the population, update s p and n p Two indicators, when n p = 0, it means that the individuals in the population process the first layer of non-dominated frontier, that is, the first layer of non-dominated individual set H1 is obtained; where n p represents the number of individuals that dominate the population individual p, s p represents the set of all individuals dominated by individual p in the population;
[0057] The set of individuals s dominated by each individual in H1 p Search and find all the n population individuals in the individual set p The value decreases by 1. If the n that dominates the population individual p at this time p =0, then store it in the set H2, and all population individuals in H2 are the second-level non-dominated frontier;
[0058] Copy all population individuals in set H2 to H L , for H L Continue this process until all layers of the population have been marked.
[0059] In this embodiment, the crowding distance The expression of the measure is:
[0060]
[0061] in, It represents the maximum value of all individuals in the non-dominated level of the population individual p under the jth goal, represents the minimum value of all individuals in the non-dominated level of the population individual p under the jth goal, m represents the number of objective functions, the value is 2, p v+1 and p v-1 They represent the individuals adjacent to individual p respectively.
[0062] S104, taking the initial network population as the parent network population, randomly selecting parent individuals according to the selection probability of individuals in the parent network population, performing genetic operations to generate new child individuals, and storing the child individuals in the child network population until a child network population of size N is generated.
[0063] In this embodiment, the genetic operation includes a random crossover operation and a mutation operation.
[0064] The random crossover operation randomly selects M gene values from the two parent individuals p1 and p2 for the crossover operation, and the remaining nM gene values remain unchanged. The expression for the random crossover operation on the i-th gene value of two individuals is:
[0065]
[0066] in, and Respectively represent the gene value of the i-th individual in the two parent populations, and Represents the gene value of the i-th individual in the offspring population generated by random crossover operations.
[0067] The mutation operation randomly selects M gene values from the parent individual p for mutation operation, and the remaining nM gene values remain unchanged. The expression for performing the mutation operation on the i-th gene value of individual p is:
[0068]
[0069] Among them, t i represents the gene value of the i-th position of the parent population individual, It represents the gene value of the i-th individual in the offspring population generated by the mutation operation, mum represents the parameter that controls the degree of crossover, and rand(1) represents the random generation of a number between 0 and 1.
[0070] S105, merging the parent network population with the child network population, performing non-dominated sorting, crowding distance measurement and elite retention strategy according to the fitness function value of the model accuracy and the fitness function value of the parameter pruning ratio, and selecting the best top N individuals to complete a network population update.
[0071] Specifically, in this embodiment, the elite retention strategy process includes:
[0072] Perform multi-objective fitness evaluation on the individuals in the offspring population, merge the parent population and the offspring population, and perform non-dominated sorting and crowding distance measurement on the individuals in the merged population according to the fitness function value, update the non-dominated level and crowding distance of the individuals in the merged population, select better individuals from the merged population, and restore the updated network population P to the original population size N.
[0073] S106. Iterate in sequence until the maximum number of iterations is reached, complete multiple network population updates, obtain an updated network population, and obtain a sparse network structure based on the individuals in the updated network population as the optimal convolutional neural network model set.
[0074] S107. Fine-tune each convolutional neural network model in the optimal convolutional neural network model set to achieve optimal classification results for a specific input data set, and ultimately obtain a group of convolutional neural network models with high classification accuracy and a small number of network parameters.
[0075] Specifically, each convolutional neural network model in the optimal convolutional neural network model set is fine-tuned, including:
[0076] Get the test data set; use the test data set to fine-tune each convolutional neural network in the optimal convolutional neural network model set, so that the classification effect of the fine-tuned convolutional neural network is optimal. Fine-tune the weight parameters of each layer of the sparse network structure randomly initialized according to the normal distribution to ensure that there are only structural differences between different sparse networks, and then use the Adam optimizer for re-learning.
[0077] In summary, the present invention provides a convolutional neural network model compression method based on evolutionary multi-objective pruning, constructs an evolutionary multi-objective convolutional neural network model compression analysis framework, and the population-based evolutionary search method effectively solves the problem that the pruning task is prone to fall into local optimality. The iterative search of the population ensures the recognition and retention of important structures in the network, effectively avoids the cost increase caused by repeated calculations, and thus improves the effect of automatic pruning.
[0078] In an optional embodiment of the present invention, see Figure 2 , Figure 2 1 is another schematic diagram of a convolutional neural network compression method based on evolutionary multi-objective optimization provided by an embodiment of the present invention. The convolutional neural network model compression method based on evolutionary multi-objective optimization is implemented through the following process, including:
[0079] S201, training a preset convolutional neural network through a given data set D to obtain a trained convolutional neural network, so that the trained convolutional neural network has a strong representation learning ability and interpretation ability, specifically:
[0080] Get dataset D:
[0081] MNIST, the MNIST dataset is a batch of black and white handwritten images prepared by the National Institute of Standards and Technology (NST). This dataset is mainly used for the recognition of handwritten numbers. The dataset contains 70,000 images, of which the training set contains 60,000 samples and the test set contains 10,000 samples. Figure 3 As shown, Figure 3 This is a schematic diagram of the MNIST dataset, an experimental test dataset provided by an embodiment of the present invention. These handwritten digit images of 0-9 are from different high school students and staff members. Each handwritten digit image is standardized in advance, and the image size is unified to 28*28, and each digit is basically located in the center of the image.
[0082] CIFAR-10, according to the image types included, the CIFAR dataset is divided into CIFAR-10 and CIFAR-100. CIFAR-10 has a total of 60,000 images, including 10 categories, such as Figure 4 As shown, Figure 4 : This is a schematic diagram of the CIFAR-10 dataset, an experimental test dataset provided by an embodiment of the present invention. In CIFAR-10, the number of samples in each category is the same, and the size of each picture is 32*32, and all are color pictures. The training set contains 50,000 picture samples, and the number of pictures of each category in the training set is the same. The test set contains 10,000 image samples, and the number of pictures of each category is not exactly the same, and there is a certain degree of randomness.
[0083] In order to verify the generalization of the algorithm, a fully connected neural network LeNet-300-100 and four convolutional neural networks (CONV1, LeNet-5, CONV3 and AlexNet) are used in this embodiment, and the depth of the convolutional network gradually increases. It should be noted that for the smaller CIFAR-10 data set, the network structure of AlexNet has also been adjusted to a certain extent. The following table gives the structural information of the five network models and the baseline performance on the data set, as shown in Table 1.
[0084] Table 1 Specific information of convolutional neural network model
[0085]
[0086]
[0087] S202, multi-objective pruning optimization model;
[0088] In convolutional neural network model compression, the scale (sparseness) and performance of sparse networks are a set of conflicting goals. The degree of sparsity is usually used to measure the change in the scale of the network after pruning, that is, the more important structures are pruned, the smaller the network scale, the sparser the network structure, and the worse the network performance. Traditional pruning methods can usually only optimize one of the goals, that is, the network performance is optimal under the condition of determining the degree of network sparsity, or the network is more sparse under the premise of ensuring network performance. With the help of multi-objective optimization theory, a multi-objective optimization model that simultaneously optimizes network performance and network sparsity is established. In order to evaluate each individual, the function expression based on the multi-objective pruning model is:
[0089]
[0090] F1(x)=max(f(D,W n (x)))x∈X n ;
[0091]
[0092] Among them, F1(x) represents the accuracy of the convolutional neural network model, D represents the input data of the convolutional neural network, x represents the sparse structure of the convolutional neural network, and X n represents the non-negative real solution space, and n represents the number of convolutional layers in the trained convolutional neural network. conv With the number of fully connected layers n fc The sum of W n (x) represents the sparse network after decoding x, F2(x) represents the pruning ratio of the convolutional neural network model, ||W n (x)|| represents the total number of weight connections in the convolutional neural network model, ||W n (x)|| l0 Represents the total number of unpruned weight connections in the convolutional neural network model.
[0093] In this embodiment, five evaluation indicators are used, among which classification error rate (Error), compression rate (CR), remaining parameter amount (Weights) and memory (Memory) are used to evaluate the performance of sparse networks; the hyper-volume indicator (Hyper-Volume, referred to as HV) is used to evaluate the convergence of the proposed algorithm.
[0094] The classification error rate is expressed as:
[0095]
[0096] In this embodiment, the classification error rate is uniformly calculated using a test data set. The smaller the error rate, the better the performance of the sparse network.
[0097] The compression ratio is expressed as:
[0098]
[0099] In this embodiment, the greater the compression rate, the smaller the network size, and the greater the sparseness of the network structure.
[0100] The hyper-volume index (HV) is the volume of the area in the target space enclosed by the obtained non-dominated solution set and the reference point. In the target space, the hyper-volume index is expressed as:
[0101]
[0102] Among them, A = {a, b} represents the non-dominated solution set, δ represents the Lebesgue measure, and r represents the calibrated reference point.
[0103] In deep learning, hyperparameters do not need data to drive them, but are parameters that are manually adjusted before or during training. In this embodiment, the hyperparameters include population size, crossover coefficient, coefficient of variation, and number of iterations.
[0104] S203, encoding method and population initialization;
[0105] In the evolutionary algorithm, operations such as population search, crossover and mutation are all performed on chromosomes, so the individual encoding method is very important in the entire evolutionary framework. In order to consider the redundant differences in different hierarchical structures of the network in the search and realize the search for high-quality sparse networks, this embodiment designs a network model encoding method based on a pruning threshold vector. Since the proposed method mainly prunes the convolutional layers used to represent learning and the fully connected layers of cognitive abstraction, that is, the structures such as the pooling layer, BN layer and output layer in the network remain unchanged, therefore, in the process of encoding each individual convolutional neural network, only the structures contained in its convolutional layer and fully connected layer are encoded. The schematic diagram of the encoding of the individual structure of the convolutional neural network is shown in the figure. Figure 5 As shown, Figure 5 It is a schematic diagram of a network model encoding method based on a pruning threshold vector provided in an embodiment of the present invention.
[0106] In this embodiment, a one-dimensional real number vector x=[t1, t2, ..., t n ] represents the structure of the sparse network, where n is the sum of the number of convolutional layers and fully connected layers in the trained convolutional neural network. The schematic diagram of the encoding method is given by Figure 5 Given. Figure 5 A convolutional neural network consisting of a 3-layer convolutional structure, a 2-layer fully connected structure, and a pooling layer is shown. The pruning thresholds for each layer of the network can be represented by a one-dimensional decision vector from t1 to t5 from left to right. The length of the one-dimensional vector is the total number of convolutional layers and fully connected layers in the preset convolutional neural network, where t i Represents the pruning threshold (i.e., sparsity) at the i-th layer of the convolutional neural network. The network model encoding method based on the pruning threshold vector can not only accurately describe the structure of the network, but also reflect the representation characteristics and redundancy differences of network structures at different levels, making it possible to perform differentiated search and refined pruning of sparse structures at each layer of the network.
[0107] The decoded expression is:
[0108] W n (x) = decod(x(ub-lb)+lb);
[0109] Among them, lb represents the lower limit of the threshold, ub represents the upper limit of the threshold, and decod(·) means decoding each individual in the population from a vector into a corresponding network model.
[0110] Based on the proposed encoding method, the introduction of upper and lower bounds can effectively control the search space of the algorithm. More importantly, expert knowledge can be introduced by manually setting upper and lower bounds, which helps to realize the pruning search process that integrates machine guidance and human experience. Figure 6 As shown, Figure 6 It is a schematic diagram of expert knowledge in the encoding method provided in an embodiment of the present invention. When lb=0, ub=1, the individual does not contain any expert knowledge. If the characteristic boundary is set by certain expert knowledge, the individual's search will be guided by the expert knowledge, but at the same time the search will also be constrained.
[0111] In the population initialization of the algorithm, a one-dimensional decision vector of the chromosome is generated randomly. Figure 7 As shown, Figure 7 : is a schematic diagram of population initialization provided by an embodiment of the present invention. First, a one-dimensional vector of length n is generated. A real value between 0 and 1 is randomly generated for each element in the one-dimensional vector to determine the sparsity of each layer of the network, and an initial network population P0={p1, p2, ..., p N}.
[0112] S204, evolution operation operator;
[0113] As the main search methods in the evolutionary space, crossover and mutation directly affect the search efficiency of the evolutionary algorithm and the quality of the problem solution. Since the present invention uses a one-dimensional decision vector, an indirect encoding method, to represent the structure of a sparse network, the crossover and mutation operators only need to operate on the decision vector to complete the modification operation of the network sparse structure, which greatly reduces the design difficulty of the evolutionary algorithm. Based on this, the present invention uses the widely used and effective simulated binary random crossover and polynomial random mutation method to search the evolutionary space.
[0114] This embodiment uses the tournament selection strategy to randomly select two excellent chromosomes (sparse networks) as parents, and generates two daughter chromosomes (sparse networks) by simulating binary random crossover operations to achieve the population evolution task. The random crossover operation randomly selects M gene values from the two parent individuals p1 and p2 for crossover operation, and the remaining nM gene values remain unchanged. The mathematical model and schematic diagram of simulating binary random crossover operation on the i-th gene value of the two parent individuals are as follows: Figure 8 Given, Figure 8 is a schematic diagram of a crossover operation provided by an embodiment of the present invention, wherein: and are the gene values of the i-th position of the chromosomes of the two parents, respectively representing the pruning of the i-th layer of the network structure by the parents, that is, the corresponding sparse network structure. and are respectively the gene values of the i-th position of the offspring chromosome generated by simulating binary random crossover operations.
[0115]
[0116] The β in the following formula is determined by the parameter muc that controls the degree of crossover. Through the crossover operation, new chromosomes are generated, that is, a new sparse network that retains the excellent structure of the parent is generated.
[0117]
[0118] Similar to the crossover operation, the parent individual selection strategy in the mutation operation still uses the tournament method. By performing polynomial random mutation operations on the parent chromosomes, new chromosomes are generated and a new sparse network structure is obtained. The schematic diagram and mathematical model of the polynomial random mutation operation on the i-th gene value of individual p are respectively represented by Fig. 9 And the following formula gives, Fig. 9 is a schematic diagram of a mutation operation provided by an embodiment of the present invention. The mutation operation generates a new chromosome by performing a polynomial random mutation operation on the parent chromosome to obtain a new sparse network structure. The mathematical model of the polynomial random mutation operation is given by the following formula. Where, t i is the gene value of the i-th position of the parent chromosome, indicating the pruning of the i-th layer of the network structure by the parent, t i is the gene value of the i-th position of the offspring chromosome generated by the polynomial random mutation operation, and mum is the parameter that controls the degree of crossover. The sparse network corresponding to the new chromosome is generated by random mutation based on itself, which is a further exploration of its own structure.
[0119]
[0120] S205, NSGA-II;
[0121] Taking the minimization multi-objective problem as an example, for a minimization multi-objective optimization problem consisting of n variable parameters, m objective functions and k constraints, its mathematical model is as follows.
[0122]
[0123] Among them, n variables x1, x2, .., x n It is called a decision variable. The vector x composed of each decision variable is x=(x1,x2,..,x n ) is called the decision vector, and the X formed by the decision vector is called the decision space. c (x) is used to determine the feasible range of the decision vector; m objective functions f1(x), f2(x), ..., fm The vector y composed of (x) is called the target vector, and the Y formed by the target vector y is called the target space of the problem.
[0124] For any two decision vectors x1 and x2 in the decision space, there is the following definition:
[0125] 1) If and only if f v (x1)≤f v (x2) and f j (x1) <f j (x2), (p dominates q);
[0126] 2) If and only if f v (x1)≤f v (x2), (p weakly dominates q).
[0127] For a decision vector x∈X and the set And the feasible solution set X is defined as follows:
[0128] 1) The set p(A) consisting of all non-dominated solutions in set A is called the non-dominated solution set of A, and the set f(p(A)) consisting of the target vectors of all solutions in p(A) is called the non-dominated front or leading edge of A;
[0129] 2) For all feasible solution sets X, X p =p(X) is called the Pareto optimal solution set, and Y P =f(X p ) is called the Pareto optimal front end.
[0130] like Fig. 9 As shown in the figure, taking the minimization optimization problem of two objective functions as an example, the set X' consisting of decision vectors x1, x2, x3, x4 and x5 is the Pareto optimal solution set of the problem, and the set f(X') consisting of the corresponding target vectors is the Pareto optimal front end of the problem. The optimal Pareto front end approximately forms a curve in the target space, that is, Fig. 9 The black dashed line in .
[0131] NSGA-II performs iterative searches on the population, generates new solutions using crossover mutation, and retains excellent individuals through survival of the fittest after fitness evaluation, and uses them for the next evolutionary iteration until the termination conditions are met and a set of optimal solutions are output. Based on this process, NSGA-II adds two unique operations: 1) The fast non-dominated sorting strategy and crowding distance measurement strategy are proposed to address the difficulty of selecting individuals in multi-objective optimization problems; 2) The elite retention strategy is proposed to prevent excellent individuals in the parent generation from being discarded and to be retained in the new generation, thereby improving the evolutionary efficiency of the population.
[0132] Fast non-dominated sorting uses non-dominated relationships to quickly stratify the population, thereby achieving individual pros and cons comparison. In fast non-dominated sorting, assume that for individual p, it is necessary to store s p and n p Two indicators. Among them, n p represents the number of individuals that dominate individual p, s p represents the set of all individuals dominated by individual p. It can be divided into the following three steps:
[0133] For individual p in the population, update s p and n p Two indicators, when n p = 0, it means that the individuals in the population process the first layer of non-dominated frontier, that is, the first layer of non-dominated individual set H1 is obtained; where n p represents the number of individuals that dominate the population individual p, s p represents the set of all individuals dominated by individual p in the population;
[0134] The set of individuals s dominated by each individual in H1 p Search and find all the n population individuals in the individual set p The value decreases by 1, if the n that dominates the population individual p at this time p =0, then store it in the set H2, and all population individuals in H2 are the second-level non-dominated frontier;
[0135] Copy all population individuals in set H2 to H L , for H L Continue this process until all layers of the population have been marked.
[0136] See also Fig.10 , Fig.10 : This is a schematic diagram of the crowding distance calculation provided by an embodiment of the present invention. The crowding distance metric can effectively measure the distribution of individuals in the target space and compare the pros and cons of individuals belonging to the same non-dominated relationship after fast non-dominated sorting. It can be obtained by the following formula:
[0137]
[0138] in, It represents the maximum value of all individuals in the non-dominated level of the population individual p under the jth goal, represents the minimum value of all individuals in the non-dominated level of the population individual p under the jth goal, m represents the number of objective functions, the value is 2, p v+1 and p v-1 They represent the individuals adjacent to individual p. Since the boundary individuals do not have enough adjacent points, they are directly set to ∞ to prevent them from being eliminated.
[0139] The crowding distance metric can effectively measure the distribution of individuals in the target space, that is, it can compare the advantages and disadvantages of individuals belonging to the same level of non-dominated relationship after fast non-dominated sorting.
[0140] like Fig.11 As shown, Fig.11 It is a schematic diagram of the elite retention strategy provided by an embodiment of the present invention. When maintaining population updates in NSGA-II, the elite retention strategy is adopted to expand the sampling space, which can ensure that excellent individuals in the population will not be discarded, and improve the population quality and the accuracy of the optimization results. That is, before selection, the parent generation (P) and the offspring generation (C) are first merged into a new population (R). Then, the new population is quickly non-dominated sorted to generate 7 levels. Under the premise of ensuring that the population size remains unchanged, individuals are selected in order from small to large non-dominated levels; in the same level, individuals with large crowding distances are given priority, and the remaining individuals are naturally eliminated. Compared with directly eliminating the parent generation, this elite selection strategy can well retain some excellent individuals.
[0141] S206, fine-tuning;
[0142] After iterative operations such as evolutionary operations, fitness evaluation, and individual selection, this embodiment finally obtains a Pareto optimal solution set of a set of chromosomes, such as Fig.12 As shown, Fig.12It is a schematic diagram of the Pareto optimal solution set for minimizing the MOP problem provided by an embodiment of the present invention. These are a group of sparse networks of different sizes after chromosome decoding. Although these sparse networks retain important structures, there may be a loss of accuracy due to partial connection pruning, so they need to be compensated by fine-tuning. For sparse networks that retain important structures such as extracted features, very high performance can often be restored, while some sparse networks that have lost some important structures due to excessive sparsity can restore relatively little performance. Fine-tuning randomly initializes the weight parameters of each layer of the sparse network structure according to the normal distribution to ensure that there are only structural differences between different sparse networks, and then re-learns using the Adam optimizer with a learning rate of 0.001.
[0143] like Figure 2 As shown, the present invention is divided into three main steps: training network, evolutionary pruning, and fine-tuning. First, sufficient network training is performed for a specific data set to ensure that the network has strong representation learning and interpretation capabilities; then, the encoding length of the pruning threshold vector chromosome is determined for the network model, and an evolutionary multi-objective algorithm is used to perform evolutionary iterative search on chromosomes of a certain scale, and finally a set of pruning threshold vectors that balance model performance and model complexity, that is, network models with multiple sparsities, can be obtained; finally, the network is fine-tuned again using a specific data set to compensate for the precision loss of pruning, and finally multiple high-precision network models with different sparsities can be obtained.
[0144] With the help of the ability of evolutionary global search and the network model encoding method based on pruning threshold vector, the present invention can realize the separate search and adjustment of the pruning threshold of each layer, wherein the combination of the pruning thresholds of each layer is not restricted by any prior knowledge, thereby realizing more refined pruning. The algorithm autonomously learns the representation structure and redundant relationship between each layer of the network through fitness evaluation and population elite retention strategy, and searches for higher quality pruning strategies. The generation of new individuals does not rely on expert knowledge and manual operation, but is automatically generated through crossover between populations and individual mutations, which can ensure that the algorithm can search for the global optimal solution. The algorithm automatically balances the network accuracy and sparsity through fast non-dominated sorting and crowding distance measurement, avoiding the burden of manual operation and the difficulty of trade-offs. Finally, it is only necessary to select the appropriate network according to the required sparsity from the numerous sparse networks after fine-tuning.
[0145] S207, output change detection results;
[0146] In order to verify the performance of the evolutionary multi-objective convolutional neural network model compression algorithm, two types of data sets were used to perform pruning operations on five convolutional neural network models of different sizes. The effectiveness of the proposed algorithm was verified by comparing it with three more classic convolutional neural network model compression algorithms. The three compared algorithms are: manual pruning method based on a unified pruning threshold (NaiveCut), manual pruning method based on L2 norm significance ranking (L2-pruning), and iterative automatic pruning method based on particle swarm optimization (MOPSO). Among them, the L2-pruning method uses a manually designed L2 norm judgment standard and uses different pruning thresholds for each layer of the network; although MOPSO also uses a multi-objective optimization model, due to the limitation of the algorithm framework, the algorithm can only output a sparse network.
[0147] In the embodiment, the specific parameters of the proposed evolutionary multi-objective pruning algorithm are shown in Table 2.
[0148] Table 2 Parameter settings of evolutionary multi-objective pruning algorithm
[0149]
[0150]
[0151] In order to more intuitively demonstrate the effectiveness of the proposed algorithm, the results with similar accuracy or sparsity to the three comparison algorithms are selected from the results of the algorithm operation for comparative analysis.
[0152] Table 3 shows the performance comparison of the four pruning algorithms at similar error levels, and the best results are marked in bold. Obviously, for each convolutional neural network model, the experimental results of the evolutionary multi-objective convolutional neural network model compression algorithm are the best. Compared with the other three methods, the proposed algorithm obtains the smallest sparse network classification error, the largest network sparsity, and the remaining parameters of the compression model and the storage requirements are also at the minimum.
[0153] Table 3 Performance comparison of four algorithms at similar error levels
[0154]
[0155]
[0156] Taking LeNet-300-100 as an example, this embodiment achieved the lowest error rate of 3.63% while achieving the highest compression of the network of 6.4, with only 41501 weight parameters left in the network; compression rates of 29.3, 26.7 and 26.4 were achieved on CONV1, LeNet-5 and CONV3 networks respectively, which is much higher than the suboptimal 20, 14.3 and 16.7 in the same group of experiments, and the classification error of the present invention is the smallest on these three network models, which fully demonstrates that the proposed algorithm can search for higher quality sparse networks. On the larger AlexNet network, although the degree of network compression is not as obvious as the above three networks, compared with other methods, the performance of this embodiment is still the best, 7.5 percentage points lower than the suboptimal L2-pruning in classification error, and 96KB less storage resource requirements.
[0157] Table 4 shows the performance comparison of four pruning algorithms under similar sparsity. The network model pruned by the present invention not only has the highest compression rate among the five network models, but also has a much lower classification error rate than other methods. For example, the classification error rate on the LeNet-5 network is 1.27% lower than the suboptimal L2-pruning method. In summary, the evolutionary multi-objective pruning algorithm proposed in the present invention can automatically search for sparse networks of higher quality (smaller size and higher performance) than other methods.
[0158] Table 4 Performance comparison of four algorithms under similar sparsity
[0159]
[0160]
[0161] In order to verify the influence of the refined pruning strategy on the quality of sparse networks, the present invention is compared with two different manual pruning methods, NaiveCut method and L2-pruning. In each experiment, a group of un-fine-tuned sparse network structures are selected. The sparsity of these networks is the same, but due to the use of different pruning strategies, the sparsity of each layer of the network is not the same. In the case of un-fine-tuning, the classification error of the sparse network is evaluated only by the remaining network structure, so it can directly reflect the importance of these structures, and then evaluate the pros and cons of the pruning strategy. The results are shown in Table 5, Table 6 and Table 7.
[0162] Table 5 Pruning results of LeNet-300-100 network by three methods (CR=20)
[0163]
[0164] Table 6 Pruning results of CONV1 network by three methods (CR=33.3)
[0165]
[0166]
[0167] Table 7 Pruning strategies of three methods for CONV1 network (CR=50)
[0168] Network Layer Structure Type Parameter scale NaiveCut L2 pruning Our First layer CR Convolutional Layer 200 50 1.5 2 Second layer CR Fully connected 270400 50 192.3 59.5 Third layer CR Fully connected 24000 50 6.4 28.7 Fourth layer CR Fully connected 1200 50 2 3.56 sum —— —— 50 50 50.7 Error —— —— 88.65% 75.97% 27.31%
[0169] Obviously, the method of NaiveCut using the same pruning strategy to uniformly prune each layer of the network is the simplest, but it ignores the redundancy differences of different layers, resulting in the largest classification error of the pruned network model. L2-pruning takes this difference characteristic into account and achieves a lower classification error than NaiveCut. When the total network compression is the same, as shown in Table 5, the proposed algorithm prunes more network weights and connections on the second and third layers than other methods. Among them, the compression rate of the third layer in this embodiment is 2.8, which is much higher than the 1.3 of the L2-pruning method, but the classification error of this embodiment is the best, indicating that the pruning of each layer of the network by the proposed algorithm is more in line with the redundancy of the network. By reasonably allocating the pruning conditions of each network layer, more important structures in the original network are retained when the same amount of weights are pruned.
[0170] Secondly, although L2-pruning takes redundant differences into account, as the overall compression rate increases, the compression rate of each layer also increases; while the algorithm proposed in this embodiment has some increases and decreases in the pruning distribution of each layer, such as the pruning changes in Table 7 and Table 8, where the compression rate of the third layer increases from 15 to 28.7 and the fourth layer decreases from 9.3 to 3.56, and the algorithm still maintains a lower classification error, indicating that the algorithm can identify more important combinations in the dependency characteristics between network layers and retain a higher quality sparse structure.
[0171] This embodiment can obtain a set of non-dominated sparse network solutions after one run. Fig.13 The left figure shows the LeNet-300-100 network result. Each point on the curve represents a sparse network model. Compared with the traditional method that can only obtain one network model per run, the efficiency of the algorithm proposed in this embodiment in obtaining sparse network models is greatly improved. Although the accuracy of the model decreases significantly with the increase of sparsity, the accuracy of all models is greatly improved after fine-tuning. Fig.13As shown in the right figure, when the sparsity of the LeNet-300-100 network model exceeds 90%, the accuracy of the algorithm drops significantly. This result can prove that the algorithm proposed in this embodiment is not only more efficient in calculation, but also can obtain a sparse network that meets higher accuracy. These sparse networks are not only smaller, more accurate, and more suitable for deployment on devices than those designed by manual methods, but can also provide networks for devices with different hardware resources and scenario requirements at the same time, solving the problem of repeated design and high manpower overhead of manual methods.
[0172] Unlike 90% of the LeNet-300-100 network, Fig.14 In the middle left figure, when the convolutional network CONV1 pruned more than 97% of the network parameters, the accuracy of the sparse network dropped significantly. After fine-tuning, the sparse network can still achieve more than 90% accuracy performance despite 99% of the parameters being pruned. Fig.14 In the middle right figure, a sparse network with almost 99.8% of its parameters pruned can be fine-tuned to recover from 10% accuracy to nearly 70% accuracy; this has extremely important application value for some embedded devices (such as smart watches) that allow a certain loss of accuracy but have extremely demanding storage requirements. It also shows that CONV1, which introduces a convolutional structure, can learn more critical features for the MNIST dataset than LeNET-300-100. In pruning, by retaining these representation structures, higher performance can be achieved at a very small network scale. This is also the purpose of fine-tuning the algorithm design, that is, to find more critical representation structures in the network through reasonable allocation.
[0173] As the number of convolutional layers increases, Fig.15 After pruning more than 90% of the parameters of the LeNet-5 network in the middle left figure, the accuracy of the sparse network began to drop significantly, lower than 97% of CONV1; Fig.15 The CONV3 network in the middle right figure has a significant drop in accuracy after pruning more than 99% of the parameters, which is higher than 97% of CONV1 and 90% of LeNet-5. Obviously, although changes in network structure have a direct impact on network performance, artificial experience based on sensory experience may not be effective at all times, so it is even more important to search the network globally.
[0174] like Fig.17 As shown in the figure, since the complexity of CIFAR10 data is much higher than that of the handwritten digit dataset MINST, AlexNet lost 60% of its accuracy after pruning more than 85% of its parameters, but the sparse network was able to recover as before through fine-tuning. This shows that AlexNet only needs 15% of the parameters and structure to achieve the same accuracy as the original large network, and the present invention successfully found a sparse network structure containing important representation structures in the original network.
[0175] Fig.18 The hypervolume evolution curve of the pruning result of the present invention on the network model is given. Fig.18 As shown in (a), on the LeNet-300-100 network, the proposed algorithm starts to converge after about 20 generations, while Fig.18 CONV1 in (b) and Fig.18 (c) The LeNet-5 network converges at about the 40th generation; Fig.18 The CONV3 network in (d) is about the 20th generation, because the search space of CONV3 may be simpler, and more than 50 generations on the AlexNet network still do not reflect the trend of convergence. This result shows that, except the AlexNet model, the present embodiment has found a solution set close to the search limit of the present embodiment in other four network models. If it is necessary to find a solution set with better performance, it is necessary to design a more efficient search method. For the AlexNet model, 50 iterations cannot meet the computing requirements of the model. Although increasing the number of iterations is the simplest and most direct means, considering the reasons for the computing cost, the demand for designing an efficient pruning strategy is more urgent. It can be seen from this that as the network depth gradually deepens and the search space becomes larger and more complex, the search efficiency of the algorithm is more obvious on the impact of the algorithm performance, and an efficient automatic pruning search strategy is particularly necessary.
[0176] The above contents are further detailed descriptions of the present invention in combination with specific preferred embodiments, and it cannot be determined that the specific implementation of the present invention is limited to these descriptions. For ordinary technicians in the technical field to which the present invention belongs, several simple deductions or substitutions can be made without departing from the concept of the present invention, which should be regarded as falling within the protection scope of the present invention.
Claims
1. A convolutional neural network compression method based on evolutionary multi-objective optimization, It is characterized in that include: Encoding the convolutional layer and the fully connected layer in the trained convolutional neural network, and randomly generating a plurality of encoding individuals according to the sparse structure of the convolutional layer and the fully connected layer to form an initial network population; Decode each individual in the initial network population, and calculate the fitness function value of the convolutional neural network model accuracy and the fitness function value of the convolutional neural network parameter pruning ratio corresponding to each individual after decoding according to the evolutionary multi-objective pruning optimization model; perform non-dominated sorting and crowding distance measurement according to the fitness function value of the model accuracy and the fitness function value of the parameter pruning ratio to determine the selection probability of each individual in the initial network population; Taking the initial network population as the parent network population, randomly selecting parent individuals according to the selection probability of individuals in the parent network population, performing genetic operations to generate new offspring individuals, and storing the offspring individuals in the offspring network population until a offspring network population of size N is generated; The parent network population is merged with the child network population, and non-dominated sorting, crowding distance measurement and elite retention strategy are performed according to the fitness function value of the model accuracy and the fitness function value of the parameter pruning ratio, and the best top N individuals are selected to complete a network population update; Iterate in sequence until the maximum number of iterations is reached, and multiple network population updates are completed to obtain an updated network population, and a sparse network structure is obtained according to individuals in the updated network population as an optimal convolutional neural network model set; Each convolutional neural network model in the optimal convolutional neural network model set is fine-tuned to achieve the best classification result for a specific input data set, and finally a group of convolutional neural network models with high classification accuracy and small network parameters are obtained.
2. The convolutional neural network compression method based on evolutionary multi-objective optimization according to claim 1, It is characterized in that The process of acquiring the trained convolutional neural network includes: Get the training dataset; The preset convolutional neural network is trained to obtain a trained convolutional neural network, so that the trained convolutional neural network has strong representation learning ability and interpretation ability; wherein the trained convolutional neural network model accuracy is f(D,W n (x)), D represents the input data of the convolutional neural network, W n (x) represents the sparse network after decoding the network sparse structure x.
3. The convolutional neural network compression method based on evolutionary multi-objective optimization according to claim 1, It is characterized in that The convolutional layer and the fully connected layer in the trained convolutional neural network are encoded, and according to the sparse structure of the convolutional layer and the fully connected layer, a plurality of encoding individuals are randomly generated to form an initial network population, including: The convolutional layer and the fully connected layer in the trained convolutional neural network are encoded, and the encoding is performed layer by layer according to the sparsity of the convolutional layer and the fully connected layer. After selecting the real number encoding, a one-dimensional vector x=[t 1 ,...,t i ,...,t n ], which is an individual p in the initial network population, n represents the sum of the number of convolutional layers and fully connected layers in the trained convolutional neural network, t i represents the pruning threshold of the i-th layer of the trained convolutional neural network; Randomly generate a value between 0 and 1 for each position in the one-dimensional vector to determine the initial sparsity of each layer of the network; Generate an initial network population P consisting of N individuals 0 ={p 1 ,p 2 ,...,p N }.
4. The convolutional neural network compression method based on evolutionary multi-objective optimization according to claim 1, It is characterized in that The functional expression of the evolutionary multi-objective pruning model is: F 1 (x)=f(D,W n (x))x∈X n ; Among them, F 1 (x) represents the accuracy of the convolutional neural network model, D represents the input data of the convolutional neural network, x represents the sparse structure of the convolutional neural network, and X n represents the non-negative real solution space, and n represents the number of convolutional layers in the trained convolutional neural network. conv With the number of fully connected layers n fc The sum of W n (x) represents the sparse network after decoding x, F 2 (x) represents the pruning ratio of the convolutional neural network model, ||W n (x)|| represents the total number of weight connections in the convolutional neural network model, ||W n (x)|| l0 Represents the total number of unpruned weight connections in the convolutional neural network model.
5. The convolutional neural network compression method based on evolutionary multi-objective optimization according to claim 1, It is characterized in that The decoding expression is: W n (x)=decod(x(ub-lb)+lb); Among them, lb represents the lower limit of the threshold, ub represents the upper limit of the threshold, and decod(·) represents decoding the vector into the corresponding network model for each individual in the population.
6. The convolutional neural network compression method based on evolutionary multi-objective optimization according to claim 1, It is characterized in that The non-dominated sorting process includes: For individual p in the population, update s p and n p Two indicators, when n p = 0, it means that the individuals in the population process the first layer of non-dominated frontier, that is, the first layer of non-dominated individual set H is obtained. 1 ; where n p represents the number of individuals that dominate the population individual p, s p represents the set of all individuals dominated by individual p in the population; For H 1 The set of individuals dominated by each individual in the population is s p Search and set the individual set s p The number of all individuals in the population n p The value decreases by 1. If the n that dominates the population individual p at this time p =0, then store it in the set H 2 Middle, H 2 All individuals in the population are the second-layer non-dominated frontier; Set H 2 All individuals in the population are copied to H L , for H L Continue this process until all layers of the population have been marked.
7. The convolutional neural network compression method based on evolutionary multi-objective optimization according to claim 1, It is characterized in that The crowding distance The expression of the measure is: in, It represents the maximum value of all individuals in the non-dominated level of the population individual p under the jth goal, represents the minimum value of all individuals in the non-dominated level of the population individual p under the jth objective, m represents the number of objective functions, m = 2, p v+1 and p v-1 They represent the individuals adjacent to individual p respectively.
8. The convolutional neural network compression method based on evolutionary multi-objective optimization according to claim 1, It is characterized in that The method of using the initial network population as a parent network population, randomly selecting a parent individual according to the selection probability of individuals in the parent network population, performing genetic operations to generate new child individuals, and storing the child individuals in the child network population until a child network population of size N is generated includes: Genetic operations include random crossover operations and mutation operations; The random crossover operation selects two parent individuals p 1 and p 2 Randomly select M gene values for crossover operation, and the remaining nM gene values remain unchanged; the expression for random crossover operation of the i-th gene value of two individuals is: in, and Respectively represent the gene value of the i-th individual in the two parent populations, and Represents the gene value of the i-th individual in the offspring population generated by random crossover operations; The mutation operation randomly selects M gene values from the parent individual p for mutation operation, and the remaining nM gene values remain unchanged; the expression for performing the mutation operation on the i-th gene value of individual p is: Among them, t i represents the gene value of the i-th position of the parent population individual, It represents the gene value of the i-th individual in the offspring population generated by the mutation operation, mum represents the parameter that controls the degree of crossover, and rand(1) represents the random generation of a number between 0 and 1.
9. The convolutional neural network compression method based on evolutionary multi-objective optimization according to claim 1, It is characterized in that The elite retention strategy includes: A multi-objective fitness evaluation is performed on the individuals of the offspring population, the parent population and the offspring population are merged, and the individuals of the merged population are non-dominated sorted and the crowding distance is measured according to the fitness function value, the non-dominated level and crowding distance of the individuals of the merged population are updated, and better individuals are selected from the merged population, so that the updated network population P is restored to the original population size N.
10. The convolutional neural network compression method based on evolutionary multi-objective optimization according to claim 1, It is characterized in that The step of fine-tuning each convolutional neural network model in the optimal convolutional neural network model set includes: Acquire a test data set; use the test data set to fine-tune each convolutional neural network in the optimal convolutional neural network model set, so that the classification effect of the fine-tuned convolutional neural network is optimal; fine-tune the weight parameters of each layer structure of the sparse network to be randomly initialized according to a normal distribution to ensure that there are only structural differences between different sparse networks, and then use the Adam optimizer to re-learn.
Citation Information
Cited By
Chip production logistics optimization method and system based on multi-objective genetic algorithm
CN119378960A
Multi-objective optimization method for rapeseed oil processing parameters and related device
CN119476349A
Multi-target analysis method for industrial edge scene heterogeneous convolutional neural network
CN119512750A
Multi-objective analysis method for heterogeneous convolutional neural network facing industrial edge scene
CN119512750B
Cottonseed protein peptide enzymolysis extraction method based on machine learning optimization and application of cottonseed protein peptide enzymolysis extraction method
CN120199335A
