A power operation scene element lightweight detection method
By improving the YOLOv5s model and image enhancement technology, a lightweight power operation scene element detection model was constructed, which solved the problems of accuracy and real-time performance in power operation scene detection and improved the detection effect.
Patent Information
- Application Number
- CN202411166306.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-08-23
- Publication Date
- 2025-10-17
- Estimated Expiration
- 2044-08-23
AI Technical Summary
Existing detection algorithms for power operation scenarios cannot achieve accurate detection, mainly due to low sample library quality, limited image quality, and a lack of lightweight detection algorithms, which cannot meet the complex and ever-changing environment and real-time requirements of power operation sites.
Image samples of power operation scenarios were collected and labeled, preprocessed, and the YOLOv5s model was improved into a lightweight network. Image enhancement was performed by combining the multi-scale Retinex algorithm and the normalized incomplete Beta function. The model was optimized using the LFOcal-EIoU loss function to construct a lightweight power operation scenario element detection model.
It improves image quality, reduces computational load, and enhances the model's detection accuracy and real-time performance in power operation scenarios, providing an algorithmic foundation for the safe and intelligent management of power operation scenarios.
Smart Images

Figure CN119152424B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to a power operation scene element lightweight detection method, belonging to the technical field of power operation safety management and control. BACKGROUND
[0002] There are dangerous factors such as live areas in power operation sites, and power operation needs to be managed and controlled by special personnel in real time. With the development of image processing technology, some power operation risk identification algorithms are proposed, which provide a basis for realizing intelligent safety management and control of power operation sites.
[0003] The key link of intelligent safety management and control of power operation sites is the accurate detection of various elements. The current element detection effect cannot realize popularization and application, and the main reasons include:
[0004] The quality of the power operation scene sample library is not high. The current samples are mainly collected by fixed camera devices, and the shooting angle is limited, which affects the detection accuracy. There are problems such as being unable to face the operator and being blocked by live equipment; the power operation image requires high image enhancement preprocessing method. The power operation scene is complex and changeable, and there are factors such as dark light environment and large light ratio environment that affect image quality, so appropriate image enhancement measures need to be taken; there is a lack of efficient power operation scene element lightweight detection algorithm. Due to the high real-time requirement of power operation safety management and control, the detection algorithm of power operation scene elements needs to run on the edge side, and related research is not mature enough.
[0005] The invention patent with publication number "CN116994095A" discloses a pre-training method and system suitable for power scene target detection, which includes: obtaining a clear power scene image dataset, which does not require manual labeling; after different preprocessing of the unlabeled images, the preprocessed images are input into multiple encoders, and a plurality of loss functions are designed to operate on the output of the encoder, so that the encoder can extract features from a large number of unlabeled power scene images, and finally obtain a pre-training model for the target detection task of the power scene; after fine-tuning the pre-training model using a labeled power scene target detection dataset, a target detection model is obtained. The invention greatly reduces the training time of the target detection model, and at the same time, compared with training on a single target detection dataset, it obtains better performance;
[0006] However, the pre-training model used in the above-mentioned invention cannot accurately detect elements with small quantities in the power scene due to the large changes in the power scene. SUMMARY
[0007] In order to solve the problems existing in the prior art, the present application proposes a power operation scene element lightweight detection method.
[0008] The technical solutions of the present application are as follows:
[0009] In one aspect, the present application provides a lightweight detection method for power operation scene elements, comprising the following steps:
[0010] Collecting power operation scene image samples and labeling elements in the image samples;
[0011] Preprocessing the power operation scene image samples;
[0012] Lightweight improvement is made to the YOLOv5s model, and a lightweight power operation scene element detection model is constructed based on the lightweight improved YOLOv5s model;
[0013] The lightweight power operation scene element detection model is trained through the preprocessed image samples, and a trained lightweight power operation scene element detection model is obtained;
[0014] Real-time collection of power operation scene image samples and element detection through the trained lightweight power operation scene element detection model.
[0015] As a preferred embodiment of the present application, the labeled elements in the image samples include various power transformation equipment, operation personnel, operation personnel protective equipment and operation personnel operation tools.
[0016] As a preferred embodiment of the present application, the power operation scene image samples in dark light environment and large light ratio environment are subjected to image enhancement preprocessing, and the specific steps are as follows:
[0017] For power operation scene image samples in dark light environment, the image is processed through a multi-scale Retinex algorithm, specifically as follows:
[0018]
[0019] Wherein: K is the total number of Gaussian center wrap functions; S(x, y) is the original image; F(x, y) is the Gaussian filter function; w k The kth Gaussian center wrap function represents the weighting coefficient; r(x, y) represents the enhanced power operation scene image sample in dark light environment.
[0020] As a preferred embodiment of the present application, the image enhancement preprocessing step of the power operation scene image sample in large light ratio environment is as follows:
[0021] Image enhancement processing is performed through normalized incomplete Beta function, specifically as follows:
[0022]
[0023]
[0024] Wherein: B(alpha, beta) represents an incomplete Beta function; F(u) represents a normalized incomplete Beta function; the function output value is applied to the enhancement processing of the image sample after adaptive adjustment of alpha and beta according to different image samples.
[0025] As a preferred embodiment of the application, the lightweight improvement step of the YOLOv5s model is:
[0026] Replacing the backbone network in the YOLOv5s model with a lightweight network composed of a plurality of SandGlass modules and Conv modules;
[0027] The SandGlass module is composed of two spatial depth convolution layers at the beginning and end and two point-wise convolution layers in the middle.
[0028] As a preferred embodiment of the application, the original loss function L of the lightweight power operation scene element detection model EIoU is improved to L Focal-EIoU , which is specifically as follows:
[0029] L Focal-EIoU = IoU γ L EIoU
[0030]
[0031] Wherein: w c represents the width of the minimum circumscribed rectangle of the predicted bounding box and the real bounding box; h c represents the height of the minimum circumscribed rectangle of the predicted bounding box and the real bounding box; p represents the Euclidean distance; b represents the predicted bounding box; b gt represents the real bounding box; w represents the width of the predicted bounding box; w gt represents the width of the real bounding box; h represents the height of the predicted bounding box; h gt represents the height of the real bounding box; IoU represents the intersection over union of the predicted bounding box and the real bounding box; and g is a hyperparameter.
[0032] On the other hand, the application also provides a lightweight power operation scene element detection system, comprising a data acquisition module, a model construction module, a model training module and a model output module;
[0033] The data acquisition module is used to acquire power operation scene image samples and label the elements in the image samples, and pre-process the power operation scene image samples;
[0034] The model construction module is used for lightweight improvement of a YOLOv5s model, and a lightweight power operation scene element detection model is constructed based on the lightweight improved YOLOv5s model.
[0035] The model training module is used for training the lightweight power operation scene element detection model through the preprocessed image samples, so as to obtain the trained lightweight power operation scene element detection model.
[0036] The model output module is used for real-time collection of power operation scene image samples, and element detection is performed through the trained lightweight power operation scene element detection model.
[0037] As a preferred embodiment of the present application, the lightweight improvement step of the YOLOv5s model is:
[0038] The backbone network in the YOLOv5s model is replaced by a lightweight network composed of a plurality of SandGlass modules and Conv modules.
[0039] The SandGlass module is composed of two spatial depth convolution layers at the head and tail and two point-wise convolution layers in the middle.
[0040] In another aspect, the present application also provides an electronic device, which includes a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the program to realize the method according to any one of the embodiments of the present application.
[0041] In another aspect, the present application also provides a computer readable storage medium, which stores a computer program executable by a processor to realize the method according to any one of the embodiments of the present application.
[0042] The present application has the following beneficial effects:
[0043] 1. The present application proposes a low-quality image enhancement method in a dark environment and a large light ratio environment, which further improves the data set quality; the YOLOv5s model is improved, the lightweight deployment potential of the model is improved through the optimization of the backbone network, and the effect of the model on the power operation scene element detection is improved through the optimization of the loss function, which provides an algorithm basis for the safe and intelligent management and control of the power operation scene. BRIEF DESCRIPTION OF DRAWINGS
[0044] Figure 1 The present application is a method flowchart;
[0045] Figure 2 The present application is an improved YOLOv5s model structure diagram;
[0046] Figure 3A schematic diagram of a SandGlass module structure of the present application. DETAILED DESCRIPTION
[0047] The technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the drawings in the embodiments of the present application. Obviously, the described embodiments are only a part of the embodiments of the present application, rather than all the embodiments of the present application. Based on the embodiments in the present application, all other embodiments obtained by a person of ordinary skill in the art without creative work are within the protection scope of the present application.
[0048] It should be understood that the step numbers used herein are only for the convenience of description, and are not limited to the execution sequence of the steps.
[0049] It should be understood that the terms used in the present application are only for the purpose of describing specific embodiments and are not intended to limit the present application. As used in the present application specification and the appended claims, unless otherwise clear from the context, the singular forms "a", "an" and "the" are intended to include the plural forms.
[0050] The terms "comprise" and "include" indicate the presence of described features, integers, steps, operations, elements, and / or components, but do not exclude one or more other features, integers, steps, operations, elements, components, and / or sets thereof.
[0051] The term "and / or" means any combination of one or more of the associated listed items and all possible combinations, and includes these combinations.
[0052] Embodiment one:
[0053] Referring to Figure 1 A power operation scene element lightweight detection method, comprising the following steps:
[0054] Collecting power operation scene image samples and labeling elements in the image samples;
[0055] Pretreating the power operation scene image samples;
[0056] Lightweight improvement is made to the YOLOv5s model, and a lightweight power operation scene element detection model is constructed based on the lightweight improved YOLOv5s model;
[0057] The lightweight power operation scene element detection model is trained through the pretreated image samples, and a trained lightweight power operation scene element detection model is obtained;
[0058] Real-time collection of power operation scene image samples, and element detection through the trained lightweight power operation scene element detection model.
[0059] As a preferred embodiment of the present embodiment, the elements labeled in the image samples include: each power transformation device, operation personnel, protective articles such as safety helmets of operation personnel, and operation tools of operation personnel.
[0060] As a preferred embodiment of the present embodiment, the image enhancement preprocessing is performed on the power operation scene image samples in dark light environment and large light ratio environment, and the specific steps are as follows:
[0061] For the power operation scene image samples in dark light environment, the image is processed through a multi-scale Retinex algorithm, and the specific formula is as follows:
[0062]
[0063] Wherein: K is the total number of Gaussian center wrap functions, which is set to 3 in the present embodiment; S(x,y) is the original image; F(x,y) is the Gaussian filter function; w k The weighting coefficient of the kth Gaussian center wrap function, since three Gaussian center wrap functions are set in the present embodiment, then r(x,y) represents the enhanced power operation scene image sample in dark light environment.
[0064] As a preferred embodiment of the present embodiment, the image enhancement preprocessing steps of the power operation scene image samples in large light ratio environment are as follows:
[0065] The image enhancement processing is performed through the normalized incomplete Beta function, and the specific formula is as follows:
[0066]
[0067]
[0068] Wherein: B(alpha, beta) represents the incomplete Beta function; F(u) represents the normalized incomplete Beta function; after adaptive adjustment of alpha and beta according to different large light ratio environment picture samples, the function output value is applied to the enhancement processing of the image sample, and the specific is adjusting the gray scale of the picture.
[0069] As a preferred embodiment of the present embodiment, the lightweight improvement steps of the YOLOv5s model are as follows:
[0070] Referring to Figure 2The main network in the YOLOv5s model is replaced by a lightweight network composed of a plurality of SandGlass modules and Conv modules, the use of C3 modules is reduced relative to the original main network, and the purpose of reducing the calculation amount is achieved.
[0071] Referring to Figure 3 The SandGlass module is composed of two spatial depth convolution layers at the beginning and the end and two consecutive pointwise convolution layers in the middle, and can realize the dimensionality reduction and dimensionality increase of the feature map.
[0072] As a preferred embodiment of the present embodiment, the original loss function L EIoU of the lightweight power operation scene element detection model is improved to L Focal-EIoU , which is specifically as follows:
[0073] L Focal-EIoU =IoU γ L EIoU
[0074]
[0075] Wherein: w c represents the width of the minimum circumscribed rectangle of the predicted bounding box and the real bounding box; h c represents the height of the minimum circumscribed rectangle of the predicted bounding box and the real bounding box; ρ represents the Euclidean distance; b represents the predicted bounding box; b gt represents the real bounding box; w represents the width of the predicted bounding box; w gt represents the width of the real bounding box; h represents the height of the predicted bounding box; h gt represents the height of the real bounding box; IoU represents the intersection over union of the predicted bounding box and the real bounding box; γ is a hyperparameter, and the value is 0.5.
[0076] Through experiments, the effects of the lightweight YOLOv5s model used in the present embodiment and other models are as shown in the following table:
[0077]
[0078] Embodiment two:
[0079] A lightweight power operation scene element detection system, characterized by comprising a data acquisition module, a model construction module, a model training module and a model output module.
[0080] The data acquisition module is used to acquire power operation scene image samples and label the elements in the image samples, and pre-process the power operation scene image samples;
[0081] The model construction module is used for lightweight improvement of a YOLOv5s model, and a lightweight power operation scene element detection model is constructed based on the lightweight improved YOLOv5s model.
[0082] The model training module is used for training the lightweight power operation scene element detection model through the preprocessed image samples, to obtain a trained lightweight power operation scene element detection model.
[0083] The model output module is used for real-time collection of power operation scene image samples, and element detection is performed through the trained lightweight power operation scene element detection model.
[0084] As a preferred embodiment of the present embodiment, the lightweight improvement step of the YOLOv5s model is as follows:
[0085] The backbone network in the YOLOv5s model is replaced by a lightweight network composed of a plurality of SandGlass modules and Conv modules.
[0086] The SandGlass module is composed of two spatial depth convolution layers at the head and tail and two point-wise convolution layers in the middle.
[0087] The system is used to realize the functions in Embodiment One, which will not be described here.
[0088] Embodiment Three:
[0089] The present embodiment proposes an electronic device, which includes a memory, a processor, and a computer program stored in the memory and executable on the processor, and the processor executes the program to realize the method as described in any embodiment of the present application.
[0090] Specifically, the present embodiment includes an image acquisition device and an edge computing terminal.
[0091] The image acquisition device is movable, and the shooting direction should face the power operation area during use. The image sample should contain all the substation power operation personnel and all the substation power operation personnel and all the substation power operation personnel.
[0092] The edge computing terminal internally deploys a lightweight power operation scene element detection model. The image acquisition device transmits the acquired image to the edge computing terminal, and the edge computing terminal runs the lightweight power operation scene element detection model to realize intelligent identification of the elements in the substation power operation scene.
[0093] Embodiment Four:
[0094] The embodiment provides a computer readable storage medium, which stores a computer program. The computer program is executed by a processor to implement the method in any embodiment of the application.
[0095] In the embodiments of the present application, "at least one" refers to one or more, and "multiple" refers to two or more. The "and / or" describes the association relationship of the associated objects, which means that there can be three kinds of relationships, for example, A and / or B, which can represent the cases of A alone, A and B together, and B alone. Wherein A and B can be singular or plural. The character " / " generally represents that the associated objects before and after it are in an "or" relationship. "At least one of the following" and the like means any combination of these items, including any combination of single or multiple items. For example, at least one of a, b and c can represent: a, b, c, a and b, a and c, b and c, or a and b and c, wherein a, b, and c can be single or multiple.
[0096] Those skilled in the art can realize that the units and algorithm steps described in the embodiments disclosed in the present application can be realized by electronic hardware, computer software and combination of electronic hardware and computer software. Whether the functions are realized by hardware or software depends on the specific application and design constraints of the technical solution. Those skilled in the art can use different methods to realize the described functions for each specific application, but such implementation should not be considered beyond the scope of the present application.
[0097] Those skilled in the art can clearly understand that, for the convenience and brevity of the description, the specific working processes of the above-mentioned system, device and unit can refer to the corresponding processes in the foregoing method embodiments, which will not be described here.
[0098] In several embodiments provided in the present application, any function realized in the form of a software function unit and sold or used as an independent product can be stored in a computer readable storage medium. Based on such understanding, the technical solutions of the present application essentially or the parts that make contributions to the prior art or parts of the technical solutions can be embodied in the form of a software product. The computer software product is stored in a storage medium, including a plurality of instructions for causing a computer device (which can be a personal computer, a server, or a network device, etc.) to execute all or part of the steps of the methods described in the embodiments of the present application. The foregoing storage medium includes: a U disk, a mobile hard disk, a read-only memory (Read-Only Memory, ROM for short), a random access memory (Random Access Memory, RAM for short), a magnetic disk or an optical disk, and various media that can store program codes.
[0099] The above merely illustrates the embodiments of the present application, and does not limit the patent scope of the present application, and any equivalent structure or equivalent process transformation, or direct or indirect application in other related technical fields, which are made by using the content of the present application specification and drawings, are also included in the patent protection scope of the present application.
Claims
1. A lightweight detection method for elements in power operation scenes, characterized by: The following steps are involved: Collect image samples of power operation scenes and annotate the elements in the image samples; Preprocessing of power operation scene image samples; The YOLOv5s model is lightweighted and improved, and a lightweight power operation scene element detection model is constructed based on the lightweight and improved YOLOv5s model; The lightweight power operation scene element detection model is trained using the preprocessed image samples to obtain a trained lightweight power operation scene element detection model; Collect power operation scene image samples in real time and perform element detection using a trained lightweight power operation scene element detection model; Image enhancement preprocessing is performed on power operation scene image samples in dark light environments and high light ratio environments. The specific steps are as follows: For the image samples of power operation scenes in dark environments, the multi-scale Retinex algorithm is used to process the images, as shown in the following formula: Where: K is the total number of Gaussian center surround functions; S(x,y) is the original image; F(x,y) is the Gaussian filter function; w k represents the weighting coefficient of the kth Gaussian center surround function; r(x,y) represents the enhanced image sample of the power operation scene in a dark environment; The image enhancement preprocessing steps of the electric power operation scene image sample in the high light ratio environment are as follows: Image enhancement is performed by normalizing the non-complete Beta function, as shown in the following formula: F(u)=B -1 (α,β)*∫0 u t α-1 (1-t) β-1 dt,α>0,β<10 B(α,β)=∫0 1 t α-1 (1-t) β-1 dt Where: B(α, β) represents the incomplete Beta function; F(u) represents the normalized incomplete Beta function; after adaptively adjusting α and β according to different image samples, the function output value is applied to the enhancement processing of the image sample; The lightweight improvement steps of the YOLOv5s model are: Replace the backbone network in the YOLOv5s model with a lightweight network consisting of several SandGlass modules and Conv modules; The SandGlass module consists of two spatial depth convolution layers at the beginning and end and two point-by-point convolution layers in the middle; The original loss function L of the lightweight power operation scene element detection model is EIoU Improved to L Focal-EIoU , as shown in the following formula: L Focal-EIoU =IoU γ L EIoU Where: w c Indicates the width of the minimum bounding rectangle of the predicted bounding box and the true bounding box; h c represents the height of the minimum bounding rectangle of the predicted bounding box and the true bounding box; ρ represents the Euclidean distance; b represents the predicted bounding box; b gt The real bounding box; w represents the width of the predicted bounding box; w gt represents the width of the true bounding box; h represents the height of the predicted bounding box; h gt Represents the height of the true bounding box; IoU represents the intersection over union ratio of the predicted bounding box to the true bounding box; γ is a hyperparameter.
2. A method for lightweight detection of elements in power operation scenes according to claim 1, characterized in that: The elements marked in the image sample include: various substation equipment, operators, operator protective equipment, and operator work tools.
3. A lightweight detection system for power operation scene elements, using a lightweight detection method for power operation scene elements according to any one of claims 1 to 2, characterized in that: It includes data acquisition module, model building module, model training module and model output module; The data acquisition module is used to collect power operation scene image samples, mark the elements in the image samples, and pre-process the power operation scene image samples; The model building module is used to perform lightweight improvement on the YOLOv5s model, and build a lightweight power operation scene element detection model based on the lightweight improved YOLOv5s model; The model training module is used to train the lightweight power operation scene element detection model through the preprocessed image samples to obtain a trained lightweight power operation scene element detection model; The model output module is used to collect power operation scene image samples in real time and perform element detection through the trained lightweight power operation scene element detection model.
4. A lightweight detection system for power operation scene elements according to claim 3, characterized in that: The lightweight improvement steps of the YOLOv5s model are: Replace the backbone network in the YOLOv5s model with a lightweight network consisting of several SandGlass modules and Conv modules; The SandGlass module consists of two spatial depth convolution layers at the beginning and end and two point-by-point convolution layers in the middle.
5. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein: When the processor executes the program, the method according to any one of claims 1 to 2 is implemented.
6. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the program is executed by a processor, the method according to any one of claims 1 to 2 is implemented.
Citation Information
Patent Citations
Pre-training method and system suitable for electric power scene target detection
CN116994095A
Improved YOLOv5 target detection method suitable for low-illumination environment
CN115512206A
Power operation safety monitoring method based on lightweight network
CN117392613A