Power distribution cabinet label and indicator light recognition method based on deep learning and related components
By improving the YOLOv8 model and OCR recognition technology, the problem of insufficient expression of color and luminous features in the detection of indicator lights in power distribution cabinets by the YOLOv8 model has been solved, improving the detection accuracy and stability, and realizing accurate identification of the status of power distribution cabinets.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- PINGDINGSHAN ZHONGXUAN AUTOMATIC CONTROL SYST
- Filing Date
- 2026-03-27
- Publication Date
- 2026-07-21
AI Technical Summary
The existing YOLOv8 target detection model is difficult to effectively express color and light emission characteristics in the detection of indicator lights in power distribution cabinets, and is easily affected by changes in lighting, cabinet reflections and background interference, resulting in insufficient detection accuracy and stability.
An improved Yolov8 model is adopted, introducing a multi-branch feature extraction structure, a color perception feature enhancement module, and a channel attention SE module. The CBS structure is improved to a DSCBS structure, and combined with an OCR digital recognition model, the ability to express color and luminescence features is enhanced, and the influence of environmental interference is reduced.
This improves the stability and accuracy of indicator light detection in power distribution cabinets, enabling precise and efficient identification of the cabinet status and meeting the requirements for safe and stable operation of power systems.
Smart Images

Figure CN121921326B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the technical field of power distribution cabinet status identification, and in particular to a method and related components for identifying power distribution cabinet labels and indicator lights based on deep learning. Background Technology
[0002] As the core control unit of the power system, the working status of the indicator lights in the distribution cabinet directly reflects the operating status of the power equipment. Accurately identifying the status of the indicator lights is of great significance for the safe and stable operation of the power system, fault diagnosis, and daily maintenance.
[0003] With the development of deep learning technology, object detection algorithms have been increasingly applied to indicator light recognition. Among them, the YOLOv8 object detection model, as a general-purpose object detection network, is widely used in object detection tasks across various natural scenes due to its fast detection speed and strong generalization ability. However, in the application of indicator light detection in power distribution cabinets, the following technical challenges exist: First, power distribution cabinet indicator lights are typically small in scale, and the shapes of indicator lights in different states are highly similar. Their state discrimination mainly relies on low-level visual information such as shape, color, and brightness. The original YOLOv8 network structure focuses more on the geometric shape, edge texture, and semantic structure information of the target, and has limited capabilities in explicit modeling of color features and expression of luminous features. Second, the operating environment of power distribution cabinets is complex and easily affected by changes in lighting, metal reflections from the cabinet, and background clutter, leading to a decrease in the detection accuracy of the general-purpose YOLOv8 model for indicator lights. Third, the general detection model is insufficient in preserving and distinguishing small target features, making it difficult to stably extract subtle features of the indicator lights, thus affecting the stability of the detection box and the accuracy of state recognition. Therefore, a method that can accurately and efficiently identify the state of indicator lights in power distribution cabinets is urgently needed. Summary of the Invention
[0004] To achieve accurate and efficient identification of the status of power distribution cabinets, this application provides a deep learning-based method and related components for identifying power distribution cabinet labels and indicator lights.
[0005] Firstly, this application provides a method for identifying power distribution cabinet labels and indicator lights based on deep learning, employing the following technical solution: A deep learning-based method for identifying power distribution cabinet labels and indicator lights, comprising: Acquire images of the power distribution cabinet; The image of the power distribution cabinet is used for target detection through an improved Yolov8 model to determine the coordinate information of the power distribution cabinet number and the indicator light information. The feature extraction network of the improved Yolov8 model adopts a multi-branch feature extraction structure and introduces a color perception feature enhancement module and a channel attention SE module. At the same time, the CBS structure in the Yolov8 model is improved to a DSCBS structure. The indicator light information includes the indicator light category. If the coordinate information of the power distribution cabinet number is not empty, the power distribution cabinet image is identified based on the OCR digital recognition model and the coordinate information of the power distribution cabinet number to determine the power distribution cabinet number; The distribution cabinet status is determined by matching the distribution cabinet number and the indicator light type based on the distribution cabinet number coordinate information and the indicator light information.
[0006] By adopting the above technical solution and using the improved Yolov8 model for target detection, the coordinates of the distribution cabinet number and indicator light information can be determined. The improved Yolov8 model's multi-branch feature extraction structure, color perception feature enhancement module, channel attention (SE) module, and DSCBS structure enhance the ability to express color and luminous features, reduce the influence of complex lighting, cabinet reflections, and background interference, and improve the ability to maintain and distinguish small target features. This improves the stability of the detection frame and the accuracy of state recognition, enabling precise and efficient identification of the distribution cabinet indicator light status. Based on the OCR digital recognition model, the distribution cabinet number can be accurately identified, and then the distribution cabinet number is matched with the indicator light category to determine the distribution cabinet status, thus achieving precise and efficient identification of the distribution cabinet status.
[0007] Optionally, before performing target detection on the power distribution cabinet image using an improved Yolov8 model to determine the power distribution cabinet's coordinate information and indicator light information, the method further includes: Construct the improved Yolov8 model; Obtain a sample dataset, wherein each sample in the sample dataset includes image data and annotation data; The sample dataset is expanded using a preset method to obtain a training dataset; The improved Yolov8 model is trained based on the training dataset.
[0008] By adopting the above technical solution, an improved Yolov8 model is constructed to provide a foundation for subsequent power distribution cabinet image detection. The obtained labeled sample dataset can be used for subsequent model training. Expanding the sample dataset can increase the diversity of training data. Training the improved Yolov8 model based on the expanded training dataset can enable the model to learn more features and improve the accuracy and stability of the model in detecting the coordinate information of the power distribution cabinet number and indicator light information.
[0009] Optionally, the multi-branch feature extraction structure includes a first feature extraction branch, a second feature extraction branch, and a third feature extraction branch, which are set in parallel. The first feature extraction branch is used to extract the color semantic features of the indicator light, and the input image is a Lab color space image. The second feature extraction branch is used to extract the brightness and luminous state features of the indicator light, and the input image is a V channel image in the HSV color space. The third feature extraction branch is used to extract the structural and contextual features of the indicator light, and the input image is an RGB color space image.
[0010] By adopting the above technical solution, the three parallel branches of the multi-branch feature extraction structure extract the color semantic features, brightness and luminous state features, and structural and contextual features of the indicator lights from images in different color spaces. This can comprehensively capture the feature information of the indicator lights, overcome the shortcomings of the native YOLOv8 model in explicit modeling of color features and expression of luminous features, reduce the influence of complex lighting conditions, cabinet reflections and background interference, and improve the stability and accuracy of the detection of power distribution cabinet labels and indicator lights.
[0011] Optionally, the first feature extraction branch, the second feature extraction branch, and the third feature extraction branch have the same branch structure, and each branch structure includes two cascaded DSCBS structures and a channel attention SE module in sequence; the feature maps obtained by the first feature extraction branch, the second feature extraction branch, and the third feature extraction branch are fused by adding them element by element, and the fused feature map is input into the C2f layer of the improved Yolov8 model.
[0012] By adopting the above technical solution, each branch of the multi-branch feature extraction structure adopts the same branch structure, including two cascaded DSCBS structures and a channel attention SE module, which can enhance the feature extraction capability. By adding elements one by one, the features extracted by different branches can be effectively fused, thereby improving the accuracy and stability of the improved Yolov8 model in detecting the distribution cabinet number and indicator light, and thus accurately determining the coordinate information of the distribution cabinet number and the indicator light information.
[0013] Optionally, the DSCBS structure sequentially includes a depthwise separable convolutional layer, a batch normalization layer, and a SiLU activation function layer, wherein the depthwise separable convolutional layer includes a depthwise convolutional submodule and a pointwise convolutional submodule. The channel attention (SE) module includes a global average pooling layer, a channel compressed fully connected layer, a ReLU activation function layer, a channel extended fully connected layer, and a Sigmoid activation function layer connected in sequence.
[0014] By adopting the above technical solutions, the CBS structure in the YOLOv8 model is improved to a DSCBS structure. The depthwise separable convolutional layer includes depthwise convolutional submodules and pointwise convolutional submodules, which can reduce the amount of computation and improve computational efficiency. The batch normalization layer can accelerate network convergence and improve model stability. The SiLU activation function layer can enable the model to have better nonlinear expression capabilities. The channel attention SE module, through a global average pooling layer, two fully connected layers, and two activation function layers, can adaptively adjust the importance of channel features, enhance the model's attention to important features, and thus improve the model's recognition performance of power distribution cabinet labels and indicator lights.
[0015] Optionally, the step of recognizing the power distribution cabinet image based on the OCR digital recognition model and the coordinate information of the power distribution cabinet number to determine the power distribution cabinet number includes: The power distribution cabinet image is segmented based on the coordinate information of the power distribution cabinet number to obtain a digital label image containing the power distribution cabinet number; The power distribution cabinet number is obtained by recognizing the digital label image based on the OCR digital recognition model.
[0016] By adopting the above technical solution, the distribution cabinet image is first segmented according to the coordinate information of the distribution cabinet number to obtain a digital label image, which can focus on the part containing the distribution cabinet number and reduce interference from irrelevant information; then, the OCR digital recognition model is used to recognize the digital label image, which can accurately determine the distribution cabinet number.
[0017] Optionally, the distribution cabinet label coordinate information includes the distribution cabinet label coordinates and the number of distribution cabinet labels; the indicator light information includes the indicator light position coordinates; and the step of matching the distribution cabinet label and the indicator light category based on the distribution cabinet label coordinate information and the indicator light information to determine the distribution cabinet status includes: The category of the indicator light corresponding to each distribution cabinet number is determined based on the horizontal coordinate of the distribution cabinet number coordinate and the horizontal coordinate of the indicator light position coordinate; The status of each power distribution cabinet is determined based on a preset category status association and the correspondence between the power distribution cabinet number and the indicator light category. The preset category status association includes the association between the indicator light category and the power distribution cabinet status.
[0018] By adopting the above technical solution, the distribution cabinet image is acquired and the distribution cabinet number coordinate information and indicator light information are obtained through detection using an improved Yolov8 model. After determining the distribution cabinet number using an OCR digital recognition model, the indicator light category corresponding to each distribution cabinet number is matched based on the horizontal coordinate in the distribution cabinet number coordinates and the horizontal coordinate in the indicator light position coordinates. Combined with the preset association between the indicator light category and the distribution cabinet status, the distribution cabinet status corresponding to each distribution cabinet number can be accurately determined, improving the accuracy and stability of recognition and meeting the needs of intelligent identification of electrical equipment.
[0019] Secondly, this application provides a deep learning-based device for identifying power distribution cabinet labels and indicator lights, employing the following technical solution: A deep learning-based device for identifying distribution cabinet labels and indicator lights, comprising: Image acquisition module, used to acquire images of the power distribution cabinet; The target detection module is used to perform target detection on the power distribution cabinet image through an improved Yolov8 model, determine the coordinate information of the power distribution cabinet number and the indicator light information. The feature extraction network of the improved Yolov8 model adopts a multi-branch feature extraction structure, and introduces a color perception feature enhancement module and a channel attention SE module. At the same time, the CBS structure in the Yolov8 model is improved to a DSCBS structure. The indicator light information includes the indicator light category. The power distribution cabinet number determination module is used to identify the power distribution cabinet image based on the OCR digital recognition model and the power distribution cabinet number coordinate information if the power distribution cabinet number coordinate information is not empty, and to determine the power distribution cabinet number. The power distribution cabinet status module is used to match the power distribution cabinet number and the indicator light category based on the coordinate information of the power distribution cabinet number and the indicator light information to determine the status of the power distribution cabinet.
[0020] By adopting the above technical solution and using the improved Yolov8 model for target detection, the coordinates of the distribution cabinet number and indicator light information can be determined. The improved Yolov8 model's multi-branch feature extraction structure, color perception feature enhancement module, channel attention (SE) module, and DSCBS structure enhance the ability to express color and luminous features, reduce the influence of complex lighting, cabinet reflections, and background interference, and improve the ability to maintain and distinguish small target features. This improves the stability of the detection frame and the accuracy of state recognition, enabling precise and efficient identification of the distribution cabinet indicator light status. Based on the OCR digital recognition model, the distribution cabinet number can be accurately identified, and then the distribution cabinet number is matched with the indicator light category to determine the distribution cabinet status, thus achieving precise and efficient identification of the distribution cabinet status.
[0021] Thirdly, this application provides an electronic device that adopts the following technical solution: An electronic device includes a processor coupled to a memory; The memory stores a computer program that can be loaded by a processor and executed by the deep learning-based method for identifying power distribution cabinet numbers and indicator lights as described in any of the first aspects.
[0022] Fourthly, this application provides a computer-readable storage medium, which adopts the following technical solution: A computer-readable storage medium storing a computer program capable of being loaded by a processor and executing the deep learning-based method for identifying power distribution cabinet numbers and indicator lights as described in any of the first aspects. Attached Figure Description
[0023] Figure 1 This is a flowchart illustrating a deep learning-based method for identifying power distribution cabinet labels and indicator lights, as provided in an embodiment of this application.
[0024] Figure 2 This is a structural block diagram of a deep learning-based power distribution cabinet number and indicator light recognition device provided in an embodiment of this application.
[0025] Figure 3 This is a structural block diagram of the electronic device provided in the embodiments of this application. Detailed Implementation
[0026] The present application will be further described in detail below with reference to the accompanying drawings.
[0027] This application provides a method for identifying power distribution cabinet labels and indicator lights based on deep learning. This method can be executed by an electronic device, which can be a server or a terminal device. The server can be a standalone physical server, a server cluster or distributed system composed of multiple physical servers, or a cloud server providing cloud computing services. The terminal device can be a smartphone, tablet computer, desktop computer, etc., but is not limited to these.
[0028] To make the objectives, technical solutions, and advantages of the embodiments of this application clearer, the technical solutions of the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this application, not all embodiments. Based on the embodiments of this application, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this application.
[0029] Furthermore, the term "and / or" in this article is merely a description of the relationship between related objects, indicating that three relationships can exist. For example, A and / or B can represent: A existing alone, A and B existing simultaneously, or B existing alone. Additionally, the character " / " in this article, unless otherwise specified, generally indicates that the preceding and following related objects have an "or" relationship.
[0030] like Figure 1 As shown, a method for identifying power distribution cabinet labels and indicator lights based on deep learning is described in the following main process flow (steps S101 to S104): S101. Obtain the image of the power distribution cabinet.
[0031] A video data acquisition device, such as an IPC, is installed at the power distribution cabinet to be monitored. FFmpeg is used to decode the RTMP video stream output by the IPC in real time. During the decoding process, the RTMP video stream is converted into frame-by-frame image data to obtain the image of the power distribution cabinet.
[0032] S102. The image of the power distribution cabinet is used to perform target detection through the improved Yolov8 model to determine the coordinate information of the power distribution cabinet number and the indicator light information.
[0033] The distribution cabinet number coordinate information includes the distribution cabinet number coordinates and the number of distribution cabinets, while the indicator light information includes the indicator light type and the indicator light position coordinates.
[0034] The image of the power distribution cabinet is input into the improved Yolov8 model for target detection (power distribution cabinet label and indicator lights that are lit). The improved Yolov8 model outputs the detected target categories (including power distribution cabinet label categories and various indicator light categories) and the corresponding target location coordinates. The number of targets whose target category is the power distribution cabinet label category is counted, i.e., the number of power distribution cabinet labels, thereby determining the coordinate information of the power distribution cabinet label and the indicator light information. Among them, the indicator light categories are, for example: red1, red2, red3, yellow1, yellow2, etc., and different indicator light categories have different meanings.
[0035] Before using the improved Yolov8 model to detect targets in the power distribution cabinet image and determine the cabinet's coordinates and indicator light information, it is necessary to first construct an improved Yolov8 model and train it so that the trained improved Yolov8 model can complete the target detection task.
[0036] The improved YOLOv8 model is based on the original YOLOv8 object detection model. Targeted improvements are made to the input stage of the backbone feature extraction network up to the C2f layer. The remaining structures (e.g., the C2f layer, the YOLOv8 native detection neck, the YOLOv8 native detection head, etc.) are consistent with the original YOLOv8 object detection model and will not be described in detail here.
[0037] Specifically, the improved Yolov8 model's feature extraction network adopts a multi-branch feature extraction structure and introduces a color perception feature enhancement module and a channel attention (SE) module. At the same time, the CBS structure in the Yolov8 model is improved to a DSCBS structure.
[0038] The multi-branch feature extraction structure includes a first feature extraction branch, a second feature extraction branch, and a third feature extraction branch. These three branches are set up in parallel to model the color, brightness, and structural features of the indicator light from different color spaces. The first feature extraction branch extracts the color semantic features of the indicator light, with the input image being a Lab color space image. The second feature extraction branch extracts the brightness and luminous state features of the indicator light, with the input image being a V channel image in the HSV color space. The third feature extraction branch extracts the structural and contextual features of the indicator light, with the input image being an RGB color space image. After the power distribution cabinet image is input into the improved Yolov8 model, the improved Yolov8 model first performs size normalization on the power distribution cabinet image. The image is scaled to a standard pixel matrix of 640×640×3. Then, the standard pixel matrix is converted into Lab color space image (3 channels), HSV color space V channel image (1 channel), and RGB color space image (3 channels). To ensure network structure consistency, before the Lab color space image, HSV color space V channel image, and RGB color space image enter each feature extraction branch, the improved Yolov8 model will also use 1×1 convolution to uniformly map the number of channels of the three input forms of Lab color space image, HSV color space V channel image, and RGB color space image to 32 channels, resulting in a feature representation of size 640×640×32. Then, the various feature representations of the 32 channels enter the corresponding feature extraction branches for feature extraction.
[0039] More specifically, the first, second, and third feature extraction branches have the same branch structure. Each branch structure includes two cascaded DSCBS structures (completing initial feature downsampling and feature representation enhancement) and a channel attention SE module. The feature maps obtained from the first, second, and third feature extraction branches are fused element-wise. The fused feature map is then input into the C2f layer of the improved Yolov8 model (same as the original Yolov8 model) for deep feature modeling and information reuse. Afterward, the subsequent object detection process is completed through the original structure of the Yolov8 model.
[0040] Unlike the traditional CBS structure, the DSCBS structure uses depthwise separable convolution instead of ordinary convolution, thus significantly reducing computational cost and parameter size while maintaining multi-channel feature extraction capabilities. The DSCBS structure consists of depthwise separable convolutional layers, batch normalization layers, and SiLU activation function layers. The depthwise separable convolutional layers include a depthwise convolutional submodule (using a 3×3 kernel with a stride of 2, performing independent convolution in each channel) and a pointwise convolutional submodule (using a 1×1 kernel, fusing across channels). The depthwise convolutional submodule extracts spatial features for each input channel separately, while the pointwise convolutional submodule achieves cross-channel feature fusion, thereby reducing computational complexity while maintaining strong feature representation capabilities.
[0041] In each feature extraction branch, the input spatial image (one of Lab color space image, V channel image in HSV color space, or RGB color space image) is first processed through a first-level DSCBS structure. This process downsamples the spatial image and increases the number of channels from 32 to 64, resulting in an output feature map of size 320×320×64. Subsequently, the feature map output from the first-level DSCBS structure is further processed through a second-level DSCBS structure, which downsamples the feature map to 160×160 while maintaining the number of channels at 64. This enhances the semantic expressiveness of the features; therefore, the output feature map from the second-level DSCBS structure is 160×160×64.
[0042] After feature extraction for each branch, a channel attention SE module (SE-Block) is introduced after the second DSCBS structure for each branch. This module adaptively models and recalibrates the importance of each feature channel within the branch, thereby highlighting key feature channels highly correlated with the status of the power distribution cabinet indicator lights. The channel attention SE module does not change the size or number of channels of the feature map; that is, the output feature map size remains 160×160×64. The channel attention SE module includes a globally average pooling layer, a channel compression fully connected layer, a ReLU activation function layer, a channel expansion fully connected layer, and a Sigmoid activation function layer connected in sequence. The globally average pooling layer is used to compress the spatial dimension and extract the global response information of each channel. Subsequently, the channel compression fully connected layer and the channel expansion fully connected layer generate the weight coefficients of each channel, and the corresponding activation function layers (the channel compression fully connected layer corresponds to the ReLU activation function layer, and the channel expansion fully connected layer corresponds to the Sigmoid activation function layer) are used to normalize the weight coefficients. Finally, the channels of the input feature map are weighted and calibrated. This approach allows channels related to the color changes of red, green, and yellow indicator lights to receive higher weights in the first feature extraction branch (Lab branch), channels related to the indicator light's luminous intensity and on / off state to be effectively enhanced in the second feature extraction branch (HSV-V branch), and channels related to the indicator light's structural outline and contextual information to be highlighted in the third feature extraction branch (RGB branch).
[0043] The three parallel feature extraction branches all output feature maps of the same size. Then, the three feature maps are fused by adding them element by element. The size of the fused feature map is kept at 160×160×64. This fusion method achieves deep integration of complementary features in different color spaces without introducing additional parameters.
[0044] It is worth noting that the V channel image in the HSV color space can also be replaced with the Y channel in the YUV color space. The image processing and feature extraction processes are the same as those for the V channel image in the HSV color space, and will not be described again here.
[0045] The steps for training the constructed improved Yolov8 model include: obtaining a labeled sample dataset from staff, where each sample includes image data and labeled data (including labeled target categories and bounding box coordinates); then expanding the sample dataset using preset methods (e.g., random cropping, random image horizontal flipping, center cropping, etc.) to obtain the training dataset; and finally training the improved Yolov8 model using the training dataset, employing the AdamW optimizer with an initial learning rate of 1×10⁻⁶. -4Furthermore, a cosine annealing learning rate decay strategy is employed to gradually reduce the learning rate in the later stages of training to achieve better convergence. The batch size during training is set to 16 to ensure both training stability and efficiency. The total number of training epochs is set to 300, and an EarlyStopping mechanism is introduced. Training automatically terminates when the model performance validated on the validation set (obtained from staff) fails to improve within a preset number of epochs (this number is not specifically limited here), reducing the possibility of overfitting.
[0046] S103. If the distribution cabinet number coordinate information is not empty, the distribution cabinet image is identified based on the OCR digital recognition model and the distribution cabinet number coordinate information to determine the distribution cabinet number.
[0047] If the coordinate information of the distribution cabinet number is empty, that is, the distribution cabinet number has not been identified, then there is no need to perform the subsequent steps (the steps of identifying the distribution cabinet number and determining the status of the distribution cabinet), and the identification process ends.
[0048] Specifically, when the distribution cabinet label coordinate information is not empty, the distribution cabinet image is identified based on the OCR digital recognition model and the distribution cabinet label coordinate information to determine the distribution cabinet label, including: cutting the distribution cabinet image based on the distribution cabinet label coordinate information to obtain a digital label image containing the distribution cabinet label; and identifying the digital label image based on the OCR digital recognition model to obtain the distribution cabinet label.
[0049] In this embodiment, the coordinates of the distribution cabinet number are determined from the coordinate information of the distribution cabinet number. According to the rectangular area corresponding to the coordinates of the distribution cabinet number, the distribution cabinet image is cut using an image cutting tool such as OpenCV (not specifically limited here) to obtain a digital label image containing only the distribution cabinet number. The digital label image is then recognized by an OCR digital recognition model (e.g., PaddleOCR, EasyOCR, etc.) to obtain all the distribution cabinet numbers contained in the distribution cabinet image and match the corresponding distribution cabinet number coordinates.
[0050] S104. Match the distribution cabinet number and indicator light category based on the distribution cabinet number coordinate information and indicator light information to determine the distribution cabinet status.
[0051] The distribution cabinet numbers and indicator light categories are matched according to the coordinate information of the distribution cabinet number and the indicator light information to determine the indicator light category corresponding to each distribution cabinet number. Then, the status of each distribution cabinet (one distribution cabinet corresponds to one distribution cabinet number) is determined according to the indicator light category.
[0052] Specifically, the distribution cabinet number and indicator light category are matched based on the distribution cabinet number coordinate information and indicator light information to determine the distribution cabinet status, including: determining the indicator light category corresponding to each distribution cabinet number based on the horizontal coordinate in the distribution cabinet number coordinate and the horizontal coordinate in the indicator light position coordinate; determining the distribution cabinet status of each distribution cabinet number based on the preset category status association and the correspondence between the distribution cabinet number and the indicator light category, wherein the preset category status association includes the association between the indicator light category and the distribution cabinet status.
[0053] In this embodiment, if there is only one distribution cabinet number in the distribution cabinet image, the indicator light whose horizontal coordinate in the indicator light position coordinates is greater than the horizontal coordinate in the distribution cabinet number coordinates is determined as the indicator light under that distribution cabinet number. When there are multiple distribution cabinet numbers in the distribution cabinet image, taking three distribution cabinet numbers A, B, and C as an example, the horizontal coordinates of distribution cabinet numbers A, B, and C increase sequentially. Then, the indicator light whose horizontal coordinate in the indicator light position coordinates is greater than the horizontal coordinate in the coordinates of distribution cabinet number A and less than or equal to the horizontal coordinate in the coordinates of distribution cabinet number B is determined as the indicator light under distribution cabinet number A; the indicator light whose horizontal coordinate in the indicator light position coordinates is greater than the horizontal coordinate in the coordinates of distribution cabinet number B and less than or equal to the horizontal coordinate in the coordinates of distribution cabinet number C is determined as the indicator light under distribution cabinet number B; and the indicator light whose horizontal coordinate in the indicator light position coordinates is greater than the horizontal coordinate in the coordinates of distribution cabinet number C is determined as the indicator light under distribution cabinet number C.
[0054] The preset category status association includes the association between indicator light categories and distribution cabinet status. For example, the preset category status association is as follows: indicator light category red1 indicates that the distribution cabinet status is trolley in, indicator light category red2 indicates that the distribution cabinet status is circuit breaker closed, indicator light category red3 indicates that the distribution cabinet status is trolley in, indicator light category yellow2 indicates that the distribution cabinet status is grounding switch open, indicator light category red indicates that the distribution cabinet status is circuit breaker closed, indicator light category yellow1 indicates that the distribution cabinet status is circuit breaker open, indicator light category green indicates that the distribution cabinet status is circuit breaker open, indicator light category green1 indicates that the distribution cabinet status is trolley out, indicator light category green2 indicates that the distribution cabinet status is trolley out, and indicator light category red4 indicates that the distribution cabinet status is grounding switch closed.
[0055] The status of each distribution cabinet is determined based on the preset category status association and the correspondence between the distribution cabinet number and the indicator light category. For example, if the indicator light categories under distribution cabinet number D include red1 and red2, then the distribution cabinet status includes trolley in and circuit breaker closed.
[0056] Figure 2This is a structural block diagram of a deep learning-based power distribution cabinet number and indicator light recognition device 200 provided in an embodiment of this application.
[0057] like Figure 2 As shown, the deep learning-based power distribution cabinet label and indicator light recognition device mainly includes: Image acquisition module 201 is used to acquire images of the power distribution cabinet; The target detection module 202 is used to perform target detection on the power distribution cabinet image through the improved Yolov8 model, determine the coordinate information of the power distribution cabinet number and the indicator light information. The feature extraction network of the improved Yolov8 model adopts a multi-branch feature extraction structure, and introduces a color perception feature enhancement module and a channel attention SE module. At the same time, the CBS structure in the Yolov8 model is improved to a DSCBS structure. The indicator light information includes the indicator light category. The power distribution cabinet number determination module 203 is used to identify the power distribution cabinet image based on the OCR digital recognition model and the power distribution cabinet number coordinate information if the power distribution cabinet number coordinate information is not empty, and to determine the power distribution cabinet number. The power distribution cabinet status determination module 204 is used to match the power distribution cabinet number and indicator light category based on the power distribution cabinet number coordinate information and indicator light information to determine the power distribution cabinet status.
[0058] As an optional implementation of this embodiment, the target detection module 202 is specifically used to: construct an improved Yolov8 model before performing target detection on the power distribution cabinet image through the improved Yolov8 model and determining the coordinate information of the power distribution cabinet number and the indicator light information; obtain a sample dataset, wherein each sample in the sample dataset includes image data and annotation data; expand the sample dataset based on a preset method to obtain a training dataset; and train the improved Yolov8 model based on the training dataset.
[0059] As an optional implementation of this embodiment, the multi-branch feature extraction structure includes a first feature extraction branch, a second feature extraction branch, and a third feature extraction branch, which are set in parallel. The first feature extraction branch is used to extract the color semantic features of the indicator light, and the input image is a Lab color space image. The second feature extraction branch is used to extract the brightness and luminous state features of the indicator light, and the input image is a V channel image in the HSV color space. The third feature extraction branch is used to extract the structural and contextual features of the indicator light, and the input image is an RGB color space image.
[0060] As an optional implementation of this embodiment, the first feature extraction branch, the second feature extraction branch, and the third feature extraction branch have the same branch structure. Each branch structure includes two cascaded DSCBS structures and a channel attention SE module. The feature maps obtained by the first feature extraction branch, the second feature extraction branch, and the third feature extraction branch are fused by adding them element by element. The fused feature map is then input into the C2f layer of the improved Yolov8 model.
[0061] As an optional implementation of this embodiment, the DSCBS structure sequentially includes a depthwise separable convolutional layer, a batch normalization layer, and a SiLU activation function layer. The depthwise separable convolutional layer includes a depthwise convolutional submodule and a pointwise convolutional submodule. The channel attention (SE) module includes a global average pooling layer, a channel compressed fully connected layer, a ReLU activation function layer, a channel extended fully connected layer, and a Sigmoid activation function layer connected in sequence.
[0062] As an optional implementation of this embodiment, the power distribution cabinet number determination module 203 is specifically used to identify the power distribution cabinet image based on the OCR digital recognition model and the power distribution cabinet number coordinate information to determine the power distribution cabinet number, including: cutting the power distribution cabinet image based on the power distribution cabinet number coordinate information to obtain a digital label image containing the power distribution cabinet number; and identifying the digital label image based on the OCR digital recognition model to obtain the power distribution cabinet number.
[0063] As an optional implementation of this embodiment, the distribution cabinet label coordinate information includes the distribution cabinet label coordinates and the number of distribution cabinet labels, and the indicator light information includes the indicator light position coordinates. The distribution cabinet status determination module 204 is specifically used to match the distribution cabinet label and indicator light category based on the distribution cabinet label coordinate information and the indicator light information to determine the distribution cabinet status, including: determining the indicator light category corresponding to each distribution cabinet label based on the horizontal coordinate in the distribution cabinet label coordinates and the horizontal coordinate in the indicator light position coordinates; determining the distribution cabinet status of each distribution cabinet label based on the preset category status association and the correspondence between the distribution cabinet label and the indicator light category, wherein the preset category status association includes the association between the indicator light category and the distribution cabinet status.
[0064] In one example, the module in any of the above devices may be one or more integrated circuits configured to implement the above methods, such as one or more application-specific integrated circuits (ASICs), or one or more digital signal processors (DSPs), or one or more field-programmable gate arrays (FPGAs), or a combination of at least two of these integrated circuit forms.
[0065] For example, when modules in a device can be implemented via a processing element scheduler, the processing element can be a general-purpose processor, such as a central processing unit (CPU) or other processor capable of calling programs. Alternatively, these modules can be integrated together as a system-on-a-chip (SOC).
[0066] Those skilled in the art will clearly understand that, for the sake of convenience and brevity, the specific working process of the above-described device and module can be referred to the corresponding process in the foregoing method embodiments, and will not be repeated here.
[0067] Figure 3 This is a structural block diagram of an electronic device 300 provided in an embodiment of this application.
[0068] like Figure 3 As shown, the electronic device 300 includes a processor 301 and a memory 302, and may further include one or more of an information input / output (I / O) interface 303, a communication component 304, and a communication bus 305.
[0069] The processor 301 controls the overall operation of the electronic device 300 to complete all or part of the steps of the deep learning-based distribution cabinet label and indicator light identification method described above. The memory 302 stores various types of data to support the operation of the electronic device 300. This data may include, for example, instructions for any application or method operating on the electronic device 300, as well as application-related data. The memory 302 can be implemented by any type of volatile or non-volatile storage device or a combination thereof, such as one or more of Static Random Access Memory (SRAM), Electrically Erasable Programmable Read-Only Memory (EEPROM), Erasable Programmable Read-Only Memory (EPROM), Programmable Read-Only Memory (PROM), Read-Only Memory (ROM), magnetic storage, flash memory, magnetic disk, or optical disk.
[0070] I / O interface 303 provides an interface between processor 301 and other interface modules, such as keyboards, mice, and buttons. These buttons can be virtual or physical. Communication component 304 is used for wired or wireless communication between electronic device 300 and other devices. Wireless communication includes Wi-Fi, Bluetooth, Near Field Communication (NFC), 2G, 3G, or 4G, or a combination thereof. Therefore, the corresponding communication component 304 may include a Wi-Fi component, a Bluetooth component, and an NFC component.
[0071] The electronic device 300 can be implemented by one or more application-specific integrated circuits (ASICs), digital signal processors (DSPs), digital signal processing devices (DSPDs), programmable logic devices (PLDs), field-programmable gate arrays (FPGAs), controllers, microcontrollers, microprocessors, or other electronic components to execute the deep learning-based distribution cabinet label and indicator light recognition method given in the above embodiments.
[0072] The communication bus 305 may include a path for transmitting information between the aforementioned components. The communication bus 305 may be a PCI (Peripheral Component Interconnect) bus or an EISA (Extended Industry Standard Architecture) bus, etc. The communication bus 305 may be divided into an address bus, a data bus, a control bus, etc.
[0073] Electronic device 300 may include, but is not limited to, mobile terminals such as mobile phones, laptops, digital radio receivers, PDAs (personal digital assistants), PADs (tablet computers), PMPs (portable multimedia players), and in-vehicle terminals (such as in-vehicle navigation terminals), as well as fixed terminals such as digital TVs and desktop computers, and may also be servers.
[0074] This application also provides a computer-readable storage medium storing a computer program, which, when executed by a processor, implements the steps of the above-described deep learning-based method for identifying power distribution cabinet labels and indicator lights.
[0075] The computer-readable storage medium may include various media capable of storing program code, such as USB flash drives, portable hard drives, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks.
[0076] The terms “comprising,” “including,” or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such process, method, article, or apparatus.
[0077] The above description is merely a preferred embodiment of this application and an explanation of the technical principles employed. Those skilled in the art should understand that the scope of this application is not limited to technical solutions formed by specific combinations of the above-described technical features, but should also cover other technical solutions formed by arbitrary combinations of the above-described technical features or their equivalents without departing from the foregoing application concept. For example, technical solutions formed by substituting the above features with (but not limited to) technical features with similar functions claimed in this application.
Claims
1. A method for identifying power distribution cabinet labels and indicator lights based on deep learning, characterized in that, include: Acquire images of the power distribution cabinet; The image of the power distribution cabinet is used for target detection through an improved Yolov8 model to determine the coordinates of the cabinet number and indicator light information. The feature extraction network of the improved Yolov8 model adopts a multi-branch feature extraction structure and introduces a color perception feature enhancement module and a channel attention (SE) module. At the same time, the CBS structure in the Yolov8 model is improved to a DSCBS structure. The DSCBS structure includes a depthwise separable convolutional layer, a batch normalization layer, and a SiLU activation function layer. The depthwise separable convolutional layer includes a depthwise convolutional submodule and a pointwise convolutional submodule. The indicator light information includes the indicator light category. The multi-branch feature extraction structure includes a first feature extraction branch, a second feature extraction branch, and a third feature extraction branch, which are set in parallel. The first feature extraction branch is used to extract the color semantic features of the indicator light, and the input image is a Lab color space image. The second feature extraction branch is used to extract the brightness and luminous state features of the indicator light, and the input image is a V channel image in the HSV color space or a Y channel image in the YUV color space. The third feature extraction branch is used to extract the structural and contextual features of the indicator light, and the input image is an RGB color space image. The first feature extraction branch, the second feature extraction branch, and the third feature extraction branch have the same branch structure. Each branch structure includes two cascaded DSCBS structures and a channel attention SE module. The feature maps obtained by the first feature extraction branch, the second feature extraction branch, and the third feature extraction branch are fused by adding them element by element. The fused feature map is then input into the C2f layer of the improved Yolov8 model. If the coordinate information of the power distribution cabinet number is not empty, the power distribution cabinet image is identified based on the OCR digital recognition model and the coordinate information of the power distribution cabinet number to determine the power distribution cabinet number; The distribution cabinet status is determined by matching the distribution cabinet number and the indicator light category based on the distribution cabinet number coordinate information and the indicator light information. The distribution cabinet label coordinate information includes the distribution cabinet label coordinates and the number of distribution cabinet labels. The indicator light information includes the indicator light position coordinates. The process of matching the distribution cabinet label and the indicator light category based on the distribution cabinet label coordinate information and the indicator light information to determine the distribution cabinet status includes: The category of the indicator light corresponding to each distribution cabinet number is determined based on the horizontal coordinate of the distribution cabinet number coordinate and the horizontal coordinate of the indicator light position coordinate; The status of each power distribution cabinet is determined based on a preset category status association and the correspondence between the power distribution cabinet number and the indicator light category. The preset category status association includes the association between the indicator light category and the power distribution cabinet status.
2. The method according to claim 1, characterized in that, Before performing target detection on the power distribution cabinet image using an improved Yolov8 model to determine the power distribution cabinet's coordinate information and indicator light information, the method further includes: Construct the improved Yolov8 model; Obtain a sample dataset, wherein each sample in the sample dataset includes image data and annotation data; The sample dataset is expanded using a preset method to obtain a training dataset; The improved Yolov8 model is trained based on the training dataset.
3. The method according to claim 1, characterized in that, The channel attention (SE) module includes a global average pooling layer, a channel compressed fully connected layer, a ReLU activation function layer, a channel extended fully connected layer, and a Sigmoid activation function layer connected in sequence.
4. The method according to claim 1, characterized in that, The process of recognizing the power distribution cabinet image based on the OCR digital recognition model and the coordinate information of the power distribution cabinet number to determine the power distribution cabinet number includes: The power distribution cabinet image is segmented based on the coordinate information of the power distribution cabinet number to obtain a digital label image containing the power distribution cabinet number; The power distribution cabinet number is obtained by recognizing the digital label image based on the OCR digital recognition model.
5. A deep learning-based device for identifying distribution cabinet labels and indicator lights, characterized in that, For implementing the method of claim 1, comprising: Image acquisition module, used to acquire images of the power distribution cabinet; The target detection module is used to perform target detection on the power distribution cabinet image using an improved Yolov8 model, determining the coordinate information of the power distribution cabinet number and the indicator light information. The feature extraction network of the improved Yolov8 model adopts a multi-branch feature extraction structure and introduces a color perception feature enhancement module and a channel attention SE module. At the same time, the CBS structure in the Yolov8 model is improved to a DSCBS structure. The DSCBS structure includes a depthwise separable convolutional layer, a batch normalization layer, and a SiLU activation function layer. The depthwise separable convolutional layer includes a depthwise convolutional submodule and a pointwise convolutional submodule. The indicator light information includes the indicator light category. The power distribution cabinet number determination module is used to identify the power distribution cabinet image based on the OCR digital recognition model and the power distribution cabinet number coordinate information if the power distribution cabinet number coordinate information is not empty, and to determine the power distribution cabinet number. The power distribution cabinet status module is used to match the power distribution cabinet number and the indicator light category based on the coordinate information of the power distribution cabinet number and the indicator light information to determine the status of the power distribution cabinet.
6. An electronic device, characterized in that, Includes a processor, which is coupled to a memory; The processor is configured to execute a computer program stored in the memory, causing the electronic device to perform the method as described in any one of claims 1 to 4.
7. A computer-readable storage medium, characterized in that, It includes a computer program or instructions that, when run on a computer, cause the computer to perform the method as described in any one of claims 1 to 4.