A neural network structure search method and system based on evolutionary learning

By using an evolutionary learning-based approach and leveraging the weight update mechanism of population and supernets, the problems of large search space and high computational resource consumption in neural network structure search are solved, achieving efficient and reliable neural network structure search.

CN116964594BActive Publication Date: 2025-10-28HUAWEI TECH CO LTD +1
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202080107589.9
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2020-12-16
Publication Date
2025-10-28
Estimated Expiration
2040-12-16

AI Technical Summary

Technical Problem

Existing neural network structure search methods suffer from problems such as huge search space, high computational resource consumption, slow search speed, and poor performance.

Method used

An evolutionary learning-based approach is adopted, which involves initializing the population, randomly selecting structural codes, training the neural network model, evaluating winners and losers, updating the supernet weights and structural codes, and using pseudo-gradient values ​​for evolution, thereby reducing the search space and improving search efficiency.

Benefits of technology

It significantly reduces the computational cost and runtime of neural network structure search, improves the reliability and efficiency of the search, and can quickly find the optimal neural network model.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN116964594B_ABST
    Figure CN116964594B_ABST
Patent Text Reader

Abstract

A method and system for searching neural network structures based on evolutionary learning, the method comprising: S101, initializing a population, wherein each neural network structure in the population is a structure encoding; S102, randomly selecting two structure encodings in the population, decoding them into two neural network structures for pairing; inheriting corresponding weights from a supernet to obtain first and second neural network models; S103, evaluating the trained first and second neural network models to obtain winners and losers; S104, updating the supernet based on the trained first and second neural network models; S105, calculating pseudo-gradient values ​​to enable losers to learn from winners, obtaining the structure encoding of a third neural network structure; S106, replacing the structure encoding of losers in the population with the structure encoding of the third neural network to update the population; S107, outputting the optimal neural network model in the population, and iteratively evolving the updated population.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of artificial intelligence, and in particular to a method and system for searching neural network structures based on evolutionary learning. Background Technology

[0002] As learning tasks become increasingly complex, neural network model design also becomes more intricate. Designing high-performance neural networks requires extensive expertise and repeated manual trials, significantly increasing computational resources and time costs. Using algorithms to automatically search for neural network architecture models can save manual costs and optimize neural network models. Neural Architecture Search (NAS) is a technique for automatically designing neural networks, enabling a given computer algorithm to automatically search for preferred neural network models based on deep learning tasks. NAS is a hot topic in the field of Automated Machine Learning (Auto-ML), automatically acquiring neural network architectures with strong generalization capabilities and hardware-friendly features through the design of cost-effective search methods, greatly liberating researchers' creativity.

[0003] The three main components of the core design decisions related to NAS methods are: search space definition, search strategy, and search target evaluation. Neural networks typically consist of many nodes. During neural network architecture search, nodes can be combined in completely arbitrary ways; that is, each node can be connected to any other node, and different operations can be selected between nodes. The search space increases exponentially with the number of nodes, resulting in a huge search space and slow search speed. Because NAS involves a huge search space, and its performance evaluation often involves model training, it consumes significant resources. Summary of the Invention

[0004] To address the aforementioned problems, embodiments of this application provide a method, system, electronic device, and storage medium for searching neural network structures based on evolutionary learning.

[0005] In a first aspect, this application provides a method for searching neural network structures based on evolutionary learning. The method includes: S101, initializing a population, wherein the population is a set of structure codes containing multiple different neural network structures, the structure codes being used to indicate the mapping relationship between connections and operations between any two nodes of the neural network structure through a continuous real number interval; S102, randomly selecting two structure codes within the population, decoding the two structure codes to obtain two neural network structures, and pairing the two neural network structures; inheriting corresponding weights from a supernet for each of the two neural network structures to obtain a first neural network model and a second neural network model; wherein the supernet includes a set of multiple operations and weights for each operation; S103, training the first and second neural network models respectively to obtain trained first and second neural network models; and labeling the supernet with the structure codes. S104. Inputting the signed audio, video, or graphic samples into the trained first and second neural network models, calculating the error value between the output result and the label to obtain the winner and loser, wherein the error value of the winner is less than the error value of the loser; S105. Updating the supernet according to the trained first and second neural network models; S106. Calculating the pseudo gradient value between the structural encoding of the loser and the structural encoding of the winner, and based on the pseudo gradient value, causing the structural encoding of the loser to evolve towards the structural encoding of the winner, to obtain the structural encoding of the third neural network; the pseudo gradient is the gradient for updating the structural encoding; S107. Replacing the structural encoding of the neural network structure corresponding to the loser with the third neural network structural encoding in the population to obtain an updated population; S108. Outputting the optimal neural network model in the updated population, thereby completing the search for the neural network structure.

[0006] This implementation uses a continuous real number space to represent the neural network structure, which can reduce the search space corresponding to the operation selection, improve the NAS search efficiency, increase the diversity of neural network structures in the population to match the second-order learning evolution of the subsequent neural network, and solve the problems of poor performance and high computational resource consumption of existing neural network structure search methods.

[0007] In one implementation, the step of outputting the optimal neural network model in the updated population to complete the search for the neural network structure includes: outputting the optimal neural network model in the updated population when a termination condition is met, thereby completing the search for the neural network structure.

[0008] This implementation improves the reliability of neural network structure search by setting termination conditions to iteratively evolve the population.

[0009] In one implementation, the step of outputting the optimal neural network model in the updated population to complete the search for the neural network structure includes: if the termination condition is not met, returning to S102, iteratively evolving the updated population until the termination condition is met, and then outputting the optimal neural network model in the updated population to complete the search for the neural network structure.

[0010] This implementation method finds a set of optimized neural network models based on the characteristics of the population through an iterative approach, which can provide decision-makers with multiple options.

[0011] In one embodiment, the step of inheriting corresponding weights from the supernet to obtain a first neural network model and a second neural network model includes: inheriting from the supernet the same connections as the first neural network structure and the first weights corresponding to the same operations corresponding to the connections to obtain the first neural network model; and inheriting from the supernet the same connections as the second neural network structure and the second weights corresponding to the same operations corresponding to the connections to obtain the second neural network model.

[0012] This implementation method can accelerate the model acquisition speed by inheriting the weights of the supernet, significantly reducing the computational cost and running time required for searching the neural network; during the iteration process, the weights inherited by the neural network structure from the supernet are optimized weights, which significantly reduces the computational cost and running time required for searching the neural network.

[0013] In one embodiment, training the first and second neural network models respectively to obtain trained first and second neural network models includes: training the weight values ​​of the first neural network model at least once using stochastic gradient descent to obtain the optimized first neural network model; and training the weight values ​​of the second neural network model at least once using stochastic gradient descent to obtain the optimized second neural network model.

[0014] This implementation obtains first and second neural network models with optimized weight values ​​by training the first and second neural network models.

[0015] In one implementation, the step of inputting labeled voice, video, or image samples into the trained first and second neural network models, and calculating the error value between the output result and the label to determine the winner and loser includes: inputting labeled voice, video, or image samples into the trained first neural network model and the trained second neural network model respectively; calculating a first error value between the first output result and the label of the sample based on the first output result of the trained first neural network model; calculating a second error value between the second output result and the label of the sample based on the second output result of the trained second neural network model; comparing the first error value and the second error value, and determining the first / second neural network model with the smaller error value as the winner and the first / second neural network model with the larger error value as the loser, thereby determining the winner and loser.

[0016] This implementation trains paired first and second neural network models using labeled samples, and evaluates the performance of the trained first and second models to accelerate the search for the optimal model.

[0017] In one implementation, updating the supernet based on the trained first and second neural network models includes: under the condition that two nodes in the first and second neural network models have the same connection and the operation corresponding to the connection is the same, using the weight of the winner as the weight of the corresponding operation in the supernet, and updating the supernet.

[0018] This implementation enables synchronous optimization of the supernet's operational weights, thereby accelerating the search speed; the weight updates of the supernet can significantly reduce the computational cost and runtime required for the search neural network.

[0019] In one implementation, updating the supernet based on the trained first and second neural network models includes: when the connections between two nodes in the first and second neural network models and the corresponding operations are different, using the weights of the first neural network model as the weights of the connections in the supernet that have the same structure as the first neural network and the corresponding operations; using the weights of the second neural network model as the weights of the connections in the supernet that have the same structure as the second neural network and the corresponding operations; and updating the supernet.

[0020] This implementation enables synchronous optimization of the supernet's operational weights, thereby accelerating the search speed; the weight updates of the supernet can significantly reduce the computational cost and runtime required for the search neural network.

[0021] In one embodiment, calculating the pseudo-gradient value between the structural codes of the loser and the winner, and evolving the structural codes of the loser towards the structural codes of the winner based on the pseudo-gradient value to obtain the structural code of the third neural network structure, includes: calculating the difference between the structural code value of the loser and the structural code value of the winner; multiplying the difference by a random coefficient and summing it with historical pseudo-gradients at a multiple of the random coefficient to obtain the value of the pseudo-gradient updated to the structural code of the loser; and summing the structural code value of the loser with the value of the pseudo-gradient to obtain the structural code of the third neural network structure, thereby realizing the evolution of the structural codes of the loser towards the structural codes of the winner.

[0022] This implementation method, based on the evaluation results of the paired first and second neural network models, enables the loser to learn from the winner and perform structural evolution updates in order to find the optimal neural network model more quickly.

[0023] In one implementation, the termination condition includes whether all structural codes in the population have participated in pairing or whether a set number of iterations has been reached.

[0024] This implementation improves the reliability of neural network structure search by setting termination conditions to perform comprehensive iterative evolution of the population.

[0025] Secondly, this application provides a search system for neural network structures based on evolutionary learning. The system includes: a population initialization module for initializing a population, wherein the population is a set of structure codes containing multiple different neural network structures, the structure codes being used to indicate the mapping relationship between connections and operations between any two nodes of the neural network structure through a continuous real number interval; an individual pairing module for randomly selecting two structure codes within the population, decoding the two structure codes to obtain two neural network structures, and pairing the two neural network structures; a weight inheritance module for inheriting corresponding weights from a supernet for each of the two neural network structures to obtain a first neural network model and a second neural network model; wherein the supernet includes a set of multiple operations and the weight of each operation; a training module for training the first and second neural network models respectively to obtain trained first and second neural network models; and an evaluation module for using... The system inputs labeled speech, video, or image samples into the trained first and second neural network models, calculates the error value between the output result and the label to obtain the winner and loser, where the error value of the winner is smaller than that of the loser; a supernet weight update module is used to update the supernet according to the trained first and second neural network models; a structure encoding evolution module is used to calculate the pseudo gradient value between the structure encoding of the loser and the structure encoding of the winner, and based on the pseudo gradient value, the structure encoding of the loser evolves towards the structure encoding of the winner to obtain the structure encoding of the third neural network; the pseudo gradient is the gradient for structure encoding update; a population update module is used to replace the structure encoding of the neural network structure corresponding to the loser in the population with the third neural network structure encoding to obtain an updated population; and a model output module outputs the optimal neural network model in the updated population, thereby completing the search for the neural network structure.

[0026] In one implementation, the model output module is used to: output the optimal neural network model in the updated population when the termination condition is met, thereby completing the search for the neural network structure.

[0027] In one implementation, the model output module is used to: return to S102 if the termination condition is not met, iteratively evolve the updated population until the termination condition is met, and then output the optimal neural network model in the updated population, thereby completing the search for the neural network structure.

[0028] In one embodiment, the weight inheritance module is used to: inherit the same connections as the first neural network structure and the first weights corresponding to the same operations corresponding to the connections from the supernet to obtain the first neural network model; and inherit the same connections as the second neural network structure and the second weights corresponding to the same operations corresponding to the connections from the supernet to obtain the second neural network model.

[0029] In one embodiment, the training module is used to: train the weight values ​​of the first neural network model at least once using stochastic gradient descent to obtain the optimized first neural network model; and train the weight values ​​of the second neural network model at least once using stochastic gradient descent to obtain the optimized second neural network model.

[0030] In one implementation, the evaluation module is configured to: input labeled voice, video, or image samples into the trained first neural network model and the trained second neural network model, respectively; calculate a first error value between the first output result and the label of the sample based on the first output result of the trained first neural network model; calculate a second error value between the second output result and the label of the sample based on the second output result of the trained second neural network model; compare the first error value and the second error value, and designate the first / second neural network model with the smaller error value as the winner and the first / second neural network model with the larger error value as the loser, thereby obtaining the winner and the loser.

[0031] In one embodiment, the supernet weight update module is used to update the supernet by using the weight of the winner as the weight of the corresponding operation in the supernet when two nodes of the first and second neural network models have the same connection and the operation corresponding to the connection is the same.

[0032] In one embodiment, the supernet weight update module is used to: when the connections between two nodes of the first and second neural network models and the corresponding operations of those connections are different, use the weights of the first neural network model as the weights of the connections in the supernet that have the same structure as the first neural network and the corresponding operations of those connections; use the weights of the second neural network model as the weights of the connections in the supernet that have the same structure as the second neural network and the corresponding operations of those connections; and update the supernet.

[0033] In one implementation, the structure encoding evolution module is used to: calculate the difference between the structure encoding value of the loser and the structure encoding value of the winner; multiply the difference by a random coefficient and sum the difference with the historical pseudo gradients at the random coefficient multiple to obtain the value of the pseudo gradient for updating the structure encoding of the loser; sum the structure encoding value of the loser with the value of the pseudo gradient to obtain the structure encoding of the third neural network structure, thereby realizing the evolution of the structure encoding of the loser to the structure encoding of the winner.

[0034] In one implementation, the termination condition includes whether all structural codes in the population have participated in pairing or whether a set number of iterations has been reached.

[0035] Thirdly, this application provides an electronic device, including a memory and a processor; the processor is configured to execute computer execution instructions stored in the memory, and the processor executes the computer execution instructions to perform the search method for neural network structures based on evolutionary learning as described in any of the above embodiments.

[0036] Fourthly, this application provides a storage medium, including a readable storage medium and a computer program stored in the readable storage medium, the computer program being used to implement the search method for neural network structures based on evolutionary learning as described in any of the above embodiments.

[0037] The embodiments of this application provide a method, system, electronic device, and storage medium for searching neural network structures based on evolutionary learning. This method maps a continuous space onto a neural network structure to enable continuous mathematical operations on the structure, thus giving the algorithm better global search capabilities. Through a population-based pairwise second-order learning structure update method, the optimal solution can be found more quickly. Furthermore, based on the characteristics of the population, a set of solutions can be found, providing decision-makers with multiple choices and improving the reliability of the algorithm. The weight inheritance and update of the supernet can accelerate model evaluation and significantly reduce the computational cost and running time required to search the neural network. Attached Figure Description

[0038] Figure 1 A schematic diagram illustrating the application environment of neural network structure search provided in the embodiments of this application;

[0039] Figure 2 A flowchart of the population-based neural network architecture search proposed for the first scheme;

[0040] Figure 3 A basic framework diagram for neural network structure search based on evolutionary learning is proposed for the system embodiments of this application;

[0041] Figure 4A general flowchart of a method for searching neural network structures based on evolutionary learning, provided for embodiments of this application;

[0042] Figure 5a A block diagram illustrating a specific embodiment of a method for searching neural network structures based on evolutionary learning, provided in this application.

[0043] Figure 5b Population initialization flowchart;

[0044] Figure 5c A flowchart of the supernet initialization process;

[0045] Figure 6 A schematic diagram illustrating the operation between two nodes in a method for searching neural network structures based on evolutionary learning provided in this application embodiment;

[0046] Figure 7 A schematic diagram illustrating the connection and operation between two nodes in a supernet in a method for searching neural network structures based on evolutionary learning, provided in an embodiment of this application;

[0047] Figure 8 A flowchart of the supernet weight update method provided in the embodiments of this application;

[0048] Figure 9 A flowchart of the structure update method based on population pairing provided in the embodiments of this application;

[0049] Figure 10 A system block diagram for neural network architecture search based on evolutionary learning, provided for embodiments of this application;

[0050] Figure 11 A block diagram of a supernet update system provided in this application embodiment;

[0051] Figure 12 This application provides a schematic diagram of an electronic device according to an embodiment. Detailed Implementation

[0052] In the following description, reference is made to “some embodiments”, which describes a subset of all possible embodiments, but it will be understood that “some embodiments” may be the same subset or different subsets of all possible embodiments and may be combined with each other without conflict.

[0053] In the following description, the terms “first, second, third, etc.” or module A, module B, module C, etc. are used only to distinguish similar objects and do not represent a specific ordering of objects. It is understood that a specific order or sequence may be interchanged where permitted so that the embodiments of this application described herein can be implemented in an order other than that illustrated or described herein.

[0054] In the following description, the labels of the steps, such as S110, S120, etc., do not necessarily mean that the steps will be executed in this way. The order of the steps can be interchanged or executed simultaneously if permitted.

[0055] Unless otherwise defined, all technical and scientific terms used herein have the same meaning as commonly understood by one of ordinary skill in the art to which this application belongs. The terminology used herein is for the purpose of describing embodiments of this application only and is not intended to limit this application.

[0056] The technical solutions in the embodiments of this application will now be described with reference to the accompanying drawings.

[0057] Neural Architecture Search (NAS) technology has a wide range of applications. For example, in image recognition, using algorithms to automatically design neural network architecture models can achieve better performance than manually designed neural network structures. Similarly, in medical image processing, NAS is used to generate neural network architecture models to process data from magnetic resonance imaging (MRI), computed tomography (CT), and ultrasound to determine whether a patient has a disease. This application is applicable to all situations involving image classification and segmentation, as well as other scenarios related to video processing.

[0058] Figure 1 This is a schematic diagram of the application environment for neural network structure search provided in the embodiments of this application; as shown... Figure 1 As shown, the application scenario includes at least one backend server 10 and a smart device 11. The smart device 11 can connect to the backend server 10 via the Internet; the smart device 11 may include smart devices capable of outputting medical images, voice, video, or pictures, such as magnetic resonance imaging (MRI) machines, smart speakers, smart cameras, and smartphones.

[0059] The smart device 11 is equipped with an image, voice, medical image or video acquisition device, which can collect image, voice, medical image or video data and send it to the backend server 10. The backend server 10 can then use neural network structure search to generate a neural network structure model for classification, segmentation or recognition of the image, voice, medical image or video input.

[0060] NAS is a subset of hyperparameter optimization. Customized NAS methods are not actually fully automated; they rely on manually coded neural network architectures specifically designed for the application or learning task as a starting point for the search. Generally, the objective of neural network architecture search methods is defined as:

[0061]

[0062]

[0063] In formula (1), α is defined as the structural encoding, ω is defined as the weight information, and ω * This is the corresponding optimal weight. The loss value on the training set, Let be the loss value on the validation set. Equation (1) means that neural network architecture search needs to find a structure encoding α, which is optimal at weights ω. * The following can make the loss value on the validation set As small as possible.

[0064] Current NAS research can be divided into three main categories: population-based neural network architecture search, reinforcement learning-based neural network architecture search, and differentiable neural network architecture search.

[0065] The first approach is population-based neural network architecture search, one of the most common methods in current neural network architecture search research. The general process involves initializing a population, then selecting parent individuals and using operators such as crossover and mutation to update the parent topology to obtain the offspring topology. Finally, the idea of ​​"survival of the fittest" is used to eliminate individuals with low fitness and retain the better individuals. Iterating through this process allows the population to continuously evolve and obtain global / local optima.

[0066] Figure 2 The population-based neural network architecture search proposed for the first scheme; such as Figure 2 As shown, the steps of population-based neural network structure search include: initializing the population, which is a set of individuals containing different neural network structures; training individuals with different neural network structures and obtaining their accuracy on the validation set as the fitness of the individuals; determining whether the termination condition set by the algorithm is met; if the determination result is "no", then generating offspring neural network structures from the parent neural network structure through different crossover and mutation operators; if the determination result is "yes", then outputting the preference model; training the offspring neural network structure and obtaining its accuracy on the validation set as the fitness value of the offspring; selecting individuals with at least one neural network structure from the parent and offspring neural network structures based on the fitness value of the offspring; and outputting the new population containing the selected individuals with at least one neural network structure.

[0067] The main difference between different population-based structure search algorithms lies in the steps involved in generating offspring neural network structures from parent neural network structures using different crossover and mutation operators. There are many ways to design these crossover and mutation operators. For example, the AmoebaNet algorithm (source code link) defines a macro template for the neural network structure and designs two mutation operators: operators that change the different operations between nodes and operators that change the connections between different nodes. The Large-Scaleevolution algorithm, on the other hand, does not define a macro template but proposes eleven different mutation operators, including operators for changing the learning rate, inserting convolutional layers, removing convolutional layers, and changing the number of channels. By executing different mutation operators, this method can automatically evolve complex neural network structures from simple ones.

[0068] While population-based neural network architecture search methods offer advantages such as suitability for parallelization and high reliability, the large number of individuals in the population requiring fitness evaluation leads to significant GPU resource and time consumption. For example, AmoebaNet requires 3150 GPU days to complete its search task. Therefore, it is difficult to achieve a balance between architecture search accuracy and resource consumption using this method.

[0069] Differentiable Architecture Search (DARTS) maps neural networks to a continuous space and solves them using gradient descent, simultaneously obtaining parameters such as the network's structure and weights. Specifically, it obtains the gradient information of the structure. for:

[0070]

[0071] In formula (2), α is defined as the structure of the neural network model, and ω represents the current weights. * (α) represents the corresponding optimal weight, and ξ represents the learning rate for the internal optimization step. Let ω be the loss value on the validation set. This method approximates ω using the loss value obtained after one training iteration. * Instead of achieving convergence through continuous training of ω, this method searches for neural network structures along the gradient direction, thus enabling it to quickly find optimal neural network structures.

[0072] While differentiable neural network-based structure search methods offer the advantage of speed, they suffer from lower reliability compared to population-based methods because they only search for individual structures at a time. Furthermore, relying solely on gradient information from individual structures fails to avoid local optima; moreover, encoding each possible connection and operation with a probability results in a vast search space and high optimization costs.

[0073] The following describes the concept of a method and system for searching neural network structures based on evolutionary learning, as provided in the embodiments of this application.

[0074] Figure 3 A basic framework diagram for neural network structure search based on evolutionary learning is proposed for a system embodiment of this application. For example... Figure 3 As shown, this application provides a method and system for neural network structure search based on evolutionary learning. This scheme, based on a custom encoding of the neural network structure, uses a population-based pairing mechanism and a second-order learning method to generate new neural network models for population updates. It then trains the newly generated neural network models using gradient descent with supernet weights, and uses the trained neural network models to update the supernet model's weights, thereby completing the automatic search for neural network structures. During this process, the performance of the paired neural network models is evaluated; the unsuccessful models learn from the winners to generate new neural network models for population updates. This scheme can solve the problems of poor performance and high computational resource consumption in existing neural network structure search methods.

[0075] In the above scheme, custom encoding refers to encoding the neural network structure according to manually set encoding rules based on the learning task or application. In this application, the nodes in the neural network structure can be represented by multiple real-valued variables, and the connections and operations between any two nodes are uniformly and independently encoded.

[0076] In the above scheme, the supernet is a directly defined neural network with the same number of nodes as the neural network model in the initial population, including all connection and operation relationships, and the weights corresponding to the operations are shared. The structure of the supernet is fixed, and its optimal weights can be optimized through standard backpropagation. The optimized weight values ​​are applicable to all neural network models to improve recognition performance.

[0077] Figure 4 This is a flowchart illustrating a method for searching neural network structures based on evolutionary learning, provided in an embodiment of this application. Figure 2As shown, the method's flow is as follows: S101, initialize the population and the supernet; each neural network structure in the population is a structural code, and population initialization involves randomly initializing these codes. S102, for each initialized code in the population, first decode it into a neural network structure and then randomly pair it up. The two paired neural network structures inherit weights from the initialized supernet. S103, according to the learning task, train and optimize the two paired neural network structures after inheriting weights to obtain neural network models. Evaluate the performance of the two trained neural network models on the validation set, and determine the loser and winner based on the evaluation results. S104, update the corresponding weight values ​​of the supernet based on the neural network models obtained after training in S103 and the evaluation results. S105, based on the evaluation results, make the structural code of the loser learn from the structural code of the winner to obtain a new neural network structural code, and then use the new neural network structural code to replace the structural code of the loser in the population to update the population. S106, determine whether the termination condition is met. If the termination condition is met, proceed to S107; otherwise, return to S102 and iteratively evolve the updated population. The termination condition is that all individuals in the population have participated in pairing and the set number of iterations has been reached; S107, output the preference model in the new population. The preference model is the optimal neural network that meets the requirements of the learning task.

[0078] Figure 5a This is a block diagram illustrating an embodiment of a method for searching neural network structures based on evolutionary learning, provided in this application. Figure 5a As shown, this method is implemented by performing the following steps.

[0079] S201, Initialize the population and supernet.

[0080] Specifically, during the population initialization step, a custom encoding rule is defined for the application or learning task. Based on this rule, a structural encoding for the neural network structure is generated, mapping consecutive real-number intervals to the neural network structure. The application or learning task includes classifying, segmenting, or recognizing input images, speech, medical images, or videos.

[0081] Population initialization process as follows Figure 5b As shown in S2011, the nodes of the neural network structure are set, the connections between the set nodes are represented as continuous real numbers, random connections are made between the nodes, and the connections of the nodes and the operations corresponding to the connections are encoded into the structure encoding α of the neural network. α is set as a vector, which includes the connections between the nodes and the operations in these connections, thereby mapping the continuous real number intervals to the neural network structure.

[0082] For example, a neural network structure can be configured with m nodes, mapping the continuous real number space [0, 1), [1, 2), [2, 3), [3, 4)...[m-1, m) to these m nodes. The first two nodes represent the input, and subsequent nodes randomly select the two preceding nodes for connection. Therefore, each node needs to store four variables in addition to the first two: two variables represent the node codes corresponding to the connected nodes, and the other two variables represent the operation codes corresponding to the operations represented by the two connections. Each node is represented by four variables, and the operation code α is a vector containing multiple four-variables, defining the values ​​of the operation codes in a real number space where the difference between the upper and lower limits is 1. For example, suppose the neural network has four nodes, m = 4, and the node numbers are 0, 1, 2, 3; the encoding range of each node is [0, 1), [1, 2), [2, 3), [3, 4); for example, the connection code of a certain node is 0.5, 2.3, indicating that this node is connected to node 0 and node 2.

[0083] S2012 initializes and generates N structural codes using the encoding rules of S2011, forming a population where N is a natural number greater than 2. These N structural codes can be decoded into N neural network structures, each with the same number of nodes but different connection relationships and operations.

[0084] Representing neural network structures using a continuous real number space can increase the diversity of neural network structures within a population, thus matching the subsequent second-order learning evolution of the neural network.

[0085] The initialization process of a supernet is as follows: Figure 5c As shown.

[0086] S2013, set the nodes of the supernet, the number of nodes in the supernet is the same as the number of nodes in the neural network structure of the population.

[0087] S2014 allows you to set multiple operations between every two nodes and assign weights to each operation.

[0088] S2015 represents the operations between nodes as a set of weight values, which covers all possible operations required for the application or learning task; the set of weight values ​​is shared.

[0089] Any possible structural encoding in the population represents a subnetwork of the supernet, and these subnetworks are denoted as network units. Only one operation can be chosen between any two nodes in the neural network structure of the population.

[0090] For example, such as Figure 6As shown, assume there are three possible operations: the first is a 3x3 average pooling layer operation, the second is a 3x3 max pooling layer operation, and the third is a 3x3 convolutional layer operation. The continuous real number space [0, 1) can be mapped to the first operation, with operation code ∈ [0, 1) indicating that the operation between node 0 and node 1 is an average pooling layer operation. The continuous real number space [1, 2) can be mapped to the second operation, with operation code ∈ [1, 2) indicating that the operation is a max pooling layer operation. The continuous real number space [2, 3) can be mapped to the third operation, with operation code ∈ [2, 3) indicating that the operation is a convolutional layer operation. Finally, one operation is selected as the operation between these two nodes. For example... Figure 7 The diagram illustrates the connection between any two nodes in a hypernet. The hypernet does not involve structural encoding; each pair of nodes can involve all possible operations required for the application or learning task, including but not limited to average pooling, max pooling, and convolutional layer operations, operating in parallel. Each operation is configured to contain its own weight information and requires separate training.

[0091] In this application, the population initialization step is encoded using the encoding rules of the connection and operation search between two nodes. This can map independent continuous variable intervals to the connection between two nodes and the corresponding operation, thereby reducing the search space for operation selection, improving NAS search efficiency, and enabling the conversion of discrete real numbers, combinations, and probability values ​​into continuous real numbers.

[0092] Back Figure 5a Execute S202, randomly select the structure encoding corresponding to two neural network structures within the population, decode them into two neural network structures, and pair them up. The paired neural network structures inherit weights from the supernet. These weights include the weight values ​​of the operations.

[0093] Specifically, taking any pair of neural network structures randomly paired in the population as an example, the nth neural network structure is denoted as the first neural network structure, and the (n+1)th neural network structure is denoted as the second neural network structure. The first neural network inherits the same connections as the first neural network structure and the weights corresponding to the same operations of the same connections from the initialized supernet to obtain the first neural network model; the second neural network structure inherits the same connections as the second neural network structure and the weights corresponding to the same operations of the same connections from the initialized supernet to obtain the second neural network model.

[0094] For example, in the supernet, the weights of the convolutional layers in the same connections and corresponding operations as the first neural network structure are 2.6. The first neural network structure inherits the weights of the same connections and corresponding operations from the initialized supernet, resulting in a weight of 2.6 for the convolutional layers of the first neural network structure. Similarly, the second neural network structure inherits the weights of the same connections and corresponding operations from the supernet.

[0095] It should be noted that the weights that the two paired neural network structures initially inherit from the supernet are the weight values ​​of the connections in the initial supernet that are identical to their structures and the weight values ​​of the corresponding operations in the same supernet. In each subsequent iteration, the weights that the two paired neural network structures inherit from the supernet are the weight values ​​of the connections in the updated supernet that are identical to their structures and the weight values ​​of the corresponding operations in the same supernet.

[0096] S203, in conjunction with the learning task, perform one or more gradient descent training operations on the two neural network models after inheriting weights to optimize the weight values. Validate the trained first and second neural network models on the validation set to obtain the error values ​​of the first and second neural network models. Compare the two error values, mark the neural network model with the smaller error value as the winner, and mark the neural network model with the larger error value as the loser, thus obtaining the evaluation result.

[0097] Specifically, in S2031, combined with the learning task, two neural network models are trained using stochastic gradient descent, and the weight descent value of the current neural network model is obtained by calculating formula (3). The weight ω of the optimized neural network model is obtained by calculating formula (4).

[0098]

[0099] ω(t)=ω(t-1)-η(t)*Δω(t) (4)

[0100] Where t is the number of iterations of the stochastic gradient descent method, Δω(t) represents the weight reduction value of the t-th generation neural network model, ω(t) represents the weight value of the optimized t-th iteration neural network model, β is the momentum, and η(t) is the learning rate. This is the error value (loss) of the neural network on the training set, which is obtained by calculating the accuracy of the current neural network model on the validation set.

[0101] In the embodiments of this application, the first neural network model is trained by manipulating the weights along the direction of gradient descent. The optimized weight value ω1 is calculated based on the calculated weight descent value Δω1(t), resulting in the first optimized neural network model. Similarly, the second neural network model is trained by manipulating the weights along the direction of gradient descent. The optimized weight value ω2 is calculated based on the calculated weight descent value Δω2(t), resulting in the optimized second neural network model.

[0102] S2032, on the validation set, verify the error values ​​of the first optimized first neural network model and the first optimized second neural network model respectively, mark the first / second neural network model with the smaller error value as the winner, and mark the first / second neural network model with the larger error value as the loser, and obtain the evaluation result.

[0103] S204 updates the weight values ​​of the supernet based on the weight values ​​obtained after training and the evaluation results.

[0104] Specifically, it is determined whether two nodes in the first and second neural networks have the same connection and the same operation. If so, the weight values ​​of the corresponding operations in the supernet are updated to the weight values ​​of the winner based on the weight values ​​obtained after training and the evaluation results. Otherwise, based on the weight values ​​obtained after training and the evaluation results, the weights of the connections in the supernet with the same structural encoding as the first neural network model and the weights of the same operations corresponding to those connections are updated to the weight values ​​ω1 optimized by the first neural network model, and the weights of the connections in the supernet with the same structural encoding as the second neural network model and the weights of the same operations corresponding to those connections are updated to the weight values ​​ω2 optimized by the second neural network model.

[0105] S205. Based on the evaluation results, the structural encoding of the losers learns from the structural encoding of the winners to obtain the structural encoding of the new neural network structure. Then, the structural encoding of the new neural network structure replaces the structural encoding of the losers' neural networks in the population, thus updating the population.

[0106] Specifically, step S2051 is executed first. Based on the evaluation results of the two neural network models optimized after training in S204, the losers learn from the winners to obtain a new neural network model. Specifically, the structural encoding α of the losers is updated and optimized by using pseudo-gradient-based learning, so that the structural encoding of the losers is close to that of the winners. Then, the structural encoding of the new neural network structure replaces the losers in the population.

[0107] Pseudo-gradient-based learning and updating algorithms can include learning and updating based on first-order gradients, second-order gradients, or both. They can even be extended with constant or multiplicative terms based on gradient information. Specifically, let α be the structural encoding of the winner in a pair of neural network structures. w The structure of the loser is encoded as α. l The pseudo-gradient Δα updated by the structure encoding of the losing neural network model. l as follows:

[0108] Δα l (t)=a*μ*(α w (t)-α l (t))+b*γ*Δα l (t-1)+c (5)

[0109] Where, Δα l (t) represents the pseudo-gradient value of the structural encoding of the t-th generation loser, μ and γ represent two real values ​​randomly sampled from a uniform distribution of [0,1], α and b are two given real values ​​between [-1,1], representing the confidence level of different orders of gradients, c is a given real number between [-1,1], representing the bias effect on the pseudo-gradient, and Δα l (t-1) represents the pseudo-gradient value accumulated in history before the structure update of the loser, with an initial value of Δα. l (0) takes the value 0.

[0110] Then calculate the updated structure code α of the loser. l 'for:

[0111] α l '(t)=α l (t)+Δα l (t) (6)

[0112] Assume the winner's structural encoding α w The structure encoding α of the loser is 0.2. l Given 0.9, assign values ​​to a, b, and c, for example, a = 1, b = 1, c = 0. Then, α is calculated using formula (6). l The value of ′ will be less than 0.9, and the structure encoding of the loser will be updated to learn to approach the structure encoding of the winner in order to obtain a new neural network structure.

[0113] Then, step S2052 is executed to replace the losers with the structural encoding of the new neural network structure in the population, thereby updating the population.

[0114] S206: Determine if the termination condition is met. If it is, proceed to S207; otherwise, repeat steps 202-206, performing pairing and iterative learning based on the population, continuing to evolve and update the population until the set termination condition is reached. The termination condition can be that all structural encodings in the population have completed pairing and learning of their corresponding neural network structures.

[0115] Specifically, determine whether all the structural encodings in the population correspond to neural network structures that participate in pairing; if the result is "no", then execute S202; if the result is "yes", then execute S208.

[0116] When executing step S206, it can be determined that if n < N-1, then the value of n is incremented by 2, and the execution returns to step 202. If n ≥ N-1, then step S207 is executed.

[0117] The termination condition can also be reaching a set number of iterations.

[0118] Specifically, let t be the number of generations in the current evolution and T be the set number of iterations. Determine whether the number of generations in the current evolution has reached the set number of iterations. If the determination result is "no", then execute S202; if the determination result is "yes", then execute S207.

[0119] When executing step S206, it can be determined that if t < T and n < N-1, then the value of t is incremented by 1 and the value of n is incremented by 2, and the execution returns to step 202; if t < T and n ≥ N-1, then the value of t is incremented by 1 and the value of n is 1, and the execution returns to step 202; if t ≥ T, then S207 is executed.

[0120] S207, Select the preference model from the updated population.

[0121] Based on the above embodiments, this application also proposes a supernet weight update mechanism. This mechanism utilizes the pairwise, non-repeating pairing of neural network structures within the population for evolution. During the evolution process, the supernet weights are updated jointly by the weights of both the losers and winners. Specifically, Figure 8 The flowchart of the supernet weight update method proposed in this application is as follows: Figure 6 The following are included:

[0122] S301, Randomly initialize the supernet weights. For specific implementation details, please refer to steps S2013-S2015.

[0123] In step S302, the decoded neural network structures in the population are randomly paired. The two paired neural network structures inherit the same connections and corresponding weights for the same operations from the initialized supernet, generating two neural network models. It should be noted that the initial weights inherited by the paired neural network structures from the supernet are the weights of the same connections and corresponding operations in the initial supernet. In subsequent iterations, the weights inherited by the paired neural network structures from the supernet are the weights of the updated supernet and the corresponding connections and operations.

[0124] S303 trains the two neural network models with inherited weights from S302 using gradient descent once or multiple times.

[0125] S304: By calculating the error values ​​of two neural network models on the validation set, the winner and loser are determined. The neural network model with the smaller error value is the winner, and the neural network model with the larger error value is the loser.

[0126] S305, determine whether the two paired neural network models contain the same connection and whether the operation corresponding to the connection is the same; if the result is "yes", execute S306; if the result is "no", execute S307.

[0127] S306, the weights of the same connections in the supernet as those in the two neural network models, and the weights of the same operations corresponding to those connections, are updated to the weights of the winner.

[0128] S307, the weight values ​​of the operations corresponding to the connections between the two neural network models in the supernet are respectively used as the optimized weight values ​​of the two neural network models.

[0129] S308 outputs the supernet with updated weight values.

[0130] Based on the above embodiments, this application also proposes a structure update mechanism based on population pairing. This mechanism is used to realize the competition of pairwise non-repeating pairing of neural network structures in the population. The loser learns from the winner based on pseudo-gradients in a second-order manner to generate a new individual to replace the original loser.

[0131] Figure 9 This is a flowchart of the population-pairing-based structure update method proposed in this application. Figure 7 Shown, including:

[0132] S401, Initialize the population, where N is the total number of encoded neural network structures in the population. For detailed implementation, refer to steps S2011-2012.

[0133] S402, randomly pair the decoded neural network structures in the population without repetition, where n and n+1 are the numbers of the two paired neural network structures; the nth neural network structure is denoted as the first neural network structure, and the (n+1)th neural network structure is denoted as the second neural network structure.

[0134] S403, the two paired neural network structures inherit weight values ​​from the supernet.

[0135] It should be noted that the weight values ​​initially inherited by the two paired neural network structures from the supernet are the weight values ​​of the connections corresponding to the two neural network structures and the weight values ​​of the same operations corresponding to those connections in the initial supernet. In each subsequent iteration, the weight values ​​inherited by the two paired neural network structures from the supernet are the weight values ​​of the updated supernet.

[0136] S404 trains paired neural network structures based on the learning task to identify losers and winners.

[0137] S405, based on the evaluation results, the structural encoding of the loser learns from the structural encoding of the winner, resulting in a new structural encoding of the neural network.

[0138] S406 replaces the losers in the population with the structural encoding of a new neural network.

[0139] S407, determine whether all individuals in the population participate in pairing; if the result is "no", then execute S402; if the result is "yes", then execute S408;

[0140] Specifically, if n ≥ N-1, the iteration ends and S508 is executed; if n < N-1, the value of n is incremented by 2, and the process returns to step 402.

[0141] S408, a new population was exported.

[0142] This application maps continuous space onto a neural network structure to enable continuous mathematical operations on the structure, thus giving the algorithm better global search capabilities. Through a population-based pairwise second-order learning structure update method, the optimal solution can be found more quickly. At the same time, based on the characteristics of the population, a set of solutions can be found, providing decision-makers with multiple choices and improving the reliability of the algorithm. Furthermore, the weight inheritance and update of the supernet can accelerate the model evaluation speed and significantly reduce the computational cost and running time required for searching neural networks.

[0143] This application provides a system for searching neural network structures based on evolutionary learning, such as... Figure 10As shown, the system includes: a population initialization module 801, an individual pairing module 802, a training evaluation module 803, a supernet weight update module 804, a population update module 805, and a model output module 806.

[0144] The system initializes the population through the population initialization module 801, where each neural network structure in the population is a structure code. This structure code maps the connections and corresponding operations between nodes of the neural network structure using a continuous range of real numbers. The individual pairing module 802 randomly selects two structural codes within the population, decodes them into two neural network structures, and pairs them. The paired neural network structures inherit corresponding weights from the supernet to obtain the first and second neural network models. The supernet includes the set of all operations, and the weights are the weight information corresponding to all operations. The training and evaluation module 803 trains the first and second neural network models respectively, evaluates the trained first and second neural network models, and obtains the winners and losers. The supernet weight update module 804 updates the supernet based on the trained first and second neural network models. The population update module 805 calculates the pseudo-gradient value between the structural codes of the losers and the structural codes of the winners, and evolves the structural codes of the losers towards the structural codes of the winners based on the pseudo-gradient value to obtain the structural code of the third neural network structure. The structural code of the third neural network structure replaces the structural code of the corresponding neural network structure of the losers in the population to obtain an updated population. The model output module 806 outputs the optimal neural network model in the updated population if the termination condition is met, thus completing the search for the neural network structure. Otherwise, the individual pairing module 802 is executed to iteratively evolve the updated population.

[0145] Specifically, the population initialization module 801 can also generate N neural network structures with the same number of nodes by manually encoding according to a custom encoding rule; through encoding, continuous real number intervals are mapped to the connections and corresponding discrete operations between nodes of a single neural network structure, where N is a natural number.

[0146] The system for searching neural network structures based on evolutionary learning provided in this application also includes a supernet initialization module. The supernet initialization module sets up a supernet according to the learning task. The supernet includes N network units and a set of all operations.

[0147] Specifically, in the neural network structure search system based on evolutionary learning provided in this application embodiment, the individual pairing module 802 inherits the same connections and corresponding weights of the same operations from the supernet to obtain a first neural network model; and inherits the same connections and corresponding weights of the same operations from the supernet to obtain a second neural network model. The training and evaluation module 803, in conjunction with the learning task, trains the weight values ​​of the first neural network model at least once using stochastic gradient descent to obtain an optimized first neural network model; in conjunction with the learning task, it trains the second neural network model once using stochastic gradient descent to obtain an optimized second neural network model; it evaluates the optimized first neural network model and the optimized second neural network model on the validation set respectively; it calculates the error value of the first neural network model based on the optimized first neural network model; it calculates the error value of the second neural network model based on the optimized second neural network model; it compares the error values ​​of the first and second neural network models; and it records the neural network model with the smaller error value as the winner, and the first / second neural network with the larger error value as the loser, thus obtaining the evaluation result. The supernet weight update process (804) assumes that, under the condition that two nodes in the first and second neural networks have the same connection and the same operation, the weight of the winning node for that operation is used as the weight of the supernet. If the first and second neural networks have different node connections or the same node connection corresponding to different operations, the weights of the first neural network model are used as the weights of the connections in the supernet that have the same structure as the first neural network and the corresponding operations. The weights of the second neural network model are used as the weights of the connections in the supernet that have the same structure as the second neural network and the corresponding operations. This results in an updated supernet. The population update module calculates the difference between the structure encoding values ​​of the losers and the winners, multiplies this difference by a random coefficient, and sums it with the historical pseudo-gradients at a multiple of this random coefficient to obtain the pseudo-gradient value for updating the loser's structure encoding. Finally, the structure encoding value of the loser is summed with the pseudo-gradient value to obtain the structure encoding of the third neural network structure. The model output module 806 determines whether all neural network structures in the population participate in pairing. If the result is "no," it returns to the individual pairing module 802 to iteratively evolve the updated population. If the result is "yes," it outputs the optimal neural network model in the updated population, thus completing the search for the neural network structure. The model output module 806 sets the iteration count to T, where T is a natural number greater than 0, and determines whether the current execution count is less than T. If the result is "yes," it returns to the individual pairing module 802 to iteratively evolve the updated population. If the result is "no," it outputs the optimal neural network model in the updated population, thus completing the search for the neural network structure.The model output module 806 can also inherit the corresponding weight values ​​from the updated supernet when the number of iterations is greater than 1.

[0148] This application provides a supernet update system, such as... Figure 11 As shown, the system includes: randomly initializing a supernet through a supernet initialization module 901, the supernet comprising N network units and a set of all operations; randomly selecting two neural network structures within the population for pairing through an individual pairing module 802; the two paired neural network structures inheriting corresponding weights from the supernet to obtain a first neural network model and a second neural network model; training and evaluating the first and second neural network models respectively through a training and evaluation module 803, evaluating the trained first and second neural network models to obtain winners and losers; under the condition that two nodes in the first and second neural networks have the same connection and that connection has the same operation, the weight of the winner's operation is used as the weight of the supernet. The weight of the winner is used as the weight of the supernet; and under the condition that the first and second neural networks have different node connections or the same node connection but corresponding to different operations, the update module 904 uses the weight of the first neural network model as the weight of the connection in the supernet that is the same as the first neural network structure and the weight of the same operation corresponding to that connection; the weight of the second neural network model is used as the weight of the connection in the supernet that is the same as the second neural network structure and the weight of the same operation corresponding to that connection; thus obtaining an updated supernet.

[0149] This application provides an electronic device 1000, such as... Figure 12 As shown, it includes a processor 1001 and a memory 1002; the processor 1001 is used to execute computer execution instructions stored in the memory 1002, and the processor 1001 executes the computer execution instructions to perform the method of neural network structure search based on evolutionary learning described in any of the above embodiments.

[0150] This application provides a storage medium, including a readable storage medium and a computer program stored in the readable storage medium, the computer program being used to implement the method for searching neural network structures based on evolutionary learning as described in any of the above embodiments.

[0151] Those skilled in the art will recognize that the units and algorithm steps of the various examples described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are implemented in hardware or software depends on the specific application and design constraints of the technical solution. Those skilled in the art can use different methods to implement the described functions for each specific application, but such implementation should not be considered beyond the scope of the embodiments of this application. Furthermore, various aspects or features of the embodiments of this application can be implemented as methods, apparatus, or articles of manufacture using standard programming and / or engineering techniques. The term "article of manufacture" as used in this application encompasses a computer program accessible from any computer-readable device, carrier, or medium. For example, computer-readable media may include, but are not limited to: magnetic storage devices (e.g., hard disks, floppy disks, or magnetic tapes), optical discs (e.g., compact discs (CDs), digital versatile discs (DVDs), etc.), smart cards, and flash memory devices (e.g., erasable programmable read-only memory (EPROMs), cards, sticks, or key drives, etc.). Additionally, the various storage media described herein may represent one or more devices and / or other machine-readable media used for storing information. The term "machine-readable media" may include, but is not limited to, wireless channels and various other media capable of storing, containing, and / or carrying instructions and / or data.

[0152] It should be understood that in the various embodiments of this application, the order of the above-mentioned processes does not imply the order of execution. The execution order of each process should be determined by its function and internal logic, and should not constitute any limitation on the implementation process of this application.

[0153] Those skilled in the art will understand that, for the sake of convenience and brevity, the specific working processes of the systems, devices, and units described above can be referred to the corresponding processes in the foregoing method embodiments, and will not be repeated here.

[0154] In the several embodiments provided in this application, it should be understood that the disclosed systems, apparatuses, and methods can be implemented in other ways. For example, the apparatus embodiments described above are merely illustrative; for instance, the division of units is only a logical functional division, and in actual implementation, there may be other division methods. For example, multiple units or components may be combined or integrated into another system, or some features may be ignored or not executed. Furthermore, the coupling or direct coupling or communication connection shown or discussed may be through some interfaces; the indirect coupling or communication connection between apparatuses or units may be electrical, mechanical, or other forms.

[0155] The units described as separate components may or may not be physically separate. The components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple network units. Some or all of the units can be selected to achieve the purpose of this embodiment according to actual needs.

[0156] If the aforementioned function is implemented as a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of this application embodiment, essentially, or the part that contributes to the prior art, or part of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause a computer device (which may be a personal computer, a server, or an access network device, etc.) to execute all or part of the steps of the methods described in the various embodiments of this application. The aforementioned storage medium includes various media capable of storing program code, such as USB flash drives, portable hard drives, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks.

[0157] The above description is merely a specific embodiment of the present application, but the scope of protection of the present application is not limited thereto. Any changes or substitutions that can be easily conceived by a person skilled in the art within the technical scope disclosed in this application should be included in the scope of protection of this application. Therefore, the scope of protection of this application should be based on the scope of protection of the claims.

Claims

1. A method for searching neural network structures based on evolutionary learning, characterized in that, The method is used to include: S101, Initialize the population, which is a set of structure codes containing multiple different neural network structures. The structure codes are used to indicate the mapping relationship between any two nodes of the neural network structure through a continuous real number interval. S102, randomly select two structural codes within the population, decode the two structural codes to obtain two neural network structures, and pair the two neural network structures; inherit the corresponding weights from the supernet for each of the two neural network structures to obtain a first neural network model and a second neural network model; wherein the supernet includes a set of multiple operations and the weight of each operation; S103, train the first and second neural network models respectively to obtain the trained first and second neural network models; input the labeled voice, video or image samples into the trained first and second neural network models, calculate the error value between the output result and the label to obtain the winner and loser, wherein the error value of the winner is less than the error value of the loser; S104, Update the supernet based on the trained first and second neural network models; S105, calculate the pseudo gradient value between the structural encoding of the loser and the structural encoding of the winner, and based on the pseudo gradient value, evolve the structural encoding of the loser towards the structural encoding of the winner to obtain the structural encoding of the third neural network; the pseudo gradient is the gradient for updating the structural encoding. S106, the structure encoding of the third neural network structure is used to replace the structure encoding of the neural network structure corresponding to the loser in the population to obtain an updated population; S107, Output the optimal neural network model in the updated population to complete the search for the neural network structure.

2. The method according to claim 1, characterized in that, The step of outputting the optimal neural network model in the updated population to complete the search for the neural network structure includes: outputting the optimal neural network model in the updated population when the termination condition is met, thereby completing the search for the neural network structure.

3. The method according to claim 1, characterized in that, The step of outputting the optimal neural network model in the updated population to complete the search for the neural network structure includes: if the termination condition is not met, returning to S102, iteratively evolving the updated population until the termination condition is met, and then outputting the optimal neural network model in the updated population to complete the search for the neural network structure.

4. The method according to any one of claims 1-3, characterized in that, The step of inheriting the corresponding weights from the supernet to obtain the first neural network model and the second neural network model includes: The first neural network model is obtained by inheriting the same connections and the first weights corresponding to the same operations as the first neural network structure from the supernet. The second neural network model is obtained by inheriting the same connections and the second weights corresponding to the same operations from the supernet.

5. The method according to any one of claims 1-3, characterized in that, The step of training the first and second neural network models respectively to obtain the trained first and second neural network models includes: The weight values ​​of the first neural network model are trained at least once using stochastic gradient descent to obtain an optimized first neural network model; The weight values ​​of the second neural network model are trained at least once using stochastic gradient descent to obtain an optimized second neural network model.

6. The method according to any one of claims 1-3, characterized in that, The step of inputting labeled voice, video, or image samples into the trained first and second neural network models, calculating the error value between the output result and the label to determine the winner and loser, includes: The labeled voice, video, or image samples are respectively input into the trained first neural network model and the trained second neural network model; Based on the first output of the trained first neural network model, calculate the first error value between the first output and the label of the sample; Based on the second output of the trained second neural network model, calculate the second error value between the second output and the label of the sample; By comparing the first error value and the second error value, the first / second neural network model with the smaller error value is identified as the winner, and the first / second neural network model with the larger error value is identified as the loser, thus obtaining the winner and loser.

7. The method according to any one of claims 1-3, characterized in that, The step of updating the supernet based on the trained first and second neural network models includes: Given that two nodes in the first and second neural network models have the same connection and the corresponding operation is the same, the weight of the winner is used as the weight of the corresponding operation in the supernet, and the supernet is updated.

8. The method according to any one of claims 1-3, characterized in that, The step of updating the supernet based on the trained first and second neural network models includes: When the connections between two nodes in the first and second neural network models and the corresponding operations are different, the weights of the first neural network model are used as the weights of the connections in the supernet that have the same structure as the first neural network and the corresponding operations; the weights of the second neural network model are used as the weights of the connections in the supernet that have the same structure as the second neural network and the corresponding operations; and the supernet is updated.

9. The method according to any one of claims 1-3, characterized in that, The process of calculating the pseudo-gradient value between the structural encoding of the loser and the structural encoding of the winner, and then using the pseudo-gradient value to evolve the structural encoding of the loser towards the structural encoding of the winner, to obtain the structural encoding of the third neural network structure, includes: Calculate the difference between the structure encoding value of the loser and the structure encoding value of the winner, multiply the difference by a random coefficient, and sum the historical pseudo gradients at the random coefficient multiplier to obtain the pseudo gradient value of the structure encoding update of the loser. The structural encoding value of the loser is summed with the value of the pseudo gradient to obtain the structural encoding of the third neural network structure, thereby realizing the evolution of the structural encoding of the loser to the structural encoding of the winner.

10. The method according to claim 2 or 3, characterized in that, The termination conditions include whether all structural codes in the population have participated in pairing or whether the set number of iterations has been reached.

11. A search system for neural network structures based on evolutionary learning, characterized in that, The system includes: A population initialization module is used to initialize a population, which is a set of structure codes containing multiple different neural network structures. The structure codes are used to indicate the mapping relationship of connections and operations between any two nodes of the neural network structure through a continuous range of real numbers. An individual pairing module is used to randomly select two structural codes within the population, decode the two structural codes to obtain two neural network structures, and pair the two neural network structures. The weight inheritance module inherits the corresponding weights from the supernet for the two neural network structures respectively, to obtain the first neural network model and the second neural network model; wherein the supernet includes a set of multiple operations and the weight of each operation; The training module is used to train the first and second neural network models respectively to obtain the trained first and second neural network models; An evaluation module is used to input labeled voice, video, or image samples into the trained first and second neural network models, calculate the error value between the output result and the label to obtain the winner and the loser, wherein the error value of the winner is smaller than that of the loser. The supernet weight update module is used to update the supernet based on the trained first and second neural network models. The structural encoding evolution module is used to calculate the pseudo-gradient value between the structural encoding of the loser and the structural encoding of the winner, and based on the pseudo-gradient value, to evolve the structural encoding of the loser towards the structural encoding of the winner, thereby obtaining the structural encoding of the third neural network; the pseudo-gradient is the gradient for updating the structural encoding; and The population update module is used to replace the structure encoding of the neural network structure corresponding to the loser in the population with the structure encoding of the third neural network structure in the population to obtain an updated population. The model output module outputs the optimal neural network model in the updated population, thereby completing the search for the neural network structure.

12. The system according to claim 11, characterized in that, The model output module is used for: If the termination condition is met, the optimal neural network model in the updated population is output, thereby completing the search for the neural network structure.

13. The system according to claim 11, characterized in that, The model output module is used for: If the termination condition is not met, return to S102 and iterate the updated population until the termination condition is met. Then, output the optimal neural network model in the updated population to complete the search for the neural network structure.

14. The system according to claim 11, characterized in that, The weight inheritance module is used for: The first neural network model is obtained by inheriting the same connections and the first weights corresponding to the same operations as the first neural network structure from the supernet. The second neural network model is obtained by inheriting the same connections and the second weights corresponding to the same operations from the supernet.

15. The system according to claim 11, characterized in that, The training module is used for: The weight values ​​of the first neural network model are trained at least once using stochastic gradient descent to obtain an optimized first neural network model; The weight values ​​of the second neural network model are trained at least once using stochastic gradient descent to obtain an optimized second neural network model.

16. The system according to claim 11, characterized in that, The evaluation module is used for: The labeled voice, video, or image samples are respectively input into the trained first neural network model and the trained second neural network model; Based on the first output of the trained first neural network model, calculate the first error value between the first output and the label of the sample; Based on the second output of the trained second neural network model, calculate the second error value between the second output and the label of the sample; By comparing the first error value and the second error value, the first / second neural network model with the smaller error value is recorded as the winner, and the first / second neural network model with the larger error value is recorded as the loser, thus obtaining the winner and loser.

17. The system according to claim 11, characterized in that, The supernet weight update module is used for: Given that two nodes in the first and second neural network models have the same connection and the corresponding operation is the same, the weight of the winner is used as the weight of the corresponding operation in the supernet, and the supernet is updated.

18. The system according to claim 11, characterized in that, The supernet weight update module is used for: Under the condition that the connection between two nodes in the first and second neural network models and the corresponding operation of the connection are different, the weight of the first neural network model is used as the weight of the connection in the supernet that has the same structure as the first neural network and the weight of the corresponding operation of the connection. The weights of the second neural network model are used as the weights of the connections in the supernet that have the same structure as the second neural network and the weights of the same operations corresponding to those connections; the supernet is then updated.

19. The system according to claim 11, characterized in that, The structure encoding evolution module is used for: Calculate the difference between the structure encoding value of the loser and the structure encoding value of the winner, multiply the difference by a random coefficient, and sum the historical pseudo gradients at the random coefficient multiplier to obtain the pseudo gradient value of the structure encoding update of the loser. The structural encoding value of the loser is summed with the value of the pseudo gradient to obtain the structural encoding of the third neural network structure, thereby realizing the evolution of the structural encoding of the loser to the structural encoding of the winner.

20. The system according to claim 12 or 13, characterized in that, The termination conditions include whether all structural codes in the population have participated in pairing or whether the set number of iterations has been reached.

21. An electronic device, characterized in that, It includes a memory and a processor; the processor is used to execute computer execution instructions stored in the memory, and the processor executes the computer execution instructions to perform the search method for neural network structures based on evolutionary learning as described in any one of claims 1-10.

22. A storage medium, characterized in that, The method includes a readable storage medium and a computer program stored in the readable storage medium, the computer program being used to implement the method for searching neural network structures based on evolutionary learning as described in any one of claims 1-10.

Citation Information

Patent Citations

  • Super-network search space construction method and device and electronic device

    CN110569972A

  • Method and Apparatus for Training Neural Network and Computer Server

    US20190385059A1