A substation digital meter detection network model compression method and system

By improving the combination of the YOLOV5 algorithm and the FasterNet network, combined with random local search and SR-C annealing quantization algorithms, the substation digital meter detection network model is compressed, which solves the problem of limited edge device resources and achieves efficient digital meter recognition.

CN116977795BActive Publication Date: 2025-10-17NARI NANJING CONTROL SYSTEM CO LTD +1
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202311093950.9
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2023-08-28
Publication Date
2025-10-17
Estimated Expiration
2043-08-28

AI Technical Summary

Technical Problem

Non-intelligent digital instruments in substations cannot automatically upload data, making manual transcription time-consuming, labor-intensive, and error-prone. Existing convolutional neural network models have many parameters, consume large amounts of storage space and computing resources, and are difficult to widely use on edge devices.

Method used

The improved YOLOV5 algorithm is adopted, combined with the FasterNet network, BiFormer attention mechanism and Wise-IoU loss function. The random local search and SR-C annealing quantization algorithm are used to compress the substation digital meter detection network model. The permutation matrix and centroid codebook C and code B are used for model deployment to reduce storage space and computing resource consumption.

Benefits of technology

Without affecting the inference speed and detection accuracy, the storage space and computing resource consumption of the meter model are greatly reduced, adapting to the computing resource limitations of edge devices, and achieving efficient digital meter recognition.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN116977795B_ABST
    Figure CN116977795B_ABST
Patent Text Reader

Abstract

The application discloses a substation digital meter detection network model compression method and system, which comprises the following steps: collecting substation digital meter sample images, and forming a training set after preprocessing; training a network model based on an improved YOLOV5 algorithm by using the training set to obtain a substation digital meter detection model; obtaining a permutation matrix P by using a local search algorithm, and rearranging a weight matrix W in the model; obtaining a centroid codebook C and a code B for approximately representing the weight matrix W by using an SR-C annealing quantization algorithm; fine-tuning the centroid codebook C by using an optimization algorithm; and deploying the centroid codebook C and the code B as a compressed model on an edge device, and using the model to recognize substation digital meters. The application can greatly reduce the storage space occupied by the digital meter model and save the computing resources of the edge device.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present application relates to the field of target detection, and particularly relates to a substation digital meter detection network model compression method and system. BACKGROUND

[0002] Due to some historical reasons, there are still many non-intelligent digital meters in substations, and the data of these digital meters cannot be automatically uploaded to the computer background system. If manual transcription is used, it is time-consuming and laborious and prone to errors.

[0003] Therefore, it is of great significance to collect digital meter images through on-site cameras and use computer vision technology for meter identification. At present, using a convolutional neural network to automatically extract features from an RGB image and then detecting and identifying the extracted feature map is a trend in digital meter detection. However, a good performance convolutional neural network usually involves millions of parameters, and the storage space and computing resources are extremely large. This is obviously incompatible with the characteristics of limited computing resources of edge devices, which seriously hinders its widespread application on edge devices. SUMMARY

[0004] The present application relates to the field of target detection, and particularly relates to a substation digital meter detection network model compression method and system.

[0005] Another object of the present application is to provide a substation digital meter detection network model compression system.

[0006] TECHNICAL SOLUTION: A substation digital meter detection network model compression method of the present application comprises the following steps:

[0007] Collecting substation digital meter sample images, and pre-processing the collected substation digital meter sample images after screening, expanding and sorting to form a training set;

[0008] Training a network model based on an improved YOLOV5 algorithm using the training set to obtain a substation digital meter detection network model;

[0009] Processing each layer of neural network of the substation digital meter detection network model through a random local search algorithm to obtain a permutation matrix P with a local minimum distortion rate;

[0010] Using the permutation matrix P to rearrange the weight matrix W of the layer of neural network to obtain a new weight matrix W P ;

[0011] Using an SR-C annealing quantization algorithm to cluster and obtain a weight matrix W Pa centroid codebook C and a code B;

[0012] fine-tuning the centroid codebook C by an optimization algorithm based on the original dataset and the loss function;

[0013] deploying the centroid codebook C and the code B as a compressed substation digital meter detection network model on an edge computing device;

[0014] recognizing the substation digital meter by using the substation digital meter detection network model on the edge computing device.

[0015] Further, the pre-constructed network model based on the improved YOLOV5 algorithm is trained by using the training set to obtain the substation digital meter detection network model, wherein the backbone network of the network model based on the improved YOLOV5 algorithm uses FasterNet network for feature extraction; the BiFormer attention mechanism is used to retain the digital meter detail information; the loss function uses Wise-IoU instead of the CIoU loss function in the original network; and the Efficient-RepGFPN is used to replace the Neck part in YOLOV5.

[0016] Further, the construction process of the network model based on the improved YOLOV5 algorithm is as follows:

[0017] The backbone network of the original network model based on the YOLOV5 algorithm is replaced by the FasterNet network, and the FasterNet network has four levels of levels, and an embedding layer or a merging layer is arranged before each level of level, which is used for spatial down-sampling and channel number expansion;

[0018] The loss function Wise-IoU formula is as follows:

[0019]

[0020]

[0021] wherein, W g represents the width of the smallest detection box, H g represents the height of the smallest detection box; x represents the center horizontal coordinate of the detection box; y represents the center vertical coordinate of the detection box; x gt represents the center horizontal coordinate of GT; y gt represents the center vertical coordinate of GT; represents the intersection-over-union of the detection box and the box gt .

[0022] Further, the permutation matrix P with the local minimum distortion rate is obtained by processing each layer of neural network of the substation digital meter detection network model by using the random local search algorithm, including:

[0023] A random local search algorithm is used to randomly select two rows in the weight matrix W of a layer of the neural network of the substation digital meter detection network model. When the covariance of the two rows after the exchange is less than the covariance before the exchange, the two rows are exchanged; otherwise, they are not exchanged. The above operation is iterated a predetermined number of times and then the search algorithm is terminated.

[0024] Furthermore, the SR-C annealing quantization algorithm is used to cluster and obtain the weight matrix W for reconstruction. P The centroid codebook C and code B include the following steps:

[0025] Add Gaussian noise to the original data that gradually decreases with the number of iterations;

[0026] The standard K-means clustering algorithm is used to continuously perform clustering operations on noisy data;

[0027] After iterating the above operation for a predetermined number of times, the final clustering result is returned.

[0028] Furthermore, the SR-C annealing quantization algorithm is used to cluster and obtain the centroid codebook C and code B for reconstructing the weight matrix WP, where:

[0029] The centroid codebook C is the centroid set of the local minimum loss for all sub-vectors in the reconstruction weight matrix;

[0030] Code B is the subscript set of the local minimum loss of each subvector in the weight matrix reconstructed using set C.

[0031] Furthermore, the centroid codebook C is fine-tuned according to the original dataset and loss function, including:

[0032] For multiple centroids in different layers, we first calculate the gradient corresponding to each centroid in the weight matrix according to back propagation, then add up the gradients corresponding to each centroid, and finally use the accumulated gradients to update the centroid parameters.

[0033] Based on the same inventive concept, the present invention provides a substation digital meter detection network model compression system, comprising:

[0034] The data processing module is used to collect sample images of digital meters in substations, and pre-process the collected sample images of digital meters in substations after screening, expansion and sorting to form a training set;

[0035] A model building module is used to train a pre-built network model based on the improved YOLOV5 algorithm using a training set to obtain a substation digital meter detection network model;

[0036] The model processing module is configured to process each layer neural network of the substation digital meter detection network model by using a random local search algorithm to obtain a permutation matrix P with a local minimum distortion rate.

[0037] The matrix arrangement module is configured to rearrange the weight matrix W of the neural network by using the permutation matrix P to obtain a new weight matrix W P ;

[0038] The clustering obtaining module is configured to obtain a centroid codebook C and a code B for reconstructing the weight matrix W by using an SR-C annealing quantization algorithm. P

[0039] The fine-tuning module is configured to fine-tune the centroid codebook C according to the original data set and the loss function.

[0040] The deployment module is configured to deploy the centroid codebook C and the code B as a compressed substation digital meter detection network model on an edge computing device.

[0041] The digital meter identification module is configured to identify the substation digital meter by using the substation digital meter detection network model on the edge computing device.

[0042] Based on the same inventive concept, the substation digital meter detection network model compression device of the present application comprises a processor and a memory, the memory stores computer instructions, and the processor is configured to execute the computer instructions stored in the memory, and when the computer instructions are executed by the processor, the electronic device realizes the steps of the substation digital meter detection network model compression method.

[0043] Based on the same inventive concept, the computer readable storage medium of the present application stores a computer program, and when the program is executed by the processor, the steps of the substation digital meter detection network model compression method are realized.

[0044] Firstly, the network model based on the improved YOLOV5 algorithm is trained by using the training set to obtain a substation digital meter detection model; secondly, the permutation matrix P is obtained by using the local search algorithm to rearrange the weight matrix W in the model; the centroid codebook C and the code B for approximately representing the weight matrix W are obtained by using the SR-C annealing quantization algorithm; then, the centroid codebook C is fine-tuned by using the optimization algorithm; finally, the centroid codebook C and the code B are deployed as a compressed model on an edge device, and the model is used to identify the substation digital meter.

[0045] ​Beneficial effects: compared with the prior art, the technical scheme of the present application has the beneficial effects that the problem of difficulty in application on edge devices caused by the large number of model parameters of digital meters in substations, large storage space and large consumption of computing resources is solved; the storage space occupied by the meter model is greatly reduced on the basis of not affecting the inference speed and detection accuracy, and the computing resources of the edge computing device are saved. BRIEF DESCRIPTION OF DRAWINGS

[0046] Figure 1 The flowchart of the present application is shown in the figure.

[0047] Figure 2 The principle diagram of the centroid codebook fine-tuning algorithm in the embodiment of the present application is shown in the figure. DETAILED DESCRIPTION

[0048] The technical scheme of the present application will be described in detail below in combination with the specific embodiments and the accompanying drawings of the specification.

[0049] Embodiment 1

[0050] As shown in the figure, the digital meter detection network model compression method of the substation of the present application comprises the following steps: Figure 1

[0051] S1: collect the sample images of the digital meters in the substation, and perform preprocessing on the collected sample images of the digital meters in the substation after screening, expansion and arrangement to form a training set.

[0052] In this step, the sample images of the digital meters in the substation are collected, which specifically includes: collecting sample pictures of the digital meters in the substation, and the collected sample images of the digital meters in the substation should contain digital meter images of various types, various angles and different environmental lights to enhance the diversity of the training samples.

[0053] In this step, the collected sample images of the digital meters in the substation are screened, expanded and arranged for preprocessing to form a training set. Specifically, the collected sample images of the digital meters in the substation are screened, arranged and subjected to data enhancement to form a training set and a test set, and rectangular frame labeling is performed using the open source software labelImg.

[0054] In this embodiment, the collected sample images of the digital meters in the substation are screened, arranged and subjected to data enhancement to form a training set, and labeling is performed using the open source software labelImg, which specifically includes the following steps:

[0055] S1.1: using a data enhancement method, randomly cropping, randomly scaling and pasting the numbers of the collected pictures to other images to improve the generalization of the detection model;

[0056] S1.2: labeling the ten numbers from 0 to 9, and the labels corresponding to each type of number are shown in the table below.​

[0057] Table of specific numbers and corresponding label tags

[0058] Real numbers Labeled tags 0 00090000 1 00090001 2 00090002 3 00090003 4 00090004 5 00090005 6 00090006 7 00090007 8 00090008 9 00090009

[0059] S2: Train the pre-constructed network model based on the improved YOLOV5 algorithm using the training set to obtain a digital meter detection network model for substations.

[0060] In this step, the backbone network of the network model based on the improved YOLOV5 algorithm uses FasterNet network for feature extraction; BiFormer attention mechanism is used to retain more digital meter detail information for smaller size numbers; the loss function uses Wise-IoU instead of the original CIoU loss function in the network; Efficient-RepGFPN is used to replace the Neck part in YOLOV5.

[0061] In this step, the construction process of the network model based on the improved YOLOV5 algorithm is as follows:

[0062] S2.1: Replace the original backbone network of the network model based on the YOLOV5 algorithm with FasterNet network, which has four levels of levels, and before each level, there is an embedding layer (a 4x4 regular convolution with a step of 4) or a merging layer (a 2x2 regular convolution with a step of 2), which is used for spatial down-sampling and channel number expansion;

[0063] S2.2: The loss function is used to measure the difference between the predicted value and the true value of the model, aiming to minimize the error between the predicted frame and the true boundary frame and the error between the predicted class and the true class. The loss function Wise-IoU used in this patent is as follows:

[0064]

[0065]

[0066] wherein, W g represents the width of the smallest detection box, H g represents the height of the smallest detection box; x represents the center horizontal coordinate of the detection box; y represents the center vertical coordinate of the detection box; x gt represents the center horizontal coordinate of GT; y gt represents the center vertical coordinate of GT; represents the intersection over union of the detection box and the box gt .

[0067] S3: The weight matrix W of each layer of the substation digital meter detection network model is processed by a random local search algorithm to obtain a permutation matrix P with a local minimum distortion rate.

[0068] In this step, two rows in the weight matrix W of a layer of the substation digital meter detection network model are randomly selected by a random local search algorithm, and the two rows are exchanged when the covariance after the exchange is smaller than the covariance before the exchange, otherwise the two rows are not exchanged; the search algorithm is ended after the above operation is iterated for a predetermined number of times.

[0069] In this embodiment, the random local search algorithm is based on the rate distortion theory, the lower limit of the original weight distortion is determined by the covariance of the vector, and the permutation matrix P corresponding to the optimal arrangement is found by taking the covariance as the objective function. The specific steps are as follows: first, the permutation matrix P is initialized as a unit matrix. Each time, two rows row1 and row2 are randomly selected, the two rows row1 and row2 in the permutation matrix P are exchanged to obtain P2. Let f(P·W) be the covariance function of P·W. If f(P2·W) < f(P·W), that is, the covariance after the exchange is smaller, then P2 is taken as the new permutation matrix P. The above operation is repeated n times to return the permutation matrix P, and n is the number of iterations of the algorithm.

[0070] S4: The weight matrix W of the neural network is rearranged by using the permutation matrix P to obtain a new weight matrix P·W, denoted as W P , which includes the following steps:

[0071] S4.1: The permutation matrix P and the weight matrix W are multiplied to obtain a new intermediate matrix W1, that is, W1=P*W;

[0072] S4.2: The intermediate matrix W1 and the transpose of the permutation matrix P are multiplied to obtain a new weight matrix P·W, denoted as W P .

[0073] S5: The SR-C annealing quantization algorithm is used to cluster to obtain the centroid codebook C and the code B used to reconstruct the weight matrix W P , which includes the following steps:

[0074] S5.1: Gaussian noise gradually decreasing with the number of iterations is added to the original data;

[0075] S5.2: The standard K-means clustering algorithm is used to continuously perform clustering operations on the data containing noise;

[0076] S5.3: The above operation is iterated for a predetermined number of times to return the final clustering result.

[0077] The specific steps of the SR-C algorithm in this embodiment are as follows: in each iteration, first, add Gaussian noise gradually reduced with the iteration number to each sub-vector in the original weight matrix. For each sub-vector w ij , x ij is a Gaussian noise with a mean of 0 and a variance distribution of the diagonal matrix of the covariance matrix of w ij , a Gaussian noise with a size of (x ij ×(1-i / n) γ ) is added to w ij to generate a vector w where i is the current iteration number, n is the total iteration number, and γ is a constant with a size of 0.5. After adding Gaussian noise to all vectors, update the centroid codebook C and the code B using the K-means clustering method with the strategy of minimizing the loss function Repeat the above operation n times to return the final centroid codebook C and the code B, and n is the iteration number of the algorithm.

[0078] In this step, the centroid codebook C is a set of centroids used to reconstruct the local minimum loss of all sub-vectors in the weight matrix.

[0079] In this step, the code B is a set of indices used to reconstruct the local minimum loss of each sub-vector in the weight matrix using the set C.

[0080] S6: According to the transformer collected digital meter data set and the loss function, fine-tune the centroid codebook C through the gradient descent optimization algorithm.

[0081] In this step, as shown in Figure 2 , for multiple centroids of different layers, first, calculate the gradient corresponding to each centroid in the weight matrix according to back propagation, then add the gradients corresponding to each centroid, and finally use the accumulated gradient to update the centroid parameters.

[0082] Specifically, assume that C1, C2, C3 and C4 are four centroids of the codebook, and the gradient information G ij of each position of the matrix after vector quantization is obtained using the gradient optimization algorithm. According to the code B, obtain multiple gradient values corresponding to each centroid, for example, the gradient values corresponding to C1 are G 11 , G 12 , G 13 , and G 14 , then the gradient update value of C1 is G 11 +G 12 +G 13 +G 14 .

[0083] S7: Deploy the centroid codebook C and code B as the compressed substation digital meter detection network model on the edge computing device, specifically including the following steps:

[0084] S7.1: Compress the substation digital meter detection network model to reduce the size and calculation of the model, so that it can adapt to the resource limitations of the edge computing device;

[0085] S7.2: Package the compressed model and code B into an executable file, which can trigger the inference of the model by inputting a single picture or video stream, etc. by deploying this program on the edge computing device;

[0086] S8: Use the substation digital meter detection network model on the edge computing device to identify the substation digital meter, and the specific steps are as follows:

[0087] S8.1: Input the preprocessed image into the substation digital meter detection network model on the edge device for inference detection, and the model outputs the position, confidence and category information of the detected ten categories of numbers;

[0088] S8.2: Perform secondary processing on the output results of step S8.1, and use the non-maximum suppression operation to obtain the final digital meter recognition result.

[0089] Embodiment 2

[0090] The substation digital meter detection network model compression system of the application comprises:

[0091] A data processing module is configured to collect substation digital meter sample images, and perform preprocessing on the collected substation digital meter sample images after screening, expansion and arrangement to form a training set;

[0092] A model construction module is configured to train a network model based on the improved YOLOV5 algorithm using the training set to obtain a substation digital meter detection network model;

[0093] A model processing module is configured to process each layer of neural network of the substation digital meter detection network model by a random local search algorithm to obtain a permutation matrix P with a local minimum distortion rate;

[0094] A matrix arrangement module is configured to rearrange the weight matrix W of the neural network using the permutation matrix P to obtain a new weight matrix W P ;

[0095] A clustering module is configured to use an SR-C annealing quantization algorithm to cluster and obtain a centroid codebook C and code B for reconstructing the weight matrix W P ;

[0096] a fine-tuning module configured to fine-tune the centroid codebook C according to the original dataset and the loss function;

[0097] a deployment module configured to deploy the centroid codebook C and the code B on the edge computing device as a compressed substation digital meter detection network model;

[0098] a digital meter identification module configured to identify the substation digital meter by using the substation digital meter detection network model on the edge computing device.

[0099] Embodiment 3

[0100] The substation digital meter detection network model compression device of the present application comprises a processor and a memory, the memory stores computer instructions, the processor is configured to execute the computer instructions stored in the memory, when the computer instructions are executed by the processor, the electronic device realizes the steps of the substation digital meter detection network model compression method, and can achieve the same technical effect as the above method.

[0101] The memory can include computer system readable media in the form of volatile memory, such as random access memory (RAM) and / or cache memory. The device can further include other removable / non removable, volatile / non volatile computer system storage media. For example, the memory can be used to read and write to a non removable, non volatile magnetic media, commonly known as a "hard disk drive". The program / utility, having a set of (at least one) program modules, can be stored in, for example, memory, such as operating system, one or more application programs, other program modules, and program data, and each of these examples or some combination thereof, can include an implementation of a network environment. The program modules typically carry out the functions and / or methodologies of the embodiments described herein.

[0102] The processor performs various functional applications and data processing by running the program stored in the memory, such as implementing the method provided by embodiment one of the present application.

[0103] Embodiment 4

[0104] The computer readable storage medium of the present application stores a computer program, which is executed by the processor to realize the steps of the substation digital meter detection network model compression method, and can achieve the same technical effect as the above method.

[0105] The computer storage medium of the embodiments of the present application can adopt any combination of one or more computer-readable media. The computer-readable medium can be a computer-readable signal medium or a computer-readable storage medium. The computer-readable storage medium may, for example, but is not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, device or apparatus, or any combination thereof. More specific examples (non-exhaustive list) of the computer-readable storage medium include an electrical connection having one or more wires, a portable computer diskette, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the above. In this document, the computer-readable storage medium can be any tangible medium that contains or stores a program that can be used by or in connection with an instruction execution system, apparatus, or device.

[0106] The computer-readable signal medium can include a data signal propagated in baseband or propagated as a carrier wave, in which the computer-readable program code is contained. Such propagated data signals can take a wide variety of forms, including but not limited to electro-magnetic signals, optical signals, or any suitable combination thereof. The computer-readable signal medium can also be any computer-readable medium that is not a storage medium and that can communicate, propagate or transport programming for use by or in connection with an instruction execution system, apparatus, or device.

[0107] The program code contained on the computer-readable medium can be transmitted using any suitable medium, including but not limited to wireless, wired, optical fiber cable, RF, and the like, or any suitable combination thereof.

[0108] The computer program code for carrying out operations of the present application can be written in one or more programming languages or combinations of languages including an object oriented programming language such as Java, Smalltalk, C++ or the like and conventional procedural programming languages, such as the "C" programming language or similar programming languages. The program code can execute entirely on the user's computer, partly on the user's computer, as a stand-alone software package, partly on the user's computer and partly on a remote computer or entirely on the remote computer or server. In the latter scenario, the remote computer can be connected to the user's computer through any type of network, including a local area network (LAN) or a wide area network (WAN), or the connection can be made to an external computer (for example, through the Internet using an Internet Service Provider). In some embodiments of the present application, electronic mail (email) can be utilized as the inbound and outbound mechanism for receiving and transmitting data.

[0109] Of course, the storage medium provided by the embodiments of the present application contains computer executable instructions, which are not limited to the method operations as above, but can also perform related operations in the method provided by any embodiment of the present application.

[0110] The above specific embodiments further illustrate the purposes, technical solutions and beneficial effects of the present application. It should be understood that the above description is only for specific embodiments of the present application and is not intended to limit the present application. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present application shall be included in the protection scope of the present application.

Claims

1. A method for compressing a substation digital meter detection network model, characterized in that: The following steps are involved: Collect sample images of digital meters in substations, and pre-process the collected sample images after screening, expansion, and organization to form a training set; The training set is used to train the pre-built network model based on the improved YOLOV5 algorithm to obtain the substation digital meter detection network model; The random local search algorithm is used to process the neural network layers of the substation digital meter detection network model to obtain the permutation matrix P with the local minimum distortion rate. The permutation matrix P is used to rearrange the weight matrix W of each layer of the neural network of the substation digital meter detection network model to obtain a new weight matrix W P ; The SR-C annealing quantization algorithm is used to cluster and obtain the weight matrix W for reconstruction. P The centroid codebook C and code B; Based on the digital sample image dataset collected from the substation and the loss function, the centroid codebook C is fine-tuned through the optimization algorithm; The centroid codebook C and code B are used as the compressed substation digital meter detection network model and deployed on the edge computing device; Identify substation digital meters using the substation digital meter detection network model on edge computing devices; The random local search algorithm is used to process the neural networks of each layer of the substation digital meter detection network model to obtain a permutation matrix P with a local minimum distortion rate, including: A random local search algorithm is used to randomly select two rows in the weight matrix W of a layer of the neural network of the substation digital meter detection network model. When the covariance of the two rows after the exchange is less than the covariance before the exchange, the two rows are exchanged; otherwise, they are not exchanged. The above operation is iterated a predetermined number of times and then the search algorithm is terminated.

2. The method for compressing a substation digital meter detection network model according to claim 1, characterized in that: The training set is used to train the pre-built network model based on the improved YOLOV5 algorithm to obtain the substation digital meter detection network model. Among them, the backbone network of the network model based on the improved YOLOV5 algorithm uses the FasterNet network for feature extraction; the BiFormer attention mechanism is used to retain the detailed information of the digital meter; the loss function uses Wise-IoU instead of the CIoU loss function in the original network; and the Efficient-RepGFPN is used to replace the Neck part in YOLOV5.

3. The method for compressing a substation digital meter detection network model according to claim 1, characterized in that: The construction process of the network model based on the improved YOLOV5 algorithm is as follows: The backbone network of the original YOLOV5 algorithm-based network model is replaced with the FasterNet network. The FasterNet network has four hierarchical levels, and each hierarchical level is preceded by an embedding layer or a merging layer for spatial downsampling and channel number expansion. The loss function Wise-IoU formula is as follows: Among them, W g Indicates the width of the minimum detection box, H g Indicates the height of the minimum detection box; x indicates the horizontal coordinate of the center of the detection box; y indicates the vertical coordinate of the center of the detection box; x gt Indicates the central horizontal coordinate of GT; y gt Indicates the central vertical coordinate of GT; Indicates detection box and box gt The intersection and union ratio.

4. The method for compressing a substation digital meter detection network model according to claim 1, characterized in that: The SR-C annealing quantization algorithm is used to cluster and obtain the weight matrix W for reconstruction. P The centroid codebook C and code B include the following steps: Add Gaussian noise to the original data that gradually decreases with the number of iterations; The standard K-means clustering algorithm is used to continuously perform clustering operations on noisy data; After iterating the above operation for a predetermined number of times, the final clustering result is returned.

5. The method for compressing a substation digital meter detection network model according to claim 1, characterized in that: The SR-C annealing quantization algorithm is used to cluster and obtain the weight matrix W for reconstruction. P The centroid codebook C and code B, where The centroid codebook C is the centroid set of the local minimum loss for all sub-vectors in the reconstruction weight matrix; Code B is the subscript set of the local minimum loss of each subvector in the weight matrix reconstructed using set C.

6. The method for compressing a substation digital meter detection network model according to claim 1, characterized in that: Fine-tune the centroid codebook C according to the original dataset and loss function, including: For multiple centroids in different layers, we first calculate the gradient corresponding to each centroid in the weight matrix according to back propagation, then add up the gradients corresponding to each centroid, and finally use the accumulated gradients to update the centroid parameters.

7. A substation digital meter detection network model compression system, characterized in that: include: The data processing module is used to collect sample images of digital meters in substations, and pre-process the collected sample images of digital meters in substations after screening, expansion and sorting to form a training set; A model building module is used to train a pre-built network model based on the improved YOLOV5 algorithm using a training set to obtain a substation digital meter detection network model; The model processing module is used to process the neural network layers of the substation digital meter detection network model through a random local search algorithm to obtain a permutation matrix P with a local minimum distortion rate; The matrix permutation module is used to rearrange the weight matrix W of the neural network using the permutation matrix P to obtain a new weight matrix W P ; Clustering module, used to use SR-C annealing quantization algorithm to cluster and obtain the weight matrix W for reconstruction P The centroid codebook C and code B; The fine-tuning module is used to fine-tune the centroid codebook C according to the original dataset and loss function; A deployment module is used to deploy the centroid codebook C and code B as a compressed substation digital meter detection network model on the edge computing device; A digital meter identification module is used to identify substation digital meters using the substation digital meter detection network model on the edge computing device; The random local search algorithm is used to process the neural networks of each layer of the substation digital meter detection network model to obtain a permutation matrix P with a local minimum distortion rate, including: A random local search algorithm is used to randomly select two rows in the weight matrix W of a layer of the neural network of the substation digital meter detection network model. When the covariance of the two rows after the exchange is less than the covariance before the exchange, the two rows are exchanged; otherwise, they are not exchanged. The above operation is iterated a predetermined number of times and then the search algorithm is terminated.

8. A substation digital meter detection network model compression device, characterized in that: The device comprises a processor and a memory, wherein the memory stores computer instructions, and the processor is used to execute the computer instructions stored in the memory. When the computer instructions are executed by the processor, the device implements the steps of the substation digital meter detection network model compression method as described in any one of claims 1 to 6.

9. A computer-readable storage medium, characterized in that The computer-readable storage medium stores a computer program, which, when executed by a processor, implements the steps of the substation digital meter detection network model compression method according to any one of claims 1 to 6.

Citation Information

Patent Citations

  • Depth model compression method for edge device multi-layer shared codebook vector quantization

    CN114781639A

  • Digital meter detection and identification method and device and medium

    CN115147824A