A differentiable neural architecture search method based on reducing spatial and channel feature redundancy

By introducing continuous architecture parameters and design feature reconstruction modules and channel attention modules in neural architecture search, the problems of high computing resources, complex training and low search efficiency in the existing technology are solved, and efficient and stable neural network architecture search and image classification performance improvements are achieved.

CN119169344BActive Publication Date: 2025-04-22HARBIN INSTITUTE OF TECHNOLOGY (SHENZHEN) (INSTITUTE OF SCIENCE AND TECHNOLOGY INNOVATION HARBIN INSTITUTE OF TECHNOLOGY SHENZHEN)
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202411145247.2
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-08-20
Publication Date
2025-04-22
Estimated Expiration
2044-08-20

Smart Images

  • Figure CN119169344B_ABST
    Figure CN119169344B_ABST
Patent Text Reader

Abstract

The present invention provides a differentiable neural architecture search method based on reducing spatial and channel feature redundancy, the method comprising first defining a search space, searching for an optimal neural network architecture in the search space; designing a spatial feature reconstruction module to eliminate spatial feature redundancy; using an adaptive channel attention module to extract the importance of each channel through fast one-dimensional convolution, and using the calculated attention weight to guide the direction of the channel; wherein channels with higher attention weights are sent to the operation space, while other channels are directly in contact with the output of the operation space to balance information retention and computational efficiency; stacking the searched optimal network architecture units, reconstructing and training the neural network model, and then achieving the image classification task. The present invention exhibits significant advantages in terms of light weight, high efficiency, dynamic channel selection, balance between information retention and computational efficiency, easy expansion and generalization, and improved image classification performance.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of neural network architecture technology, and in particular to a differentiable neural architecture search method based on reducing spatial and channel feature redundancy. Background Art

[0002] Neural Architecture Search (NAS) is an optimal parameter search problem in a high-dimensional space. Figure 1 As shown in the figure, first a set of candidate neural network structures called search space is given, then sub-network structures are sampled according to a certain search strategy, and they are evaluated using a performance evaluation strategy, and the next round of search is performed based on the feedback results. It can be seen that the method of neural architecture search involves three aspects: search space, search strategy, and performance evaluation strategy. A network architecture is selected in the search space through a search strategy, and the network architecture is evaluated with the help of a performance evaluation strategy, and the results are fed back to the search strategy to guide the search strategy to select a better network architecture, and the optimal network architecture is obtained through continuous iteration.

[0003] The search space defines the types of neural networks that can be searched in the NAS algorithm, and also defines how to describe the neural network structure. The calculations implemented by the neural network can be abstracted into a directed acyclic graph (DAG) without isolated nodes. The nodes of the graph represent the layers of the neural network, and the edges represent the data flow. Each node receives data from its predecessor node and outputs the data to the subsequent node after calculation. The search space can be roughly divided into two categories: global search space and cell-based search space. The global search space is defined for a graph representing the entire neural structure, including a series of convolutions, pooling, linear transformations with activations (Dense layers) and different hyperparameter settings such as the number of filters, kernel size, step size, etc. The cell-based search space assumes that an architecture is a combination of repeated small numbers of cells to build the entire network. This design not only produces high-performance models, but also achieves task generalization across datasets.

[0004] The search strategy in neural architecture search defines how to find the optimal network structure in the search space. This is usually an iterative optimization process, which is essentially a hyperparameter optimization problem. Currently known search methods include random search, Bayesian optimization, genetic algorithm, reinforcement learning, and gradient-based algorithms. Among them, reinforcement learning, genetic learning, and gradient-based optimization are currently the mainstream algorithms.

[0005] For the neural network structure searched by the search strategy, it is first trained on a training set and then the accuracy value is tested on the validation set. The training and validation process is very time-consuming, so it is necessary to take measures to reduce the cost of performance evaluation. The neural network architecture search method based on multi-objective optimization can find the best neural network structure by maintaining a set of Pareto frontiers during the search process. Specifically, this method generates a set of new neural network structures in each iteration and evaluates these structures using multiple evaluation indicators. Then, based on the weights of these evaluation indicators, a multi-objective optimization algorithm is used to select a set of optimal neural network structures.

[0006] The current NAS technology has the following main disadvantages: (1) Most current NAS rely on a large amount of computing resources. This is because NAS needs to search for the optimal neural network architecture in a predefined search space. Each possible architecture needs to be trained and verified on a large-scale dataset to evaluate its performance. This process usually requires a lot of computing resources, including CPU, GPU, and memory. Therefore, NAS usually needs to be run on a high-performance computing platform, which may result in high computing costs. (2) In addition, the training process of NAS is usually complicated. First, NAS needs to define a search space that contains all possible neural network architectures. Then, NAS needs to define a search strategy that determines how to find the optimal neural network architecture in the search space. Finally, NAS needs to define a performance evaluation strategy that is used to evaluate the performance of each neural network architecture. These steps require a deep understanding of the principles of machine learning and deep learning, as well as familiarity with the use of related tools and libraries. (3) The training results of the neural network may be affected by the initial weights. This means that even the optimal network architecture may not achieve the best performance if the initial weights are not set properly. For example, if the initial weights are too large or too small, the training process of the neural network may fall into a local optimal solution and fail to find the global optimal solution. Therefore, when using NAS, it is necessary to pay attention to setting the initial weights reasonably to ensure that the neural network can learn and optimize correctly. (4) NAS usually needs to find the optimal architecture in a discrete search space. Therefore, when using reinforcement learning, evolutionary algorithms, Bayesian optimization, etc., the gradient of the loss cannot be used to update the network architecture, and the controller of the generated sub-network model can only be indirectly optimized. The discrete search space means that each architecture is composed of some discrete choices, such as the type, number, and connection method of the layer. The discrete search space brings some challenges, such as: the discrete search space is often non-convex, non-continuous, and high-dimensional, which makes it difficult to use gradient-based optimization methods to search for architectures; the discrete search space is often very large, which makes the search process very time-consuming and computationally intensive; the discrete search space is often not completely observable, which makes it necessary to train and test to evaluate the performance of each architecture, which is also very time-consuming and computationally intensive. Summary of the invention

[0007] In order to solve various problems existing in the prior art, the purpose of the present invention is to provide a differentiable neural architecture search method based on reducing spatial and channel feature redundancy, which shows significant advantages in light weight, high efficiency, dynamic channel selection, balance between information retention and computational efficiency, easy expansion and generalization, and improved image classification performance.

[0008] The present invention achieves the above-mentioned purpose through the following technical solutions:

[0009] A differentiable neural architecture search method based on reducing spatial and channel feature redundancy, the method comprising the following steps:

[0010] Define a search space that contains all desired candidate neural network models, and search for the optimal neural network architecture in the search space;

[0011] A spatial feature reconstruction module is designed to eliminate spatial feature redundancy. The module contains separation and reconstruction operations. The separation operation separates feature maps with rich information from feature maps with little information corresponding to spatial content, and then the reconstruction operation recombines these parts into spatially refined feature maps in the channel dimension.

[0012] An adaptive channel attention module is used to extract the importance of each channel through fast one-dimensional convolution, and the calculated attention weight is used to guide the direction of the channel. Among them, channels with higher attention weights are sent to the operation space, while other channels are directly superimposed with the output of the operation space in the channel dimension to balance information retention and computational efficiency.

[0013] The best network architecture units found are stacked, and the neural network model is rebuilt and trained to achieve the image classification task.

[0014] According to a differentiable neural architecture search method based on reducing spatial and channel feature redundancy provided by the present invention, when defining the search space, the search space is modeled as a directed acyclic graph, and is called a supernet structure. The nodes in the directed acyclic graph represent feature graphs, and the directed edges represent operation modes. The number of nodes in the supernet structure is set to 7, including 2 input nodes, 4 intermediate nodes representing potential feature information, and 1 output node.

[0015] According to a differentiable neural architecture search method based on reducing spatial and channel feature redundancy provided by the present invention, the set of operation modes of the supernet structure includes: separable convolution with convolution kernel sizes of 3 and 5 respectively; void convolution with convolution kernel sizes of 3 and 5 respectively; skip connection; Zero operation; maximum pooling; average pooling.

[0016] According to a differentiable neural architecture search method based on reducing spatial and channel feature redundancy provided by the present invention, the supernet structure includes:

[0017] Normal module: All operations in this module have a step size of 1, keeping the size of the feature map unchanged;

[0018] Reduce module: All operations in this module have a step size of 2, which is used to compress the feature map size and double the number of channels of the output feature map.

[0019] According to a differentiable neural architecture search method based on reducing spatial and channel feature redundancy provided by the present invention, when defining the search space, a structural parameter α is introduced to make the discrete search space continuous. In the supernet structure, the node is equivalent to a set of feature graphs, and each intermediate node and all its successor intermediate nodes have a directed connection edge. The directed edge (i, j) between the intermediate node j and its predecessor node i is represented by all operations in the operation set, that is, the predecessor node i first passes through the spatial feature reconstruction module to remove spatial feature redundancy, and then passes through the adaptive channel attention module to sample a part of channels with higher weight values, and these high-weight channels are subjected to all operations o(.) in the operation set for feature extraction, while the remaining channels are not subjected to any operation processing, and finally the extraction results are weighted and output to the intermediate node j.

[0020] According to a differentiable neural architecture search method based on reducing spatial and channel feature redundancy provided by the present invention, the intermediate node j receives the feature extraction results of all predecessor nodes and adds the results to obtain the feature map represented by the intermediate node j, which is specifically expressed as formulas (1) and (2):

[0021]

[0022] in, represents the weighted value of the extraction result of edge (i, j), o (i,j) represents all candidate operations in the operation set, s(.) represents the spatial feature reconstruction module, M(.) represents the partial channel sampling mask, and Represents a structural parameter.

[0023] According to a differentiable neural architecture search method based on reducing spatial and channel feature redundancy provided by the present invention, when designing a spatial feature reconstruction module, the separation operation based on the amount of information includes: using the scaling factor in group normalization to evaluate the information content in different feature maps, and dividing the feature maps into two groups with more information and less information; the reconstruction operation includes: adding features with more information and features with less information to generate features with more information and save space, which is specifically expressed as: performing different weighting processing on the two separated groups of features, connecting the two groups of features after weighting processing in the channel dimension, and further processing the merged feature map through subsequent convolutional layers or pooling layers to obtain a spatially refined feature map, so as to refine the spatial features and optimize their representation capabilities.

[0024] According to a differentiable neural architecture search method based on reducing spatial and channel feature redundancy provided by the present invention, a non-dimensionality reduction local cross-channel interaction strategy is adopted when designing an adaptive channel attention module. The strategy is implemented through 1D convolution:

[0025] Given an input feature map, first use global average pooling for each channel to obtain feature data of size 1×1×C;

[0026] Then, the channel weights are generated by performing a fast 1D convolution with a kernel size of k, where k is adaptively determined by mapping the channel dimension C. The mapping function of the adaptive channel attention module is expressed as formula (3):

[0027] X AM =sig(Conv(μ(X)))*X=H*X (3)

[0028] Among them, μ represents global average pooling, Conv represents 1D convolution, H represents channel weight, and sig represents a sigmoid function.

[0029] According to a differentiable neural architecture search method based on reducing spatial and channel feature redundancy provided by the present invention, for a directed edge (i, j), the weight H of the channel attention is calculated according to formula (3): (i,j) , select the first 1 / K channels to transfer to the operation space for calculation, and assign these channel attention weights to 1. The remaining channels skip the operation space and are directly connected to the output, and their channel attention weights are assigned to 0. After redistribution, the channel attention weights are regarded as the channel mask M (i,j) .

[0030] According to a differentiable neural architecture search method based on reducing spatial and channel feature redundancy provided by the present invention, in the training process of the supernet structure, the structural parameter α and the weight parameter ω are trained, wherein the structural parameter α is an upper layer variable and the weight parameter ω is a lower layer variable; the training loss L train It is used to optimize the network weight parameter ω, and the verification loss L val For optimizing the structural parameter α, the loss function is expressed as formulas (4) and (5):

[0031] min α L val (ω * (α),α), (4)

[0032] stω * (α) = argmin ω L train (ω,α) (5)

[0033] After updating the parameters in each generation, for each intermediate node, two edges with the strongest weights, i.e. two operations, are selected from all the edges connected to the node, and other directed edges and candidate operations are removed;

[0034] After the training is completed, an optimal sub-network structure is sampled, and then the sub-network structures are stacked according to the task requirements to obtain the final network model. The final network model is retrained and the image classification accuracy is obtained on the test set.

[0035] It can be seen that compared with the prior art, the method provided by the present invention has the following beneficial effects:

[0036] 1. Existing neural architecture searches mostly focus on searching in discrete spaces, that is, each possible network architecture is considered as a point in the search space. This method usually requires a lot of computing resources because each candidate architecture needs to be trained and evaluated from scratch. The present invention introduces continuous architecture parameters to transform the architecture search problem into a differentiable optimization problem, which can be solved using optimization algorithms such as gradient descent, which greatly reduces the computing requirements during the search process.

[0037] 2. The performance of the existing differentiable neural architecture search method degrades when the number of search rounds is too large, that is, when the number of search rounds is too large, the searched architecture may contain many jump connections, resulting in performance degradation, which is called the "collapse" phenomenon. The present invention uses partial channel connections, specifically, randomly samples a part of the channels for operation processing in each step. Since only a part of the channels are involved in the operation search, the deviation in operation selection can be reduced, and the role of parameter-free sub-operations (such as pooling and jump connections) can be weakened. In this way, even when the number of search rounds is too large, it is not easy to fall into the local optimal solution, thereby avoiding the collapse phenomenon.

[0038] 3. Although the partial channel connection method can reduce computer memory usage and avoid crashes, random channel selection will make the network structure search unstable. The present invention uses an efficient channel attention mechanism to select more valuable channels, avoiding search instability caused by random selection. Specifically, the present invention uses an adaptive channel attention module to extract the importance of each channel through fast one-dimensional convolution, and its kernel size can be adaptively determined by the nonlinear mapping of the channel dimension. Channels with higher attention weights are sent to the operation space, while other channels are directly in contact with the output of the operation space to improve search efficiency.

[0039] 4. It is inevitable that there will be feature redundancy in the convolutional neural network, which will reduce the search efficiency and accuracy of the network structure. The present invention designs a spatial feature reconstruction module to eliminate spatial feature redundancy, which includes separation and reconstruction operations. The separation operation separates the feature map with rich information from the feature map with little information corresponding to the spatial content, while the reconstruction operation adds the information features with little information to generate more information features.

[0040] 5. Since the present invention is based on a general neural network architecture search framework, it can be easily extended to other types of tasks and data sets. At the same time, by adjusting the search space and hyperparameters, the model can be further optimized to adapt to different application scenarios and performance requirements.

[0041] 6. The present invention can construct a high-performance neural network model by stacking and retraining the best network architecture units found, thereby effectively improving the performance of tasks such as image classification. This performance improvement is not only reflected in the accuracy, but also in the robustness, generalization ability and real-time performance of the model.

[0042] The present invention is further described in detail below in conjunction with the accompanying drawings and specific embodiments. BRIEF DESCRIPTION OF THE DRAWINGS

[0043] Figure 1 Flowchart of existing neural architecture search techniques.

[0044] Figure 2 It is a flowchart of an embodiment of a differentiable neural architecture search method based on reducing spatial and channel feature redundancy of the present invention.

[0045] Figure 3 It is an overall framework flow chart of a neural network model in an embodiment of a differentiable neural architecture search method based on reducing spatial and channel feature redundancy of the present invention.

[0046] Figure 4 It is a flow diagram of a spatial feature reconstruction module in an embodiment of a differentiable neural architecture search method based on reducing spatial and channel feature redundancy of the present invention. DETAILED DESCRIPTION

[0047] In order to make the purpose, technical solution and advantages of the present invention clearer, the technical solution of the present invention will be clearly and completely described below in conjunction with the drawings of the present invention. Obviously, the described embodiments are part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.

[0048] Reference to "embodiments" herein means that a particular feature, structure, or characteristic described in conjunction with the embodiments may be included in at least one embodiment of the present application. The appearance of the phrase in various locations in the specification does not necessarily refer to the same embodiment, nor is it an independent or alternative embodiment that is mutually exclusive with other embodiments. It is explicitly and implicitly understood by those skilled in the art that the embodiments described herein may be combined with other embodiments.

[0049] See also Figure 2, this embodiment provides a differentiable neural architecture search method based on reducing spatial and channel feature redundancy, the method comprising the following steps:

[0050] Step S1, defining a search space, the search space containing all desired candidate neural network models, and searching for an optimal neural network architecture in the search space;

[0051] Step S2, designing a spatial feature reconstruction module to eliminate spatial feature redundancy, the module includes separation and reconstruction operations, the separation operation separates the feature map with rich information from the feature map corresponding to the small amount of information of the spatial content, and then recombines these parts into a spatially refined feature map in the channel dimension through the reconstruction operation;

[0052] Step S3, using an adaptive channel attention module to extract the importance of each channel through fast one-dimensional convolution, and using the calculated attention weight to guide the direction of the channel; wherein, the channel with a higher attention weight is sent to the operation space, while the other channels are directly superimposed with the output of the operation space in the channel dimension to balance information retention and computational efficiency;

[0053] Step S4, stacking the best network architecture units found, reconstructing and training the neural network model, and then achieving the image classification task.

[0054] Specifically, differentiable architecture search achieves effective results in a short time based on the architecture representation of continuous relaxation and gradient descent method. During the search process, each operation and its corresponding output need to be stored in the node, which takes up a lot of computing memory. Partial channel connection can greatly improve operation efficiency and reduce unfair competition between candidate operations. However, random selection of channels can lead to instability in the search process. In addition, there is inevitably feature redundancy in convolutional neural networks (CNNs), which also incurs computational costs and reduces search efficiency. Figure 3 As shown, Figure 3The overall framework flow chart of the model of a differentiable neural architecture search method based on reducing spatial and channel feature redundancy proposed in this embodiment, first divide the image data set, and then set the search space of the neural network architecture, the space contains all the desired candidate network models, and search for the optimal network architecture in this space. Next, this embodiment designs a spatial feature reconstruction module to eliminate spatial feature redundancy. The module includes separation and reconstruction operations. The separation operation separates feature maps with rich information from feature maps with a small amount of information corresponding to the spatial content, and the reconstruction operation adds information features with a small amount of information to generate more information features. Then, this embodiment uses an efficient channel attention mechanism to select more valuable channels, avoiding the search instability caused by random selection. Specifically, this embodiment applies an adaptive channel attention module to extract the importance of each channel through fast one-dimensional convolution, and its kernel size can be adaptively determined by the nonlinear mapping of the channel dimension. Channels with higher attention weights are sent to the operation space, while other channels are directly in contact with the output of the operation space to improve search efficiency. Finally, the best network architecture units searched are stacked, the neural network model is reconstructed and trained, and the image classification task is achieved.

[0055] In the above step S1, in deep learning, the neural network architecture model is mainly composed of a topological structure and an operation mode between feature graphs. Therefore. The neural network architecture can be represented by a directed acyclic graph, in which nodes represent feature graphs and directed edges represent operation modes. When defining the search space, this embodiment models the search space as a directed acyclic graph and calls it a supernet structure, which contains all candidate network models. The number of nodes in the supernet structure is set to 7, including 2 input nodes, 4 intermediate nodes representing potential feature information, and 1 output node.

[0056] In this embodiment, the operation mode set of the supernet structure contains 8 operations, including:

[0057] Separable convolution with kernel sizes of 3 and 5, dilated convolution with kernel sizes of 3 and 5, skip connection, Zero operation, maximum pooling, and average pooling. The overall model is a deep convolutional neural network architecture formed by stacking supernet structures.

[0058] In this embodiment, the supernet structure is divided into two types. The neural network structure diagrams of the two modules are the same, and the difference lies in the step size of the operation in the operation set and the number of channels of the output feature map, which respectively include:

[0059] Normal module: All operations in this module have a step size of 1, keeping the size of the feature map unchanged;

[0060] Reduce module: The step size of all operations in this module is 2, and the number of channels of the output feature map is doubled, which is used to compress the feature map size and increase the depth. Therefore, the Reduce module can play the role of compressing the feature map.

[0061] When defining the search space, this embodiment introduces a structural parameter α to make the discrete search space continuous. In the supernet structure, a node is equivalent to a set of feature graphs. Each intermediate node and all its successor intermediate nodes have a directed connection edge. The directed edge (i, j) between the intermediate node j and its predecessor node i is represented by all operations in the operation set, that is, the predecessor node i first passes through the spatial feature reconstruction module to remove spatial feature redundancy, and then passes through the adaptive channel attention module to sample a part of channels with higher weight values, and these high-weight channels are subjected to all operations o(.) in the operation set for feature extraction, while the remaining channels are not subjected to any operation processing, and finally the extraction results are weighted and output to the intermediate node j.

[0062] The intermediate node j receives the feature extraction results of all the predecessor nodes and adds the results to obtain the feature map represented by the intermediate node j, which is specifically expressed as formulas (1) and (2):

[0063]

[0064]

[0065] in, represents the weighted value of the extraction result of edge (i, j), o (i,j) represents all candidate operations in the operation set, s(.) represents the spatial feature reconstruction module, M(.) represents the partial channel sampling mask, and Indicates structural parameters. The setting of the supernet structure in this embodiment is mainly used to solve the classification task of daily life images. If it is needed for other special tasks, the size of the search space can be controlled by adjusting the number of nodes and the operation set.

[0066] In the above step S2, spatial feature redundancy means that there is usually a certain correlation between adjacent pixels or data points in the image or data, and the values ​​of these adjacent pixels or data points are often similar or the same. For example, if there is a continuous area in the image, and the pixels in this area are all the same color, then this will produce spatial redundancy. Spatial feature redundancy may lead to data duplication and waste of storage space. Therefore, reducing spatial feature redundancy is an important direction to improve model performance and efficiency. The spatial feature reconstruction module proposed in the present invention includes two parts: separation and reconstruction. Figure 4As shown. The purpose of separation is to separate feature maps with large information content from feature maps with small information content, corresponding to the spatial content. When designing the spatial feature reconstruction module, the separation operation based on the amount of information includes: using the scaling factor in the group normalization (GroupNormalization) to evaluate the information content in different feature maps, and dividing the feature maps into two groups with more information and less information; the reconstruction operation includes: adding features with more information and features with less information to generate features with more information and save space, which is specifically expressed as: performing different weighting processing on the two separated groups of features, connecting the two groups of features after weighting processing in the channel dimension, and further processing the merged feature map through subsequent convolutional layers or pooling layers to obtain a spatially refined feature map, so as to refine the spatial features and optimize its representation ability.

[0067] In the above step S3, the channel attention mechanism is used to extract the importance of the input data channel during the search process. The obtained attention weight is then multiplied with the original input data to generate a new input so that key features in the input data can be identified and the neural network can use more important information. Channel selection is used to send channels with higher attention weights to the operation space, while other channels are directly in contact with the output of the operation space to improve search efficiency and stability. In addition, it can weaken the unfair competition between candidate operations caused by insufficient parameter training of the weight equipment operation in the initial stage. Therefore, when designing the adaptive channel attention module, this embodiment adopts a non-dimensionality reduction local cross-channel interaction strategy, which can be effectively implemented by 1D convolution. Among them, the size of the 1D convolution kernel can be adaptively selected to better determine the coverage of local cross-channel interactions.

[0068] First, given an input feature map, global average pooling (GAP) is used for each channel to obtain feature data of size 1×1×C.

[0069] Then, the channel weights are generated by performing a fast 1D convolution with a kernel size of k, where k is adaptively determined by mapping the channel dimension C. The mapping function of the adaptive channel attention module is expressed as formula (3):

[0070] X AM =sig(Conv(μ(X)))*X=H*X (3)

[0071] Among them, μ represents global average pooling, Conv represents 1D convolution, H represents channel weight, and sig represents a sigmoid function.

[0072] However, existing differentiable neural architecture searches tend to select unweighted operations because when the neural network is undertrained, unweighted operations can provide more accurate information than weighted operations. In addition, there is a competitive relationship between operations, and unweighted operations have more advantages, which leads to the phenomenon of network architecture collapse during the search process. The introduction of partial channel connections can effectively solve the above problems and reduce the memory usage of the operation space at runtime. Even if the weighted operations are undertrained, the loss of using partial channels is less than the method in which all channels enter the operation space, which makes the advantage of unweighted operations less obvious. However, randomly selecting channels will lead to instability of network architecture and parameters in partial channel connections. Therefore, selecting more important channels can make the search more stable and accurate. The channel attention mechanism can learn the dependencies between different channels, thereby obtaining the weights of each channel, which can reflect the importance of the channel. For a directed edge (i, j), the weight H of the channel attention can be calculated according to formula (3): (i,j) , select the first 1 / K channels to transfer to the operation space for calculation, and assign these channel attention weights to 1. The remaining channels skip the operation space and are directly connected to the output, and their channel attention weights are assigned to 0. After redistribution, the channel attention weights are regarded as the channel mask M (i,j) .

[0073] In the training process of the supernet structure, there are two sets of parameters that need to be trained, namely, the structure parameter α and the weight parameter ω. This embodiment solves the double-layer optimization problem by using the gradient descent method to learn these two sets of parameters together. Among them, the structure parameter α is the upper layer variable, and the weight parameter ω is the lower layer variable. Training the structure parameter α and the weight parameter ω includes: training loss L train It is used to optimize the network weight parameter ω, and the verification loss L val Used to optimize the structural parameter α, as shown in formulas (4) and (5):

[0074] min α L val (ω * (α),α), (4)

[0075] stω * (α) = argmin ω L train (ω,α) (5)

[0076] After updating the parameters in each generation, for each intermediate node, two edges with the strongest weights, i.e., two operations, are selected from all the edges connected to the node, and other directed edges and candidate operations are removed.

[0077] After the training is completed, an optimal sub-network structure is sampled, and then the sub-network structures are stacked according to the task requirements to obtain the final network model. The final network model is retrained and the image classification accuracy is obtained on the test set.

[0078] In summary, the present invention converts the architecture search problem into a differentiable optimization problem by introducing continuous architecture parameters, so that it can be solved using optimization algorithms such as gradient descent, which greatly reduces the computational requirements in the search process. The present invention uses partial channel connections, specifically, randomly samples a portion of channels for operation processing in each step. Since only a portion of the channels participate in the operation search, the deviation in operation selection can be reduced, weakening the role of parameter-free sub-operations (such as pooling, jump connections). In this way, even when the number of search rounds is too large, it is not easy to fall into a local optimal solution, thereby avoiding the collapse phenomenon.

[0079] The present invention uses an efficient channel attention mechanism to select more valuable channels, avoiding the search instability caused by random selection. Specifically, the present invention uses an adaptive channel attention module to extract the importance of each channel through fast one-dimensional convolution, and its kernel size can be adaptively determined by the nonlinear mapping of the channel dimension. Channels with higher attention weights are sent to the operation space, while other channels are directly in contact with the output of the operation space to improve search efficiency.

[0080] The present invention designs a spatial feature reconstruction module to eliminate spatial feature redundancy, and the module includes separation and reconstruction operations. The separation operation separates feature maps with rich information from feature maps with little information corresponding to spatial content, while the reconstruction operation adds informative features with little information to generate more informative features.

[0081] The present invention is based on a general neural network architecture search framework, so it can be easily extended to other types of tasks and data sets. At the same time, by adjusting the search space and hyperparameters, the model can be further optimized to adapt to different application scenarios and performance requirements.

[0082] The present invention stacks and retrains the best network architecture units found, and this method can build a high-performance neural network model, thereby effectively improving the performance of tasks such as image classification. This performance improvement is not only reflected in the accuracy, but also in the robustness, generalization ability and real-time performance of the model.

[0083] By designing a spatial feature reconstruction module and an adaptive channel attention module, the method can effectively reduce spatial feature redundancy and focus on feature channels that are more critical to the task. This strategy not only reduces the computational complexity, but also improves the overall efficiency of the model, making the model lighter and suitable for deployment on resource-constrained devices, such as mobile devices or embedded systems.

[0084] The present invention adopts a differentiable neural architecture search variant method, which can optimize the network architecture in continuous space, avoiding the complexity and high cost of a large number of discrete evaluations required in traditional NAS methods. This method can quickly search for the optimal or near-optimal network architecture, accelerating the iteration cycle of model development.

[0085] The adaptive channel attention module of the present invention extracts the importance of each channel through fast one-dimensional convolution and dynamically adjusts the direction of the channel accordingly. This mechanism enables the model to automatically optimize its internal connections and focus on the features that are most beneficial to the task, thereby improving the model's expressiveness and generalization capabilities.

[0086] The present invention allows channels with high attention weights to enter the operation space, while other channels are directly exposed to the output of the operation space. This method retains key information while ensuring computational efficiency. This balancing strategy helps to further reduce computing resource consumption while maintaining model performance.

[0087] The technical features of the above embodiments may be arbitrarily combined. To make the description concise, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.

[0088] The above-mentioned embodiments are only preferred embodiments of the present invention and cannot be used to limit the scope of protection of the present invention. Any non-substantial changes and substitutions made by technicians in this field on the basis of the present invention shall fall within the scope of protection required by the present invention.

Claims

1. A differentiable neural architecture search method based on reducing spatial and channel feature redundancy, characterized in that: The method comprises the following steps: Define a search space that contains all desired candidate neural network models, and search for the optimal neural network architecture in the search space; A spatial feature reconstruction module is designed to eliminate spatial feature redundancy. The module contains separation and reconstruction operations. The separation operation separates feature maps with rich information from feature maps with little information corresponding to spatial content, and then the reconstruction operation recombines these parts into spatially refined feature maps in the channel dimension. An adaptive channel attention module is used to extract the importance of each channel through fast one-dimensional convolution, and the calculated attention weight is used to guide the direction of the channel. Among them, channels with higher attention weights are sent to the operation space, while other channels are directly superimposed with the output of the operation space in the channel dimension to balance information retention and computational efficiency. The best network architecture units found are stacked, and the neural network model is rebuilt and trained to achieve the image classification task. When designing the adaptive channel attention module, a non-dimensionality reduction local cross-channel interaction strategy is adopted, which is implemented through 1D convolution: Given an input feature map, first use global average pooling for each channel to obtain feature data of size 1×1×C; Then, by performing a convolution with kernel size k The channel weights are generated by a fast 1D convolution, where k By mapping the channel dimensions C Adaptively determine, the mapping function of the adaptive channel attention module is expressed as formula (3): (3) in, µ represents global average pooling, Conv represents 1D convolution, H represents the channel weight, sig represents a sigmoid function; For a directed edge (i, j), the weight of the channel attention is calculated according to formula (3): H (i, j) , select the first 1 / K channels to transfer to the operation space for calculation, and assign these channel attention weights to 1. The remaining channels skip the operation space and are directly connected to the output, and their channel attention weights are assigned to 0; after redistribution, the channel attention weights are regarded as channel masks M (i, j) .

2. The method according to claim 1, characterized in that: When defining the search space, the search space is modeled as a directed acyclic graph, called a supernet structure. The nodes in the directed acyclic graph represent the feature graph, and the directed edges represent the operation mode. The number of nodes in the supernet structure is set to 7, including 2 input nodes, 4 intermediate nodes representing potential feature information, and 1 output node.

3. The method according to claim 2, characterized in that: The set of operation modes of the supernet structure includes: separable convolution with convolution kernel sizes of 3 and 5 respectively; hollow convolution with convolution kernel sizes of 3 and 5 respectively; skip connection; Zero operation; maximum pooling; average pooling.

4. The method according to claim 2, characterized in that: The supernet structure is divided into two types: Normal module: All operations in this module have a step size of 1, keeping the size of the feature map unchanged; Reduce module: All operations in this module have a step size of 2, which is used to compress the feature map size and double the number of channels of the output feature map.

5. The method according to claim 2, characterized in that: Also execute: When defining the search space, the structural parameter α is introduced to make the discrete search space continuous. In the supernet structure, the node is equivalent to a set of feature graphs. Each intermediate node and all its successor intermediate nodes have a directed connection edge. The directed edge (i, j) between the intermediate node j and its predecessor node i is represented by all operations in the operation set, that is, the predecessor node i first passes through the spatial feature reconstruction module to remove spatial feature redundancy, and then passes through the adaptive channel attention module to sample a part of the channels with higher weight values, and these high-weight channels pass through all operations in the operation set. o (.) is used for feature extraction, while the remaining channels are not processed in any way, and the extracted results are finally weighted and output to the intermediate node j.

6. The method according to claim 5, characterized in that: The intermediate node j receives the feature extraction results of all predecessor nodes and adds the results to obtain the feature map represented by the intermediate node j, which is specifically expressed as formulas (1) and (2): (1) (2) in, represents the weighted value of the extraction result of edge (i, j), represents all candidate operations in the operation set, Represents the spatial feature reconstruction module, represents a partial channel sampling mask, and , Represents a structural parameter.

7. The method according to claim 1, characterized in that: When designing the spatial feature reconstruction module, the separation operation based on the amount of information includes: using the scaling factor in the group normalization to evaluate the information content in different feature maps, and dividing the feature maps into two groups with more information and less information; the reconstruction operation includes: adding features with more information and features with less information to generate features with more information and save space, which is specifically expressed as: performing different weighting processing on the two separated groups of features, connecting the two weighted groups of features in the channel dimension, and further processing the merged feature map through subsequent convolutional layers or pooling layers to obtain a spatially refined feature map, so as to refine the spatial features and optimize their representation capabilities.

8. The method according to claim 2, characterized in that: During the training of the supernet structure, the structural parameters α and weight parameters ω Training is performed, where the structural parameters α is the upper-level variable, weight parameter ω is the lower layer variable; training loss L train Used to optimize network weight parameters ω , and the validation loss L val To optimize the structural parameters α , the loss function is expressed as formula (4) and (5): (4) (5) After updating the parameters in each generation, for each intermediate node, two edges with the strongest weights, i.e. two operations, are selected from all the edges connected to the node, and other directed edges and candidate operations are removed; After the training is completed, an optimal sub-network structure is sampled, and then the sub-network structures are stacked according to the task requirements to obtain the final network model. The final network model is retrained and the image classification accuracy is obtained on the test set.

Citation Information

Patent Citations

  • Neural network macro architecture searching method and system based on attention mechanism

    CN114742199A

  • Low-illumination image enhancement method based on feature fusion and attention embedding

    CN116797488A