A Lightweight Neural Network Structure Search Method Based on Neural Network Topology

By adopting a lightweight neural network structure search method based on neural network topology, the problems of high cost of manually designing neural networks and high resource consumption of traditional search methods are solved, and efficient neural network structure search and deployment in industrial fields are realized.

CN116310636BActive Publication Date: 2025-12-02FOSHAN UNIVERSITY
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202310168979.2
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2023-02-27
Publication Date
2025-12-02
Estimated Expiration
2043-02-27

AI Technical Summary

Technical Problem

In existing technologies, manually designing neural networks is costly and time-consuming, making it difficult to meet the needs of frequently changing network models in industrial settings. Furthermore, traditional neural network structure search results in high computational costs and a large number of parameters, making it difficult to deploy efficiently on edge devices.

Method used

A lightweight neural network structure search method based on neural network topology is adopted. By constructing a neural network topology search space, using topology complexity evaluation metrics and quadratic search processing, a lightweight neural network topology is constructed to reduce the search space. Depthwise separable convolution operations and adaptive dynamic shrinking of the search space are used to optimize the network structure.

Benefits of technology

It reduces manual labor costs, improves the efficiency of neural network structure search, reduces the number of network parameters, and enables efficient deployment of lightweight neural networks on devices with limited computing resources.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN116310636B_ABST
    Figure CN116310636B_ABST
Patent Text Reader

Abstract

This invention discloses a lightweight neural network structure search method based on neural network topology. The method includes: preprocessing a dataset of images to be detected to obtain a preprocessed image dataset; constructing a neural network topology search space and designing a topology complexity evaluation index based on the neural network topology; inputting the preprocessed image dataset into the neural network topology search space for secondary search processing and combining the topology complexity evaluation index to construct a lightweight neural network topology; and performing image detection processing on the dataset of images to be detected based on the lightweight neural network topology. By using this invention, the cost of manual labor can be greatly reduced and the efficiency of neural network structure search can be improved. This invention, as a lightweight neural network structure search method based on neural network topology, can be widely applied in the field of neural network image detection technology.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of neural network image detection technology, and in particular to a lightweight neural network structure search method based on neural network topology. Background Technology

[0002] Currently, image recognition technology is widely used in coal and gangue sorting industrial sites. Designing efficient neural networks typically requires highly specialized human experts to conduct multiple trials and errors and repeatedly adjust parameters to find a network structure with good performance. Manually designing neural networks is labor-intensive, time-consuming, and often yields suboptimal network structures. Furthermore, in industrial production sites, coal sources and production batches frequently change, as do the appearance characteristics of coal and gangue. This necessitates timely adjustments to the model based on these changes. Simply adjusting network parameters is insufficient to eliminate these biases; both the network structure and parameters must be adjusted simultaneously. However, industrial site personnel often lack the necessary expertise to adapt to changing tasks in a timely manner. Adjusting network parameters; manually designing neural networks requires huge labor costs and long design cycles, making it difficult to meet the needs of frequently changing network models in industrial settings; therefore, neural network architecture search has been developed, allowing machines to automatically search and design the optimal neural network structure in the search space instead of manual labor; neural network architecture search is one of the important means of model compression. Neural network architecture search (NAS) usually uses the accuracy of the test set as the single objective function to search and obtain a network structure with high accuracy, but the number of network parameters obtained is often very large, the computational cost is very high, the computation speed is slow, and it occupies a lot of storage space, making it difficult to deploy efficiently on edge devices and mobile devices with limited computing resources, such as industrial equipment. Summary of the Invention

[0003] To address the aforementioned technical problems, the purpose of this invention is to provide a lightweight neural network structure search method based on neural network topology, which can significantly reduce the cost of manual labor and improve the efficiency of neural network structure search.

[0004] The first technical solution adopted in this invention is a lightweight neural network structure search method based on neural network topology, comprising the following steps:

[0005] The image dataset to be detected is preprocessed to obtain the preprocessed image dataset.

[0006] Construct a search space for neural network topology and design a topology complexity evaluation index based on the neural network topology;

[0007] The preprocessed image dataset is input into the neural network topology search space for secondary search processing, and combined with the topology complexity evaluation index, a lightweight neural network topology is constructed.

[0008] Image detection processing is performed on the image dataset to be detected based on the lightweight neural network topology.

[0009] Furthermore, the step of preprocessing the image dataset to be detected to obtain a preprocessed image dataset specifically includes:

[0010] Obtain the dataset of images to be detected;

[0011] The size of the image dataset to be detected is adjusted to obtain an image dataset of uniform size.

[0012] A data augmentation dataset of images to be detected of uniform size is obtained by performing data augmentation processing on the random flipping method;

[0013] The enhanced image dataset is divided into segments to obtain a preprocessed image dataset.

[0014] Furthermore, the step of constructing the neural network topology search space and designing a topology complexity evaluation index based on the neural network topology specifically includes:

[0015] Determine the number of network layers, the number of feature maps in each network layer, and the connection methods between each network layer to construct the neural network topology search space;

[0016] The feature maps of each network layer are treated as nodes and connected, and corresponding complexity weight coefficients are set.

[0017] Auxiliary lines are added to the output and input network layers of the neural network topology search space to construct a strongly connected graph.

[0018] Calculate the corresponding strongly connected components based on the strongly connected graph;

[0019] A topology complexity evaluation index is constructed by combining complexity weight coefficients, the number of connections between feature graph nodes, the number of feature graphs in each network layer, and strongly connected components.

[0020] Furthermore, the formula for calculating the topology complexity evaluation index is as follows:

[0021]

[0022] In the above formula, α i The complexity weight coefficient of the convolution operation in the i-th layer is represented by E, the number of strongly connected graphs in the neural network topology is represented by N, the number of feature maps in the neural network topology is represented by P, the number of strongly connected components in the neural network topology is represented by T, and the topological complexity evaluation index of the neural network topology is represented by T.

[0023] Furthermore, the step of inputting the preprocessed image dataset into the neural network topology search space for secondary search processing and combining it with the topology complexity evaluation index to construct a lightweight neural network topology specifically includes:

[0024] The preprocessed image dataset is input into the neural network topology search space for the first stage search, and the optimized neural network topology search space is constructed.

[0025] By combining the topology complexity evaluation index, the preprocessed image dataset is input into the search space of the optimized neural network topology for a second stage of search processing to construct a lightweight neural network topology.

[0026] The lightweight neural network topology includes a first processing module, a second processing module, and a fully connected layer, wherein the first processing module and the second processing module each include three normal units and one decay unit.

[0027] Furthermore, the step of inputting the preprocessed image dataset into the neural network topology search space for the first stage search and constructing an optimized neural network topology search space specifically includes:

[0028] The preprocessed image dataset is input into the neural network topology search space according to the random search strategy to perform the first stage search and obtain the first search result.

[0029] Obtain the corresponding accuracy calculation result based on the first search result;

[0030] All accuracy calculation results are sorted and corresponding neural network topologies are selected according to selection rules, namely, selecting the top 50 neural network topologies with higher accuracy.

[0031] Calculate the effectiveness probability of the corresponding unit based on the corresponding neural network topology, and remove the unit with the lowest effectiveness probability in the neural network topology to construct an optimized neural network topology search space.

[0032] Furthermore, the step of combining topological complexity evaluation metrics to input the preprocessed image dataset into the search space for optimizing the neural network topology for a second-stage search process, thereby constructing a lightweight neural network topology, specifically includes:

[0033] The preprocessed image dataset is input into the search space of the optimized neural network topology for iterative search processing to obtain the second search result.

[0034] The second accuracy calculation result is obtained based on the second search result;

[0035] The TCNAS evaluation index is obtained by weighted summation of the topology complexity evaluation index and the second accuracy calculation result.

[0036] Repeat the above search process and weighted summation calculation process until the number of searches reaches a preset threshold, then stop the search process and output the TCNAS evaluation index corresponding to each search process.

[0037] Select the search space corresponding to the highest TCNAS evaluation index to optimize the neural network topology and output a lightweight neural network topology.

[0038] Furthermore, the calculation formula for the TCNAS evaluation index of the lightweight neural network topology is as follows:

[0039] TCNAS=(1-β)*accuracy-β*T

[0040] In the above formula, β represents the weighting coefficient between accuracy and topology complexity set according to the actual task requirements, accuracy represents the correctness, T represents the topology complexity evaluation index of the neural network topology, and TCNAS represents the TCNAS evaluation index of the lightweight neural network topology.

[0041] The beneficial effects of the method of this invention are as follows: First, the invention preprocesses the search space based on the neural network topology structure, adds auxiliary lines to construct a strongly connected graph, and then calculates the strongly connected components in the strongly connected graph. The intermediate layer feature maps of the neural network structure are regarded as nodes, and the convolution operation between feature maps is regarded as a connection. Each convolution operation is assigned a corresponding weight to obtain the topological complexity index of the neural network structure. Then, the accuracy of the preprocessed image is used as the evaluation index. The neural network structure search starts from the initial large search space. The searched networks are continuously sorted according to the accuracy of the test set. The 50 network structures with the highest accuracy of the test set are extracted, and the validity probability of each unit in the search space is calculated. Every 50 structures are searched, the unit with the lowest validity probability is deleted. Finally, the search space composed of normal units and decaying units in the lightweight neural network topology structure is reduced to only 4 units each. Normal units need to add an empty operation at the end to enable them to have a certain ability to change the number of network layers in the next stage of search. This can greatly reduce the manual labor cost, improve the adaptive adjustment capability of neural network structure search, and enable neural network structure search to maintain efficient search in a large search space without the space explosion phenomenon caused by a large search space. Attached Figure Description

[0042] Figure 1 This is a flowchart of the steps of the lightweight neural network structure search method based on neural network topology of the present invention;

[0043] Figure 2 This is a flowchart illustrating the overall structure of the adaptive search space optimization NAS algorithm based on topological complexity, as described in this invention.

[0044] Figure 3 This is a schematic diagram of the coal and gangue classification dataset collected by this invention;

[0045] Figure 4 This is a strongly connected graph representing the neural network topology of this invention;

[0046] Figure 5 This is a flowchart of the neural network structure search process for the first stage of the dynamic optimization search space of this invention.

[0047] Figure 6 This is a schematic diagram of the adaptive dynamic shrinking search space optimization method of the present invention;

[0048] Figure 7 This is a flowchart of the neural network structure search process based on the topological complexity of neural networks, i.e., the second-stage search, according to the present invention.

[0049] Figure 8 This is a schematic diagram of the lightweight neural network topology finally constructed in this invention;

[0050] Figure 9 This is a schematic diagram of the structure of each unit in the search space of the neural network topology structure of the present invention, wherein (A)-(H) represent normal units and (I)-(P) represent decaying units;

[0051] Figure 10 This is a schematic diagram of the accuracy and loss curves of the optimal network structure in the training and validation sets under the TCNAS evaluation index of this invention. Detailed Implementation

[0052] The present invention will now be described in further detail with reference to the accompanying drawings and specific embodiments. The step numbers in the following embodiments are only for ease of explanation and do not limit the order of the steps. The execution order of each step in the embodiments can be adapted according to the understanding of those skilled in the art.

[0053] Reference Figure 1 This invention provides a lightweight neural network structure search method based on neural network topology, which includes the following steps:

[0054] S1. Preprocess the image dataset to be detected to obtain the preprocessed image dataset;

[0055] Specifically, this invention uses a dataset of coal and gangue classification images collected on the coal conveyor belt in a coal washing workshop for experiments. The dataset contains 8542 images of coal and gangue limescale, such as... Figure 3 As shown, firstly, 7542 images are divided into a training set and 1000 images into a test set. The image size of the dataset is adjusted to 32x32. Since the number of samples in the dataset used in this invention is limited, in order to prevent overfitting and make the training samples more consistent with the true distribution, a data augmentation method of random flipping is needed to further process the dataset images.

[0056] S2. Construct the search space for neural network topology and design a topology complexity evaluation index based on the neural network topology.

[0057] Specifically, refer to Figure 4 , Figure 4 The topology of the neural network is a strongly connected graph, where each node represents a feature map and each connection represents a different convolution operation. Directed auxiliary lines are constructed from the output layer feature map to the input layer feature map. The auxiliary lines represent 1x1 convolution operations between the output layer and the input layer, forming a strongly connected graph.

[0058] Topology effectively reflects the complexity of a neural network. Topology complexity evaluation methods, when applied in neural network architecture search, can effectively find lightweight network structures. A neural network topology graph represents the connections between multiple key nodes. The feature map information of the upper layer nodes undergoes multiple convolution operations, and the output becomes the feature map information of the lower layer. This feature map information is then transmitted to the output layer after multiple convolution operations. Since the neural network topology has no loops during the processing of the input image, the neural network topology graph is a directed acyclic graph, but not a fully connected graph.

[0059] Furthermore, two issues need to be considered before performing topological complexity evaluation in neural networks:

[0060] First, it is important to correctly represent the topology of a neural network. The topology of a neural network includes the number of network layers, the number of feature maps in each layer, and the connection methods between layers. Each feature map in the neural network structure is degenerated into a node. Different convolution operations are represented by directed connections between the upper and lower layers of the feature map. Nodes and connections are connected according to certain rules to form a complete neural network topology. Different numbers of nodes and different types of connections will have a corresponding impact on the complexity of the neural network structure.

[0061] Secondly, it's crucial to identify the strongly connected components of the neural network structure. The topology of a neural network is a directed acyclic graph (DAG). An auxiliary dashed line needs to be constructed to connect the feature maps of the output and input layers. This auxiliary dashed line can be viewed as a 1x1 convolution operation, transforming the neural network topology from a DAG to a strongly connected graph. Within this strongly connected neural network structure, the values ​​of the strongly connected components are determined by finding the maxima of the strongly connected graph. This provides the basis for the next step of evaluating the complexity of the neural network topology. This allows for the use of methods similar to McBe's complexity to improve the topology complexity evaluation. The strongly connected graph of the neural network topology is shown below. Figure 4 As shown;

[0062] The number of feature maps (nodes) in the strongly connected component graph, the number of convolution operations (connections) in each layer, and the values ​​of strongly connected components are calculated. Using large-size convolution kernels typically increases the computational cost and complexity of the network model. Within each layer, 3x3 convolution operations are more computationally expensive than 1x1 convolution operations, and networks with a higher number of 3x3 convolution operations are more complex. Therefore, a convolution operation complexity weight coefficient α is set, with α set to 1 for 1x1 convolution and 1.3 for 3x3 convolution. The formula for calculating the complexity T of the neural network topology is shown below:

[0063]

[0064] In the above formula, α i The complexity weight coefficient of the convolution operation in the i-th layer is represented by E, the number of strongly connected graphs in the neural network topology is represented by N, the number of feature maps in the neural network topology is represented by P, the number of strongly connected components in the neural network topology is represented by T, and the topological complexity evaluation index of the neural network topology is represented by T.

[0065] S3. Input the preprocessed image dataset into the neural network topology search space for secondary search processing and combine it with the topology complexity evaluation index to construct a lightweight neural network topology.

[0066] Specifically, in existing NAS algorithms, if a large search space containing a large number of units is searched directly, it is easy to cause the space explosion problem. That is, due to limited computing resources, only a small proportion of samples can be sampled from the search space to build a network for searching. Such a search is usually incomplete and difficult to complete. The network structure found is usually a suboptimal network.

[0067] Reference Figure 2The definition and design of the search space: This invention designs the network structure from a lightweight perspective, widely employing depthwise separable convolution operations to design the search space. Eight different types of units each from the normal and decaying units form the initial large search space, as shown below. Figure 9 As shown;

[0068] Furthermore, this invention employs a two-stage search method. The first stage of the search uses a random search algorithm and is conducted in a large search space, continuously and dynamically reducing the search space size. In order for NAS to find a network structure with strong generalization ability on the coal gangue dataset and to prevent overfitting, L1 and L2 regularization are used during network training. Hyperparameters such as the number of channels and L1 and L2 regularization coefficients are optimized simultaneously during the structure search process, using warmup and dynamically decreasing learning rate adjustment strategies.

[0069] S31. Input the preprocessed image dataset into the neural network topology search space for the first stage search, namely the adaptive dynamic shrinking search space optimization method, and construct the optimized neural network topology search space.

[0070] Specifically, in order to alleviate the problem of space explosion caused by a large search space, this invention proposes an adaptive dynamic shrinking search space optimization method. This method can achieve high search efficiency while setting a large search space. First, a search is performed in the initially defined large search space. The network structures found during the search process are sorted according to their accuracy. The top 50 structures with the highest accuracy are analyzed, and the number of times each unit is selected in the Top 50 network structures and the number of times the unit appears in all the searched structures are counted.

[0071] Furthermore, as the number of network layers increases, the level of abstraction of feature information in the middle layers becomes increasingly higher. To avoid the abstract feature information in deeper network layers exceeding the learning capacity of some units, in the search of a large search space, the probability of selection of each unit is calculated using a Top50 network structure. For the normal units in the first three layers, the normal units in the last three layers, and all decaying units, the probability of selection of each unit in its corresponding position is calculated as the effectiveness probability. The Top50 network structure contains the network structures with better performance found during the search process. If a unit has a higher probability of appearing in the Top50 structure, its effectiveness probability is higher, proving that the unit is more effective in improving the accuracy of the network. The formula for calculating the effectiveness probability of a unit is as follows:

[0072]

[0073] Units with high effectiveness probabilities in the Top 50 network structures are retained, while units with the lowest effectiveness probabilities are gradually eliminated after a certain number of searches. Finally, the four units with the highest effectiveness probabilities are retained as the main search spaces. This allows NAS to dynamically optimize the search space based on the effectiveness probabilities of the units, continuously eliminating units in the large search space that do not contribute much to improving network performance, and finally retaining the units that are most effective in improving network performance as the smaller search spaces.

[0074] Furthermore, as the network layers deepen, the feature information output by the intermediate layers of the network gradually becomes abstract, and the feature information becomes increasingly difficult to extract. In the NAS search method of this invention, a search method without shared units is adopted, that is, each layer in the network structure searches for a corresponding unit. Each layer can select a suitable unit in the search space to splice the network according to the current level of abstraction of the feature map information, which can improve the feature information extraction and processing capability of the intermediate layers of the network.

[0075] NAS enables machines to automatically search for high-performance neural network structures, but it still requires experienced human experts to spend a lot of time designing the search space. It needs to incorporate a lot of prior knowledge from human experts and go through multiple trials and errors to find the best-performing units as the search space. If there are structures in the search space that do not improve performance, it will affect the performance of the relevant network structure. Not any structure designed as a unit can achieve good results. Therefore, it usually requires multiple trials and errors by human experts to determine the best search space. In order to alleviate the high labor cost of manually designing efficient search space unit structures, this search space optimization method allows human experts to design a large number of neural network units that they intuitively believe are effective as a large search space, without having to consider whether each unit is effective in improving network performance.

[0076] This invention employs a large number of depthwise separable convolutions to replace traditional ordinary convolution operations in the design of the unit, ensuring that NAS has the ability to search for lightweight neural networks from the source. It uses a large number of 1x1 and 3x3 convolution operations in the design of the unit. Although larger convolution kernels can obtain a larger receptive field and stronger feature extraction capabilities, they will also significantly increase the computational cost of the neural network. Larger convolution kernels such as 5x5 and 7x7 can achieve the same effect by stacking multiple 3x3 convolution operations, and the number of parameters required is lower than that of using a single large convolution kernel. Therefore, the search space design of this invention only uses 1x1 and 3x3 convolutions, and replaces 5x5 or 7x7 convolution operations with multiple stacked 3x3 convolution operations.

[0077] Reference Figure 5 and Figure 6The accuracy of newly searched structures is continuously evaluated on the test set, and the structures are ranked according to their accuracy on the test set. The top 50 structures with the best accuracy are selected, and the effectiveness probability of each unit is calculated. After searching for a certain number of structures, the units with the worst effectiveness probability in the search space are continuously removed, so that NAS has the ability to adaptively and dynamically shrink the search space. Finally, only the 4 normal units and 4 decayed units that have the best effect on improving the network accuracy are left.

[0078] The first stage of the search used the Adam optimizer with a learning rate of 0.001 and a weight decay coefficient of 0.001. After 250 searches, the experimental results showed that the most effective units retained in the first three layers of normal units were H, G, A, and D, with effectiveness probabilities of 0.266, 0.262, 0.258, and 0.228, respectively. The most effective units retained in the last three layers of normal units were F, G, B, and C, with effectiveness probabilities of 0.282, 0.272, 0.241, and 0.227, respectively. The most effective units retained in the two decayed layers were O, M, I, and K, with effectiveness probabilities of 0.364, 0.283, 0.241, and 0.236, respectively.

[0079] After the search in this stage is completed, an empty operation unit needs to be added to the search space of the normal unit in the small search space. If a certain layer consists of empty operations, the input and output feature maps have not undergone any operations, which is equivalent to reducing the number of network layers by one. This enables NAS to have a certain ability to dynamically adjust the depth of network layers, which is beneficial for discovering structures with fewer layers and lower network complexity.

[0080] S32. Combining the topology complexity evaluation index, the preprocessed image dataset is input into the search space for optimizing the neural network topology structure for the second stage of search processing, namely, the search for neural network structure based on the topology complexity of the neural network, to construct a lightweight neural network topology structure.

[0081] Specifically, when facing real-world application scenarios, it is desirable to achieve higher accuracy and lower complexity in network models. Therefore, a good balance must be struck between accuracy and structural complexity, and the two are fused using a linear weighted summation method.

[0082] The formula for calculating the topology complexity evaluation index of this invention is as follows:

[0083] TCNAS=(1-β)*accuracy-β*T

[0084] In the above formula, β represents the weighting coefficient between accuracy and topology complexity set according to the actual task requirements, caauiacy represents the accuracy, T represents the topology complexity evaluation index of the neural network topology, and TCNAS represents the TCNAS evaluation index of the lightweight neural network topology.

[0085] Reference Figure 7 In this stage of the search, a batch training method was used with a batch size of 64. The SGD optimizer was used with a Momentum of 0.9 for acceleration. The experiment was conducted with a balance coefficient β of 0.4 between accuracy and topological complexity. To prevent overfitting, the learning rate was set to 0.001. The network was trained on 7542 coal gangue images and tested on 1000 coal gangue images. The search process used a random search algorithm. In performance evaluation, the proposed neural network topological complexity was combined with the test set accuracy for multi-objective optimization to guide the search for a lightweight coal gangue classification network with high accuracy and low structural complexity. In the structure search process, hyperparameter optimization was performed on the number of unit channels, learning rate, and L1 and L2 regularization coefficients. The search results after searching 500 structures in this stage are shown in Table 1.

[0086] Table 1. Comparison of structural performance under small search space

[0087]

[0088] Table 2 shows the top 10 optimal network structures found under the guidance of the TCNAS comprehensive evaluation index;

[0089] Table 2 compares the performance of the best network, mainstream networks, and lightweight networks found by TCNAS evaluation metrics on the coal gangue dataset.

[0090]

[0091]

[0092] In the search for the comprehensive accuracy evaluation index related to topology complexity, the network structure and number of intermediate layer channels with optimal performance are [Q,G,Q,O,G,G,B,I,96,192,160,64,32,160,32,64,256], with an accuracy of 82.7% and a topology complexity T of 131964.4. The accuracy evaluation index related to complexity is 0.8699. Among them, the structure with the highest accuracy and number of intermediate layer channels is [G,H,H,O,N,J,J,K,160,256,160,96,64,64,256,32,160], with an accuracy of 83.1% and a topology complexity T of 581418.8, which is 4 times greater than the topology complexity of the best-performing structure under the TCNAS evaluation index, with 28 parameters. The network with the highest accuracy (41908) has 12 times more parameters than the optimal network in terms of overall performance. However, it ranks only 276th in the TCNAS evaluation index. While achieving the highest accuracy, its complex structure and large number of parameters necessitate higher computational costs, making it inefficient on devices with limited computing resources. Further comparisons were made between the optimal network in the topology complexity-related accuracy evaluation index search and currently used manually designed mainstream networks. The results are shown in Table 2. The optimal network found in this invention achieves a maximum accuracy of 82.7% on the coal gangue dataset, with a significantly reduced number of parameters. Compared to lightweight manually designed networks such as MobileNet and ShuffleNet, the number of parameters is reduced by more than 5 times. Figure 8 This is the final lightweight neural network topology of the present invention.

[0093] S4. Perform image detection processing on the image dataset to be detected according to the lightweight neural network topology.

[0094] Specifically, refer to Figure 10 Image detection processing is performed on the dataset of images to be detected based on the lightweight neural network topology. Figure 10 The training curves show the accuracy and loss of the network with the best overall performance.

[0095] The above is a detailed description of the preferred embodiments of the present invention. However, the present invention is not limited to the embodiments described. Those skilled in the art can make various equivalent modifications or substitutions without departing from the spirit of the present invention. All such equivalent modifications or substitutions are included within the scope defined by the claims of this application.

Claims

1. A lightweight neural network structure search method based on neural network topology, characterized in that, Includes the following steps: The image dataset to be detected is preprocessed to obtain the preprocessed image dataset. Construct a search space for neural network topology and design a topology complexity evaluation index based on the neural network topology; The preprocessed image dataset is input into the neural network topology search space according to the random search strategy to perform the first stage search and obtain the first search result. Obtain the corresponding accuracy calculation result based on the first search result; All accuracy calculation results are sorted and the corresponding neural network topology is selected according to the selection rules, which are to select the top 10 neural network topologies with the highest accuracy. Calculate the effectiveness probability of the corresponding unit based on the corresponding neural network topology and remove the unit with the lowest effectiveness probability in the neural network topology to construct an optimized neural network topology search space; By combining the topology complexity evaluation index, the preprocessed image dataset is input into the search space of the optimized neural network topology for a second stage of search processing to construct a lightweight neural network topology. The lightweight neural network topology includes a first processing module, a second processing module, and a fully connected layer, wherein the first processing module and the second processing module each include three normal units and one decay unit; Image detection processing is performed on the image dataset to be detected based on the lightweight neural network topology.

2. The lightweight neural network structure search method based on neural network topology according to claim 1, characterized in that, The step of preprocessing the image dataset to be detected to obtain the preprocessed image dataset specifically includes: Obtain the dataset of images to be detected; The size of the image dataset to be detected is adjusted to obtain an image dataset of uniform size. A data augmentation dataset of images to be detected of uniform size is obtained by performing data augmentation processing on the random flipping method; The enhanced image dataset is divided into segments to obtain a preprocessed image dataset.

3. The lightweight neural network structure search method based on neural network topology according to claim 2, characterized in that, The step of constructing the search space for the neural network topology and designing a topology complexity evaluation index based on the neural network topology specifically includes: Determine the number of network layers, the number of feature maps in each network layer, and the connection methods between each network layer to construct the neural network topology search space; The feature maps of each network layer are treated as nodes and connected, and corresponding complexity weight coefficients are set. Auxiliary lines are added to the output and input network layers of the neural network topology search space to construct a strongly connected graph. Calculate the corresponding strongly connected components based on the strongly connected graph; A topology complexity evaluation index is constructed by combining complexity weight coefficients, the number of connections between feature graph nodes, the number of feature graphs in each network layer, and strongly connected components.

4. The lightweight neural network structure search method based on neural network topology according to claim 3, characterized in that, The formula for calculating the topology complexity evaluation index is as follows: ; In the above formula, Indicates the first The complexity weighting coefficients of the convolution operation in the layer. This represents the number of connections in a strongly connected graph representing the topology of a neural network. The number of feature maps representing the topology of a neural network. This represents the number of strongly connected components in the neural network topology. A metric for evaluating the topological complexity of a neural network topology.

5. The lightweight neural network structure search method based on neural network topology according to claim 4, characterized in that, The step of combining topological complexity evaluation metrics to input the preprocessed image dataset into the search space for optimizing the neural network topology for a second stage of search processing, thereby constructing a lightweight neural network topology, specifically includes: The preprocessed image dataset is input into the search space of the optimized neural network topology for iterative search processing to obtain the second search result. The second accuracy calculation result is obtained based on the second search result; The TCNAS evaluation index is obtained by weighted summation of the topology complexity evaluation index and the second accuracy calculation result. Repeat the above search process and weighted summation calculation process until the number of searches reaches a preset threshold, then stop the search process and output the TCNAS evaluation index corresponding to each search process. Select the search space corresponding to the highest TCNAS evaluation index to optimize the neural network topology and output a lightweight neural network topology.

6. The lightweight neural network structure search method based on neural network topology according to claim 5, characterized in that, The formula for calculating the TCNAS evaluation index of the lightweight neural network topology is as follows: ; In the above formula, This represents the weighting coefficient between accuracy and topological complexity, set according to the actual task requirements. Indicates accuracy rate. A metric for evaluating the topological complexity of a neural network topology. The TCNAS evaluation index indicates the lightweight neural network topology.

Citation Information

Patent Citations

  • Network model compression method and device, storage medium and computer equipment

    CN110490323A

  • Neural network unit structure searching method and system based on attention mechanism

    CN114626506A