A parallel differentiable neural network architecture search method
By constructing a dual-path super network with binary gates and using the sigmoid function for search space continuity, combined with gradient descent optimization, the problem of high computational burden in neural network architecture search is solved, and a faster and more efficient neural network architecture search is achieved. Significantly improved performance and speed.
Patent Information
- Application Number
- CN202211299553.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-10-23
- Publication Date
- 2024-10-29
- Estimated Expiration
- 2042-10-23
AI Technical Summary
Existing neural network architecture search methods have limited their wide application and research due to their heavy computational burden. In particular, methods based on reinforcement learning and evolutionary algorithms consume a lot of resources when exploring optimal neural network architectures.
A parallel differentiable neural network architecture search method is adopted, by constructing a dual-path super network with binary gates, using the sigmoid function to continuousize the search space, and using gradient descent optimization to obtain the optimal basic unit, and finally stacking it to form a deep neural network for reconstruction. train.
It significantly improves the speed and performance of neural network architecture search, reduces memory consumption during the training process, and balances the performance of operation operators through the sigmoid function to avoid unfair selection, achieving faster and more efficient neural network architecture search.
Smart Images

Figure CN115906935B_ABST
Abstract
Description
Technical Field
[0001] The present invention belongs to the field of deep learning technology, and specifically relates to a parallel differentiable neural network architecture search method. Background Art
[0002] The rapid development of deep learning has proved its dominance in the field of artificial intelligence and deep learning. Thanks to the unremitting efforts of researchers, the performance of deep neural networks has been continuously improved. However, since the manual design of neural networks requires a continuous trial and error process and relies heavily on the design experience of experts, manually creating neural network structures consumes a lot of time and resources. In order to reduce manpower and costs, the neural network architecture search (NAS) technology was proposed. NAS, as a technology that uses algorithms to automatically search for neural network architectures to meet the requirements of different tasks, has become a research hotspot in the field of automated machine learning.
[0003] The core of the NAS method is to construct a huge search space, and then use an efficient search algorithm to mine this space and find the best architecture under a series of training data and constraints. Early work was mainly based on reinforcement learning and evolutionary algorithms. They have shown great potential in finding high-performance neural network architectures. However, neural network architecture search methods based on reinforcement learning and evolutionary algorithms usually bear a heavy computational burden, which seriously hinders the widespread application and research of NAS. In order to reduce the heavy computational burden, a weight sharing algorithm is proposed, which formulates the search space as an over-parameterized super network and evaluates the sampled architectures without additional optimization. By sharing weights, NAS is accelerated by several orders of magnitude.
[0004] A special type of weight sharing method is the differentiable neural network architecture search technology proposed in the paper "Darts: Differentiable architecture search". This technology first defines the search space as a super network stacked by basic units (normal units and reduction units), and searches for basic units to find the optimal architecture of the neural network. Then DARTS converts discrete operations into a weighted set of fixed operations, so that the super network can be trained through a gradient-based two-layer optimization method. This makes NAS more promising in exploring the optimal network architecture from a huge architecture search space. Despite this, existing technologies still have certain limitations: they still have to bear the massive computing costs brought by the huge network architecture and a large amount of redundant space, which limits the widespread application and research of NAS. Summary of the invention
[0005] In order to overcome the shortcomings of the prior art, the present invention provides a parallel differentiable neural network architecture search method, firstly constructing a dual-path super network with binary gates; then using the sigmoid function to make the search space continuous; then using the gradient descent method to optimize the super network to obtain the optimal basic unit, including ordinary units and reduction units; finally using the obtained basic units to stack, obtain the required deep neural network, and retrain the deep neural network until the network converges. By designing a fast and parallel differentiable neural network architecture search method, the speed and performance of the neural network architecture search are significantly improved.
[0006] The technical solution adopted by the present invention to solve the technical problem includes the following steps:
[0007] Step 1: Build a dual-path super network with binary gates;
[0008] The super network is formed by stacking L basic units;
[0009] The basic unit includes a common unit and a reduction unit; the common unit and the reduction unit are both directed acyclic graphs consisting of 7 nodes, including 2 input nodes, 4 intermediate nodes and 1 output node, the connections between the nodes represent different operations, and the connection relationships between the internal nodes of the common unit and the reduction unit are different;
[0010] Step 1-1: Assume that the operation pool is O, which contains 8 basic operation operators: sep-conv-3×3, sep-conv-5×5, dil-conv-3×3, dil-conv-5×5, max-pool-3×3, avg-pool-3×3, skip-connection and none;
[0011] The operation pool O is decomposed into two operator subsets O1 and O2 by random sampling, where O1 and O2 satisfy |O1|=|O2|, |O1|+|O2|=|O| and O1 and O2 are used to construct two sub-networks respectively;
[0012] Two groups of channels are sampled in the input channel of the entire network, which are adopted by two sub-networks respectively. The two sub-networks are finally merged into one through addition operation; for two different nodes x in a basic unit of the super network i to x j The information propagation of is described as:
[0013]
[0014]
[0015]
[0016] Among them, x i and x j Represents different nodes, and 0≤i <j≤5, and Represent the weights of different operations in O1 and O2 respectively; and There are two sets of channel sampling masks, and the masks are composed only of 0 and 1; and represent the selected and unselected channels, respectively; and The two selected sets of channels are simultaneously adopted by two subsets of operators;
[0017] The super network covers all architectures in the form of two parallel paths;
[0018] Step 1-2: During the training of the super network, binary gating is used to selectively activate each path to participate in the training;
[0019] For two nodes x in a basic unit i to x j The information propagation of the super network is described as follows:
[0020]
[0021] The values of gate1 and gate2 are 0 or 1, excluding the case where gate1 and gate2 are 0 at the same time; the binary gating operation takes values in a random sampling manner to selectively activate the corresponding paths to participate in training;
[0022] Step 2: Use the sigmoid function to make the search space continuous and redefine the two sub-networks;
[0023]
[0024]
[0025] Where δ(·) represents the sigmoid function, and its calculation formula is as follows:
[0026]
[0027] Step 3: Use the gradient descent method to optimize the super network and obtain the optimal basic unit, including ordinary units and reduction units;
[0028] By jointly optimizing the network parameter w and the structural parameter α, we find the optimal α to determine the optimal basic unit:
[0029]
[0030] swt * (α) = arg min L train (w,α)
[0031] Among them, L train is the training loss, L val For validation loss, cross entropy loss is used for both training loss and validation loss;
[0032] After obtaining the structural parameter α, according to the one-hot encoding:
[0033]
[0034] Select the two operations with the largest α value as the input of the intermediate node of the basic unit;
[0035] Step 4: Use the basic units obtained in step 2 to stack and obtain the required deep neural network, and retrain the deep neural network until the network converges.
[0036] Preferably, the super network optimization process in step 3 adopts a network formed by stacking 6 common units and 2 reduction units, wherein the 2 reduction units are respectively located at 1 / 3 and 2 / 3 of the total depth of the network.
[0037] Preferably, the deep neural network required in step 4 is a deep neural network for CIFAR-10, which is formed by stacking 20 basic units, each of which includes 2 reduction units and 18 ordinary units.
[0038] Preferably, the deep neural network required in step 4 is a deep neural network for ImageNet, which is stacked with 12 basic units, each of which includes 2 reduction units and 12 ordinary units, and the 2 reduction units are respectively located at 1 / 3 and 2 / 3 of the total depth of the network.
[0039] The beneficial effects of the present invention are as follows:
[0040] The present invention proposes a fast and parallel differentiable neural network architecture search technology. By constructing a dual-path super network with binary gates, the memory consumption in the training process is reduced, and the speed of the neural network architecture search is improved. At the same time, considering that when using softmax to select the best input for the intermediate nodes of two operator subsets, unfairness may be encountered. In order to solve this problem, the sigmoid function is introduced, which measures the performance of each operation operator without normalization, thereby ensuring the performance of the neural network architecture search technology. The present invention significantly improves the speed and performance of the neural network architecture search. BRIEF DESCRIPTION OF THE DRAWINGS
[0041] Figure 1 It is a diagram of the implementation steps of a fast and parallel differentiable neural network architecture search method of the present invention.
[0042] Figure 2 This is the search method of the present invention, taking a basic unit as an example.
[0043] Figure 3 : is a structural diagram of the basic unit obtained by searching on CIFAR-10, where (a) is a normal unit and (b) is a reduction unit.
[0044] Figure 4 : This is a structural diagram of the basic unit obtained by searching on ImageNet in the present invention: (a) is a normal unit, and (b) is a reduction unit. DETAILED DESCRIPTION
[0045] The present invention is further described below in conjunction with the accompanying drawings and embodiments.
[0046] A parallel differentiable neural network architecture search method comprises the following steps:
[0047] Step 1: Build a dual-path super network with binary gates;
[0048] The super network is formed by stacking L basic units;
[0049] The basic unit includes a common unit and a reduction unit; the common unit and the reduction unit are both directed acyclic graphs consisting of 7 nodes, including 2 input nodes, 4 intermediate nodes and 1 output node, the connections between the nodes represent different operations, and the connection relationships between the internal nodes of the common unit and the reduction unit are different;
[0050] Step 1-1: Assume that the operation pool is O, which contains 8 basic operation operators: sep-conv-3×3, sep-conv-5×5, dil-conv-3×3, dil-conv-5×5, max-pool-3×3, avg-pool-3×3, skip-connection and none;
[0051] The operation pool O is decomposed into two operator subsets O1 and O2 by random sampling, where O1 and O2 satisfy |O1|=|O2|, |O1|+|O2|=|O| and O1 and O2 are used to construct two sub-networks respectively;
[0052] Two groups of channels are sampled in the input channel of the entire network, which are adopted by two sub-networks respectively. The two sub-networks are finally merged into one through addition operation; for two different nodes x in a basic unit of the super network i to x j The information propagation of is described as:
[0053]
[0054]
[0055]
[0056] Among them, x i and x j Represents different nodes, and 0≤i <j≤5, and Represent the weights of different operations in O1 and O2 respectively; and There are two sets of channel sampling masks, and the masks are composed only of 0 and 1; and represent the selected and unselected channels, respectively; and The two selected sets of channels are simultaneously adopted by two subsets of operators;
[0057] The super network covers all architectures in the form of two parallel paths;
[0058] Step 1-2: During the training of the super network, binary gating is used to selectively activate each path to participate in the training;
[0059] For two nodes x in a basic unit i to x j The information propagation of the super network is described as follows:
[0060]
[0061] The values of gate1 and gate2 are 0 or 1, excluding the case where gate1 and gate2 are 0 at the same time; the binary gating operation takes values in a random sampling manner to selectively activate the corresponding paths to participate in training;
[0062] Step 2: Use the sigmoid function to make the search space continuous and redefine the two sub-networks;
[0063]
[0064]
[0065] Where δ(·) represents the sigmoid function, and its calculation formula is as follows:
[0066]
[0067] The super network optimization process uses a network formed by stacking 6 common units and 2 reduction units, where the 2 reduction units are located at 1 / 3 and 2 / 3 of the total depth of the network respectively;
[0068] Step 3: Use the gradient descent method to optimize the super network and obtain the optimal basic unit, including ordinary units and reduction units;
[0069] By jointly optimizing the network parameter w and the structural parameter α, we find the optimal α to determine the optimal basic unit:
[0070]
[0071] swt * (α) = arg min L train (w,α)
[0072] Among them, L train is the training loss, L val For validation loss, cross entropy loss is used for both training loss and validation loss;
[0073] After obtaining the structural parameter α, according to the one-hot encoding:
[0074]
[0075] Select the two operations with the largest α value as the input of the intermediate node of the basic unit;
[0076] Step 4: Use the basic units obtained in step 2 to stack and obtain the required deep neural network, and retrain the deep neural network until the network converges.
[0077] The deep neural network used for CIFAR-10 is formed by stacking 20 basic units, each of which includes 2 reduction units and 18 ordinary units.
[0078] The deep neural network used for ImageNet is composed of 12 basic units stacked together, each of which includes 2 reduction units and 12 ordinary units. The 2 reduction units are located at 1 / 3 and 2 / 3 of the total depth of the network respectively. Specific embodiment:
[0080] The fast parallel differentiable neural network architecture search method of this embodiment specifically includes the following steps:
[0081] S1: construct a super network, wherein the super network is a dual-path super network with binary gates;
[0082] S2: Use the sigmoid function to make the search space continuous;
[0083] S3: Optimizing the super network by using a gradient descent method to obtain optimal basic units (normal units and reduction units);
[0084] S4: stacking the basic units obtained in step S2 to obtain the desired deep neural network, and retraining the deep neural network until the network converges.
[0085] By adopting the above technical scheme, a super network containing two parallel paths and gated operations is constructed to reduce the memory consumption of the neural network architecture search technology, thereby improving the speed of the neural network architecture search. When softmax is used to select the best input for the intermediate nodes of two operator subsets, unfairness may be encountered. In order to solve this problem, the sigmoid function is introduced to make the search space continuous. The sigmoid function measures the performance of the operation without normalization. The present invention significantly improves the speed and performance of the neural network architecture search. In the step S1, the super network is stacked by L basic units. The basic unit includes a common unit and a reduction unit. The common unit and the reduction unit are directed acyclic graphs composed of 7 nodes, including 2 input nodes, 4 intermediate nodes, and 1 output node. The connection between the nodes represents possible operations (such as 3×3 convolution). The reduction unit uses a convolution with a stride of 2, so the spatial resolution of the feature map is reduced to half of the original. In order to improve the search speed, the present invention constructs a dual-path super network with binary gates. The specific construction process of the dual-path super network with binary gates is as follows:
[0086] S11: Assume that the entire operation pool is O, which contains 8 basic operators, namely: sep-conv-3×3, sep-conv-5×5, dil-conv-3×3, dil-conv-5×5, max-pool-3×3, avg-pool-3×3, identity (skip-connection) and none. The operation pool O is decomposed into two smaller operator subsets O1 and O2, where O1 and O2 satisfy |O1|=|O2|, |O1|+|O2|=|O| and O1 and O2 are used to construct two smaller sub-networks respectively. In order to reduce the computational burden and make the search space cover all possible architectures, the present invention designs a dual-path super network with binary gates. First, the present invention adopts a partial connection strategy. Specifically, two groups of channels are sampled from the entire input channel, which are respectively adopted by the above two sub-networks. The two sub-networks are merged into one through addition operation. In this way, the super network is presented in a parallel form, with nodes x i To node x j Taking information propagation as an example, the super network can be described as:
[0087]
[0088]
[0089]
[0090] Among them, x i and x j Represents different nodes, and 0≤i <j≤5。 and Represent the weights of different operations in O1 and O2 respectively. and are two sets of channel sampling masks, the masks consist only of 0 and 1. and Represents the selected and unselected channels respectively. and The two sets of selected channels are simultaneously adopted by two subsets of operators. This design brings an intuitive advantage that the super network can cover all possible architectures in the form of two parallel paths;
[0091] S12: In the process of training the super network, we use binary gating to selectively activate each path to participate in the training. i To node x j Taking information propagation as an example, the super network can be described as:
[0092]
[0093] The values of gate1 and gate2 are 0 or 1. In actual operation, gate1 = 0 and gate2 = 0 are excluded. Binary gating operations are performed by random sampling to selectively activate corresponding paths for training, thereby greatly reducing memory costs.
[0094] In step S2, the sigmoid function is used to make the search space continuous, as follows:
[0095]
[0096]
[0097] Where δ(·) represents the sigmoid function, and its calculation formula is as follows:
[0098]
[0099] In step 3, the super network is optimized by jointly optimizing the network parameter w and the structural parameter α to find the optimal α and determine the best basic unit:
[0100]
[0101] swt * (α) = arg min L train (w,α)
[0102] Among them, L train is the training loss, L val is the validation loss. Both training loss and validation loss use cross entropy loss. After obtaining the architecture parameter α, according to the one-hot encoding:
[0103]
[0104] Select the two operations with the largest α value as the input of the intermediate node of the basic unit.
[0105] In the super network optimization process in step S3, a large network is formed by stacking 6 common units and 2 reduction units, wherein the 2 reduction units are located at 1 / 3 and 2 / 3 of the total depth of the network respectively.
[0106] In the step S4, the neural network is formed by stacking 20 basic units (2 reduction units and 18 common units) for the deep neural network of CIFAR-10, and a large network is constructed by stacking 12 basic units (2 reduction units and 12 common units) for the deep neural network of ImageNet. The 2 reduction units are respectively located at 1 / 3 and 2 / 3 of the total depth of the network.
[0107] The deep neural network constructed in step S4 is evaluated on the corresponding data set to test its performance. Among them, 97.47% classification accuracy is achieved on CIFAR-10 using only 0.08 GPU days. Compared with the results of the reference "Darts" (1 GPU day, 97.24% classification accuracy), the search rate and network performance are greatly improved, wherein the search rate is improved by 12.5 times. At the same time, since the search speed of the present invention is very fast, it supports direct search on ImageNet, and only 2.44 GPU days are used on ImageNet to achieve 76.1% Top-1 classification accuracy and 92.8% Top-5 classification accuracy.
Claims
1. A parallel differentiable neural network architecture search method, characterized in that: The steps include: Step 1: Build a dual-path super network with binary gates; The super network is formed by stacking L basic units; The basic unit includes a common unit and a reduction unit; the common unit and the reduction unit are both directed acyclic graphs consisting of 7 nodes, including 2 input nodes, 4 intermediate nodes and 1 output node, the connections between the nodes represent different operations, and the connection relationships between the internal nodes of the common unit and the reduction unit are different; Step 1-1: Assume that the operation pool is O, which contains 8 basic operation operators: sep-conv-3×3, sep-conv-5×5, dil-conv-3×3, dil-conv-5×5, max-pool-3×3, avg-pool-3×3, skip-connection and none; The operation pool O is decomposed into two operator subsets O1 and O2 by random sampling, where O1 and O2 satisfy |O1|=|O2|, |O1|+|O2|=|O| and O1 and O2 are used to construct two sub-networks respectively; Two groups of channels are sampled in the input channel of the entire network, which are adopted by two sub-networks respectively. The two sub-networks are finally merged into one through addition operation; for two different nodes x in a basic unit of the super network i to x j The information propagation of is described as: Among them, x i and x j Represents different nodes, and 0≤i <j≤5, and Represent the weights of different operations in O1 and O2 respectively; and There are two sets of channel sampling masks, and the masks are composed only of 0 and 1; and represent the selected and unselected channels, respectively; and The two selected sets of channels are simultaneously adopted by two subsets of operators; The super network covers all architectures in the form of two parallel paths; Step 1-2: During the training of the super network, binary gating is used to selectively activate each path to participate in the training; For two nodes x in a basic unit i to x j The information propagation of the super network is described as follows: The values of gate1 and gate2 are 0 or 1, excluding the case where gate1 and gate2 are 0 at the same time; the binary gating operation takes values in a random sampling manner to selectively activate the corresponding paths to participate in training; Step 2: Use the sigmoid function to make the search space continuous and redefine the two sub-networks; Where δ(·) represents the sigmoid function, and its calculation formula is as follows: Step 3: Use the gradient descent method to optimize the super network and obtain the optimal basic unit, including ordinary units and reduction units; By jointly optimizing the network parameter w and the structural parameter α, we find the optimal α to determine the optimal basic unit: st * (α)=argminL train (in,α) Among them, L train is the training loss, L val For validation loss, cross entropy loss is used for both training loss and validation loss; After obtaining the structural parameter α, according to the one-hot encoding: Select the two operations with the largest α value as the input of the intermediate node of the basic unit; Step 4: Use the basic units obtained in step 2 to stack and obtain the required deep neural network, and retrain the deep neural network until the network converges; The deep neural network is a deep neural network for CIFAR-10, which is formed by stacking 20 basic units, each of which includes 2 reduction units and 18 ordinary units; or a deep neural network for ImageNet, which is formed by stacking 12 basic units, each of which includes 2 reduction units and 12 ordinary units, and the 2 reduction units are respectively located at 1 / 3 and 2 / 3 of the total depth of the network.
2. A parallel differentiable neural network architecture search method according to claim 1, characterized in that: The super network optimization process in step 3 adopts a network formed by stacking 6 common units and 2 reduction units, wherein the 2 reduction units are respectively located at 1 / 3 and 2 / 3 of the total depth of the network.
Citation Information
Patent Citations
Neural network architecture searching method and device, equipment and medium
CN113361680A
Transform-based twin network image denoising method and system, medium and equipment
CN114359109A
Darts network-based multi-modal medical image fusion method
WO2022121100A1
