Agent model-assisted evolutionary generative adversarial network architecture search method and system
Through the evolutionary generative adversarial network architecture search method assisted by proxy model, the problem of pattern crash and gradient disappearance during the generative adversarial network training process is solved, and the search efficiency is improved, and more efficient generative adversarial network architecture search is achieved, reducing the computational cost. .
Patent Information
- Application Number
- CN202411300567.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-09-18
- Publication Date
- 2024-11-29
- Estimated Expiration
- 2044-09-18
AI Technical Summary
The existing generative adversarial networks are prone to falling into the problem of pattern crashes and gradient disappearance during training, and the evolutionary generative adversarial network architecture is low in search efficiency, resulting in high computational cost.
Using the proxy model-assisted evolutionary generative adversarial network architecture search method, by constructing generative adversarial networks, initializing particle populations and proxy models, updating populations using non-dominant sorting and particle swarm algorithms, and predicting the performance of network architecture through support vector machines to reduce the performance of the network architecture. The necessary training process improves search efficiency.
It effectively alleviates the instability of generative adversarial network training, significantly reduces the time consumption of the search process, finds a better generative adversarial network architecture, and improves the performance of generative adversarial network.
Smart Images

Figure CN118821905B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of deep neural network technology, and in particular to a proxy model-assisted evolutionary generative adversarial network architecture search method and system. Background Art
[0002] Generative adversarial networks were proposed in 2014. Due to its innovative ideas, generative adversarial networks have had a profound impact on deep learning and generative model research. Generative adversarial networks introduce an adversarial learning framework for generators and discriminators. By continuously optimizing the competitive relationship between the generator and the discriminator, the generator can generate more realistic samples. GAN has many advantages, making it an important tool in the field of generative models in deep learning. First, GAN is not limited to a single neighborhood and can be used to generate multimodal data, such as from text to image and from image to text. Second, GAN has a certain degree of controllability, and the quality and diversity of generated samples can be affected by adjusting the structure and hyperparameters of the generator and discriminator. Finally, GAN performs well in transfer learning and data augmentation. It can generate samples on the source domain and then use the generator for target domain tasks. However, GAN still faces some challenges. For example, generative adversarial networks are prone to mode collapse and gradient vanishing problems during training; in some special cases, generative adversarial networks will have the problem of generating low-quality images; in small sample generation tasks, generated images often have problems of missing details and class imbalance. Therefore, how to solve these problems to improve the performance of generative adversarial networks is a very meaningful research direction.
[0003] In response to the problem that the existing generative adversarial network training process is prone to mode collapse and gradient vanishing, researchers proposed using evolutionary neural network architecture search to improve the stability of generative adversarial network training. Neural architecture search is proposed to automatically discover high-performance deep neural network architectures. The three most widely used categories for neural network architecture search are evolutionary algorithms, reinforcement learning, and gradient descent algorithms. Evolutionary neural architecture search has become a topic of extensive research because its implementation does not require a lot of prior knowledge about the problem and can be used directly. However, evolutionary neural architecture search may involve a large number of performance evaluations of candidate architectures, resulting in high computational costs and requiring a lot of resources.
[0004] Surrogate models are another approach used to accelerate neural network architecture evaluation. A "surrogate" model is a computationally cheap model that is trained to predict / simulate the accuracy of candidate architectures without the computationally expensive training of the architecture. Surrogate models currently used in neural network architecture search can be divided into two categories: the first category uses regression models to predict the accuracy of architectures, while the second category uses classification models to compare pairs of architectures and predict which of the two has the highest accuracy. Surrogate models belonging to the second category have gradually become prominent in this subfield due to their small prediction errors and the fact that they can be naturally embedded into evolutionary algorithms. Therefore, in order to solve the problems that the existing generative adversarial network training process is prone to mode collapse and gradient vanishing and the low efficiency of evolutionary generative adversarial network architecture search, it is necessary to propose evolutionary generative adversarial network architecture search assisted by surrogate models. Summary of the invention
[0005] Purpose of the invention: The technical problem to be solved by the present invention is to provide a proxy model-assisted evolutionary generative adversarial network architecture search method and system in view of the deficiencies of the prior art. The method comprises the following steps:
[0006] Step 1: Build a generative adversarial network;
[0007] Step 2: Initialize and generate a certain number of generative adversarial network architectures and train them to generate training data sets and train the proxy model;
[0008] Step 3: Initialize the particle population, set the historical optimal solution of each individual, and use non-dominated sorting to select the global optimal solution;
[0009] Step 4: Use the proxy model to select potential network architectures from the population, train the selected network architectures, and use non-dominated sorting and particle swarm optimization to update the population;
[0010] Step 5, update the proxy model training dataset and retrain the proxy model;
[0011] Step 6: Repeat steps 4 and 5 until the particle swarm algorithm reaches the target number of generations and selects the network architecture for retraining.
[0012] In step 1, the generative adversarial network architecture consists of a fully connected layer and multiple cells. Each cell can be represented by a directed acyclic graph, which usually consists of an input node, an output node and several intermediate nodes. Among them, the edges connecting different intermediate nodes perform some operations, process the data of the input nodes, and finally output the results by the output nodes. Among them, the edges connecting the input nodes will use upsampling operations, usually including "nearest neighbor interpolation", "bilinear interpolation" and "transposed convolution" and other operations to convert low-resolution feature maps into high-resolution images. The edges connecting two intermediate nodes or output nodes usually use various convolution operations, usually including: 3*3 convolution, 5*5 convolution and jump connection operations, to achieve effective feature extraction, information fusion and resolution adjustment, so as to improve the performance and performance of the model.
[0013] In order to more clearly express the network architecture of the generative adversarial network, the present invention uses a 1*n matrix to express a cell, where n represents the number of edges in each cell. Each cell is encoded separately, and finally an N*n matrix is formed to express a network architecture, where N is the number of cells in the network architecture. Each edge randomly selects an operation from its operation candidate pool to form a network architecture.
[0014] Furthermore, in step 1, the network architecture of the generative adversarial network includes a fully connected layer and 3 stacked cells, each cell contains 5 nodes and 7 edges, wherein the 7 edges are divided into 2 upsampling edges and 5 convolution edges, the upsampling edges will be selected from 3 upsampling operations, and the convolution edges will be selected from 7 convolution operations; each cell is regarded as a directed acyclic graph, the edges represent candidate operations, and the nodes represent the processed feature graphs;
[0015] The i-th cell is represented by , where i ranges from 1 to 3, , Represents the operations corresponding to the two upsampling edges, Represents the operation corresponding to the first convolution edge; stacking three cells to obtain the corresponding encoding of the network architecture of the generative adversarial network .
[0016] In step 2, the proxy model is a small model. Generally speaking, it takes a lot of time and effort to train a large neural network. The proxy model is trained by using an architecture with known accuracy to map the architecture and their performance values. Therefore, when a new neural network architecture is generated, its performance can be directly predicted by the trained proxy model. In addition to using regression-based proxy models to directly predict the accuracy of the network architecture, another method is to use a classification model to compare the resulting network architecture and predict which architecture will perform better. The pairwise comparison method has a smaller prediction error and is suitable for the process of the evolutionary algorithm.
[0017] The present invention adopts support vector machine as a proxy model. Support vector machine is a supervised learning model for classification and regression tasks. It is particularly good at processing linear and nonlinear classification problems, and can find the best classification boundary to distinguish data of different categories. Therefore, it is used as a proxy model to distinguish the pros and cons of two network architectures. In order to better evaluate the generative neural adversarial network, the present invention selects the IS and FID values of the generative adversarial network as network evaluation indicators. IS evaluates the quality and diversity of the image by calculating the entropy of the class prediction distribution of the generated image, while FID evaluates the image quality by calculating the Fréchet distance between the Inception network feature distribution of the generated image and the real image. The higher the IS value and the lower the FID value, the better the network performance.
[0018] Furthermore, in step 2, m generative adversarial network architectures are randomly generated and trained to form a proxy model dataset. ; N m Represents the mth generative adversarial network architecture; m is generally taken as 30;
[0019] Randomly divide the dataset set into training datasets And the test dataset ;
[0020] The following method is used to combine any two generative adversarial network architectures: the training dataset set train And the test dataset set test The network architecture encoding in is re-encoded in the form of one-hot encoding. The network architecture after one-hot encoding is One-hot encoding represents each category as a binary vector of length L, where L is the total number of categories. In this vector, only the position corresponding to the category is 1, and the other positions are 0. This prevents the machine learning algorithm from misunderstanding the numerical relationship between categories, thereby causing calculation errors. Randomly extract the training data set settrain Any two generative adversarial network architectures and ,Will and Directly splice to form proxy model input data , by comparing two generative adversarial network architectures and The Frechet Inception Distance (FID) and the image quality score (IS) value are used to label the input data. label ,if label The value is 1, indicating that the Fréchet index distance FID and image quality score IS of the first network architecture are better than those of the second network architecture. label A value of 0 indicates that the Fréchet index distance FID and image quality score IS of the second network architecture are better than those of the first network architecture;
[0021] The training data set is trained by the method set train Any two generative adversarial network architectures in the above are combined in pairs, and the support vector machine SVM is trained to obtain the proxy model; for a data set with n network architectures, a total of n (n-1) data can be generated by combining them in pairs. set test The proxy model performance is tested by combining the data from the proxy model. If the classification accuracy of the proxy model is greater than the threshold of 80%, the proxy model is used to predict the performance of the network architecture. Otherwise, several main network architectures are generated and added to the proxy model dataset to retrain the proxy model.
[0022] In step 3, the particle swarm optimization algorithm initializes a random speed for each individual in the population, so that these data can be used to determine the flight direction of the particle. Each particle remembers the current best particle position and records the best position it has reached in history. With these two pieces of information, it moves in the solution space and continuously searches for a better solution. Initialize the particle population , N i represents the i-th neural network architecture, n is the number of individuals in the population; at the same time, the position and speed are randomly initialized, N i The position is represented by , is the position of the ith individual in the dth dimension; N i Speed , is the velocity of the i-th individual in the d-th dimension;
[0023] Train the initialized individuals to obtain the fitness value , , They are the FID and IS values corresponding to the network architecture;
[0024] At the same time, the i-th neural network architecture N i The historical optimal solution is pbest i , initialized to pbest i = fitness i Since FID and IS are two optimization objectives, non-dominated sorting is used to sort and select the network architecture with excellent performance. Non-dominated sorting is an important step for classifying solution sets in multi-objective optimization. It is used to divide the population into different non-dominated fronts, each of which represents a set of solutions that do not have a dominant relationship with each other. The individuals at the first front represent the set of solutions with the best current fitness value. Non-dominated sorting is used to sort the individuals in the particle population P0, and the set of individuals at the first front in the population is set as the global optimal solution of the current population. .
[0025] Step 4 includes:
[0026] Step 4.1, iterate the population using the population update formula;
[0027] Step 4.2: Use the proxy model to predict the network architecture with excellent performance and train it;
[0028] Step 4.3, update the historical optimal solution and the global optimal solution of each individual in the population.
[0029] In step 4.1, the population is iterated according to the following formula:
[0030] , (1)
[0031] , (2)
[0032] in, is the inertia factor, Determines the ratio of the next particle update speed to the current speed; k represents the number of current iterations; , It is the acceleration factor (or learning factor) to prevent the speed from being too high or too low; , A random number between 0 and 1; is the velocity of the i-th particle of the k-th generation in the d-th dimension, is the position of the i-th particle of the k-th generation in the d-th dimension; pbestid is the position of the individual extreme point of the ith particle in the dth dimension, gbest d is the position of all extreme points of the entire group in the dth dimension. Usually set and To limit the maximum position and maximum speed of the particle in the dimension direction.
[0033] In step 4.2, traverse all individuals in the current population, for any individual N i , N i and pbest i The corresponding network architectures are one-hot encoded, and the resulting encoding structures are and , according to the method in step 2 and Combine to form the proxy model input , the proxy model is input Send it to the proxy model to get the corresponding output. If the output result is 1, it means that N i The network architecture performs better than pbest i architecture, and for N i The network architecture is trained to obtain the true accuracy fitness i ; If the output result is 0, it means N i The network architecture performs worse than pbest i Architecture, fitness i The value is set to 0; at the same time, all the network architectures being trained in the current era are recorded to build a new set of training network architectures , t is the number of new training network architectures, N t Represents the tth new training network architecture.
[0034] Step 4.3 includes: obtaining the fitness value corresponding to each individual in the current population after the update according to step 4.2, updating the historical optimal solution and the global optimal solution of the individuals in the population by using non-dominated sorting, and i , if individual N i of fitness i Complete domination pbest i , that is, individual N i The FID and IS values of the network architecture are better than the corresponding values of the historical optimal solution. pbest i = fitness i ;if fitnessi and pbest i For a non-dominant relationship, , i.e. save randomly fitness i and pbest i one of; if fitness i quilt pbest i Domination, then pbest i Remain unchanged; incorporate the newly trained individuals into the global optimal solution gbest , select the individuals in the first frontier position through non-dominated sorting to form a new global optimal solution gbest .
[0035] In step 5, the new training network architecture is collected set new The network architecture in is added to the proxy model dataset set. According to the operation in step 2, the training dataset and test dataset of the proxy model are re-divided, and the proxy model is retrained and tested. If the proxy model does not reach the accuracy threshold, all individuals of the next generation are trained to obtain their true performance. If the proxy model reaches the accuracy threshold, the proxy model is continued to be used to predict the network architecture performance.
[0036] In step 6, after the population has iterated to the target generation, the global optimal solution gbest All individuals in the network are retrained, and finally a generative adversarial network that meets the task requirements is selected.
[0037] The present invention also provides a proxy model-assisted evolutionary generative adversarial network architecture search system, including an encoding module, a training module and an optimization module;
[0038] The encoding module is used to construct a generative adversarial network, initialize the generative adversarial network architecture and perform training to generate a training data set and train the agent model; initialize the particle population, set the historical optimal solution of each individual, and use non-dominated sorting to select the global optimal solution;
[0039] The training module uses the proxy model to select potential network architectures in the population, and trains the selected network architectures, while using non-dominated sorting and particle swarm algorithm to update the population; updates the proxy model training data set and retrains the proxy model;
[0040] The optimization module repeats the steps performed by the training module until the particle swarm algorithm reaches the target number of generations, and selects the network architecture for retraining.
[0041] The present invention introduces a method for searching neural network architectures to effectively alleviate the instability problem of generative adversarial network training. In order to be able to search for a more stable generative adversarial network architecture from multiple angles, the present invention designs a multi-objective evolutionary search algorithm for multiple evaluation indicators of the generative adversarial network, and fully considers the network architecture that is better under different indicators. At the same time, in order to reduce the time consumption of the search process, this project intends to study the proxy model to accelerate the evolution of the generative adversarial network architecture search. This method has achieved better results than existing methods.
[0042] The beneficial effects of the present invention are:
[0043] The method of the present invention proposes a proxy model-assisted evolutionary generative adversarial network architecture search method for generative adversarial networks. The method encodes the generator network architecture in the generative adversarial neural network and performs evolutionary search on the network architecture, while accelerating the search process by using a proxy model. In this method, we propose a proxy model, which assists in the evolutionary search process of the generative adversarial neural network by predicting the dominance relationship between architectures, thereby avoiding the training process of some architectures and directly performing non-dominated sorting on the neural architecture. At the same time, the whole process is implemented by a particle swarm algorithm. The substitution model based on the comparison relationship can better adapt to the particle swarm algorithm and find a set of better non-dominated solutions in a shorter time. This proxy model-assisted evolutionary generative adversarial network architecture search method brings new methods and ideas to the field of generative adversarial network architecture search, and has high practical value and broad application prospects. BRIEF DESCRIPTION OF THE DRAWINGS
[0044] Figure 1 This is a diagram of the architecture of the generative adversarial network in the present invention.
[0045] Figure 2 Construct a graph for the proxy model dataset in the present invention.
[0046] Figure 3 It is a schematic diagram of the evolutionary search process after filtering by the proxy model.
[0047] Figure 4 It is a performance diagram of all training individuals. DETAILED DESCRIPTION
[0048] The present invention will be further described in detail below in conjunction with the accompanying drawings and specific embodiments, and the above and / or other advantages of the present invention will become more clear.
[0049] In a specific embodiment of the present invention, a proxy model-assisted evolutionary generative adversarial network architecture search method and system are provided. Figure 1Taking the search space containing 7 connection edges, 2 upsampling candidate operations and 7 convolution candidate operations as an example, the implementation process and details of the proxy model-assisted evolutionary generative adversarial network architecture search method and system proposed in the present invention will be introduced in detail. The method specifically includes:
[0050] Step 1: Figure 1 As shown, the present invention proposes a generative adversarial network architecture search space and encoding method. Figure 1 The middle part is the overall framework of the network, which consists of a fully connected layer and three cells. By processing the generated random noise, the target image is finally generated. The search space of each cell is as follows Figure 1 As shown below, the search space contains a total of 5 nodes and 7 edges. The candidate operations in the generative adversarial network are divided into 3 upsampling operations and 7 convolution operations. The topological connections of the upsampling operations include and , the topological connections of the convolution operation include , , and The upsampling operations include three candidate operations: "nearest neighbor sampling", "bilinear interpolation sampling" and "3×3 transposed convolution", while the convolution operations include "none", "skip-connection", "conv 1×1 (dilation=1)", "conv 3×3 (dilation=1)", "conv 5×5 (dilation=1)", "conv 3×3 (dilation=2)" and "conv 5×5 (dilation=1)". The two types of operations are encoded separately, with the encoding range of upsampling operations being 0~2 and the range of convolution operations being 0~6. Through this encoding method, a 3*7 matrix is finally constructed to represent the network architecture, such as Figure 1 As shown in the upper part. Through this step, the spatial encoding of the generative adversarial network is obtained for the subsequent evolution process.
[0051] Step 2: First, 60 network architectures are randomly initialized, and the proxy model training set and test set are divided into 8:2 ratios. In order to train the proxy model, if the integer encoding form is used directly, it is easy to cause machine learning to misunderstand the category data due to the different distances between the data. Therefore, the present invention uses One-hot encoding to re-encode the network architecture and construct the proxy model training data set. Since the number of candidate operations for upsampling operations and convolution operations is different, this paper designs one-hot encodings of different lengths for different operation types. Specifically, the upsampling operation uses a One-hot encoding of length 3, while the conventional operation uses a One-hot encoding of length 6. For example, the code corresponding to "nearest neighbor sampling" is '001', the code corresponding to "bilinear interpolation sampling" is '010', and the code corresponding to "none" is '0000001', the code corresponding to "skip-connection" is '0000010', and the code corresponding to "conv 1×1 (dilation= 1)" is '0000100'; the rest are deduced by analogy. Therefore, the encoding length of one cell is 41 (3*2+7*5), and the encoding length of the entire network architecture is 123 (41*3). Then, the encodings of two arbitrary network architectures are concatenated to form the proxy model input data, such as Figure 2 As shown in the figure, we concatenate the 123-dimensional vector containing the first structural information and the 123-dimensional vector containing the second structural information to form a vector that provides 246-dimensional input information for the proxy model. Then, the IS and FID values of the two structures are compared respectively. If the IS value and FID value of the first structure are better than the second network structure, the label is set to 1; otherwise, it is set to 0. In this way, a training sample of a proxy model is established. In this way, the proxy model is trained and tested. If the test accuracy of the proxy model is higher than 80%, the model is used. If the accuracy is less than 80%, 10 more samples are randomly generated and the above steps are repeated to ensure the performance of the proxy model.
[0052] Step 3: First randomly initialize the particle swarm , a total of 30 individuals in the population. At the same time, randomly initialize N i The position and velocity of , the speed is . Train the initialized individuals to obtain their fitness values , and are the FID and IS values corresponding to their network architectures. Set N i The historical optimal solution of is its current value . Use Pareto sorting to Sort the individuals in the population and set the first frontier individual set in the population as the global optimal solution of the current population. . Get the fitness value, historical optimal solution and global optimal solution of each individual in the current population.
[0053] Step 4: Evolve the GAN architecture and use the proxy model to assist. The specific process includes the following steps:
[0054] Step 4.1, iterate the population using the population update formula;
[0055] Step 4.2: Use the proxy model to predict the network architecture with excellent performance and train it;
[0056] Step 4.3, update the historical optimal solution and the global optimal solution of each individual in the population.
[0057] In step 4.1, the population is iterated according to the following formula:
[0058] , (1)
[0059] , (2)
[0060] in, is the inertia factor, Determines the ratio of the next particle update speed to the current speed; k represents the number of current iterations; , It is the acceleration factor (or learning factor) to prevent the speed from being too high or too low; , A random number between 0 and 1; is the velocity of the i-th particle of the k-th generation in the d-th dimension, is the position of the i-th particle of the k-th generation in the d-th dimension; pbest id is the position of the individual extreme point of the ith particle in the dth dimension, gbest d is the position of all extreme points of the entire group in the dth dimension. Usually set and To limit the maximum position and maximum speed of the particle in the dimension direction.
[0061] In step 4.2, traverse all individuals in the current population, for any individual N i , N i and pbest i The corresponding network architectures are one-hot encoded, and the resulting encoding structures are and , according to the method in step 2 and Combine to form the proxy model input , the proxy model is input Send it to the proxy model to get the corresponding output. If the output result is 1, it means that N i The network architecture performs better than pbest i architecture, and for N i The network architecture is trained to obtain the true accuracy fitness i ; If the output result is 0, it means N i The network architecture performs worse than pbest i Architecture, fitness i The value is set to 0; at the same time, all the network architectures being trained in the current era are recorded to build a new set of training network architectures , t is the number of new training network architectures, N t Represents the tth new training network architecture.
[0062] Step 4.3 includes: obtaining the fitness value corresponding to each individual in the current population after the update according to step 4.2, updating the historical optimal solution and the global optimal solution of the individuals in the population by using non-dominated sorting, and i , if individual N i of fitness i Complete domination pbest i , that is, individual N i The FID and IS values of the network architecture are better than the corresponding values of the historical optimal solution. pbest i = fitness i ;if fitness i and pbest i For a non-dominant relationship, , i.e. save randomly fitness i and pbest i one of; if fitness i quilt pbest i Domination, then pbest i Remain unchanged; incorporate the newly trained individuals into the global optimal solution gbest , select the individuals in the first frontier position through non-dominated sorting to form a new global optimal solution gbest .
[0063] Step 5: Set the new training network architecture set new The network architecture in is added to the proxy model dataset set. According to the operation in step 2, the training dataset and test dataset of the proxy model are re-divided, and the proxy model is retrained and tested. If the proxy model does not reach the accuracy threshold, all individuals of the next generation are trained to obtain their true performance. If the proxy model reaches the accuracy threshold, the proxy model is continued to be used to predict the network architecture performance.
[0064] Step 6: Repeat steps 4 and 5. When the population has iterated to 50 generations, stop iterating and select the optimal solution. gbest All individuals in the network are retrained, and finally a generative adversarial network that meets the task requirements is selected. The final network architecture obtained by this method is:
[0065] [['Bilinear Interpolation', 'Bilinear Interpolation', 'Skip-connection', 'Skip-connection', 'Conv1x1 (dilation=1)', 'Skip-connection'];
[0066] ['Nearest Neighbor Interpolation', 'Bilinear Interpolation', 'Conv1x1(dilation=1)', 'Skip-connection', 'Skip-connection', 'Conv1x1 (dilation=1)', 'Conv1x1 (dilation=1)'];
[0067] ['Bilinear Interpolation', 'Nearest Neighbor Interpolation', 'Conv5x5(dilation=1)', 'Conv1x1 (dilation=1), 'Conv3x3 (dilation=1)', 'Conv5x5(dilation=2)', 'Conv1x1 (dilation=1)']];
[0068] Among them, Bilinear Interpolation means bilinear interpolation, Nearest NeighborInterpolation means nearest neighbor interpolation, Skip-connection means skip connection, Conv1x1 (dilation=1) means a convolution operation with a convolution kernel size of 1*1 and a dilation rate of 1, Conv3x3 (dilation=1) means a convolution operation with a convolution kernel size of 3*3 and a dilation rate of 1, Conv5x5 (dilation=1) means a convolution operation with a convolution kernel size of 5*5 and a dilation rate of 1, and Conv5x5 (dilation=2) means a convolution operation with a convolution kernel size of 5*5 and a dilation rate of 2.
[0069] Compared with the prior art, the present invention generates adversarial neural networks through neural network architecture search, which can alleviate the problems of mode collapse and gradient vanishing in existing generative adversarial neural networks. In addition, the proxy model proposed in the present invention can greatly reduce the resources and energy required for evolutionary search. The performance of the method of the present invention was tested on the public dataset CIFAR-10, which contains 10 categories and 60,000 pictures, of which 50,000 are used for training and 10,000 are used for testing. The size of pictures of all categories is 32×32 and the number is equal. The present invention can search for a network architecture that meets the task requirements in only 19 hours on a GPU 2080ti, and the FID value of the final network architecture is 9.53 and the IS value is 8.93. The evolutionary search process after filtering by the proxy model is as follows. Figure 3 As shown:
[0070] In order to further demonstrate the search performance of the present invention during the evolution process, this embodiment records the performance of all trained individuals. By recording the IS value and FID value of each particle, the performance change of the particle during the search process is shown. The darker the color of the particle, the earlier it appears in the evolution process. The particles trained in the later stage of evolution have lighter colors, such as Figure 4 shown.
[0071] The present invention provides a proxy model-assisted evolutionary generative adversarial network architecture search method and system. There are many methods and ways to implement the technical solution. The above is only a preferred implementation of the present invention. It should be pointed out that for ordinary technicians in this technical field, without departing from the principle of the present invention, several improvements and modifications can be made, and these improvements and modifications should also be regarded as the scope of protection of the present invention. All components not specified in this embodiment can be implemented using existing technologies.
Claims
1. The proxy model-assisted evolutionary generative adversarial network architecture search method is characterized by: The following steps are involved: Step 1: Build a generative adversarial network; Step 2: Initialize and train the generative adversarial network architecture to generate a training dataset and train the proxy model. Step 3: Initialize the particle population, set the historical optimal solution of each individual, and use non-dominated sorting to select the global optimal solution; Step 4: Use the proxy model to select potential network architectures from the population, train the selected network architectures, and use non-dominated sorting and particle swarm optimization to update the population; Step 5, update the proxy model training dataset and retrain the proxy model; Step 6: Repeat steps 4 and 5 until the particle swarm algorithm reaches the target number of generations and selects the network architecture for retraining; In step 1, the network architecture of the generative adversarial network includes a fully connected layer and 3 stacked cells, each cell contains 5 nodes and 7 edges, wherein the 7 edges are divided into 2 upsampling edges and 5 convolution edges, the upsampling edges will be selected from 3 upsampling operations, and the convolution edges will be selected from 7 convolution operations; each cell is regarded as a directed acyclic graph, the edges represent candidate operations, and the nodes represent the processed feature graphs; The i-th cell is represented by The value of i ranges from 1 to 3. Represents the operations corresponding to the two upsampling edges, Represents the operation corresponding to the first convolution edge; stacking the three cells Cells to obtain the corresponding encoding N = [X1, X2, X3] of the network architecture of the generative adversarial network; In step 2, m generative adversarial network architectures are randomly generated and trained to form a proxy model dataset set = [N1, N2, ..., N m ]; N m represents the mth generative adversarial network architecture; Randomly divide the dataset set into training dataset set train And the test dataset set test ; The following method is used to combine any two generative adversarial network architectures: the training dataset set train And the test dataset set test The network architecture encoding in is re-encoded in the form of one-hot encoding. The network architecture after one-hot encoding is N o =One_hot(N), randomly extract training data set set train Any two generative adversarial network architectures and Will and Directly splice to form proxy model input data By comparing two generative adversarial network architectures and The Fréchet index distance FID and image quality score IS value are used to label the input data. If the label value is 1, it means that the Fréchet index distance FID and image quality score IS of the first network architecture are better than those of the second network architecture. If the label value is 0, it means that the Fréchet index distance FID and image quality score IS of the second network architecture are better than those of the first network architecture. The training data set set is trained by the method train Combine any two generative adversarial network architectures in two pairs and train the support vector machine SVM to obtain a proxy model; use the method to test the data set set test The performance of the proxy model is tested by combining the data. If the classification accuracy of the proxy model is greater than the threshold, the proxy model is used to predict the performance of the network architecture.
2. The method according to claim 1, characterized in that In step 3, initialize the particle population P0 = [N1, N2, ..., N n ],N i represents the i-th neural network architecture, n is the number of individuals in the population; and N is randomly initialized i The position and velocity, N i The position is represented by x id is the position of the ith individual in the dth dimension; N i Speed v id is the velocity of the i-th individual in the d-th dimension; Train the initialized individuals to obtain the fitness value fitness i =[FID i , I.S. i ], FID i , IS i They are the FID and IS values corresponding to the network architecture; At the same time, the i-th neural network architecture N i The historical optimal solution is pbest i , initialized to pbest i :fitness i , use non-dominated sorting to sort the individuals in the particle population P0, and set the first frontier individual set in the population as the global optimal solution of the current population gbest = [pbest1, pbest2, ..., pbest n ].
3. The method according to claim 2, characterized in that Step 4 includes: Step 4.1, iterate the population using the population update formula; Step 4.2: Use the proxy model to predict the network architecture with excellent performance and train it; Step 4.3, update the historical optimal solution and the global optimal solution of each individual in the population.
4. The method according to claim 3, characterized in that In step 4.1, the population is iterated according to the following formula: Among them, ω is the inertia factor; k represents the number of current iterations; c1 and c2 are acceleration coefficients; rand1 and rand2 are random numbers between 0 and 1; is the velocity of the i-th particle of the k-th generation in the d-th dimension, is the position of the i-th particle of the k-th generation in the d-th dimension; pbest id is the position of the individual extreme point of the ith particle in the dth dimension, gbest d is the position of all extreme points of the entire group in the dth dimension.
5. The method according to claim 4, characterized in that In step 4.2, traverse all individuals in the current population, for any individual N i , N i and pbest i The corresponding network architectures are one-hot encoded, and the resulting encoding structures are According to the method in step 2 Combine to form the proxy model input Enter the proxy model into input i Send it to the proxy model to get the corresponding output. If the output result is 1, it means that N i The network architecture performance is better than pbest i architecture, and for N i The network architecture is trained to obtain the true accuracy fitness i ; If the output result is 0, it means N i The network architecture performance is worse than pbest i Architecture, fitness i The value is set to 0; at the same time, all the network architectures being trained are recorded, and a new training network architecture set is constructed. new =[N1, N2, ..., N t ], t is the number of new training network architectures, N t Represents the tth new training network architecture.
6. The method according to claim 5, characterized in that Step 4.3 includes: obtaining the fitness value corresponding to each individual in the current population after the update according to step 4.2, updating the historical optimal solution and the global optimal solution of the individuals in the population by using non-dominated sorting, and i , if individual N i fitness i Completely dominate pbest i , that is, individual N i The FID and IS values of the network architecture are better than the corresponding values of the historical optimal solution, then pbest i =fitness i ; if fitness i and pbest i For a non-dominant relationship, pbest i = rand(fitness i , pbest i ); if fitness i By pbest i Dominant, then pbest i Keep unchanged; merge the newly trained individuals into the global optimal solution gbest, select the individuals in the first frontier position through non-dominated sorting, and form a new global optimal solution gbest.
7. The method according to claim 6, characterized in that In step 5, the new training network architecture set new The network architecture in is added to the proxy model dataset set, and according to the operation in step 2, the training dataset and test dataset of the proxy model are re-divided, and the proxy model is retrained and tested; In step 6, after the population iterates to the target generation, all individuals in the global optimal solution gbest will be retrained, and finally a generative adversarial network that meets the task requirements will be selected.
8. The proxy model-assisted evolutionary generative adversarial network architecture search system implemented by the method according to any one of claims 1 to 7, characterized in that: Includes encoding module, training module and optimization module; The encoding module is used to construct a generative adversarial network, initialize the generative adversarial network architecture and perform training to generate a training data set and train the agent model; initialize the particle population, set the historical optimal solution of each individual, and use non-dominated sorting to select the global optimal solution; The training module uses a proxy model to select potential network architectures from the population, trains the selected network architectures, and simultaneously uses a non-dominated sorting and a particle swarm algorithm to update the population; Update the proxy model training dataset and retrain the proxy model; The optimization module repeats the steps performed by the training module until the particle swarm algorithm reaches the target number of generations, and selects the network architecture for retraining.
Citation Information
Patent Citations
Method and apparatus using machine learning for evolutionary data-driven design of proteins and other sequence defined biomolecules
CA3149211A1
Oil reservoir injection and production parameter multi-objective optimization method based on a support vector machine agent model
CN109872007A
