Network optimization method and device, computer device and storage medium
By constructing and optimizing the network coding information of the power equipment defect detection network, and by adjusting the network node weights and optimizing the algorithm, the problem of low accuracy in power equipment defect identification is solved, and more efficient defect detection is achieved.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- SHENZHEN POWER SUPPLY BUREAU
- Filing Date
- 2022-12-27
- Publication Date
- 2026-06-19
AI Technical Summary
Existing network optimization methods have low accuracy in power equipment defect identification and are difficult to meet the needs of complex scenarios.
By constructing the network coding information of the initial defect detection network, updating the network coding information according to the weight adjustment of network nodes and the random weight matrix, and optimizing the network using genetic algorithms and meta-learning algorithms, the accuracy of defect detection is improved.
This improves the accuracy and efficiency of the defect detection network, enabling more precise identification of defects in power equipment.
Smart Images

Figure CN116319318B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of artificial intelligence technology, and in particular to a network optimization method, apparatus, computer device, and storage medium. Background Technology
[0002] With the vigorous development of artificial intelligence, network optimization methods have emerged in the field of power equipment defect identification. These methods can optimize a massive detection network into a more accurate and efficient detection network that is specifically designed to identify power equipment defects.
[0003] Current network optimization methods mainly rely on manual methods, where the optimal network is selected by comparing one by one. However, considering the diversity of power equipment scenarios, the optimal network found manually will have problems such as low accuracy, and urgently needs to be improved. Summary of the Invention
[0004] Therefore, it is necessary to provide a network optimization method, apparatus, computer equipment, and storage medium that can improve the accuracy of network optimization in response to the above-mentioned technical problems.
[0005] Firstly, this application provides a network optimization method. The method includes:
[0006] Based on the connection relationships between network nodes in each network layer of the initial defect detection network and the random weight matrix, the network coding information of the initial defect detection network is constructed.
[0007] The network coding information is updated based on the impact of adjusting the weights of network nodes within each network layer on the initial defect detection network.
[0008] Based on the updated network coding information, the initial defect detection network is optimized to obtain the target defect detection network.
[0009] In one embodiment, the network coding information of the initial defect detection network is constructed based on the connection relationships between network nodes within each network layer of the initial defect detection network and the random weight matrix, including:
[0010] Based on the connection relationships between network nodes within each network layer in the initial defect detection network, the layer coding information of each network layer is determined; based on the random weight matrix and the layer coding information of each network layer, the network coding information of the initial defect detection network is constructed.
[0011] In one embodiment, the network coding information is updated based on the impact of adjusting the weights of network nodes within each network layer on the initial defect detection network, including:
[0012] Based on the sample power equipment images and their labeled regions, the impact of adjusting the weights of network nodes in each network layer on the initial defect detection network is determined; and the network coding information is updated according to the impact of adjusting the weights of network nodes in each network layer on the initial defect detection network.
[0013] In one embodiment, based on sample power equipment images and their labeled regions, the impact of adjusting the weights of network nodes within each network layer on the initial defect detection network is determined, including:
[0014] The sample power equipment image is input into the initial defect detection network to obtain the first target detection region. For each network layer, the sample power equipment image is input into the initial defect detection network after adjusting the weights of the network nodes in that network layer to obtain the second target detection region. Based on the intersection-union ratio (IUU) between the first target detection region and the labeled region of the sample power equipment image, and the IUU between the second target detection region and the labeled region, the impact of adjusting the weights of the network nodes in that network layer on the initial defect detection network is determined.
[0015] In one embodiment, the method further includes:
[0016] A genetic algorithm is used to optimize the target defect detection network based on sample power equipment images.
[0017] In one embodiment, the method further includes:
[0018] Based on the meta-learning algorithm, the initial power equipment image is augmented to obtain sample power equipment images; using the sample power equipment images, the initial neural network is trained to obtain the initial defect detection network.
[0019] Secondly, this application also provides a network optimization device. The device includes:
[0020] The coding information construction module is used to construct the network coding information of the initial defect detection network based on the connection relationship between network nodes in each network layer of the initial defect detection network and the random weight matrix.
[0021] The coding information update module is used to update the network coding information based on the impact of adjusting the weights of network nodes in each network layer on the initial defect detection network.
[0022] The network optimization module is used to optimize the initial defect detection network based on the updated network coding information to obtain the target defect detection network.
[0023] Thirdly, this application also provides a computer device. The computer device includes a memory and a processor, the memory storing a computer program, and the processor executing the computer program to perform the following steps:
[0024] Based on the connection relationships between network nodes in each network layer of the initial defect detection network and the random weight matrix, the network coding information of the initial defect detection network is constructed.
[0025] The network coding information is updated based on the impact of adjusting the weights of network nodes within each network layer on the initial defect detection network.
[0026] Based on the updated network coding information, the initial defect detection network is optimized to obtain the target defect detection network.
[0027] Fourthly, this application also provides a computer-readable storage medium. The computer-readable storage medium stores a computer program thereon, which, when executed by a processor, performs the following steps:
[0028] Based on the connection relationships between network nodes in each network layer of the initial defect detection network and the random weight matrix, the network coding information of the initial defect detection network is constructed.
[0029] The network coding information is updated based on the impact of adjusting the weights of network nodes within each network layer on the initial defect detection network.
[0030] Based on the updated network coding information, the initial defect detection network is optimized to obtain the target defect detection network.
[0031] Fifthly, this application also provides a computer program product. The computer program product includes a computer program that, when executed by a processor, performs the following steps:
[0032] Based on the connection relationships between network nodes in each network layer of the initial defect detection network and the random weight matrix, the network coding information of the initial defect detection network is constructed.
[0033] The network coding information is updated based on the impact of adjusting the weights of network nodes within each network layer on the initial defect detection network.
[0034] Based on the updated network coding information, the initial defect detection network is optimized to obtain the target defect detection network.
[0035] The aforementioned network optimization method, apparatus, computer equipment, and storage medium construct network coding information for the initial defect detection network based on the connection relationships between network nodes within each network layer and the random weight matrix. Subsequently, the network coding information is updated based on the impact of adjusting the weights of network nodes within each network layer on the initial defect detection network. Finally, the initial defect detection network is optimized based on the updated network coding information to obtain the target defect detection network. This scheme, by introducing network coding information and determining the impact of each network node on the initial defect detection network based on adjusting the weights of network nodes within each network layer, can improve the accuracy of the optimized defect detection network in detecting equipment defects. Attached Figure Description
[0036] Figure 1 This is a flowchart illustrating a network optimization method in one embodiment;
[0037] Figure 2 This is a flowchart illustrating the process of determining the impact of network nodes on the network in one embodiment;
[0038] Figure 3 This is a flowchart illustrating the process of determining the initial defect detection network in one embodiment;
[0039] Figure 4 This is a flowchart illustrating the network optimization method in another embodiment;
[0040] Figure 5 This is a structural block diagram of a network optimization device in one embodiment;
[0041] Figure 6 This is a structural block diagram of the network optimization device in another embodiment;
[0042] Figure 7 This is a structural block diagram of the network optimization device in yet another embodiment;
[0043] Figure 8 This is an internal structural diagram of a computer device in one embodiment. Detailed Implementation
[0044] To make the objectives, technical solutions, and advantages of this application clearer, the following detailed description is provided in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative and not intended to limit the scope of this application.
[0045] In one embodiment, such as Figure 1 As shown, a network optimization method is provided. Taking the application of this method to a server as an example, the method includes the following steps:
[0046] S101. Construct the network coding information of the initial defect detection network according to the connection relationships between network nodes within each network layer in the initial defect detection network and the random weight matrix.
[0047] Among them, the initial defect detection network refers to the original neural network that has been trained and can be used to detect defects in power equipment; the random weight matrix refers to the matrix randomly generated to represent the weights of network nodes within each network layer in the initial defect detection network; the network coding information refers to the coding used to represent the connection conditions of network nodes within each network layer in the initial defect detection network.
[0048] Optionally, the following steps can be adopted to construct the network coding information of the initial defect detection network:
[0049] The first step: Determine the layer coding information of each network layer according to the connection relationships between network nodes within each network layer in the initial defect detection network.
[0050] Among them, the layer coding information refers to the coding used to represent the connection conditions of network nodes within each network layer in the initial defect detection network.
[0051] Optionally, the connection relationships between network nodes within each network layer can be represented in vector form. For each network layer, the obtained vector combinations representing the connection conditions of network nodes are concatenated in the order of positions, and the layer coding information of this network layer can be obtained.
[0052] For example, an initial defect detection network contains M network layers, and there are N i network nodes in the i-th network layer. For any two network nodes, such as the connection condition between the N r -th network node and the N j -th network node (r < j) can be expressed by a three-dimensional vector. Since each network node can be connected to all other network nodes in the same network layer as it, in the i-th network layer, there are a total of N i +(N i -1)+(N i -2)+…+1 = (N i +1) / 2N i such vector combinations.
[0053] Among them, [1, 0, 0] can be used to represent that there is a connection between the N r -th node and the N j -th node; [0, 1, 0] can be used to represent that there is no connection between the N r -th node and the N j -th node; [0, 0, 1] can be used to represent that there is a connection between the N r -th node and the Nj There is a connection between the nodes, and there is also an additional jumper connection.
[0054] Furthermore, the obtained (N) i +1) / 2N i By concatenating the vectors in order of their positions, the layer coding information of the i-th network layer can be obtained.
[0055] The second step is to construct the network coding information of the initial defect detection network based on the random weight matrix and the layer coding information of each network layer.
[0056] Optionally, after obtaining the layer coding information of each network layer, since the number of network nodes in each network layer is different, in order to unify the format of the layer coding information of each network layer, the length of the layer coding information of the network layer with the most network nodes can be taken as the target length. The length of the layer coding information of each network layer is compared with the target length. If the length of the layer coding information of a certain network layer is less than the target length, a zero vector for padding is added to the end of the layer coding information of that network layer so that the length of the layer coding information of that network layer is the same as the target length.
[0057] Furthermore, after unifying the length of the layer coding information of each network layer, the layer coding information of each network layer can be concatenated into a coding matrix according to the positional relationship between the network layers. Subsequently, a random weight matrix with each value between 0 and 1 can be randomly generated. Multiplying the coding matrix with the random weight matrix yields the network coding information of the initial defect detection network.
[0058] S102, Update the network coding information based on the impact of adjusting the weights of network nodes in each network layer on the initial defect detection network.
[0059] Optionally, the following steps can be used to update the network coding information:
[0060] The first step is to determine the impact of adjusting the weights of network nodes in each network layer on the initial defect detection network, based on the sample power equipment images and the labeled areas of the sample power equipment images.
[0061] Among them, the sample power equipment images refer to power equipment images that have been pre-labeled and can be used as samples to optimize the initial defect detection network.
[0062] Specifically, by adjusting the weights of network nodes within each network layer, the weighted network nodes can be made inactive when the initial defect detection network detects sample power equipment images. Furthermore, the detected area obtained by inputting the sample power equipment image into the defect detection network after adjusting the weights of the network nodes is compared with the labeled area of the sample power equipment image. If the overlapping area is greater than a preset threshold, it indicates that the network node has a small impact on the defect detection network; if the overlapping area is less than the preset threshold, it indicates that the network node has a large impact on the defect detection network.
[0063] It should be noted that, in order to more accurately determine the impact of adjusting the weights of network nodes in each network layer on the initial defect detection network, the weights of network nodes in other network layers remain unchanged when adjusting the weights of network nodes in each network layer. After determining the impact of adjusting the weights of network nodes in that network layer on the initial defect detection network, the weights of network nodes in that network layer are restored to their initial state, and then the weights of network nodes in the next network layer are adjusted.
[0064] The second step is to update the network coding information based on the impact of adjusting the weights of network nodes in each network layer on the initial defect detection network.
[0065] Specifically, the vector combination of the connection method of network nodes with little impact on the initial defect detection network can be changed so that the network node does not play a role in subsequent defect detection; furthermore, the network coding information can be updated based on the adjustment results of each network node.
[0066] S103, Based on the updated network coding information, optimize the initial defect detection network to obtain the target defect detection network.
[0067] Among them, the target defect detection network refers to the optimized defect detection network.
[0068] Optionally, based on the updated network coding information, the connection method between network nodes can be obtained; further, based on the connection method between network nodes, the initial defect detection network can be pruned to optimize the initial defect detection network and obtain the target defect detection network.
[0069] Understandably, due to the large number of network nodes and the varying impact of each node on the initial defect detection network, after optimization, one or more target defect detection networks can be obtained.
[0070] In the aforementioned network optimization method, network coding information for the initial defect detection network is constructed based on the connection relationships between network nodes within each network layer and the random weight matrix. Then, the network coding information is updated according to the impact of adjusting the weights of network nodes within each network layer on the initial defect detection network. Finally, the initial defect detection network is optimized based on the updated network coding information to obtain the target defect detection network. This scheme, by introducing network coding information and determining the impact of each network node on the initial defect detection network based on adjusting the weights of network nodes within each network layer, can improve the accuracy of the optimized defect detection network in detecting equipment defects.
[0071] Based on the above embodiments, in one embodiment, such as Figure 2 As shown, an optional method is provided to determine the impact of adjusting the weights of network nodes within each network layer on the initial defect detection network, specifically including the following steps:
[0072] S201, Input the sample power equipment image into the initial defect detection network to obtain the first target detection area.
[0073] The first target detection region refers to the region in the sample power equipment image predicted by the initial defect detection network where the defect is located.
[0074] Specifically, the sample power equipment image is input into the trained initial defect detection network, which can obtain the first target detection area based on the input data and the network's own parameters.
[0075] S202, for each network layer, the sample power equipment image is input into the initial defect detection network after adjusting the weights of the network nodes in that network layer to obtain the second target detection area.
[0076] The second target detection region refers to the detection region output by the initial defect detection network after adjusting the network node weights, based on the sample power equipment image.
[0077] Specifically, for each network layer, the connection status of the network nodes within that layer can be adjusted by adjusting the weights of the network nodes within that layer. Furthermore, for the adjusted initial defect detection network, sample power equipment images can be input into the adjusted initial defect detection network, which can then obtain the second target detection area based on the input data and the network's own parameters.
[0078] S203, based on the cross-union ratio between the first target detection area and the labeled area of the sample power equipment image, and the cross-union ratio between the second target detection area and the labeled area, determine the impact of adjusting the weights of the network nodes in the network layer on the initial defect detection network.
[0079] Specifically, as shown in formula (1), a value can be obtained by subtracting the cross-union ratio between the first target detection area and the labeled area of the sample power equipment image from the cross-union ratio between the second target detection area and the labeled area. This value can represent the impact of adjusting the weights of the network nodes in the network layer on the initial defect detection network.
[0080]
[0081] Where T represents the numerical value of the impact of adjusting the weights of network nodes within this network layer on the initial defect detection network; A represents the initial defect detection network; W represents the weights of the network nodes; and IOU(A,w) represents the intersection-union ratio between the first target detection region and the labeled region of the sample power equipment image. This represents the weight of the i-th network node in the M-th network layer of the initial defect detection network; This represents the cross-union ratio between the second target detection region and the labeled region.
[0082] In this embodiment, by introducing a first target detection region and a second target detection region, the impact of adjusting the weights of network nodes within a certain network layer on the initial defect detection network can be determined more accurately, thereby improving the accuracy of the optimized defect detection network in detecting equipment defects.
[0083] Based on the above embodiments, in order to further select the optimal target defect detection network, this embodiment provides an optional network optimization method, specifically including:
[0084] A genetic algorithm is used to optimize the target defect detection network based on sample power equipment images.
[0085] Specifically, before performing network optimization, the maximum number of generations G is first set. max Then, the iteration round of the target defect detection network is set to 0. Subsequently, the sample power equipment images are input into the target defect detection network one by one. The intersection-union ratio (IUU) of the detected area of each sample power equipment image output by the target defect detection network and the manually labeled area can be obtained. The average IUU of each sample power equipment image is then used to obtain a good value for measuring the quality of the target defect detection network.
[0086] Furthermore, by performing selection, crossover, and mutation operations on all target defect detection networks containing excellent values, the first round of screening results can be obtained. At this point, the iteration number of the selected target defect detection networks is incremented by one, and the next round of screening is performed until the iteration number is greater than the preset maximum number of generations G. max .
[0087] Furthermore, when the number of iterations exceeds the preset maximum number of generations G... max When the selected target defect detection network is selected, it is the optimal defect detection network.
[0088] In this embodiment, by introducing a genetic algorithm, the optimal defect detection network can be selected, thereby improving the accuracy of the optimized defect detection network in detecting equipment defects.
[0089] Based on the above embodiments, such as Figure 3 As shown, in this embodiment, an optional method for obtaining an initial defect detection network is provided, specifically including the following steps:
[0090] S301, based on the meta-learning algorithm, amplifies the initial power equipment image to obtain sample power equipment images.
[0091] Specifically, images of power equipment obtained by inspection systems deployed in different geographical scenarios are acquired, and the locations of power equipment in the images are marked. Subsequently, power equipment can be classified into N categories based on its type, such as overhead lines and different types of power testing instruments; power equipment images can be classified into 3 categories based on the area ratio of power equipment in the image, such as greater than 80%, greater than 50% and less than 80%, and greater than 30% and less than 50%; and power equipment images can be classified into M categories based on the complexity of the background of the power equipment images.
[0092] Furthermore, a meta-learner is randomly generated and input with N*3*M types of power equipment images. The generator in the meta-learner can amplify the N*3*M types of power equipment images through convolution and mapping to obtain more labeled power equipment images. Subsequently, the discriminator in the meta-learner can identify the power equipment images generated by the generator based on the authenticity of the power equipment images, and obtain sample power equipment images with high authenticity.
[0093] S302, using sample images of power equipment, trains the initial neural network to obtain the initial defect detection network.
[0094] Optionally, a complete feature extraction network can be selected as the initial neural network, which contains two cascaded neural networks. The first layer of the neural network is used to initially detect sample power equipment images and label the target areas where wire defects are detected. The second layer of the neural network is used to classify wire defects and further accurately label the target areas where wire defects are detected.
[0095] Furthermore, the sample power equipment images are input into the initial neural network for training. Based on the difference between the annotation information output by the initial neural network and the annotation information of the sample power equipment images themselves, the initial neural network is trained to obtain the initial defect detection network.
[0096] In this embodiment, by introducing a meta-learner to amplify the sample power equipment image data, the accuracy of the initial defect detection network prediction can be improved, thereby improving the accuracy of the optimized defect detection network in detecting equipment defects.
[0097] Figure 4 This is a flowchart illustrating a network optimization method in another embodiment. Based on the above embodiments, this embodiment provides an optional example of network optimization. (Combined with...) Figure 4 The specific implementation process is as follows:
[0098] S401, determine the layer coding information of each network layer based on the connection relationship between network nodes in each network layer of the initial defect detection network.
[0099] S402, Based on the random weight matrix and the layer coding information of each network layer, construct the network coding information of the initial defect detection network.
[0100] S403, input the sample power equipment image into the initial defect detection network to obtain the first target detection area.
[0101] S404, For each network layer, the sample power equipment image is input into the initial defect detection network after adjusting the weights of the network nodes in that network layer to obtain the second target detection region; based on the cross-union ratio between the first target detection region and the labeled region of the sample power equipment image, and the cross-union ratio between the second target detection region and the labeled region, the impact of adjusting the weights of the network nodes in that network layer on the initial defect detection network is determined.
[0102] S405, Update the network coding information based on the impact of adjusting the weights of network nodes in each network layer on the initial defect detection network.
[0103] S406. Based on the updated network coding information, the initial defect detection network is optimized to obtain the target defect detection network.
[0104] S407 uses a genetic algorithm to optimize the target defect detection network based on sample power equipment images.
[0105] The specific processes of S401-S407 described above can be found in the description of the above method embodiments. Their implementation principles and technical effects are similar, and will not be repeated here.
[0106] It should be understood that although the steps in the flowcharts of the embodiments described above are shown sequentially according to the arrows, these steps are not necessarily executed in the order indicated by the arrows. Unless explicitly stated herein, there is no strict order restriction on the execution of these steps, and they can be executed in other orders. Moreover, at least some steps in the flowcharts of the embodiments described above may include multiple steps or multiple stages. These steps or stages are not necessarily completed at the same time, but can be executed at different times. The execution order of these steps or stages is not necessarily sequential, but can be performed alternately or in turn with other steps or at least some of the steps or stages of other steps.
[0107] Based on the same inventive concept, this application also provides a network optimization apparatus for implementing the network optimization method described above. The solution provided by this apparatus is similar to the implementation scheme described in the above method; therefore, the specific limitations in one or more network optimization apparatus embodiments provided below can be found in the limitations of the network optimization method described above, and will not be repeated here.
[0108] In one embodiment, such as Figure 5 As shown, a network optimization device 1 is provided, comprising: an encoding information construction module 10, an encoding information updating module 20, and a network optimization module 30, wherein:
[0109] The coding information construction module 10 is used to construct the network coding information of the initial defect detection network based on the connection relationship between network nodes in each network layer of the initial defect detection network and the random weight matrix.
[0110] The encoding information update module 20 is used to update the network encoding information based on the impact of adjusting the weights of network nodes in each network layer on the initial defect detection network.
[0111] The network optimization module 30 is used to optimize the initial defect detection network based on the updated network coding information to obtain the target defect detection network.
[0112] In one embodiment, such as Figure 6 As shown, the encoded information construction module 10 includes:
[0113] The encoding information determination unit 11 is used to determine the layer encoding information of each network layer based on the connection relationship between network nodes in each network layer of the initial defect detection network.
[0114] The encoding information construction unit 12 is used to construct the network encoding information of the initial defect detection network based on the random weight matrix and the layer encoding information of each network layer.
[0115] In one embodiment, such as Figure 7 As shown, the encoding information update module 20 includes:
[0116] The influence determination unit 21 is used to determine the influence of adjusting the weights of network nodes in each network layer on the initial defect detection network based on the sample power equipment image and the labeled area of the sample power equipment image.
[0117] The encoding information update unit 22 is used to update the network encoding information according to the impact of adjusting the weights of network nodes in each network layer on the initial defect detection network.
[0118] In one embodiment, the influence determination unit 21 is specifically used for:
[0119] The sample power equipment image is input into the initial defect detection network to obtain the first target detection region. For each network layer, the sample power equipment image is input into the initial defect detection network after adjusting the weights of the network nodes in that network layer to obtain the second target detection region. Based on the intersection-union ratio (IUU) between the first target detection region and the labeled region of the sample power equipment image, and the IUU between the second target detection region and the labeled region, the impact of adjusting the weights of the network nodes in that network layer on the initial defect detection network is determined.
[0120] In one embodiment, the network optimization module 30 can also be used for:
[0121] A genetic algorithm is used to optimize the target defect detection network based on sample power equipment images.
[0122] In one embodiment, the network optimization device 1 further includes:
[0123] The data augmentation module is used to augment the initial power equipment image based on the meta-learning algorithm to obtain sample power equipment images;
[0124] The training module is used to train the initial neural network using sample images of electrical equipment to obtain the initial defect detection network.
[0125] Each module in the aforementioned network optimization device can be implemented entirely or partially through software, hardware, or a combination thereof. These modules can be embedded in the processor of a computer device in hardware form or independent of it, or stored in the memory of the computer device in software form, so that the processor can call and execute the operations corresponding to each module.
[0126] In one embodiment, a computer device is provided, which may be a server, and its internal structure diagram may be as follows: Figure 8 As shown, this computer device includes a processor, memory, input / output interfaces (I / O), and a communication interface. The processor, memory, and I / O interfaces are connected via a system bus, and the communication interface is also connected to the system bus via the I / O interfaces. The processor provides computational and control capabilities. The memory includes non-volatile storage media and internal memory. The non-volatile storage media stores the operating system, computer programs, and a database. The internal memory provides the environment for the operation of the operating system and computer programs stored in the non-volatile storage media. The database stores image data of power equipment. The I / O interfaces are used for exchanging information between the processor and external devices. The communication interface is used for communicating with external terminals via a network connection. When the computer program is executed by the processor, it implements a network optimization method.
[0127] Those skilled in the art will understand that Figure 8 The structure shown is merely a block diagram of a portion of the structure related to the present application and does not constitute a limitation on the computer device to which the present application is applied. Specific computer devices may include more or fewer components than those shown in the figure, or combine certain components, or have different component arrangements.
[0128] In one embodiment, a computer device is provided, including a memory and a processor, wherein the memory stores a computer program, and the processor executes the computer program to perform the following steps:
[0129] Based on the connection relationships between network nodes in each network layer of the initial defect detection network and the random weight matrix, the network coding information of the initial defect detection network is constructed.
[0130] The network coding information is updated based on the impact of adjusting the weights of network nodes within each network layer on the initial defect detection network.
[0131] Based on the updated network coding information, the initial defect detection network is optimized to obtain the target defect detection network.
[0132] In one embodiment, when the processor executes the logic in the computer program to construct the network coding information of the initial defect detection network based on the connection relationships between network nodes in each network layer of the initial defect detection network and the random weight matrix, the specific steps are as follows:
[0133] Based on the connection relationships between network nodes within each network layer in the initial defect detection network, the layer coding information of each network layer is determined; based on the random weight matrix and the layer coding information of each network layer, the network coding information of the initial defect detection network is constructed.
[0134] In one embodiment, when the processor executes the logic in the computer program to update the network coding information based on the impact of adjusting the weights of network nodes within each network layer on the initial defect detection network, the following steps are specifically implemented:
[0135] Based on the sample power equipment images and their labeled regions, the impact of adjusting the weights of network nodes in each network layer on the initial defect detection network is determined; and the network coding information is updated according to the impact of adjusting the weights of network nodes in each network layer on the initial defect detection network.
[0136] In one embodiment, when the processor executes the logic in the computer program to determine the impact of adjusting the weights of network nodes in each network layer on the initial defect detection network based on sample power equipment images and the labeled regions of the sample power equipment images, the specific steps are as follows:
[0137] The sample power equipment image is input into the initial defect detection network to obtain the first target detection region. For each network layer, the sample power equipment image is input into the initial defect detection network after adjusting the weights of the network nodes in that network layer to obtain the second target detection region. Based on the intersection-union ratio (IUU) between the first target detection region and the labeled region of the sample power equipment image, and the IUU between the second target detection region and the labeled region, the impact of adjusting the weights of the network nodes in that network layer on the initial defect detection network is determined.
[0138] In one embodiment, when a processor executes logic in a computer program, it specifically implements the following steps:
[0139] A genetic algorithm is used to optimize the target defect detection network based on sample power equipment images.
[0140] In one embodiment, when a processor executes logic in a computer program, it specifically implements the following steps:
[0141] Based on the meta-learning algorithm, the initial power equipment image is augmented to obtain sample power equipment images; using the sample power equipment images, the initial neural network is trained to obtain the initial defect detection network.
[0142] In one embodiment, a computer-readable storage medium is provided having a computer program stored thereon, the computer program performing the following steps when executed by a processor:
[0143] Based on the connection relationships between network nodes in each network layer of the initial defect detection network and the random weight matrix, the network coding information of the initial defect detection network is constructed.
[0144] The network coding information is updated based on the impact of adjusting the weights of network nodes within each network layer on the initial defect detection network.
[0145] Based on the updated network coding information, the initial defect detection network is optimized to obtain the target defect detection network.
[0146] In one embodiment, when the processor executes the code logic in the computer program that constructs the network encoding information of the initial defect detection network based on the connection relationships between network nodes in each network layer of the initial defect detection network and the random weight matrix, the following steps are specifically implemented:
[0147] Based on the connection relationships between network nodes within each network layer in the initial defect detection network, the layer coding information of each network layer is determined; based on the random weight matrix and the layer coding information of each network layer, the network coding information of the initial defect detection network is constructed.
[0148] In one embodiment, when the processor executes the code logic in the computer program that updates the network encoding information based on the impact of adjusting the weights of network nodes within each network layer on the initial defect detection network, the specific steps are as follows:
[0149] Based on the sample power equipment images and their labeled regions, the impact of adjusting the weights of network nodes in each network layer on the initial defect detection network is determined; and the network coding information is updated according to the impact of adjusting the weights of network nodes in each network layer on the initial defect detection network.
[0150] In one embodiment, when the processor executes the code logic in the computer program that determines the impact of adjusting the weights of network nodes in each network layer on the initial defect detection network based on sample power equipment images and their labeled regions, the specific steps are as follows:
[0151] The sample power equipment image is input into the initial defect detection network to obtain the first target detection region. For each network layer, the sample power equipment image is input into the initial defect detection network after adjusting the weights of the network nodes in that network layer to obtain the second target detection region. Based on the intersection-union ratio (IUU) between the first target detection region and the labeled region of the sample power equipment image, and the IUU between the second target detection region and the labeled region, the impact of adjusting the weights of the network nodes in that network layer on the initial defect detection network is determined.
[0152] In one embodiment, when the code logic in a computer program is executed by a processor, the following steps are specifically implemented:
[0153] A genetic algorithm is used to optimize the target defect detection network based on sample power equipment images.
[0154] In one embodiment, when the code logic in a computer program is executed by a processor, the following steps are specifically implemented:
[0155] Based on the meta-learning algorithm, the initial power equipment image is augmented to obtain sample power equipment images; using the sample power equipment images, the initial neural network is trained to obtain the initial defect detection network.
[0156] In one embodiment, a computer program product is provided, including a computer program that, when executed by a processor, performs the following steps:
[0157] Based on the connection relationships between network nodes in each network layer of the initial defect detection network and the random weight matrix, the network coding information of the initial defect detection network is constructed.
[0158] The network coding information is updated based on the impact of adjusting the weights of network nodes within each network layer on the initial defect detection network.
[0159] Based on the updated network coding information, the initial defect detection network is optimized to obtain the target defect detection network.
[0160] In one embodiment, when a computer program is executed by a processor to construct the network coding information of the initial defect detection network based on the connection relationships between network nodes in each network layer of the initial defect detection network and the random weight matrix, the following steps are specifically implemented:
[0161] Based on the connection relationships between network nodes within each network layer in the initial defect detection network, the layer coding information of each network layer is determined; based on the random weight matrix and the layer coding information of each network layer, the network coding information of the initial defect detection network is constructed.
[0162] In one embodiment, when a computer program is executed by a processor to update network coding information based on the impact of adjusting the weights of network nodes within each network layer on the initial defect detection network, the following steps are specifically implemented:
[0163] Based on the sample power equipment images and their labeled regions, the impact of adjusting the weights of network nodes in each network layer on the initial defect detection network is determined; and the network coding information is updated according to the impact of adjusting the weights of network nodes in each network layer on the initial defect detection network.
[0164] In one embodiment, when a computer program is executed by a processor to determine the impact of adjusting the weights of network nodes within each network layer on the initial defect detection network based on sample power equipment images and labeled regions of those images, the following steps are specifically implemented:
[0165] The sample power equipment image is input into the initial defect detection network to obtain the first target detection region. For each network layer, the sample power equipment image is input into the initial defect detection network after adjusting the weights of the network nodes in that network layer to obtain the second target detection region. Based on the intersection-union ratio (IUU) between the first target detection region and the labeled region of the sample power equipment image, and the IUU between the second target detection region and the labeled region, the impact of adjusting the weights of the network nodes in that network layer on the initial defect detection network is determined.
[0166] In one embodiment, when a computer program is executed by a processor, the following steps are specifically implemented:
[0167] A genetic algorithm is used to optimize the target defect detection network based on sample power equipment images.
[0168] In one embodiment, when a computer program is executed by a processor, the following steps are specifically implemented:
[0169] Based on the meta-learning algorithm, the initial power equipment image is augmented to obtain sample power equipment images; using the sample power equipment images, the initial neural network is trained to obtain the initial defect detection network.
[0170] It should be noted that the data involved in this application (including but not limited to power equipment image data, etc.) are all information and data authorized by the user or fully authorized by all parties, and the collection, use and processing of the relevant data must comply with the relevant laws, regulations and standards of the relevant countries and regions.
[0171] Those skilled in the art will understand that all or part of the processes in the methods of the above embodiments can be implemented by a computer program instructing related hardware. The computer program can be stored in a non-volatile computer-readable storage medium, and when executed, it can include the processes of the embodiments of the above methods. Any references to memory, databases, or other media used in the embodiments provided in this application can include at least one of non-volatile and volatile memory. Non-volatile memory can include read-only memory (ROM), magnetic tape, floppy disk, flash memory, optical memory, high-density embedded non-volatile memory, resistive random access memory (ReRAM), magnetic random access memory (MRAM), ferroelectric random access memory (FRAM), phase change memory (PCM), graphene memory, etc. Volatile memory can include random access memory (RAM) or external cache memory, etc. By way of illustration and not limitation, RAM can take many forms, such as Static Random Access Memory (SRAM) or Dynamic Random Access Memory (DRAM). The databases involved in the embodiments provided in this application may include at least one type of relational database and non-relational database. Non-relational databases may include, but are not limited to, blockchain-based distributed databases. The processors involved in the embodiments provided in this application may be general-purpose processors, central processing units, graphics processing units, digital signal processors, programmable logic devices, quantum computing-based data processing logic devices, etc., and are not limited to these.
[0172] The technical features of the above embodiments can be combined in any way. For the sake of brevity, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.
[0173] The embodiments described above are merely illustrative of several implementation methods of this application, and while the descriptions are specific and detailed, they should not be construed as limiting the scope of this patent application. It should be noted that those skilled in the art can make various modifications and improvements without departing from the concept of this application, and these all fall within the protection scope of this application. Therefore, the protection scope of this application should be determined by the appended claims.
Claims
1. A network optimization method, characterized in that, The method includes: Based on the connection relationships between network nodes in each network layer of the initial defect detection network and the random weight matrix, the network coding information of the initial defect detection network is constructed; wherein, the network coding information is an encoding used to represent the connection status between network nodes in each network layer of the initial defect detection network; The sample power equipment image is input into the initial defect detection network to obtain the first target detection area; For each network layer, the sample power equipment image is input into the initial defect detection network after adjusting the weights of the network nodes in that network layer to obtain the second target detection area; Based on the cross-union ratio between the first target detection region and the labeled region of the sample power equipment image, and the difference between the cross-union ratio between the second target detection region and the labeled region, the impact of adjusting the weights of network nodes in the network layer on the initial defect detection network is determined, and the network coding information is updated based on the impact of adjusting the weights of network nodes in each network layer on the initial defect detection network. Based on the updated network coding information, the connection method between network nodes in each network layer is determined, and based on the connection method, the initial defect detection network is pruned to obtain the target defect detection network. The sample power equipment images are input one by one into the target defect detection network to obtain the intersection-union ratio of the detection area and the labeled area of each sample power equipment image. The excellent value is obtained based on the average cross-union ratio corresponding to each sample power equipment image; wherein, the excellent value is used to measure the quality of the target defect detection network. Based on the excellent value, selection, crossover, and mutation operations are performed on all target defect detection networks containing excellent values to optimize the target defect detection network.
2. The method according to claim 1, characterized in that, The step of constructing the network coding information of the initial defect detection network based on the connection relationships between network nodes in each network layer of the initial defect detection network and the random weight matrix includes: Based on the connection relationships between network nodes within each network layer of the initial defect detection network, determine the layer coding information of each network layer; Based on the random weight matrix and the layer coding information of each network layer, the network coding information of the initial defect detection network is constructed.
3. The method according to claim 2, characterized in that, The connection relationships between network nodes within each network layer are represented in vector form; determining the layer coding information of each network layer based on the connection relationships between network nodes within each network layer in the initial defect detection network includes: For each network layer, all vectors representing the connection relationships between network nodes within that network layer are concatenated in positional order to obtain the layer encoding information of that network layer.
4. The method according to claim 2, characterized in that, The process of constructing the network coding information of the initial defect detection network based on the random weight matrix and the layer coding information of each network layer includes: The layer coding information of each network layer is standardized in length. Then, according to the positional relationship between the network layers, the standardized layer coding information of each network layer is concatenated to obtain the coding matrix. Multiplying the encoding matrix by the random weight matrix yields the network encoding information of the initial defect detection network.
5. The method according to claim 1, characterized in that, The step of optimizing the target defect detection network by performing selection, crossover, and mutation operations on all target defect detection networks containing excellent values, based on the excellent values, includes: Based on the excellent value, selection, crossover, and mutation operations are performed on all target defect detection networks containing excellent values to obtain the first round of screening results; Increment the iteration number of the selected target defect detection network by one and proceed to the next round of selection until the iteration number is greater than the preset maximum number of generations. The selected target defect detection network is then taken as the optimal defect detection network.
6. The method according to claim 1, characterized in that, The method further includes: Based on the meta-learning algorithm, the initial power equipment image is augmented to obtain sample power equipment images; The initial neural network is trained using the sample images of the power equipment to obtain the initial defect detection network.
7. A network optimization device, characterized in that, The device includes: The encoding information construction module is used to construct the network encoding information of the initial defect detection network based on the connection relationship between network nodes in each network layer of the initial defect detection network and the random weight matrix; wherein, the network encoding information is an encoding used to represent the connection status between network nodes in each network layer of the initial defect detection network; The encoding information update module is used to input sample power equipment images into the initial defect detection network to obtain a first target detection region; for each network layer, input the sample power equipment images into the initial defect detection network after adjusting the weights of the network nodes in that network layer to obtain a second target detection region; determine the impact of adjusting the weights of the network nodes in that network layer on the initial defect detection network based on the difference between the intersection-union ratio (IU) between the first target detection region and the labeled region of the sample power equipment image, and the IU between the second target detection region and the labeled region; and update the network encoding information based on the impact of adjusting the weights of the network nodes in each network layer on the initial defect detection network. The network optimization module is used to determine the connection method between network nodes in each network layer based on the updated network coding information, and prune the initial defect detection network based on the connection method to obtain the target defect detection network; input the sample power equipment images one by one into the target defect detection network to obtain the intersection-union ratio (IU) of the detection area and the labeled area for each sample power equipment image; obtain the good value based on the average IU of each sample power equipment image; wherein the good value is used to measure the goodness of the target defect detection network; and perform selection, crossover, and mutation operations on all target defect detection networks containing good values to optimize the target defect detection network.
8. A computer device comprising a memory and a processor, wherein the memory stores a computer program, characterized in that, When the processor executes the computer program, it implements the steps of the method according to any one of claims 1 to 6.
9. A computer-readable storage medium having a computer program stored thereon, characterized in that, When the computer program is executed by a processor, it implements the steps of the method according to any one of claims 1 to 6.
10. A computer program product, comprising a computer program, characterized in that, When the computer program is executed by a processor, it implements the steps of the method according to any one of claims 1 to 6.
Citation Information
Patent Citations
Product surface defect detection method, device and computer device
CN109272497A
Electrical equipment defect detection method and device based on neural network
CN113052103A
General defect detection method based on graph neural network
CN114489785A