Power transmission and transformation inspection model network structure search method, system and storage medium
By designing basic network modules, building hypernetworks and using pruning strategy training methods, the parameter convergence difficulties and high computing power consumption problems in the neural network structure search method in the existing technology are solved, and the neural network structure with excellent automatic design is realized, which improves the research and development efficiency of deep learning models.
Patent Information
- Application Number
- CN202210434377.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-04-24
- Publication Date
- 2025-06-06
- Estimated Expiration
- 2042-04-24
AI Technical Summary
In the prior art, the neural network structure search method based on reinforcement learning has problems such as difficulty in converging parameters, high computing power consumption, and difficulty in promoting it in actual business applications.
A network structure search method for power transmission and transformation inspection model is adopted. By designing multiple basic network modules, a hypernetwork is built, and a pruning strategy is used to train the hypernetwork, so as to automatically design an excellent neural network structure.
It realizes convenient and efficient automatic design of neural network structures, improves the R&D efficiency of deep learning models, reduces R&D costs, and reduces manpower consumption.
Smart Images

Figure CN114881225B_ABST
Abstract
Description
Technical Field
[0001] The present invention belongs to the technical field of deep neural network structure design, and specifically relates to a network structure search method, system and storage medium for a power transmission and transformation inspection model. Background Art
[0002] With the growth of computer and GPU (graphics processing unit) computing power, deep neural networks have been widely used not only in artificial intelligence fields such as speech recognition, image understanding and natural language processing, but also in complex systems such as cancer detection, autonomous driving and complex games. Deep neural networks have surpassed human accuracy in recognition tasks and have made great breakthroughs compared with traditional algorithms, such as the hand-designed histogram of oriented gradient (HOG) features (Dalal and Triggs, 2005) and scale-invariant feature transform (SIFT) features (Lowe, 2004). These performance improvements are mainly due to the fact that deep neural networks can extract very high-level features, thereby obtaining a more effective representation of input data. In addition, the improvement of GPU computing power has further increased the number of layers of neural networks and further enhanced their representation capabilities. The structure of neural networks has evolved from AlexNet to VGGNe, and then to GoogLeNet and ResNet, and the structure of neural networks has become more and more complex.
[0003] The reason why deep neural networks can achieve good performance is largely due to excellent network structure design. Neural network structure search is to automatically search for a suitable neural network structure for a given task, hoping that its performance (accuracy on the target task) exceeds the network structure designed by human experts. Usually, neural network structure search can be divided into three dimensions: search space, search strategy, and performance estimation strategy. The search strategy refers to selecting a neural network structure a from the search space A, and then using the performance evaluation strategy to estimate the generalization performance of the network structure. Finally, the estimated generalization performance is fed back to the search strategy to further improve the search strategy.
[0004] The common neural network architecture search is based on reinforcement learning. The main idea is to first construct a controller composed of a recurrent neural network (RNN), which gradually generates the network structure and is guided by a reinforcement learning strategy in the process. This method uses a recurrent neural network as a controller to generate the model description: the controller generates their hyperparameters as a token sequence. Once the controller RNN finishes generating an architecture, a neural network with this architecture is constructed and trained. At convergence, the network accuracy on the external validation set is recorded, and the parameters θ of the controller RNN are then optimized to maximize the expected validation accuracy of the proposed architecture. The token list predicted by the controller can be regarded as a list of actions for designing the architecture for a sub-network. In the convergence phase, the sub-network will obtain an accuracy R on the dataset, use the accuracy R as a reward signal, and then use reinforcement learning to train the controller. The neural network search method based on reinforcement learning has difficulty in parameter convergence and consumes a lot of computing power during the training process, which is difficult to promote in actual business applications. Summary of the invention
[0005] The purpose of the present invention is to address the problems in the above-mentioned prior art and provide a network structure search method, system and storage medium for a power transmission and transformation inspection model, which can conveniently and efficiently automatically design a neural network structure with excellent performance, improve the efficiency of deep learning model research and development, reduce research and development costs, and reduce manpower consumption.
[0006] In order to achieve the above object, the present invention has the following technical solutions:
[0007] In a first aspect, a method for searching a network structure of a power transmission and transformation inspection model is provided, comprising:
[0008] Design multiple basic network modules according to the requirements of power transmission and transformation inspection tasks;
[0009] Select a number of modules from multiple basic network modules to build a super network;
[0010] The pruning strategy is used to train the super network, and an optimal basic network module is selected from each hidden layer of the super network. The optimal basic network modules selected from all hidden layers are connected in series in sequence to obtain the target network structure of the power transmission and transformation inspection model.
[0011] As a preferred solution of the network structure search method of the power transmission and transformation inspection model, in the step of designing multiple basic network modules according to the power transmission and transformation inspection task requirements, the basic network modules are designed using the following principles:
[0012] In the convolution layer adjacent to the input, a 1×1 small convolution kernel is used to extract features and reduce the number of model parameters, while in the convolution layer adjacent to the output, a 3×3 large convolution kernel is used to capture more and higher-order abstract features;
[0013] Use two small convolution kernels in series instead of one large convolution kernel;
[0014] Use 1×1 convolution kernel to achieve linear transformation and input and output channel transformation;
[0015] Split an n×n convolution into a 1×n and an n×1 asymmetric convolution kernel to achieve the same convolution effect;
[0016] Optimize large-area convolution kernels into Depthwise convolution and Pointwise convolution;
[0017] Use global average pooling instead of fully connected layers.
[0018] As a preferred solution of the network structure search method of the power transmission and transformation inspection model, the step of designing multiple basic network modules according to the power transmission and transformation inspection task requirements also includes calculating the computing power consumption of the basic network modules;
[0019] The computing power consumption of the computing basic network module includes the following steps:
[0020] Select edge computing devices for testing, and keep the test devices consistent throughout the test process;
[0021] Repeatedly stack a single basic network module and test it, then take the average value. The number of stacking times of different modules should be kept consistent. Test the stacked basic network module to be tested on the selected test device according to the following formula:
[0022] t i =T i / (n*m)
[0023] In the formula, n represents the number of test rounds, m represents the number of stacking times, and T i represents the total time of the i-th basic network module test, t i Indicates the computing power consumption time of the i-th basic network module.
[0024] Furthermore, as a preferred solution of the network structure search method of the power transmission and transformation inspection model, the step of designing multiple basic network modules according to the power transmission and transformation inspection task requirements also includes constructing a basic network module scoring table, and the content of the basic network module scoring table includes network layer number, module identification, module structure, computing power consumption and module score;
[0025] The module structure describes the number of layers, structure, neuron connection method, and activation function information of the module;
[0026] The module score is initially set to 1 or is assigned by a human expert, and is subsequently changed and adjusted based on usage.
[0027] Furthermore, as a preferred solution of the network structure search method of the power transmission and transformation inspection model, in the step of selecting a number of modules from a plurality of basic network modules to construct a super network, the selection method includes any one of the following methods:
[0028] All basic network modules are used for super network construction;
[0029] According to the basic network module scoring table, specify the number of modules and select the modules of each layer in order of the scores;
[0030] According to the basic network module scoring table, the number of modules is specified, and a probability distribution model is constructed according to the scores. Modules with high scores are highly selected, while modules with low scores are less likely to be selected. Modules at each layer are selected by random sampling.
[0031] As a preferred solution of the network structure search method of the power transmission and transformation inspection model, in the step of selecting a number of modules from a plurality of basic network modules to construct a super network, the super network is constructed in the following manner:
[0032] The input layer structure is determined according to the target business and training sample set;
[0033] The number of hidden layers is equal to the number of network layers, and the hidden layer structure is composed of selected basic structure modules in parallel;
[0034] The connection layer is located between every two adjacent hidden layers, and the structure of the connection layer is consistent with the last layer of the network connected to the hidden layer;
[0035] The output layer structure is determined according to the requirements of the power transmission and transformation inspection task, and is a network composed of several fully connected layers.
[0036] As a preferred solution of the network structure search method of the power transmission and transformation inspection model, in the step of selecting a number of modules from a plurality of basic network modules to construct a super network, the super network is constructed in the following manner:
[0037] Embed the hypernetwork into a known network structure and reuse a fixed part of the network structure.
[0038] As a preferred solution of the network structure search method of the power transmission and transformation inspection model, the steps of adopting a pruning strategy to train the super network, selecting an optimal basic network module from each hidden layer of the super network, and connecting the optimal basic network modules selected from all hidden layers in series in sequence to obtain the target network structure of the power transmission and transformation inspection model include:
[0039] Determine the computing power consumption factor W t ;
[0040] Set the number of training batches num, the upper threshold max and lower threshold min of the weight coefficient;
[0041] After num training processes are completed, the weights W of each basic network module and connection module in the hidden layer are obtained, and W is set k i represents the weight of the i-th type basic network module in the k-th layer, let t k i It represents the computation time of the i-th basic network module of the k-th layer;
[0042] Determine the weight coefficient W of each basic network module and connection module k i -W t *t k i Is it greater than the upper threshold max? If yes, keep the module and prune all other modules in the hidden layer;
[0043] Determine the weight coefficient W of each basic network module and connection module k i -W t *t k i Is it less than the lower threshold min? If yes, prune the module;
[0044] Return to perform the training process num times again and perform the corresponding judgment and pruning operations until only one basic network module is left in each hidden layer;
[0045] The connection layers between the hidden layers are pruned, and the network obtained by splicing the remaining hidden layers is used as the target network structure of the power transmission and transformation inspection model.
[0046] In a second aspect, a network structure search system for a power transmission and transformation inspection model is provided, comprising:
[0047] Basic network module design module, used to design multiple basic network modules according to the requirements of power transmission and transformation inspection tasks;
[0048] A super network construction module, used for selecting a number of modules from a plurality of basic network modules to construct a super network;
[0049] The target network structure training module is used to train the super network using a pruning strategy, select an optimal basic network module from each hidden layer of the super network, and connect the optimal basic network modules selected from all hidden layers in series in sequence to obtain the target network structure of the power transmission and transformation inspection model.
[0050] As a preferred solution of the network structure search system for the power transmission and transformation inspection model, the basic network module design module adopts the following principles to design the basic network module:
[0051] In the convolution layer adjacent to the input, a 1×1 small convolution kernel is used to extract features and reduce the number of model parameters, while in the convolution layer adjacent to the output, a 3×3 large convolution kernel is used to capture more and higher-order abstract features;
[0052] Use two small convolution kernels in series instead of one large convolution kernel;
[0053] Use 1×1 convolution kernel to achieve linear transformation and input and output channel transformation;
[0054] Split an n×n convolution into a 1×n and an n×1 asymmetric convolution kernel to achieve the same convolution effect;
[0055] Optimize large-area convolution kernels into Depthwise convolution and Pointwise convolution;
[0056] Use global average pooling instead of fully connected layers.
[0057] As a preferred solution of the network structure search system for the power transmission and transformation inspection model, the basic network module design module calculates the computing power consumption of the basic network module according to the following steps;
[0058] Select edge computing devices for testing, and keep the test devices consistent throughout the test process;
[0059] Repeatedly stack a single basic network module and test it, then take the average value. The number of stacking times of different modules should be kept consistent. Test the stacked basic network module to be tested on the selected test device according to the following formula:
[0060] t i =T i / (n*m)
[0061] In the formula, n represents the number of test rounds, m represents the number of stacking times, and T i represents the total time of the i-th basic network module test, t i Indicates the computing power consumption time of the i-th basic network module.
[0062] Furthermore, as a preferred solution of the network structure search system of the power transmission and transformation inspection model, the basic network module design module constructs a basic network module scoring table, and the content of the basic network module scoring table includes network layer number, module identification, module structure, computing power consumption and module score;
[0063] The module structure describes the number of layers, structure, neuron connection method, and activation function information of the module;
[0064] The module score is initially set to 1 or is assigned by a human expert, and is subsequently changed and adjusted based on usage.
[0065] Furthermore, as a preferred solution of the network structure search system for the power transmission and transformation inspection model, the method for the super network construction module to select the basic network module includes any one of the following methods:
[0066] All basic network modules are used for super network construction;
[0067] According to the basic network module scoring table, specify the number of modules and select the modules of each layer in order of the scores;
[0068] According to the basic network module scoring table, the number of modules is specified, and a probability distribution model is constructed according to the scores. Modules with high scores are highly selected, while modules with low scores are less likely to be selected. Modules at each layer are selected by random sampling.
[0069] As a preferred solution of the network structure search system for the power transmission and transformation inspection model, the super network construction module constructs the super network in the following manner:
[0070] The input layer structure is determined according to the target business and training sample set;
[0071] The number of hidden layers is equal to the number of network layers, and the hidden layer structure is composed of selected basic structure modules in parallel;
[0072] The connection layer is located between every two adjacent hidden layers, and the structure of the connection layer is consistent with the last layer of the network connected to the hidden layer;
[0073] The output layer structure is determined according to the requirements of the power transmission and transformation inspection task, and is a network composed of several fully connected layers.
[0074] As a preferred solution of the network structure search system for the power transmission and transformation inspection model, the super network construction module constructs the super network in the following manner:
[0075] Embed the hypernetwork into a known network structure and reuse a fixed part of the network structure.
[0076] As a preferred solution of the power transmission and transformation inspection model network structure search system, the step of obtaining the target network structure of the power transmission and transformation inspection model by the target network structure training module includes:
[0077] Determine the computing power consumption factor W t ;
[0078] Set the number of training batches num, the upper threshold max and lower threshold min of the weight coefficient;
[0079] After num training processes are completed, the weights W of each basic network module and connection module in the hidden layer are obtained, and W is set k i represents the weight of the i-th type basic network module in the k-th layer, let t k i It represents the computation time of the i-th basic network module of the k-th layer;
[0080] Determine the weight coefficient W of each basic network module and connection module k i -W t *t k i Is it greater than the upper threshold max? If yes, keep the module and prune all other modules in the hidden layer;
[0081] Determine the weight coefficient W of each basic network module and connection module k i -W t *t k i Is it less than the lower threshold min? If yes, prune the module;
[0082] Return to perform the training process num times again and perform the corresponding judgment and pruning operations until only one basic network module is left in each hidden layer;
[0083] The connection layers between the hidden layers are pruned, and the network obtained by splicing the remaining hidden layers is used as the target network structure of the power transmission and transformation inspection model.
[0084] In a third aspect, a computer-readable storage medium is provided, wherein the computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the network structure search method for the power transmission and transformation inspection model as described in the first aspect is implemented.
[0085] Compared with the prior art, the first aspect of the present invention has at least the following beneficial effects:
[0086] The present invention can conveniently and efficiently automatically design a neural network structure with excellent performance, avoid excessive computing power consumption, effectively improve the research and development efficiency of deep learning models, reduce research and development costs, and reduce manpower consumption. Building a deep learning model requires designing a corresponding network structure according to specific tasks, involving the setting of many parameters, which requires both business domain knowledge and knowledge of deep learning, resulting in a high threshold for deep learning application development, and different network structures need to be designed for different problems, resulting in low model development efficiency. The present invention implements neural network structure search based on the super network pruning strategy, and realizes automatic search of neural network structure through three steps of basic network module design, super network construction, and super network pruning training, which significantly improves the research and development efficiency of the model. In summary, the present invention can be used in the training process of electric power artificial intelligence models, helping developers to automatically design the optimal network structure, improve the development efficiency of power transmission and transformation inspection models, and greatly reduce model development costs.
[0087] It can be understood that the beneficial effects of the second to third aspects mentioned above can be found in the relevant description of the first aspect mentioned above, and will not be repeated here. BRIEF DESCRIPTION OF THE DRAWINGS
[0088] In order to more clearly illustrate the technical solutions in the embodiments of the present application, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative labor.
[0089] Figure 1 A flow chart of a method for searching a network structure of a power transmission and transformation inspection model according to an embodiment of the present invention;
[0090] Figure 2 A schematic diagram of a super network structure according to an embodiment of the present invention;
[0091] Figure 3 Block diagram of the network structure search system of the power transmission and transformation inspection model according to an embodiment of the present invention. DETAILED DESCRIPTION
[0092] In the following description, specific details such as specific system structures, technologies, etc. are provided for the purpose of illustration rather than limitation, so as to provide a thorough understanding of the embodiments of the present application. However, it should be clear to those skilled in the art that the present application may also be implemented in other embodiments without these specific details. In other cases, detailed descriptions of well-known systems, devices, circuits, and methods are omitted to prevent unnecessary details from obstructing the description of the present application.
[0093] In addition, in the description of the present application specification and the appended claims, the terms "first", "second", "third", etc. are only used to distinguish the descriptions and cannot be understood as indicating or implying relative importance.
[0094] Example 1
[0095] See also Figure 1 The network structure search method of the power transmission and transformation inspection model proposed in the present invention mainly includes three steps: basic network module design, super network construction, and super network pruning training. Furthermore, it includes:
[0096] S1. Design multiple basic network modules according to the requirements of power transmission and transformation inspection tasks;
[0097] S2, select a number of modules from multiple basic network modules to build a super network;
[0098] S3. Use the pruning strategy to train the super network, select an optimal basic network module from each hidden layer of the super network, connect the optimal basic network modules selected from all hidden layers in series in sequence, and obtain the target network structure of the power transmission and transformation inspection model.
[0099] The following details the specific contents of each step:
[0100] The basic network module (Block) consists of several layers of neural networks and is the smallest component unit of the target network. The basic network module needs to be designed according to the specific task. For example, for the business field of computer vision, a basic network module containing a convolutional layer should be designed. The basic network module is usually composed of 3-5 layers of neural networks, but it can also be adjusted accordingly according to specific business needs. In order to design a network structure with excellent performance, it is usually necessary to design multiple basic network modules. The number of network layers and internal structures of different basic network modules can be different, but the last layer structure needs to remain consistent.
[0101] In a possible implementation, step S1 basic network module design includes the following steps:
[0102] 1. Module design
[0103] In view of the business scenarios in the field of power transmission and transformation inspection, in order to reduce the number of model parameters and improve the generalization performance of the model, this embodiment adopts the following principles to design the basic network module:
[0104] 1) Use a 1×1 small convolution kernel instead of a 3×3 large convolution kernel. In the convolution layer adjacent to the input, use a small convolution kernel to extract features, that is, use convolution kernels of and, which can effectively reduce the number of model parameters. In the convolution layer adjacent to the output, a large-area convolution kernel is used preferentially to capture more and higher-order abstract features.
[0105] 2) Use two small convolution kernels connected in series to replace a large convolution kernel. Using two small convolution kernels connected in series to replace a large-area convolution kernel can greatly reduce the number of parameters while achieving the same effect.
[0106] 3) Use 1×1 convolution kernel. When the parameter value of 1 is 1, the 1×1 convolution kernel can realize linear transformation, input and output channel transformation and other functions.
[0107] 4) Use asymmetric convolution kernels. Splitting an n×n convolution into a 1×n and an n×1 asymmetric convolution kernel can achieve the same convolution effect, greatly reduce the number of parameters, and improve the diversity of convolution.
[0108] 5) Use Depthwise convolution and Pointwise convolution. Optimize the large-area convolution kernel into Depthwise convolution and Pointwise convolution, which achieves similar feature extraction effects, reduces the number of parameters, and reduces the computational cost.
[0109] 6) Use global average pooling instead of fully connected layers. Using global average pooling instead of fully connected layers in hidden layers greatly reduces the number of parameters when the network structure is deeper.
[0110] 2. Calculation of computing power consumption of basic network modules
[0111] The power transmission and transformation inspection business involves a large number of edge model inference scenarios. The edge computing resources are relatively limited, so it is necessary to consider the computing power consumption of the model. The basic network module computing power consumption calculation includes the following steps:
[0112] 1) Select computing power test equipment
[0113] The architecture of edge computing devices is quite different from that of cloud server devices. In order to better reflect the actual computing consumption, edge computing devices in actual business should be selected for testing. There are many types of edge computing devices. It is not specified here which specific device to use for testing. However, it is necessary to ensure that the test equipment remains consistent during the entire computing power consumption test.
[0114] 2) Basic network module stack to be tested
[0115] Since the error of directly testing a single basic network module is large, consider repeatedly stacking a single basic network module, testing it, and then taking the average value. The number of stacking times depends on the specific situation, and the number of stacking times for different modules should be consistent.
[0116] 3) Computing power consumption test
[0117] Test the stacked modules on the selected test equipment. Assume that t i The computing power consumption time of the i-th basic network module can be expressed as follows:
[0118] t i =T i / (n*m)
[0119] Where n is the number of test rounds, m is the number of stacking times, and T i It represents the total time of the test of the i-th basic network module.
[0120] 3. Construction module scoring table
[0121] Construct a basic network module scoring table to provide a basis for the subsequent super network construction. The table format is as follows:
[0122]
[0123] In a possible implementation, step S2 of constructing a super network includes the following steps:
[0124] 1. Determine the number of network layers
[0125] The number of network layers is determined according to the specific business scenario. A specific number of network layers can be given, or a group of candidate network layers can be given.
[0126] 2. Selection of basic network modules
[0127] Select a number of modules from the constructed basic network module library to construct a super network. The following three selection methods can be considered:
[0128] 1) Select all. All modules in the basic network module library are used to build the super network. The advantages of this method are simplicity and easy automation. The disadvantages are that the model structure search space is large, the search computing power consumption is large, and the search efficiency is low.
[0129] 2) Selection based on the module score table. There are two ways: (1) Specify the number of selected modules and select the modules of each layer in order of the scores; (2) Specify the number of selected modules and construct a probability distribution model according to the scores, that is, the modules with high scores have a high probability of being selected, and the modules with low scores have a low probability of being selected. The modules of each layer are selected by random sampling.
[0130] 3. Network construction
[0131] There are two ways to construct the network:
[0132] 1) All composed of selected modules
[0133] The entire super network is composed of selected basic network modules, and its overall structure consists of four parts, including input layer, output layer, hidden layer and connection layer, such as Figure 2 As shown, specifically:
[0134] (1) The input layer has the same function as the traditional neural network, and its structure needs to be determined based on the target business and training sample set;
[0135] (2) The number of hidden layers is the number of network layers determined previously. The hidden layer structure is composed of the selected basic structure modules in parallel, and the structure of each hidden layer is not necessarily the same;
[0136] (3) The connection layer is located between every two adjacent hidden layers, and the structure of the connection layer is consistent with the last layer of the network connected to the hidden layer;
[0137] (4) The output layer has the same function as the traditional neural network. Its structure needs to be determined according to the target business and is usually a network composed of several fully connected layers.
[0138] 2) Embed the hypernetwork into a known network structure
[0139] This method can reuse a fixed part of the network structure. The construction method of the super network itself is consistent with the above method and will not be repeated here.
[0140] In a possible implementation, step S3 uses a pruning strategy to train the hypernetwork, including the following steps:
[0141] The purpose of building a hypernetwork is to select an optimal block from each hidden layer, and then connect all the selected blocks in series in order to obtain the optimal neural network structure. To achieve the above goal, a pruning strategy is used to train the hypernetwork. The target network structure is obtained by training the hypernetwork, which includes the following processes:
[0142] 1. Construct a training sample set
[0143] Construct a training sample set based on specific business. The number of samples in the sample set should be as large as possible, and the types should cover as many situations in the real world as possible.
[0144] 2. Hypernetwork Training
[0145] 1) Determine the factor W affecting computing power consumption t ;
[0146] 2) Set the number of training batches num, the upper threshold max and the lower threshold min of the weight coefficient;
[0147] 3) Perform num training processes. After completing num training processes, obtain the weights W of each basic network module and connection module in the hidden layer, and let W k i represents the weight of the i-th type basic network module in the k-th layer, let t k i It represents the computation time of the i-th basic network module of the k-th layer;
[0148] 4) Determine the weight coefficient W of each basic network module and connection module k i -W t *t k i Is it greater than the upper threshold max? If yes, keep the module and prune all other modules in the hidden layer;
[0149] 5) Determine the weight coefficient W of each basic network module and connection module k i -W t *t k i Is it less than the lower threshold min? If yes, prune the module;
[0150] 6) Return to step 3) and perform the training process num times again, and perform the judgment and pruning operations corresponding to steps 4) and 5) until only one basic network module is left in each hidden layer;
[0151] 7) Prune the connection layers between the hidden layers, and concatenate the remaining hidden layers to obtain a network as the target network structure of the power transmission and transformation inspection model.
[0152] 8) Update the module scoring table based on the final network structure.
[0153] Example 2
[0154] See also Figure 3 The embodiment of the present invention further provides a network structure search system for a power transmission and transformation inspection model, including:
[0155] Basic network module design module 1, used to design multiple basic network modules according to the power transmission and transformation inspection task requirements;
[0156] A super network construction module 2, used for selecting a number of modules from a plurality of basic network modules to construct a super network;
[0157] The target network structure training module 3 is used to train the super network using a pruning strategy, select an optimal basic network module from each hidden layer of the super network, and connect the optimal basic network modules selected from all hidden layers in series in sequence to obtain the target network structure of the power transmission and transformation inspection model.
[0158] In a possible implementation, the basic network module design module 1 adopts the following principles to design the basic network module:
[0159] In the convolution layer adjacent to the input, a 1×1 small convolution kernel is used to extract features and reduce the number of model parameters, while in the convolution layer adjacent to the output, a 3×3 large convolution kernel is used to capture more and higher-order abstract features;
[0160] Use two small convolution kernels in series instead of one large convolution kernel;
[0161] Use 1×1 convolution kernel to achieve linear transformation and input and output channel transformation;
[0162] Split an n×n convolution into a 1×n and an n×1 asymmetric convolution kernel to achieve the same convolution effect;
[0163] Optimize large-area convolution kernels into Depthwise convolution and Pointwise convolution;
[0164] Use global average pooling instead of fully connected layers.
[0165] The basic network module design module 1 calculates the computing power consumption of the basic network module according to the following steps;
[0166] Select edge computing devices for testing, and keep the test devices consistent throughout the test process;
[0167] Repeatedly stack a single basic network module and test it, then take the average value. The number of stacking times of different modules should be kept consistent. Test the stacked basic network module to be tested on the selected test device according to the following formula:
[0168] t i =T i / (n*m)
[0169] In the formula, n represents the number of test rounds, m represents the number of stacking times, and T i represents the total time of the i-th basic network module test, t i Indicates the computing power consumption time of the i-th basic network module.
[0170] The basic network module design module 1 constructs a basic network module scoring table, wherein the basic network module scoring table includes network layer number, module identification, module structure, computing power consumption and module score;
[0171] The module structure describes the number of layers, structure, neuron connection method, and activation function information of the module;
[0172] The module score is initially set to 1 or is assigned by a human expert, and is subsequently changed and adjusted based on usage.
[0173] In a possible implementation manner, the method for the super network construction module 2 to select the basic network module includes any one of the following methods:
[0174] All basic network modules are used for super network construction;
[0175] According to the basic network module scoring table, specify the number of modules and select the modules of each layer in order of the scores;
[0176] According to the basic network module scoring table, the number of modules is specified, and a probability distribution model is constructed according to the scores. Modules with high scores are highly selected, while modules with low scores are less likely to be selected. Modules at each layer are selected by random sampling.
[0177] One way to construct a super network is as follows:
[0178] The input layer structure is determined according to the target business and training sample set;
[0179] The number of hidden layers is equal to the number of network layers, and the hidden layer structure is composed of selected basic structure modules in parallel;
[0180] The connection layer is located between every two adjacent hidden layers, and the structure of the connection layer is consistent with the last layer of the network connected to the hidden layer;
[0181] The output layer structure is determined according to the requirements of the power transmission and transformation inspection task, and is a network composed of several fully connected layers.
[0182] Another way to construct a hypernetwork is as follows:
[0183] Embed the hypernetwork into a known network structure and reuse a fixed part of the network structure.
[0184] In a possible implementation manner, the step of the target network structure training module 3 obtaining the target network structure of the power transmission and transformation inspection model includes:
[0185] Determine the computing power consumption factor W t ;
[0186] Set the number of training batches num, the upper threshold max and lower threshold min of the weight coefficient;
[0187] After num training processes are completed, the weights W of each basic network module and connection module in the hidden layer are obtained, and W is set k irepresents the weight of the i-th type basic network module in the k-th layer, let t k i It represents the computation time of the i-th basic network module of the k-th layer;
[0188] Determine the weight coefficient W of each basic network module and connection module k i -W t *t k i Is it greater than the upper threshold max? If yes, keep the module and prune all other modules in the hidden layer;
[0189] Determine the weight coefficient W of each basic network module and connection module k i -W t *t k i Is it less than the lower threshold min? If yes, prune the module;
[0190] Return to perform the training process num times again and perform the corresponding judgment and pruning operations until only one basic network module is left in each hidden layer;
[0191] The connection layers between the hidden layers are pruned, and the network obtained by splicing the remaining hidden layers is used as the target network structure of the power transmission and transformation inspection model.
[0192] Example 3
[0193] A computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the network structure search method for a power transmission and transformation inspection model as described in Example 1 is implemented.
[0194] The computer program includes computer program code, which may be in source code form, object code form, executable file or some intermediate form. The computer-readable storage medium may include: any entity or device, medium, USB flash drive, mobile hard disk, disk, optical disk, computer memory, read-only memory, random access memory, electric carrier signal, telecommunication signal and software distribution medium, etc. that can carry the computer program code. It should be noted that the content contained in the computer-readable medium can be appropriately increased or decreased according to the requirements of legislation and patent practice in the jurisdiction. For example, in some jurisdictions, according to legislation and patent practice, computer-readable media do not include electric carrier signals and telecommunication signals. For ease of explanation, the above content only shows the part related to the embodiment of the present invention. For specific technical details not disclosed, please refer to the method part of the embodiment of the present invention. The computer-readable storage medium is non-temporary and can be stored in a storage device formed by various electronic devices, which can realize the execution process recorded in the method of the embodiment of the present invention.
[0195] Those skilled in the art will appreciate that embodiments of the present invention may be provided as methods, systems, or computer program products. Therefore, the present invention may take the form of a complete hardware embodiment, a complete software embodiment, or an embodiment combining software and hardware. Moreover, the present invention may take the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.
[0196] The present invention is described with reference to flowcharts and / or block diagrams of methods, devices (systems) and computer program products according to embodiments of the present invention. It should be understood that each process and / or block in the flowchart and / or block diagram, as well as the combination of processes and / or blocks in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor or other programmable data processing device to produce a machine, so that the instructions executed by the processor of the computer or other programmable data processing device generate instructions for implementing the process in the flowchart. Figure 1 A process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.
[0197] These computer program instructions may also be stored in a computer-readable memory capable of directing a computer or other programmable data processing device to operate in a specific manner, so that the instructions stored in the computer-readable memory produce an article of manufacture comprising an instruction device, which implements the process Figure 1 A process or multiple processes and / or boxes Figure 1 A function specified in one or more boxes.
[0198] These computer program instructions can also be loaded onto a computer or other programmable data processing device so that a series of operating steps are executed on the computer or other programmable device to produce a computer-implemented process, thereby providing instructions for implementing the process in the computer or other programmable device. Figure 1 A process or multiple processes and / or boxes Figure 1 The steps for the functions specified in one or more boxes.
[0199] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention rather than to limit it. Although the present invention has been described in detail with reference to the above embodiments, ordinary technicians in the relevant field should understand that the specific implementation methods of the present invention can still be modified or replaced by equivalents. Any modification or equivalent replacement that does not depart from the spirit and scope of the present invention should be covered within the scope of protection of the claims of the present invention.
Claims
1. A network structure search method for power transmission and transformation inspection model, It is characterized in that include: Design multiple basic network modules according to the requirements of power transmission and transformation inspection tasks; Select a number of modules from multiple basic network modules to build a super network; The pruning strategy is used to train the super network, an optimal basic network module is selected from each hidden layer of the super network, and the optimal basic network modules selected from all hidden layers are connected in series in sequence to obtain the target network structure of the power transmission and transformation inspection model; In the step of designing multiple basic network modules according to the power transmission and transformation inspection task requirements, the basic network modules are designed using the following principles: In the convolutional layer adjacent to the input, use Small convolution kernels are used to extract features and reduce the number of model parameters. In the convolution layer adjacent to the output, Large convolution kernels capture more high-level abstract features; Use two small convolution kernels in series instead of one large convolution kernel; use The convolution kernel realizes linear transformation and input and output channel transformation; Will one The convolution is split into one and a Asymmetric convolution kernels are used to achieve the same convolution effect; Optimize large-area convolution kernels into Depthwise convolution and Pointwise convolution; Use global average pooling instead of fully connected layers; The steps of adopting a pruning strategy to train the super network, selecting an optimal basic network module from each hidden layer of the super network, and sequentially connecting the optimal basic network modules selected from all hidden layers in series to obtain the target network structure of the power transmission and transformation inspection model include: Determine the computing power consumption factor W t ; Set the number of training batches num, the upper threshold max and lower threshold min of the weight coefficient; After num training processes are completed, the weights W of each basic network module and connection module in the hidden layer are obtained, and W is set k i represents the weight of the i-th type basic network module in the k-th layer, let t k i It represents the computation time of the i-th basic network module of the k-th layer; Determine the weight coefficient W of each basic network module and connection module k i -W t *t k i Is it greater than the upper threshold max? If yes, keep the module and prune all other modules in the hidden layer; Determine the weight coefficient W of each basic network module and connection module k i -W t *t k i Is it less than the lower threshold min? If yes, prune the module; Return to perform the training process num times again and perform the corresponding judgment and pruning operations until only one basic network module is left in each hidden layer; The connection layers between the hidden layers are pruned, and the network obtained by splicing the remaining hidden layers is used as the target network structure of the power transmission and transformation inspection model.
2. According to the network structure search method of the power transmission and transformation inspection model according to claim 1, It is characterized in that The step of designing a plurality of basic network modules according to the power transmission and transformation inspection task requirements also includes calculating the computing power consumption of the basic network modules; The computing power consumption of the computing basic network module includes the following steps: Select edge computing devices for testing, and keep the test devices consistent throughout the test process; Repeatedly stack a single basic network module, perform tests, and then take the average value. The number of times different modules are stacked is kept consistent. On the selected test equipment, the stacked basic network modules to be tested are tested as follows: In the formula, n represents the number of test rounds, m represents the number of stacking times, and T i represents the total time of the i-th basic network module test, t i Indicates the computing power consumption time of the i-th basic network module.
3. The network structure search method of the power transmission and transformation inspection model according to claim 2, It is characterized in that The step of designing a plurality of basic network modules according to the power transmission and transformation inspection task requirements also includes constructing a basic network module scoring table, wherein the basic network module scoring table includes a network layer number, a module identifier, a module structure, computing power consumption, and a module score; The module structure describes the number of layers, structure, neuron connection method, and activation function information of the module; The module score is initially set to 1 or is assigned by a human expert, and is subsequently changed and adjusted based on usage.
4. The network structure search method of the power transmission and transformation inspection model according to claim 3, It is characterized in that In the step of selecting a number of modules from a plurality of basic network modules to construct a super network, the selection method includes any one of the following methods: All basic network modules are used for super network construction; According to the basic network module scoring table, specify the number of modules and select the modules of each layer in order of the scores; According to the basic network module scoring table, the number of modules is specified, and a probability distribution model is constructed according to the scores. Modules with high scores are highly selected, while modules with low scores are less likely to be selected. Modules at each layer are selected by random sampling.
5. The network structure search method of the power transmission and transformation inspection model according to claim 1, It is characterized in that In the step of selecting a number of modules from a plurality of basic network modules to construct a super network, the super network is constructed as follows: The input layer structure is determined according to the target business and training sample set; The number of hidden layers is equal to the number of network layers, and the hidden layer structure is composed of selected basic structure modules in parallel; The connection layer is located between every two adjacent hidden layers, and the structure of the connection layer is consistent with the last layer of the network connected to the hidden layer; The output layer structure is determined according to the requirements of the power transmission and transformation inspection task, and is a network composed of several fully connected layers.
6. The network structure search method of the power transmission and transformation inspection model according to claim 1, It is characterized in that In the step of selecting a number of modules from a plurality of basic network modules to construct a super network, the super network is constructed as follows: Embed the hypernetwork into a known network structure and reuse a fixed part of the network structure.
7. A network structure search system for power transmission and transformation inspection models, It is characterized in that include: Basic network module design module, used to design multiple basic network modules according to the requirements of power transmission and transformation inspection tasks; A super network construction module, used for selecting a number of modules from a plurality of basic network modules to construct a super network; The target network structure training module is used to train the super network using a pruning strategy, select an optimal basic network module from each hidden layer of the super network, and connect the optimal basic network modules selected from all hidden layers in series in sequence to obtain the target network structure of the power transmission and transformation inspection model; The basic network module design module adopts the following principles to design the basic network module: In the convolutional layer adjacent to the input, use Small convolution kernels are used to extract features and reduce the number of model parameters. In the convolution layer adjacent to the output, Large convolution kernels capture more high-level abstract features; Use two small convolution kernels in series instead of one large convolution kernel; use The convolution kernel realizes linear transformation and input and output channel transformation; Will one The convolution is split into one and a Asymmetric convolution kernels are used to achieve the same convolution effect; Optimize large-area convolution kernels into Depthwise convolution and Pointwise convolution; Use global average pooling instead of fully connected layers; The step of obtaining the target network structure of the power transmission and transformation inspection model by the target network structure training module includes: Determine the computing power consumption factor W t ; Set the number of training batches num, the upper threshold max and lower threshold min of the weight coefficient; After num training processes are completed, the weights W of each basic network module and connection module in the hidden layer are obtained, and W is set k i represents the weight of the i-th type basic network module in the k-th layer, let t k i It represents the computation time of the i-th basic network module of the k-th layer; Determine the weight coefficient W of each basic network module and connection module k i -W t *t k i Is it greater than the upper threshold max? If yes, keep the module and prune all other modules in the hidden layer; Determine the weight coefficient W of each basic network module and connection module k i -W t *t k i Is it less than the lower threshold min? If yes, prune the module; Return to perform the training process num times again and perform the corresponding judgment and pruning operations until only one basic network module is left in each hidden layer; The connection layers between the hidden layers are pruned, and the network obtained by splicing the remaining hidden layers is used as the target network structure of the power transmission and transformation inspection model.
8. The network structure search system for power transmission and transformation inspection model according to claim 7, It is characterized in that The basic network module design module calculates the computing power consumption of the basic network module according to the following steps; Select edge computing devices for testing, and keep the test devices consistent throughout the test process; Repeatedly stack a single basic network module, perform tests, and then take the average value. The number of times different modules are stacked is kept consistent. On the selected test equipment, the stacked basic network modules to be tested are tested as follows: In the formula, n represents the number of test rounds, m represents the number of stacking times, and T i represents the total time of the i-th basic network module test, t i Indicates the computing power consumption time of the i-th basic network module.
9. The network structure search system for power transmission and transformation inspection model according to claim 8, It is characterized in that The basic network module design module constructs a basic network module scoring table, wherein the basic network module scoring table includes a network layer number, a module identifier, a module structure, computing power consumption, and a module score; The module structure describes the number of layers, structure, neuron connection method, and activation function information of the module; The module score is initially set to 1 or is assigned by a human expert, and is subsequently changed and adjusted based on usage.
10. The network structure search system for power transmission and transformation inspection model according to claim 9, It is characterized in that The method for the super network construction module to select the basic network module includes any one of the following methods: All basic network modules are used for super network construction; According to the basic network module scoring table, specify the number of modules and select the modules of each layer in order of the scores; According to the basic network module scoring table, the number of modules is specified, and a probability distribution model is constructed according to the scores. Modules with high scores are highly selected, while modules with low scores are less likely to be selected. Modules at each layer are selected by random sampling.
11. The network structure search system for power transmission and transformation inspection model according to claim 7, It is characterized in that The method of constructing a super network by the super network construction module is as follows: The input layer structure is determined according to the target business and training sample set; The number of hidden layers is equal to the number of network layers, and the hidden layer structure is composed of selected basic structure modules in parallel; The connection layer is located between every two adjacent hidden layers, and the structure of the connection layer is consistent with the last layer of the network connected to the hidden layer; The output layer structure is determined according to the requirements of the power transmission and transformation inspection task, and is a network composed of several fully connected layers.
12. The network structure search system for power transmission and transformation inspection model according to claim 7, It is characterized in that The method of constructing a super network by the super network construction module is as follows: Embed the hypernetwork into a known network structure and reuse a fixed part of the network structure.
13. A computer-readable storage medium storing a computer program. It is characterized in that When the computer program is executed by a processor, the network structure search method for a power transmission and transformation inspection model according to any one of claims 1 to 6 is implemented.
Citation Information
Patent Citations
Neural network structure search method and device, computer equipment and storage medium
CN112949842A
Abnormal network traffic detector generation method based on reinforcement learning
CN114374541A