Method and device for optimizing neural network architecture, computer device and storage medium
By selecting multiple target network parameters based on the changing trends and optimization results during the neural network architecture optimization process, the problem of extreme network parameter selection is solved, thereby improving the model's accuracy and generalization performance.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- GUANGDONG OPPO MOBILE TELECOMMUNICATIONS CORP LTD
- Filing Date
- 2021-10-12
- Publication Date
- 2026-05-05
AI Technical Summary
In existing technologies, when two-layer optimization methods jointly optimize neural network architecture parameters and model parameters, they are prone to extreme selection of network parameters, which affects model accuracy and generalization performance.
By optimizing the neural network architecture, the network loss of sub-networks is determined, and multiple target network parameters are selected based on the changing trends of network parameters during the optimization process and the optimization results, so as to avoid extremes and improve model accuracy and generalization performance.
This effectively avoids extreme choices in network parameter selection, improving the accuracy and generalization performance of neural network models.
Smart Images

Figure CN115965068B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of machine learning, and in particular to a method, apparatus, computer device, and storage medium for optimizing a neural network architecture. Background Technology
[0002] Neural Architecture Search (NAS) is a technique for automatically designing neural networks. It uses algorithms to automatically design high-performance network structures based on a sample set. Differentiable Architecture Search (DARTS), as a method within NAS, improves the efficiency of neural network architecture optimization by constructing a continuously relaxed search space and is widely used in machine learning.
[0003] In related technologies, DARTS constructs a neural network model by searching a subnetwork and then connecting multiple subnetworks. Specifically, it constructs a search space consisting of nodes and directed edges connecting the nodes, and relaxes the search space by mixing the possible candidate operations on each directed edge. A two-layer optimization method is used to jointly optimize the architecture parameters and model parameters, and the operation corresponding to the largest architecture parameter is selected to generate the final subnetwork.
[0004] The problem with the above-mentioned technical solutions is that after jointly optimizing the architecture parameters and model parameters through the two-layer optimization method, the operation corresponding to the largest architecture parameter is selected and other operations are discarded. This can easily lead to extreme selection of network parameters, affecting the accuracy and generalization performance of the neural network model. Summary of the Invention
[0005] This application provides a method, apparatus, computer device, and storage medium for optimizing neural network architectures. This method avoids extreme selection of network parameters during the optimization process, thereby improving the accuracy and generalization performance of the neural network model. The technical solution is as follows:
[0006] On one hand, embodiments of this application provide a method for optimizing a neural network architecture, the method comprising:
[0007] Determine a subnetwork, which is a differentiable network in a neural network architecture. The subnetwork consists of at least two nodes and edges connecting the nodes. The edges connecting the nodes are used to represent the basic operations in the neural network.
[0008] Based on the first training dataset, determine the network loss of the sub-network;
[0009] The network loss is minimized by optimizing network parameters, which include architecture parameters and model parameters. The architecture parameters are used to characterize the weights of the basic operations, and the model parameters are used to characterize the operation mode of the basic operations.
[0010] Based on the changing trend of the network parameters during the optimization process and / or the optimization results, the target network parameters are determined from the optimized network parameters;
[0011] The optimized sub-network is generated based on the target network parameters.
[0012] On the other hand, embodiments of this application provide an optimization apparatus for a neural network architecture, the apparatus comprising:
[0013] The first construction module is used to determine the sub-network, which is a differentiable network in the neural network architecture. The sub-network consists of at least two nodes and edges connecting the nodes. The edges connecting the nodes are used to represent the basic operations in the neural network.
[0014] The first determining module is used to determine the network loss of the sub-network based on the first training dataset;
[0015] An optimization module is used to minimize the network loss by optimizing network parameters, the network parameters including architecture parameters and model parameters, the architecture parameters being used to characterize the weights of the basic operations, and the model parameters being used to characterize the operation mode of the basic operations;
[0016] The second determining module is used to determine the target network parameters from the optimized network parameters based on the changing trend of the network parameters during the optimization process and / or the optimization results.
[0017] The generation module is used to generate the optimized sub-network based on the target network parameters.
[0018] On the other hand, embodiments of this application provide a computer device including a processor and a memory, wherein the memory stores at least one instruction, at least one program, code set, or instruction set, and the at least one instruction, the at least one program, the code set, or the instruction set is loaded and executed by the processor to implement the neural network architecture optimization method as described above.
[0019] On the other hand, embodiments of this application provide a computer-readable storage medium storing at least one instruction, at least one program, code set, or instruction set, wherein the at least one instruction, the at least one program, the code set, or the instruction set is loaded and executed by a processor to implement the neural network architecture optimization method as described above.
[0020] On the other hand, embodiments of this application provide a computer program product or computer program that includes computer instructions stored in a computer-readable storage medium. A processor of a computer device reads the computer instructions from the computer-readable storage medium and executes the computer instructions, causing the computer device to perform the neural network architecture optimization method provided above.
[0021] The technical solution provided in this application may include the following beneficial effects:
[0022] In this embodiment, multiple target network parameters are determined based on the changing trend of network parameters during the optimization process, the optimization result, or a combination of both. Compared with the related technologies that directly select a single target network parameter corresponding to the largest architecture parameter, this avoids the extreme selection of network parameters and improves the accuracy and generalization performance of the neural network model. Attached Figure Description
[0023] The accompanying drawings, which are incorporated in and form part of this specification, illustrate embodiments consistent with this application and, together with the description, serve to explain the principles of this application.
[0024] Figure 1 A schematic diagram illustrating an embodiment of the differentiable neural network search process provided in this application is shown.
[0025] Figure 2 This illustration shows a schematic diagram of the application process of a neural network model provided in an exemplary embodiment of this application;
[0026] Figure 3 A flowchart illustrating an exemplary embodiment of the method for optimizing a neural network architecture provided in this application is shown.
[0027] Figure 4 A schematic diagram of the sub-network structure shown in an exemplary embodiment of this application is illustrated;
[0028] Figure 5 A flowchart illustrating the network parameter determination process provided in an exemplary embodiment of this application is shown;
[0029] Figure 6 This illustration shows an implementation diagram of the network parameter determination process according to an exemplary embodiment of this application;
[0030] Figure 7 A schematic diagram illustrating an implementation of the network parameter determination process is shown in another exemplary embodiment of this application;
[0031] Figure 8 A schematic diagram illustrating the variation of network loss with network parameters is shown in an exemplary embodiment of this application;
[0032] Figure 9 A schematic diagram illustrating a comparison of network losses according to an exemplary embodiment of this application is shown;
[0033] Figure 10 A flowchart illustrating an optimization method for a neural network architecture provided in another exemplary embodiment of this application is shown;
[0034] Figure 11 A schematic diagram illustrating the range of network parameters shown in an exemplary embodiment of this application is provided.
[0035] Figure 12 A flowchart illustrating the target network model generation and verification process provided in an exemplary embodiment of this application is shown.
[0036] Figure 13 A structural block diagram of an optimization apparatus for a neural network architecture provided in an exemplary embodiment of this application is shown.
[0037] Figure 14 A structural block diagram of a computer device provided in an exemplary embodiment of this application is shown. Detailed Implementation
[0038] Exemplary embodiments will now be described in detail, examples of which are illustrated in the accompanying drawings. When the following description relates to the drawings, unless otherwise indicated, the same numbers in different drawings denote the same or similar elements. The embodiments described in the following exemplary embodiments do not represent all embodiments consistent with this application. Rather, they are merely examples of apparatuses and methods consistent with some aspects of this application as detailed in the appended claims.
[0039] This application relates to the application of neural networks. For ease of understanding, the relevant terms and concepts of neural networks that may be involved in this application are introduced below.
[0040] 1. Neural Networks
[0041] Neural networks are mathematical models that simulate biological neural networks and are widely used in the field of machine learning. A neural network consists of a large number of nodes and their interconnections. Nodes receive input signals and convert them into output values through activation functions, which are then passed to the next node. This output value can then be used as the input for the next node. Activation functions introduce non-linear features into the neural network. Each connection between nodes represents a weighted value for the signal passing through that connection. By training with large amounts of data and continuously adjusting the number of nodes, weights, and other relevant parameters of the neural network structure, a neural network model is obtained and used to solve real-world problems such as image classification, object recognition, and data prediction.
[0042] 2. Neural Network Optimization (Search)
[0043] Neural network optimization (search) is a technique for automatically designing neural networks. It uses algorithms to automatically design high-performance network structures based on training datasets. The specific process of neural network optimization (search) is as follows: First, a search space is defined. Then, a neural network is selected from the predefined search space according to a structure search strategy. This neural network is then evaluated using a performance evaluation method. The evaluation results are returned to the structure search strategy to adjust the next neural network selection, until a neural network model that meets the performance requirements is found.
[0044] 3. Differentiable Neural Network Search
[0045] Differentiable neural network search is a method for optimizing (searching) neural networks. Instead of searching for discrete candidate network structures, this method relaxes the search space to be continuous and optimizes the neural network through gradient descent, ultimately finding a neural network model that meets performance requirements. Differentiable neural network search constructs a neural network model by searching a sub-network and then connecting multiple sub-networks. For example... Figure 1 This diagram illustrates the implementation of the search process for a differentiable neural network. The first step is to construct a search space, consisting of nodes and directed edges connecting them. The operations on the directed edges between nodes are unknown. The second step is to relax the search space by mixing candidate operations on each directed edge. The third step is to jointly optimize the architecture and model parameters using a two-layer optimization method. The fourth step is to generate the final subnetwork based on the mixing probabilities.
[0046] The following section analyzes the problems existing in the search process of differentiable neural networks.
[0047] Differentiable neural network search methods, after jointly optimizing architecture parameters and model parameters through a two-layer optimization approach, select the operation corresponding to the largest architecture parameter and discard other operations. This can easily lead to extreme selection of network parameters, affecting the accuracy and generalization performance of the neural network model.
[0048] Furthermore, skip connections can occur during the search of neural networks, meaning connections that cross nodes. As the number of search rounds increases, skip connections gradually dominate the network architecture, leading to a reduction in the number of layers in the searched network structure, and consequently, poor performance of the final neural network model obtained.
[0049] Specifically, the solutions provided in this application can be applied to fields such as image classification, image retrieval, image segmentation, object detection, and natural language processing.
[0050] In one possible application scenario, image classification will be used as an example. The optimization method of the neural network architecture provided in the embodiments of this application is used to obtain a sub-network suitable for image classification. This sub-network is then stacked to obtain a neural network, which is then trained using images from the training dataset to obtain a neural network model suitable for image classification. In one possible implementation, this neural network model suitable for image classification is applied to a computer device to classify images stored on the computer device.
[0051] Optionally, the computer device can be a mobile computer device such as a smartphone, tablet, or laptop, or a computer device such as a desktop computer or a projector computer. This application does not limit the specific type of computer device.
[0052] In another possible implementation, the neural network model suitable for image classification is applied to the server side to classify images stored on the server side.
[0053] Optionally, the server can be an independent physical server, a server cluster or distributed system composed of multiple physical servers, or a cloud server that provides basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communication, middleware services, domain name services, security services, content delivery networks (CDN), and big data and artificial intelligence platforms. This application embodiment does not limit this.
[0054] Take, for example, the application of a neural network model suitable for image classification to a computer device. Figure 2As shown, during image capture, the raw image data (RAW format) from the camera sensor 21 is transmitted to the coprocessor chip 22 (CC). CC 22 integrates an image signal processor 221 (ISP) and an embedded neural network processing unit 222 (NPU). The ISP 221 performs denoising and sharpening on the raw image data, while the NPU 222 runs a neural network model and uses this model to further process the image processed by the ISP 221 using artificial intelligence (AI) to obtain image processing results. Examples include content recognition and AI denoising. CC 22 then transmits the image processing results to the application processor 23 (AP), which further processes the results, such as switching shooting modes based on content recognition results and further optimizing the AI-denoised image.
[0055] It should be noted that the embodiments of this application are only illustrated using the above application scenarios as examples. In practical applications, those skilled in the art can apply the neural network model obtained by the optimization method of the neural network architecture provided in the embodiments of this application to scenarios such as target detection tasks and image segmentation. The embodiments of this application do not limit this.
[0056] The optimization method for the neural network architecture provided in the embodiments of this application will be described in detail below. Please refer to... Figure 3 The diagram illustrates a flowchart of an optimization method for a neural network architecture provided in an exemplary embodiment of this application.
[0057] Step 310: Determine the subnetwork. The subnetwork is a differentiable network in the neural network architecture. The subnetwork consists of at least two nodes and edges connecting the nodes. The edges connecting the nodes are used to represent the basic operations in the neural network.
[0058] In this embodiment, the sub-network is a directed acyclic graph consisting of N ordered nodes (N being an integer greater than or equal to 2) and edges connecting the nodes. Each node represents a feature map, and each edge connecting a node represents a basic operation used to process the input feature map. The basic operation belongs to any one or more operations in the candidate operation set.
[0059] In addition, in the embodiments of this application, the sub-network can be constructed in real time or selected from several pre-constructed sub-networks. The embodiments of this application do not limit this.
[0060] Alternatively, the sub-network can be determined based on the application requirements of the target network model and the type of data being processed.
[0061] In one possible implementation, when the target network model is a neural network for processing image data, the constructed subnetworks must be adapted to the processing of image data.
[0062] In another possible implementation, when the target network model is a neural network used to process speech data, the subnetworks constructed should be adapted to the processing of speech data.
[0063] It should be noted that the requirements for sub-networks in this application embodiment are only illustrated by taking the target network model for processing image data or voice data as an example. In practical applications, those skilled in the art can determine the sub-networks according to the application requirements of the target network model and the type of data to be processed. This application embodiment does not limit this.
[0064] Optionally, the number of nodes in the subnetwork can be determined based on the application requirements of the target network model and the memory resources of the computer equipment. Specifically, the initial number of nodes can be determined first based on the application requirements of the target network model, and then the initial number of nodes can be further adjusted based on the memory resources of the computer equipment to determine the final number of nodes.
[0065] Optionally, the video memory resource requirement of a computer device can be the size of the video memory resources of the computer device.
[0066] Optionally, the candidate operation set includes input 0 operation, 3×3 depthwise separable convolution, 5×5 depthwise separable convolution, 3×3 dilated depthwise separable convolution, 5×5 dilated depthwise separable convolution, 3×3 maximum pooling, 3×3 mean pooling, etc., and this application embodiment does not limit this. Among them, input 0 operation means that there is no basic operation between nodes.
[0067] In one possible implementation, i and j represent the i-th node and the j-th node, respectively. Here, i and j are integers greater than or equal to 0, and i... <j。x i Let x represent the i-th feature map. j Let represent the j-th feature map. An edge (i, j) connecting nodes represents the connection relationship from node i to node j. Basic operations on edge (i, j) are... (i,j) The feature map x used to input node i (i) Transform into feature map x (j) And basic operations o(i,j) Belongs to the candidate operation set Any one or more operations in it.
[0068] For example, such as Figure 4 The subnetwork is a directed acyclic graph consisting of four nodes 41 and edges 42 connecting the nodes. The nodes 41 in the subnetwork are nodes 0, 1, 2, and 3. Where x... 0 x 1 x 2 and x 3 These represent the 0th, 1st, 2nd, and 3rd feature maps, respectively. The search space contains a total of 6 edges, 42 in total: edge (0, 1), edge (0, 2), edge (0, 3), edge (1, 2), edge (1, 3), and edge (2, 3).
[0069] Furthermore, the subnetwork is a differentiable network within the neural network architecture. During the optimization process of the neural network architecture, the optimized subnetwork is determined by selecting basic operations from the candidate operation set. In related technologies, methods such as reinforcement learning or evolutionary algorithms are used to select a basic operation from the candidate operation set in a discrete manner, meaning that the methods for selecting possible basic operations from the candidate operation set are unrelated. Discrete operations are difficult to differentiate mathematically, increasing the computational load and space required by computer equipment, resulting in low optimization efficiency. In this embodiment, the subnetwork is a differentiable network within the neural network architecture. Specifically, during the optimization process, each basic operation in the candidate operation set processes the feature map of each node in the subnetwork, and then the results obtained from all basic operations are weighted and summed. At this point, the relationship between any two nodes is not a single, definitive basic operation, but rather a hybrid operation composed of multiple basic operations. The basic operations selected from the candidate operation set are interconnected, making the subnetwork a differentiable network. This hybrid operation is defined as:
[0070]
[0071] in The mixed weights for operations between nodes (i, j); For the operation o between the i-th node and the j-th node (i,j) The weights, i.e., the architecture parameters in the network parameters; (i,j) This represents the possible basic operations between node i and node j; Represented as a set of candidate operations; This represents the probabilistic weighting of basic operations between node i and node j.
[0072] Therefore, based on hybrid operations, in this embodiment of the application, the process of selecting basic operations from the candidate operation set changes from discrete operations to continuous operations, and the optimization of the sub-network becomes the learning of the architecture parameter α, thereby reducing the amount of computation of the computer equipment and improving the optimization efficiency.
[0073] For example, the basic operation that might exist for the edge (0, 1) between node 0 and node 1 is a 3×3 depthwise separable convolution. 1 5×5 depthwise separable convolution 2 3×3 hole depth separable convolution o 3 There are three basic operations. Each basic operation has a weight of α. 1 α 2 α 3 The mixed operation between node 0 and node 1 is defined as follows:
[0074]
[0075] Step 320: Determine the network loss of the sub-network based on the first training dataset.
[0076] In optimizing a subnetwork, a computer aims to make the predicted values output by the subnetwork as close as possible to the ground truth values corresponding to the training data. This is achieved by comparing the current predicted values with the ground truth values, and then updating the subnetwork parameters based on the difference between the two. This process brings the predicted values output by the subnetwork closer to the ground truth values, resulting in an optimized subnetwork. The network loss is the difference between the predicted and ground truth values.
[0077] The true value is determined based on the target task to be processed by the target network model, and is the actual result required by the target task.
[0078] Optionally, when the target task to be processed by the target network model is image classification, the true value is the image classification label corresponding to the training data; when the target task to be processed by the target network model is object detection, the true value is the detection result label corresponding to the training data.
[0079] It should be noted that the embodiments of this application are only illustrated with the above-mentioned real values. In practical applications, those skilled in the art can determine the real values based on the target task to be processed by the target network model. The embodiments of this application are not limited to this.
[0080] The first training dataset is used to optimize the sub-network, resulting in the optimized sub-network. The type of the first training dataset is related to the target task that the target network model will handle. The first training dataset includes a training dataset and a test dataset. The training dataset has a larger data volume than the test dataset.
[0081] Optionally, the first training dataset can be obtained by means of network download, manual collection, etc., and this application embodiment does not limit this.
[0082] Optionally, when the target network model is to process image classification, the first training dataset can be the CIFAR-10 dataset, CIFAR-100 dataset, ImageNet dataset, etc., and this embodiment does not limit it.
[0083] Step 330: Minimize network loss by optimizing network parameters. Network parameters include architecture parameters and model parameters. Architecture parameters are used to characterize the weights of basic operations, and model parameters are used to characterize the operation mode of basic operations.
[0084] The optimization method for neural network architectures involves a computer continuously adjusting network parameters to minimize network loss. Minimizing network loss means that the predicted value of the subnetwork's output is close to the true value; this subnetwork is considered optimized. The process of continuously adjusting network parameters is the process of optimizing network parameters.
[0085] In one possible implementation, when the network loss meets the convergence condition, or when the upper limit of the number of optimization attempts is reached, the computer device stops optimizing the network parameters and obtains the optimized subnetwork based on the network parameters obtained in the final optimization.
[0086] In this embodiment of the application, network parameters include architecture parameters and network parameters. The architecture parameters are the weights α of the basic operations between every two nodes, and the network parameters are the configuration parameters of the basic operations themselves.
[0087] Optionally, the basic operation is a convolution operation, and the model parameters can be the number of channels, the size of the convolution kernel, the number of convolution kernels, the stride of the convolution kernel, etc., which are not limited in this embodiment.
[0088] Optionally, the basic operation is a pooling operation, and the model parameters can be the pooling kernel size, pooling method, pooling length, etc., which are not limited in this embodiment.
[0089] It should be noted that the embodiments of this application only use convolution and pooling operations as examples of basic operations. In practical applications, those skilled in the art can set corresponding model parameters according to different basic operations, and the embodiments of this application do not limit this.
[0090] Step 340: Based on the changing trend of network parameters during the optimization process and / or the optimization results, determine the target network parameters from the optimized network parameters.
[0091] Since the subnetwork is a differentiable network in a neural network architecture, multiple possible basic operations exist between nodes during the process of optimizing network parameters to minimize network loss. The architectural and model parameters of these basic operations can be the same or different. In related technologies, the factors by which the computer device determines the target network parameters from the optimized network parameters are relatively singular, considering only the numerical value of the network parameters to determine a single target network parameter. This can easily lead to extreme selection of network parameters, thus affecting the accuracy and generalization performance of the target network model. In this embodiment, the computer device determines the target network parameters from the optimized network parameters by comprehensively considering multiple factors such as the changing trend of network parameters during the optimization process and the optimization results. Furthermore, compared to related technologies, the computer device needs to determine multiple target network parameters, thus avoiding extreme selection of network parameters and improving the accuracy and generalization performance of the target network model.
[0092] In one possible implementation, the trend of network parameters during the optimization process refers to the trend of architecture parameters in the network parameters over optimization time.
[0093] In one possible implementation, the optimization result of the network parameters in the optimization process refers to the descending order of the architectural parameter values in the network parameters.
[0094] It should be noted that, in the embodiments of this application, and / or represent at least three possible implementation methods.
[0095] In one possible implementation, the target network parameters are determined from the optimized network parameters based on the changing trend of the network parameters during the optimization process.
[0096] In another possible implementation, the target network parameters are determined from the optimized network parameters based on the optimization results of the network parameters during the optimization process.
[0097] In another possible implementation, the target network parameters are determined from the optimized network parameters based on the changing trend of the network parameters during the optimization process and the optimization results.
[0098] Step 350: Generate an optimized subnetwork based on the target network parameters.
[0099] In this embodiment, a computer device determines target network parameters for multiple target basic operations from optimized network parameters. These target network parameters include target architecture parameters and target model parameters. The target architecture parameters and target model parameters for multiple target basic operations are concatenated and fused, and an optimized sub-network is generated based on the concatenated target network parameters.
[0100] Optionally, the splicing and fusion method is an addition operation or a concatenation operation, which is not limited in this embodiment.
[0101] In summary, in this embodiment of the application, multiple target network parameters are determined based on the changing trend of network parameters during the optimization process, the optimization result, or a combination of both. Compared with the related technologies that directly select a single target network parameter corresponding to the largest architecture parameter, this avoids the extreme selection of network parameters and improves the accuracy and generalization performance of the neural network model.
[0102] It should be noted that, in one possible implementation, the computer device determines the target architecture parameters from the optimized architecture parameters based on the changing trends and / or optimization results of the architecture parameters during the optimization process. Furthermore, the computer device determines the model parameters corresponding to the target architecture parameters in the optimized model parameters as the target model parameters.
[0103] The method is described below; please refer to it. Figure 5 The diagram illustrates a flowchart of a network parameter determination process provided in an exemplary embodiment of this application.
[0104] Step 341: Based on the descending order of the optimized architecture parameters, determine the first k architecture parameters as the target architecture parameters, where k is an integer greater than 1; and / or.
[0105] In this embodiment, the sub-network is a differentiable neural network. All operations in the candidate operation set are processed on each node. Based on the optimized architecture parameters, the basic operations between nodes are obtained as hybrid operations. These hybrid operations include several possible basic operations, and the architecture parameters and model parameters of these basic operations are not the same. The optimized architecture parameters corresponding to these basic operations are sorted in descending order, and the top k architecture parameters are selected as the target architecture parameters. Other architecture parameters besides the target architecture parameters are discarded.
[0106] For example, such as Figure 6 Taking the determination of the target architecture parameters between node 0 and node 1 as an example, there are four possible basic operations between node 0 and node 1, each represented by a different line. The architecture parameter for basic operation 1 is α. 1 The architecture parameter for basic operation 2 is α. 2 The architecture parameter for basic operation 3 is α. 3 The architecture parameter for basic operation 4 is α. 4 α 1 <α 2 <α 3 <α 4 And α 1 +α 2+α 3 +α 4 =1. Sort the architecture parameters in descending order, and determine the first two architecture parameters as the target architecture parameters. That is, determine the architecture parameters of basic operation 3 and basic operation 4 as the target architecture parameters, and discard basic operation 1 and basic operation 2. Determine the target basic operations between other nodes in the same way.
[0107] Step 342: Identify the architecture parameters that show an upward trend during the optimization process; determine the architecture parameters that show an upward trend as the target architecture parameters.
[0108] Determine the trend of the architectural parameters of several possible basic operations in the hybrid operation as the optimization time changes, and determine the architectural parameters that show an upward trend as the target architectural parameters, while discarding other architectural parameters.
[0109] For example, such as Figure 7 Taking the determination of the target architecture parameters between node 0 and node 1 as an example, there are three possible basic operations between node 0 and node 1, each represented by a different line. The architecture parameter for basic operation 1 is α. 1 The architecture parameter for basic operation 2 is α. 2 The architecture parameter for basic operation 3 is α. 3 The architecture parameter for basic operation 4 is α. 4 α 1 +α 2 +α 3 +α 4 =1. Based on the trend graph of architecture parameters changing with optimization time, it can be seen that the architecture parameters of basic operations 2 and 3 show an upward trend. Therefore, the architecture parameters of basic operations 2 and 3 are determined as the target architecture parameters, while basic operations 1 and 4 are discarded. The target basic operations between other nodes are determined in the same way.
[0110] Step 343: Determine the model parameters corresponding to the target architecture parameters in the optimized model parameters as the target model parameters.
[0111] In this embodiment, the computer device determines multiple target basic operations based on the descending order of optimized architecture parameters and / or architecture parameters that show an upward trend during the optimization process. Each target basic operation has its own corresponding architecture parameters and model parameters. After determining the target basic operation based on the target architecture parameters, the model parameters corresponding to the target basic operation are retained, while other model parameters are discarded. The network parameters of all target basic operations are concatenated and fused to obtain the optimized sub-network. For example, such as... Figure 6As shown, based on the descending order of the optimized architecture parameters, the architecture parameters of basic operations 3 and 4 are determined as the target architecture parameters, and basic operations 3 and 4 are determined as the target basic operations, while basic operations 1 and 2 are discarded. Basic operation 3 is a 3×3 depthwise separable convolution operation, and basic operation 4 is a 3×3 maximum pooling operation. Further, based on the optimized model parameters, the target model parameters for basic operation 3 are determined to be a convolution kernel size of 3×3, a stride of 1, an edge padding value of 0, and a channel count of 4; the target model parameters for basic operation 4 are a pooling kernel size of 3×3, a stride of 3, and an edge padding value of 0. The target network parameters and target model parameters of basic operations 3 and 4 are concatenated and fused to obtain the optimized sub-network.
[0112] It should be noted that, in the embodiments of this application, and / or indicate that there are at least three possible implementation methods.
[0113] In one possible implementation, the top k architecture parameters are determined as target architecture parameters based on the descending order of the optimized architecture parameters, where k is an integer greater than 1.
[0114] In another possible implementation, architectural parameters that show an upward trend during the optimization process are identified and designated as target architectural parameters.
[0115] In another possible implementation, based on the descending order of the optimized architecture parameters, the top k architecture parameters are determined as target architecture parameters, where k is an integer greater than 1. Then, architecture parameters exhibiting an upward trend during the optimization process are identified and determined as target architecture parameters. For example, Figure 6 In this process, based on the descending order of the optimized architecture parameters, the architecture parameters of basic operations 3 and 4 are determined as the target architecture parameters, while basic operations 1 and 2 are discarded. For example... Figure 7 Based on the changes in architecture parameters over time during the optimization process, the architecture parameters corresponding to basic operations 2 and 3, which show an upward trend, are determined as the target architecture parameters, while basic operations 1 and 4 are discarded. In this embodiment, the combination of the above two technical solutions is selected as the target architecture parameters, that is, the architecture parameters of basic operations 2, 3, and 4 are determined as the target architecture parameters, while basic operation 1 is discarded.
[0116] In summary, in this embodiment, multiple network parameters are determined by comprehensively considering the descending order of the optimized architecture parameters and the upward trend of the architecture parameters during the optimization process. Compared with related technologies that determine a single network parameter based on the single factor of the numerical value of the architecture parameters, this avoids extreme selection of network parameters and improves the accuracy and generalization performance of the target network model.
[0117] Additionally, it should be noted that in one possible implementation, the computer device determines the network loss of the sub-network within a range of network parameters using the Sharpness Aware Minimization (SAM) method based on a first training dataset. This range of network parameters is a parameter range centered on the network parameters. Specifically, in related technologies, the network loss is determined using only one set of network parameters. When the network parameters are updated again, the network loss may fluctuate significantly, causing the network loss to converge in the loss peak region. For example, as shown... Figure 8 As shown in the schematic diagram illustrating the change in network loss with network parameters, the network loss fluctuates little during the optimization process from network parameter 1 to network parameter 2. However, during the optimization process from network parameter 3 to network parameter 4, the network loss exhibits significant fluctuations, generating a spike region within the range of network parameter 4, leading to a collapse in network performance. In this embodiment, to reduce the large fluctuations in network loss during network parameter optimization, the network loss is determined by defining a range of network parameters. This minimizes the network loss corresponding to all network parameters within the range, causing the network loss to converge to a flat loss region, thereby improving the accuracy and generalization performance of the optimized sub-network. For example, as... Figure 9 Two identical sub-networks are constructed. One sub-network employs an optimization method from related technologies, where the network loss is determined by a specific network parameter. The other sub-network employs the optimization method described in this embodiment, where the network loss is determined by all parameters within a given range. The network parameters are optimized based on the same first training dataset to minimize the network loss. As can be seen from the network loss topography map, in the related technologies, the network loss converges in the loss peak region, while in the embodiment of this application, the corresponding network loss converges in the loss flat region.
[0118] The method is described below. Please refer to it. Figure 10 The diagram illustrates a flowchart of an optimization method for a neural network architecture provided in another exemplary embodiment of this application.
[0119] Step 1001: Determine the subnetwork. The subnetwork is a differentiable network in the neural network architecture. The subnetwork consists of at least two nodes and edges connecting the nodes. The edges connecting the nodes are used to represent the basic operations in the neural network.
[0120] Step 1001 is the same as step 310, and will not be described again in this embodiment.
[0121] Step 1002: Determine the network parameter range based on the network parameters and range size.
[0122] In this embodiment, the network parameter range is a neighborhood range centered on the current network parameters. The size of the neighborhood range needs to be determined based on the range size. The range size needs to be determined based on the video memory resources of the computer device.
[0123] Optionally, the network parameter range can be a spherical range with the current network parameters as the center line, and the range size is the radius of the sphere. For example, such as... Figure 11 The network parameter range is a neighborhood range centered on the current network parameter, with a range size of sphere radius ρ.
[0124] Step 1003: Select step size based on parameters and determine candidate network parameters within the range of network parameters.
[0125] Since there are countless parameters within the range of network parameters, computer equipment cannot determine the network loss corresponding to all parameters within this range. Therefore, it is necessary to segment the network parameter range and select candidate network parameters in step sizes. The network loss within the range of network parameters is determined by the candidate network loss corresponding to the candidate network parameters. This optimization method reduces the computational load on computer equipment and improves optimization efficiency.
[0126] The selection of the parameter step size needs to be determined based on the range of network parameters and the available memory resources of the computer. Furthermore, during the optimization of the neural network architecture, the parameter step size is not a fixed value and needs to be continuously adjusted based on the network loss.
[0127] Optionally, the parameter step size can be 0.5, 1, 1.5, 2, etc., and this application embodiment does not limit it.
[0128] Step 1004: For candidate network parameters within the range of network parameters, input the training data from the first training dataset into the sub-network using the candidate network parameters to obtain the network output of the sub-network.
[0129] The computer device determines the parameters of each candidate network as the parameters of the sub-network, trains the sub-network using the training dataset in the first training dataset, and obtains the predicted value of the sub-network output corresponding to each candidate network parameter.
[0130] Step 1005: Determine the candidate network loss corresponding to the candidate network parameters based on the network output.
[0131] The difference between the predicted value and the true value of the subnetwork output corresponding to each candidate network parameter is the candidate network loss for that parameter. The network loss is determined based on the target task to be processed by the target network model.
[0132] Optionally, when the target task to be processed by the target network model is image classification, the network loss is the result of image classification; when the target task to be processed by the target network model is target detection, the network loss is the result of target detection.
[0133] Step 1006: The sum of the candidate network losses corresponding to each candidate network parameter is determined as the network loss of the subnetwork within the range of network parameters.
[0134] When the network loss converges to a flat region, the network loss is the sum of the network losses corresponding to all parameters within the network parameter range. In this embodiment, it is expressed as the sum of the candidate network losses corresponding to each candidate network parameter within the network parameter range, rather than the network loss corresponding to a single network parameter. Therefore, the network loss within the network parameter range is expressed as...
[0135] min w max ||∈||≤ρ L train (w+∈)
[0136] Where w represents the network parameter, L train Represented as network loss, ||∈||≤ρ represents the range of network parameters, specifically, the neighborhood range of size ρ centered on the current parameter, L train (w+∈) represents the sum of network losses of the subnetwork within the range of network parameters.
[0137] Step 1007: Optimize the network parameters using a first-order optimization algorithm to minimize the network loss, and obtain the optimized network parameters.
[0138] In this embodiment, a first-order optimization algorithm is used to optimize network parameters simultaneously. Specifically, the architecture parameters and model parameters are optimized simultaneously using the same training dataset, thereby improving the utilization rate of training data.
[0139] Optionally, the first-order optimization algorithm can be gradient descent, Newton's algorithm, etc., and this embodiment does not limit it.
[0140] Step 1008: Based on the changing trend of network parameters during the optimization process and / or the optimization results, determine the target network parameters from the optimized network parameters.
[0141] Step 1008 is the same as step 340, and will not be described again in this embodiment.
[0142] Step 1009: Generate the post-ground sub-network based on the target network parameters.
[0143] Step 1009 is the same as step 350, and will not be described again in this embodiment.
[0144] In summary, the embodiments of this application determine the corresponding network loss by using all parameters within the network parameter range, and optimize the network parameters so that the network loss converges to a flat loss region. In contrast, related technologies determine the network loss using a single network parameter, and during the optimization process, the network loss is prone to significant fluctuations, causing it to converge to a loss peak region, leading to a collapse in the performance of the neural network model. Compared to related technologies, the technical solution provided in this application, by determining the network loss within the network parameter range, ensures that the network loss does not fluctuate significantly during the optimization process, allowing the network loss to converge from the loss peak region to a flat loss region. This reduces the instability of the neural network model's performance and improves its accuracy and generalization performance.
[0145] Additionally, it should be noted that the method for optimizing network parameters to minimize network loss in this embodiment is not limited to a first-order optimization algorithm. In another possible implementation, the corresponding network loss is determined based on the network parameters, and the network parameters are optimized using a second-order optimization algorithm to minimize the network loss, resulting in optimized network parameters. Specifically, a two-layer optimization method is used to optimize the architecture parameters and model parameters in the network parameters. The training dataset is divided into two parts and input into the computer device. One part of the training dataset is used to optimize the architecture parameters, and the other part is used to optimize the model parameters. Gradient descent optimization is used, that is, first fixing the architecture parameters and optimizing the model parameters, then fixing the model parameters and optimizing the architecture parameters, and so on, alternating until the network loss converges, resulting in optimized network parameters.
[0146] In this embodiment, the final target network model is obtained by stacking the optimized sub-networks. The method for generating the target network model is described below. Please refer to... Figure 12 The diagram illustrates a flowchart of the target network model generation and verification process provided in an exemplary embodiment of this application.
[0147] Step 360: Construct the target network model based on the optimized sub-networks. The target network model is obtained by stacking the optimized sub-networks.
[0148] In this embodiment, the target network model is obtained by stacking optimized subnetworks in a predetermined manner.
[0149] Optionally, the target network model can be a Convolutional Neural Network (CNN) structure, a Recurrent Neural Network (RNN) structure, a Long Short Term Memory (LSTM) structure, etc., and this embodiment does not limit it.
[0150] Optionally, the number of optimized sub-networks can be one or more, and this embodiment does not limit this. The number of optimized sub-networks corresponds to the number of sub-networks determined.
[0151] In one possible implementation, the optimized subnetwork consists of two subnetworks: an upsampled subnetwork and a downsampled subnetwork. The optimized upsampled and downsampled subnetworks are obtained by constructing both subnetworks and training them using the same initial training dataset. Stacking the upsampled and downsampled subnetworks yields a U-net neural network architecture.
[0152] It should be noted that the embodiments of this application only illustrate the U-shaped neural network architecture obtained by stacking optimized sub-networks. In practical applications, those skilled in the art can obtain optimized sub-networks and stack them to obtain the corresponding target network model according to actual needs. This embodiment does not limit this.
[0153] Step 370: Train the target network model based on the first training dataset to obtain the trained target network model.
[0154] The first training dataset includes a training dataset and a test dataset. In this embodiment, the target network model is trained using the test dataset in the first training dataset to further optimize the target network model.
[0155] Step 380: Based on the second training dataset, perform performance verification on the trained target network model to obtain performance verification results. The second training dataset is different from the first training dataset. The performance verification results include accuracy verification results and generalization verification results.
[0156] Using the second training dataset, the performance of the target network model obtained in step 250 is verified and evaluated. Performance includes the accuracy and generalization ability of the target network model. Accuracy evaluates how well the target network model matches the true values, while generalization evaluates the target network model's ability to adapt to new training data. The performance evaluation criteria need to be determined based on the target task to be processed by the target network model. The second training dataset and the first training dataset are different datasets, with the first training dataset having a larger data volume than the second training dataset. Furthermore, the data in the second training dataset does not require preprocessing. The type of the second training dataset is related to the target task to be processed by the target network model.
[0157] Optionally, the second training dataset can be obtained through network download, manual collection, or other means, and this application embodiment does not limit this.
[0158] Optionally, when the target task to be processed by the target network model is image classification, the second training dataset can be the CIFAR-10 dataset, CIFAR-100 dataset, ImageNet dataset, etc., and this embodiment does not limit it.
[0159] In one possible implementation, when the target task to be processed by the target network model is image classification, the performance evaluation criteria of the target network model are Peak Signal to Noise Ratio (PSNR) and Structural Similarity Index Measurement (SSIM).
[0160] It should be noted that the embodiments of this application are only used to illustrate the performance evaluation criteria of the target network model described above. In practical applications, those skilled in the art can select the evaluation criteria of the model according to the target task to be processed by the target network model. The embodiments of this application do not limit this.
[0161] In summary, in this embodiment, the sub-network is optimized first, and the target network model is constructed through the optimized sub-network. Compared with the method in related technologies of first constructing the target network model and then optimizing the constructed target network model, the computational load of computer equipment for optimization is reduced and the optimization efficiency is improved. In addition, the sub-network structure optimized based on this embodiment is simple, and the accuracy and generalization performance of the final constructed target network model are higher than those of the target network models constructed in related technologies.
[0162] Please refer to Figure 13 This illustration shows a structural block diagram of an optimization device for a neural network architecture provided in an exemplary embodiment of this application. The device may include:
[0163] The first building module 1301 is used to determine the sub-network, which is a differentiable network in the neural network architecture. The sub-network consists of at least two nodes and edges connecting the nodes. The edges connecting the nodes are used to represent the basic operations in the neural network.
[0164] The first determining module 1302 is used to determine the network loss of the sub-network based on the first training dataset;
[0165] The optimization module 1303 is used to minimize network loss by optimizing network parameters. The network parameters include architecture parameters and model parameters. The architecture parameters are used to characterize the weights of basic operations, and the model parameters are used to characterize the operation mode of basic operations.
[0166] The second determining module 1304 is used to determine the target network parameters from the optimized network parameters based on the changing trend of the network parameters during the optimization process and / or the optimization results.
[0167] The generation module 1305 is used to generate an optimized subnetwork based on the target network parameters.
[0168] Optionally, the second determining module 1304 includes:
[0169] The first determining unit is used to determine the target architecture parameters from the optimized architecture parameters based on the changing trend of the architecture parameters during the optimization process and / or the optimization results.
[0170] The second determining unit is used to determine the model parameters corresponding to the target architecture parameters in the optimized model parameters as the target model parameters.
[0171] Optionally, the first determining unit is used for:
[0172] Based on the optimized architecture parameters in descending order, the first k architecture parameters are determined as the target architecture parameters, where k is an integer greater than 1; and / or,
[0173] Identify the architecture parameters that show an upward trend during the optimization process, and determine the architecture parameters that show an upward trend as the target architecture parameters.
[0174] Optionally, the first determining module 1302 includes:
[0175] The third determining unit is used to determine the network loss of the sub-network within the network parameter range based on the first training dataset using the sharpness-aware minimization method. The network parameter range is the parameter range centered on the network parameters.
[0176] Optionally, the third determining unit is used for:
[0177] Determine the range of network parameters based on network parameters and range size;
[0178] For candidate network parameters within the range of network parameters, the training data in the first training dataset is input into the sub-network using the candidate network parameters to obtain the network output of the sub-network.
[0179] Determine the candidate network loss corresponding to the candidate network parameters based on the network output;
[0180] The sum of the candidate network losses corresponding to each candidate network parameter is determined as the network loss of the subnetwork within the range of network parameters.
[0181] Optionally, the third determining unit is also used for:
[0182] Based on the parameter selection step size, candidate network parameters within the range of network parameters are determined.
[0183] Optionally, the optimization module 1303 is used for:
[0184] The network parameters are optimized by a first-order optimization algorithm to minimize the network loss, resulting in the optimized network parameters.
[0185] Optionally, the device further includes:
[0186] The second building module is used to build the target network model based on the optimized sub-networks. The target network model is obtained by stacking the optimized sub-networks.
[0187] The training module is used to train the target network model based on the first training dataset to obtain the trained target network model.
[0188] Optionally, the target network model adopts a U-shaped neural network architecture, and the target network model is constructed based on the optimized upsampling sub-network and downsampling sub-network.
[0189] Optionally, the device further includes:
[0190] The performance verification module is used to perform performance verification on the trained target network model based on the second training dataset and obtain the performance verification results. The second training dataset is different from the first training dataset. The performance verification results include accuracy verification results and generalization verification results.
[0191] In summary, in this embodiment, multiple target network parameters are determined based on the changing trend of network parameters during the optimization process, the optimization results, or a combination of both. Compared with the related technologies that directly select a single target network parameter corresponding to the largest architecture parameter, this avoids the extreme selection of network parameters and improves the accuracy and generalization performance of the neural network model.
[0192] Please refer to Figure 14This illustration shows a schematic diagram of the structure of a computer device provided in an exemplary embodiment of this application. Specifically, the computer device 1400 includes a Central Processing Unit (CPU) 1401, a system memory 1404 including Random Access Memory (RAM) 1402 and Read-Only Memory (ROM) 1403, and a system bus 1405 connecting the system memory 1404 and the CPU 1401. The computer device 1400 also includes a basic input / output (I / O) system 1406 that facilitates the transfer of information between various devices within the computer, and a mass storage device 1407 for storing the operating system 1413, application programs 1414, and other program modules 1415.
[0193] The basic input / output system 1406 includes a display 1408 for displaying information and an input device 1409 for user input, such as a mouse or keyboard. Both the display 1408 and the input device 1409 are connected to the central processing unit 1401 via an input / output controller 1410 connected to the system bus 1405. The basic input / output system 1406 may also include the input / output controller 1410 for receiving and processing input from multiple other devices such as a keyboard, mouse, or electronic stylus. Similarly, the input / output controller 1410 also provides output to a display screen, printer, or other types of output devices.
[0194] The mass storage device 1407 is connected to the central processing unit 1401 via a mass storage controller (not shown) connected to the system bus 1405. The mass storage device 1407 and its associated computer-readable media provide non-volatile storage for the computer device 1400. That is, the mass storage device 1407 may include computer-readable media (not shown) such as a hard disk or a CD-ROM (Compact Disc Read-Only Memory) drive.
[0195] Without loss of generality, the computer-readable medium may include computer storage media and communication media. Computer storage media include volatile and non-volatile, removable and non-removable media implemented using any method or technology for storing information such as computer-readable instructions, data structures, program modules, or other data. Computer storage media include RAM, ROM, EPROM (Erasable Programmable Read-Only Memory), EEPROM (Electrically Erasable Programmable Read-Only Memory), flash memory or other solid-state storage technologies, CD-ROM, DVD (Digital Video Disc) or other optical storage, magnetic tape cassettes, magnetic tape, disk storage, or other magnetic storage devices. Of course, those skilled in the art will recognize that the computer storage media are not limited to the above-mentioned types. The system memory 1404 and mass storage device 1407 described above can be collectively referred to as memory.
[0196] The memory stores one or more programs, which are configured to be executed by one or more central processing units 1401. The one or more programs contain instructions for implementing the model training methods described above. The central processing unit 1401 executes the one or more programs to implement the methods provided in the various method embodiments described above.
[0197] According to various embodiments of this application, the computer device 1400 can also be connected to a remote computer on a network, such as the Internet. That is, the computer device 1400 can be connected to a network 1412 via a network interface unit 1411 connected to the system bus 1405, or the network interface unit 1411 can be used to connect to other types of networks or remote computer systems (not shown).
[0198] The memory further includes one or more programs stored in the memory, and the one or more programs include steps performed by a computer device in the methods provided in the embodiments of this application.
[0199] In this application embodiment, a computer-readable storage medium is also provided, which stores at least one instruction that is loaded and executed by a processor to implement the method for optimizing the neural network architecture as described above.
[0200] According to one aspect of this application, a computer program product or computer program is provided, comprising computer instructions stored in a computer-readable storage medium. A processor of a computer device reads the computer instructions from the computer-readable storage medium and executes the computer instructions, causing the computer device to perform an optimized method for a neural network architecture provided in various alternative implementations of the above aspect.
[0201] Other embodiments of this application will readily occur to those skilled in the art upon consideration of the specification and practice of the embodiments disclosed herein. This application is intended to cover any variations, uses, or adaptations of this application that follow the general principles of this application and include common knowledge or customary techniques in the art not disclosed herein. The specification and embodiments are to be considered exemplary only, and the true scope and spirit of this application are indicated by the following claims.
[0202] It should be understood that this application is not limited to the precise structure described above and shown in the accompanying drawings, and various modifications and changes can be made without departing from its scope. The scope of this application is limited only by the appended claims.
Claims
1. A method for optimizing a neural network architecture, characterized in that, The method includes: A subnetwork is defined, wherein the subnetwork is a differentiable network in a neural network architecture, the subnetwork consists of at least two nodes and edges connecting the nodes, the edges connecting the nodes are used to represent the basic operations in the neural network, and the subnetwork is suitable for image classification; Based on the network parameters and the range size, the network parameter range is determined, wherein the network parameter range is the parameter range centered on the network parameters; Based on the parameter selection step size, candidate network parameters within the range of network parameters are determined, and the parameter selection step size is adjusted with network loss during the optimization process of the neural network architecture; For the candidate network parameters within the range of network parameters, the training data in the first training dataset is input into the sub-network using the candidate network parameters to obtain the network output of the sub-network. The first training dataset is an image dataset, and the real value corresponding to the training data in the first training dataset is the image classification label. Based on the network output, determine the candidate network loss corresponding to the candidate network parameters; The sum of the losses of the candidate networks corresponding to each of the candidate network parameters is determined as the network loss of the sub-network within the range of the network parameters. The network loss is minimized by optimizing network parameters, which include architecture parameters and model parameters. The architecture parameters are used to characterize the weights of the basic operations, and the model parameters are used to characterize the operation mode of the basic operations. Based on the descending order of the optimized architecture parameters, the first k architecture parameters are determined as target architecture parameters, where k is an integer greater than 1; and, the architecture parameters that show an upward trend during the optimization process are determined as the target architecture parameters, wherein the trend of change during the optimization process is the trend of change of the architecture parameters with optimization time. Among the optimized model parameters, the model parameters corresponding to the target architecture parameters are determined as the target model parameters; The optimized sub-network is generated based on the target network parameters, which include the target architecture parameters and the target model parameters.
2. The method according to claim 1, characterized in that, The step of optimizing network parameters to minimize the network loss includes: The network parameters are optimized by a first-order optimization algorithm to minimize the network loss, resulting in the optimized network parameters.
3. The method according to claim 1, characterized in that, After optimizing the network parameters to minimize the network loss, the method further includes: A target network model is constructed based on the optimized sub-networks, and the target network model is obtained by stacking the optimized sub-networks. The target network model is trained based on the first training dataset to obtain the trained target network model.
4. The method according to claim 3, characterized in that, The target network model adopts a U-shaped neural network architecture and is constructed based on optimized upsampling subnetworks and downsampling subnetworks.
5. The method according to claim 4, characterized in that, After training the target network model based on the first training dataset to obtain the trained target network model, the method further includes: Based on the second training dataset, the performance of the trained target network model is verified to obtain performance verification results. The second training dataset is different from the first training dataset. The performance verification results include accuracy verification results and generalization verification results.
6. An optimization device for a neural network architecture, characterized in that, The device includes: The first construction module is used to determine a sub-network, which is a differentiable network in a neural network architecture. The sub-network consists of at least two nodes and edges connecting the nodes. The edges connecting the nodes are used to represent the basic operations in the neural network. The sub-network is suitable for image classification. The first determining module is used to determine the network parameter range based on the network parameters and the range size, wherein the network parameter range is a parameter range centered on the network parameters; Based on the parameter selection step size, candidate network parameters within the range of network parameters are determined, and the parameter selection step size is adjusted with network loss during the optimization process of the neural network architecture; For the candidate network parameters within the range of network parameters, the training data in the first training dataset is input into the sub-network using the candidate network parameters to obtain the network output of the sub-network. The first training dataset is an image dataset, and the real value corresponding to the training data in the first training dataset is the image classification label. Based on the network output, determine the candidate network loss corresponding to the candidate network parameters; The sum of the losses of the candidate networks corresponding to each of the candidate network parameters is determined as the network loss of the sub-network within the range of the network parameters. An optimization module is used to minimize the network loss by optimizing network parameters, the network parameters including architecture parameters and model parameters, the architecture parameters being used to characterize the weights of the basic operations, and the model parameters being used to characterize the operation mode of the basic operations; The second determining module is used to determine the first k architecture parameters as target architecture parameters based on the descending order of the optimized architecture parameters, where k is an integer greater than 1; and to determine the architecture parameters that show an upward trend during the optimization process, and to determine the architecture parameters that show an upward trend as the target architecture parameters, wherein the trend of change during the optimization process is the trend of change of the architecture parameters with the optimization time. Among the optimized model parameters, the model parameters corresponding to the target architecture parameters are determined as the target model parameters; The generation module is used to generate the optimized sub-network based on the target network parameters, which include the target architecture parameters and the target model parameters.
7. A computer device, characterized in that, The computer device includes a processor and a memory, the memory storing at least one instruction, at least one program, a code set, or an instruction set, the at least one instruction, the at least one program, the code set, or the instruction set being loaded and executed by the processor to implement the optimization method of the neural network architecture as described in any one of claims 1 to 5.
8. A computer-readable storage medium, characterized in that, The readable storage medium stores at least one instruction, at least one program, code set, or instruction set, wherein the at least one instruction, the at least one program, the code set, or the instruction set is loaded and executed by a processor to implement the optimization method of the neural network architecture as described in any one of claims 1 to 5.
9. A computer program product, characterized in that, The computer program product includes computer instructions that are executed by a processor to implement the optimization method for the neural network architecture as described in any one of claims 1 to 5.