A method and device for identifying the state of a circuit breaker, a computer device and a storage medium
By performing target segmentation and contact state analysis on the disconnector image, combined with multi-factor feature point recognition, the problem of inaccurate disconnector state judgment was solved, achieving higher accuracy and security.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-11-18
- Publication Date
- 2026-03-31
AI Technical Summary
In existing technologies, the determination of the status of disconnectors is greatly affected by environmental and human factors, resulting in inaccurate judgment results.
By acquiring the image to be detected, target segmentation and knife head detection model analysis are performed. The opening and closing status of the knife switch is determined by combining the reference image and the contact state. The accuracy is improved by using multi-factor feature point recognition.
This improved the accuracy of disconnector status judgment, avoided the influence of human and environmental factors, and ensured construction safety.
Smart Images

Figure CN115719416B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of switch detection technology, and in particular to a method, apparatus, computer equipment, and storage medium for identifying the status of a disconnector. Background Technology
[0002] A disconnector is a manually controlled electrical equipment switch that creates a disconnect point between equipment under maintenance and energized equipment, ensuring the safety of maintenance personnel. During actual construction, personnel need to accurately determine the open / closed state of the disconnector to ensure construction safety.
[0003] Currently, the opening and closing status of the disconnectors is mainly determined by manually observing the data measured by the corresponding sensors. However, due to the complex background and nonlinear changes in lighting in outdoor substations, the judgment results of the opening and closing status of the disconnectors are greatly affected by environmental and human factors, making it difficult to guarantee the accuracy of the judgment results. Summary of the Invention
[0004] Therefore, it is necessary to provide a method, device, computer equipment, storage medium, and computer program product for identifying disconnector status that can improve the accuracy of disconnector status judgment results, in order to address the above-mentioned technical problems.
[0005] In a first aspect, this application provides a method for identifying the status of a disconnect switch, the method comprising:
[0006] Acquire the image to be detected;
[0007] The image to be detected is segmented to obtain the target region, wherein the image to be detected includes a knife switch image;
[0008] The candidate open / closed state of the switch in the image to be detected is determined based on the reference image and the target region, wherein the switch in the reference image is in the closed state;
[0009] The contact state between the blades of the gate in the target area is obtained based on the trained blade detection model;
[0010] The opening and closing state of the disconnector is determined based on the contact state and the candidate opening and closing state.
[0011] In one embodiment, determining the candidate open / closed state of the switch in the image to be detected based on the reference image and the target region includes:
[0012] The baseline in the image to be detected is determined based on the baseline in the reference image, wherein the straight line containing the knife switch arm in the reference image is the baseline in the reference image;
[0013] Determine the edge line of the knife switch arm in the target area;
[0014] The candidate separation / merging state is determined based on the angle between the edge line and the baseline in the image to be detected.
[0015] In one embodiment, the target segmentation of the image to be detected includes:
[0016] The image to be detected is segmented according to the trained first image segmentation model to obtain the first candidate region;
[0017] The image to be detected is segmented according to a preset second image segmentation model to obtain a second candidate region;
[0018] The first candidate region and the second candidate region are fused together to obtain a third candidate region;
[0019] Target segmentation is performed based on the third candidate region to obtain the target region.
[0020] In one embodiment, the step of segmenting the image to be detected according to a preset second image segmentation model includes:
[0021] Perform YUV color space conversion on the image to be detected;
[0022] The YUV channels are separated, and the Y channel image is clustered based on an unsupervised clustering algorithm to separate the first region;
[0023] The first region is binarized to segment out the second region;
[0024] The second region is repaired and separated to obtain the second candidate region.
[0025] In one embodiment, the target segmentation of the image to be detected includes:
[0026] Target detection is performed on the image to be detected based on the trained target detection model;
[0027] The image to be detected is segmented based on the detection results of the target detection.
[0028] In one embodiment, the target detection model is a deep learning model based on an improved YOLOx algorithm. The target detection model includes a basic feature extraction network based on an improved CSPDarknet, a feature fusion network based on an improved PAFPN, and a detection head based on an improved YOLOx dynamic head.
[0029] Secondly, this application also provides a disconnect switch status identification device. The disconnect switch status identification device includes:
[0030] The acquisition module is used to acquire the image to be detected;
[0031] A segmentation module is used to perform target segmentation on the image to be detected in order to obtain a target region, wherein the image to be detected includes a knife switch image;
[0032] The state determination module is used to determine the opening and closing state of the knife switch in the image to be detected based on the reference image and the target area, wherein the knife switch in the reference image is in the closed state.
[0033] Thirdly, this application also provides a computer device. The computer device includes a memory and a processor, the memory storing a computer program, and the processor executing the computer program to perform the following steps:
[0034] Acquire the image to be detected;
[0035] The image to be detected is segmented to obtain the target region, wherein the image to be detected includes a knife switch image;
[0036] The candidate open / closed state of the switch in the image to be detected is determined based on the reference image and the target region, wherein the switch in the reference image is in the closed state;
[0037] The contact state between the blades of the gate in the target area is obtained based on the trained blade detection model;
[0038] The opening and closing state of the disconnector is determined based on the contact state and the candidate opening and closing state.
[0039] Fourthly, this application also provides a computer-readable storage medium. The computer-readable storage medium stores a computer program thereon, which, when executed by a processor, performs the following steps:
[0040] Acquire the image to be detected;
[0041] The image to be detected is segmented to obtain the target region, wherein the image to be detected includes a knife switch image;
[0042] The candidate open / closed state of the switch in the image to be detected is determined based on the reference image and the target region, wherein the switch in the reference image is in the closed state;
[0043] The contact state between the blades of the gate in the target area is obtained based on the trained blade detection model;
[0044] The opening and closing state of the disconnector is determined based on the contact state and the candidate opening and closing state.
[0045] The aforementioned disconnector status recognition method, device, computer equipment, and storage medium segment the image to be detected, dividing it into different parts of the disconnector. Based on the reference image and the target area, candidate disconnection / opening states of the disconnector in the image to be detected are determined. Based on a trained disconnector detection model, the contact state between the disconnector heads in the target area is obtained. The disconnection / opening state of the disconnector is automatically determined by combining the candidate disconnection / opening states and the contact state, thereby improving the accuracy of the determination results, avoiding the influence of human factors, and avoiding misjudgments caused by environmental factors. Attached Figure Description
[0046] Figure 1 This is an application environment diagram of the disconnector status recognition method in one embodiment;
[0047] Figure 2 This is a flowchart illustrating a disconnector status identification method in one embodiment;
[0048] Figure 3 This is a flowchart illustrating the process of determining the state of a disconnector in one example.
[0049] Figure 4 This is a flowchart illustrating the steps of determining the candidate open / closed state of a disconnector in the image to be detected based on a reference image and the target region in one embodiment.
[0050] Figure 5 This is a flowchart illustrating the steps of image segmentation of the image to be detected according to a preset second image segmentation model in one embodiment;
[0051] Figure 6 This is a diagram of the overall detection network structure based on the target detection model in one embodiment;
[0052] Figure 7 This is a schematic diagram of a feature extraction network based on an improved CSPDarknet in one embodiment;
[0053] Figure 8 This is a schematic diagram of a convolutional structure component based on a feature extraction network in one embodiment;
[0054] Figure 9 This is a schematic diagram of a fast cascaded pooling structure SPPF in one embodiment;
[0055] Figure 10 This is a schematic diagram of a feature fusion network based on PAFPN improvement in one embodiment;
[0056] Figure 11This is a schematic diagram of a YOLOx detection network head based on Dyhead improvement in one embodiment;
[0057] Figure 12 This is a structural block diagram of a disconnector status identification device in one embodiment;
[0058] Figure 13 This is an internal structural diagram of a computer device in one embodiment. Detailed Implementation
[0059] To make the objectives, technical solutions, and advantages of this application clearer, the following detailed description is provided in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative and not intended to limit the scope of this application.
[0060] The disconnector status identification method provided in this application embodiment can be applied to, for example, Figure 1 In the application environment shown, the image sensor 102 communicates with the processing terminal 104 via a network. The image sensor 102 transmits the image to be detected to the processing terminal 104, and the processing terminal 104 determines the state of the switch based on the image. The processing terminal 102 can be, but is not limited to, various personal computers, laptops, smartphones, tablets, IoT devices, and portable wearable devices. IoT devices can include smart speakers, smart TVs, smart air conditioners, smart vehicle devices, etc. Portable wearable devices can include smartwatches, smart bracelets, head-mounted devices, etc.
[0061] In one embodiment, such as Figure 2 As shown, a method for identifying the status of a disconnect switch is provided, which can be applied to... Figure 1 Taking the processing terminal in the example, the following steps are included:
[0062] S201: Acquire the image to be detected.
[0063] The image to be detected can be an image sent from an image sensor to a processing terminal.
[0064] S202: Perform target segmentation on the image to be detected to obtain the target region, wherein the image to be detected includes a knife switch image.
[0065] Specifically, target segmentation can be the segmentation of the knife switch region and the non-knife switch region to obtain the knife switch region; further, it can also be the segmentation of each part of the knife switch to obtain the image region corresponding to each part of the knife switch.
[0066] S203: Determine the candidate open / closed state of the switch in the image to be detected based on the reference image and the target region, wherein the switch in the reference image is in a closed state.
[0067] It is understandable that since the switch in the reference image is in a closed state, by comparing the reference image and the target area, the state difference between the switch in the image to be detected and the switch in the reference image can be determined. Based on the state difference of the switch, the state of the switch in the image to be detected, i.e. the candidate open / closed state of the switch, can be determined.
[0068] S204: Obtain the contact state between the blades of the knife gate in the target area based on the trained blade detection model.
[0069] It is understood that a disconnector consists of multiple disconnector arms. The open / closed state of the disconnector is changed by altering the relative states of these arms. When the disconnector is closed or open, the contact states of the disconnector's blades differ, meaning the contact states of the ends of the disconnector arms are different. By analyzing the target area or the image to be detected using a trained blade detection model, the contact states between the blades in the target area can be determined. Furthermore, the contact states between the blades can be used to assist in determining the open / closed state of the disconnector.
[0070] S205: Determine the opening / closing state of the disconnector based on the contact state and the candidate opening / closing state.
[0071] It is understandable that when the switch is in the closed state, the contact state between the cutter heads should correspond to the closed state, and the candidate open / closed state should be the closed state. Only when both conditions are met can it be determined that the switch is in the closed state. Determining the open / closed state of the switch by the contact state and the candidate open / closed state can further improve the accuracy of the judgment result.
[0072] In one example, the process of determining the state of the disconnector can be as follows: Figure 3 As shown, after acquiring the image to be detected, target segmentation is performed on the image to obtain the target region. The presence of a cutter head and a cutter arm within the target region is detected. When both a cutter head and a cutter gate are present, the contact state and candidate separation / closing state between the cutter heads are determined. If the cutter heads are in contact and the candidate separation / closing state is closed, the cutter gate is determined to be in a closed state. If only one of a cutter head or a cutter gate exists in the target region, the determination is based on the location of its presence. For example, if only a cutter head exists, the cutter gate is determined to be in a closed state if the cutter heads are in contact; otherwise, the cutter gate is determined to be in an open state. If only a cutter arm exists, the cutter gate is determined to be in a closed state if the candidate separation / closing state is closed, and in an open state if the candidate separation / closing state is open. If neither a cutter head nor a cutter gate exists in the target region, the image to be detected is reacquired.
[0073] The above-mentioned disconnector status recognition method performs target segmentation on the image to be detected, segments out different parts of the disconnector, determines the candidate open / closed states of the disconnector in the image to be detected based on the reference image and the target region, and obtains the contact state between the disconnector heads in the target region based on the trained disconnector head detection model. The disconnector status is automatically determined by combining the candidate open / closed states and the contact state, which improves the accuracy of the judgment result, avoids the influence of human factors, and avoids misjudgment caused by environmental factors.
[0074] In one embodiment, such as Figure 4 As shown, determining the candidate open / closed state of the switch in the image to be detected based on the reference image and the target region includes:
[0075] S401: Determine the baseline in the image to be detected based on the baseline in the reference image, wherein the straight line where the knife switch arm is located in the reference image is the baseline in the reference image.
[0076] Since the disconnector is in a closed state in the reference image, the disconnector arms can be considered to be on the same straight line. Therefore, a baseline can be determined based on the straight line where the disconnector arms are located.
[0077] S402: Determine the edge line of the knife switch arm in the target area;
[0078] In this process, after segmenting the target region in the image to be detected, an edge detection algorithm, such as the linesegment detector (LSD) algorithm, can be used to obtain the edge line of the knife switch arm in the target region.
[0079] S403: Determine the candidate opening / closing state based on the angle between the edge line and the baseline in the image to be detected.
[0080] In the application, the straight line containing the disconnector arm is used as the baseline, and its position is determined in the reference image. In the image to be detected, the position of the baseline can be obtained through image registration between the image to be detected and the reference image. After segmenting the target region in the image to be detected, an edge detection algorithm, such as a line segment detector (LSD), can be used to obtain the edge line of the disconnector arm. It can be understood that when the disconnector is in the closed state, the edge line of the disconnector arm should approximately coincide with the baseline, and the angle between the edge line of the disconnector arm and the baseline should be small; while when the disconnector is in the open state, the angle between the edge line of the disconnector arm and the baseline should be large. Therefore, the candidate open / closed state of the disconnector can be determined based on the angle between the edge line of the disconnector arm and the baseline.
[0081] Specifically, the angle between the edge line of each disconnector arm and the baseline can be obtained, and the maximum value among these angles can be used to determine the disconnector state. Furthermore, a first angle range corresponding to the disconnector's closed state, a second angle range corresponding to the disconnector's partially closed state, and a third angle range corresponding to the disconnector's open state can be preset. The disconnector state is determined based on the angle range to which the maximum value belongs. For example, if the maximum value belongs to the first angle range, then the candidate open / closed state of the disconnector can be determined as the closed state.
[0082] Taking a split-type disconnector as an example, the angle between the baseline A and the edge line B of the first disconnector arm is α, and the angle between the straight line A and the edge line C of the second disconnector arm is β. The larger of the two angles is used to determine the disconnector state: θ = max(α, β). A disconnector state with an angle θ < 3° is determined to be closed; a disconnector state with an angle θ ≥ 3° and θ < 15° is determined to be partially closed; and a disconnector state with an angle θ > 15° between the left and right disconnector arms is determined to be open.
[0083] In this embodiment, the detected feature points are the blade head and the switch arms. The contact state of the blade head is determined based on the feature points detected on the blade head, and the edge lines are determined based on each switch arm. The candidate opening / closing state is determined based on the angle between the edge lines and the baseline in the image to be detected. Therefore, the opening / closing state of the switch can be accurately determined based on the contact state and the candidate opening / closing state. Previous single-factor switch identification devices and algorithms are easily affected by interference in their criteria and judgment points. This application, however, uses a multi-factor switch status detection method, which can extract multiple feature points of the switch and perform device detection based on these multiple feature points, greatly increasing the success rate and accuracy of remote switch status recognition.
[0084] In one embodiment, the target segmentation of the image to be detected includes: segmenting the image to be detected according to a trained first image segmentation model to obtain a first candidate region; segmenting the image to be detected according to a preset second image segmentation model to obtain a second candidate region; fusing the first candidate region and the second candidate region to obtain a third candidate region; and segmenting the target region according to the third candidate region to obtain a target region.
[0085] The first image segmentation model can be a deep learning-based image semantic segmentation model; the second image segmentation model can be a non-deep learning model that segments the image based on low-level features such as color and texture, such as image color difference methods or segmentation methods based on YUV channel separation. Candidate regions can be the switch region, and target regions can be the regions corresponding to different parts of the switch.
[0086] For example, the first image segmentation model can be a deep learning model built on the Mask R-CNN algorithm. Mask R-CNN is a deep learning image segmentation network proposed based on the previous Faster R-CNN architecture. This method achieves high-quality semantic segmentation while completing the object detection task. Its main idea is to extend the original Faster R-CNN by adding a branch for object segmentation. At the same time, this network structure is relatively easy to implement and train, has a fast speed, and strong generalization ability. Taking the Mask R-CNN image segmentation algorithm as an example, the segmentation process of each component of the switch is as follows:
[0087] First, a large number of knife switch images are collected and the knife switch masks are labeled. Then, a first image segmentation model is trained based on the Mask R-CNN algorithm. Finally, the image to be detected is input into the first image segmentation model, and the RPN network is used to extract the first candidate region.
[0088] After obtaining the first and second candidate regions, the first and second candidate regions are merged to obtain the third candidate region. Then, the features of the third candidate region are extracted through the Roi Align operation to complete the tasks of target classification, target localization and target segmentation.
[0089] In this embodiment, the image to be detected is segmented by a first image segmentation model to obtain a first candidate region, and the image to be detected is segmented by a second image segmentation model to obtain a second candidate region. Then, the first candidate region and the second candidate region are fused to obtain a third candidate region, thereby improving the accuracy of the obtained candidate regions and thus helping to improve the accuracy of the obtained target regions.
[0090] In one embodiment, such as Figure 5 As shown, the step of segmenting the image to be detected according to the preset second image segmentation model includes:
[0091] S501: Perform YUV color space conversion on the image to be detected.
[0092] Specifically, since the image to be tested is generally an RGB image, the image to be tested is first converted to YUV color space.
[0093] RGB color space: R, G, and B represent the red, green, and blue light emitted by the screen from three different intensities of electron beams. This color space representation method is called RGB color space.
[0094] YUV color space: Y, U, and V represent the luminance, chrominance, and saturation signals, respectively, where Y is separate from U and V. If only the Y signal component exists without the U and V signal components, the image is a grayscale image. If the Y signal component is combined with the U and V signal components, the image is a color image. Therefore, the YUV color space is used to solve the compatibility problem between color and black-and-white televisions using the luminance signal Y, allowing black-and-white televisions to receive color television signals. The formula for converting RGB color space to YUV color space is:
[0095]
[0096] The formula for converting YUV color space to RGB color space is:
[0097]
[0098] S502: Separate the YUV channels, cluster the Y channel image based on an unsupervised clustering algorithm, and separate the first region.
[0099] Unsupervised clustering algorithms can automatically learn pixel clusters that conform to certain rules based on image information (grayscale values), thus achieving automatic target segmentation. Unsupervised clustering algorithms include K-Means, AP clustering, mean shift, hierarchical clustering, DBSCAN, BRICH, spectral clustering, and Gaussian mixture clustering. This embodiment uses K-Means clustering, as background areas and pillar areas are generally more distinct from other areas, making it easier to obtain cluster centers using K-Means.
[0100] The specific formula for the K-Means clustering method is as follows:
[0101]
[0102] Where SSE is the cost function, representing the sum of squared errors of each sample from its cluster center, k represents the number of clusters, x represents the number of samples, and C i This represents the cluster center of the i-th cluster.
[0103] S503: Perform binarization on the first region to segment out the second region.
[0104] To separate the region of interest from the background and simplify and accelerate subsequent processing, this paper employs a binarization algorithm to separate the switch, wires, and irrelevant background. Commonly used binarization algorithms include gray-scale averaging, percentage thresholding, iterative optimal thresholding, Otsu's method, maximum entropy method, and torque preservation method. Given that the pixel values of the switch and wires are similar, while the switch and wires differ significantly from the irrelevant background, this paper chooses the simpler gray-scale averaging method, which can quickly separate the switch and wires from the irrelevant background. The specific formula for the gray-scale averaging method is as follows:
[0105]
[0106] in,
[0107]
[0108] g(x,y) represents the pixel value at point (x,y) in the binarized image, f(x,y) represents the pixel value at point (x,y) in the grayscale image, m and n represent the width and height of the grayscale image, and T represents the average value of the image, which is also the threshold for image binarization.
[0109] S504: Repair and cut off the second region to obtain the second candidate region.
[0110] For example, the specific process can be as follows: After converting the image to be detected to YUV color space, the YUV channels are separated, and the Y channel is selected for unsupervised clustering. Next, the clustering results are binarized to separate targets such as the switch, pillar, and wire from the background, and the pillar is separated from other parts. Then, morphological closing operations are used to fill small cracks in the connected regions of the binary image, morphological erosion operators are used to break the connections between the wire and the switch or pillar, and a small object removal algorithm is used to remove smaller areas of the wire. Then, a morphological dilation operator is used to restore the edge regions of the switch and pillar (or the edge regions of the pillar are restored using a morphological dilation operator). Finally, a region filling algorithm is used to fill larger areas within the switch and pillar regions (or a region filling algorithm is used to fill larger areas within the pillar region). Finally, the difference and intersection of the binary images of the switch and pillar are used to obtain the segmented switch region (i.e., the second candidate region) and pillar region, respectively.
[0111] Morphological algorithms, as an important image processing technique, use structural elements of a certain shape to extract the shape structure in an image, thereby achieving the purpose of image analysis and recognition. Commonly used operators in morphological algorithms include erosion, dilation, opening, closing, hole filling, and removal of small objects. This paper uses binary images for morphological processing to obtain the segmented knife gate body. The specific formula is as follows:
[0112] A. Erosion operation: The operator is... Image A (i.e., the second region) is eroded using structuring element B, defined as follows:
[0113]
[0114] B. Dilation operation: The operator is... Dilate image A using structuring element B, defined as follows:
[0115]
[0116] In the above formula, The set B is symmetric to the set B about the origin.
[0117] C. Opening operation: The operator is... Using struct element B to perform an opening operation on image A, defined as follows:
[0118]
[0119] D. Closing Operation: The operator is "·", and the image A is closed using the struct element B, defined as follows:
[0120]
[0121] E. Hole Fill: The function "imfill" fills holes in an image, defined as...
[0122] A * =imfill(A)
[0123] In the above formula, image A is labeled with connected components and its boundary closed regions are filled to obtain the result image A. * .
[0124] F. Remove Small Objects: The function "bwareaopen" removes small objects from the image, defined as follows.
[0125] A * =bwareaopen(A,N)
[0126] In the above formula, the number of pixels in the connected components of image A is counted, and connected components with a count less than N are removed to obtain image A. * .
[0127] In one embodiment, the target segmentation of the image to be detected includes: performing target detection on the image to be detected based on a trained target detection model; and performing target segmentation on the image to be detected based on the detection results.
[0128] Among them, the object detection model can be built based on a two-stage detector, such as Fast-RCNN, Libra R-CNN, Faster-RCNN, Cascade-RCNN, etc., or it can be built based on a one-stage detector, such as RetinaNet, SSD, YOLO and its improved series.
[0129] In one embodiment, the object detection model is a deep learning model based on an improved YOLOx algorithm. The object detection model includes a basic feature extraction network based on an improved CSPDarknet, a feature fusion network based on an improved PAFPN, and a detection head based on an improved YOLOx dynamic head.
[0130] Specifically, the first part, the basic feature extraction network, is used to extract feature information from the input image. CSPDarknet introduces the "CSPnet" network structure by fusing depthwise separable convolutions, improving upon the original YOLO Darknet feature extraction network. This project further improves upon the CSPDarknet network, and the specific structure of the improved feature extraction network is as follows: Figure 7 As shown.
[0131] like Figure 6 and Figure 7 As shown, the improved feature extraction network mainly consists of a "Conv stem" image input convolutional network layer and four structurally similar convolutional stages (Darkn, n = 2, 3, 4, 5). For the network input "Conv stem" layer, this project uses a simple convolutional network structure (such as...). Figure 8 (1) shows that the original YOLOX focus stem layer is replaced, avoiding the space-to-depth operation of the focus stem layer, reducing the network's FLOPs (floating point operations) and complexity; Figure 7 As shown, in the "Downsampling Layer" of each Darkn, a convolutional layer with a kernel size of 2×2 and a stride of 2 is directly used to downsample the output features of the previous Darkn. In the "CspConvNeXt Layer" of each Darkn, a ConvNeXt Block (such as...) is used. Figure 8 As shown in (2), the residual structure redesigned a new CSPnet network layer. The new "CspConvNeXt Layer" network structure is as follows: Figure 8 As shown in (3) of the text.
[0132] like Figure 8 As shown, (1) the Conv stem layer consists of a convolutional layer with a kernel size of 6×6 and a stride of s=2, which transforms the input image of H×W×3 into a feature layer of H / 2×W / 2×64. Then, Layer Norm and GELU activation functions are used to normalize and nonlinearly map the output feature layer of this convolution. (2) The ConvNeXt Block structure is the core structure embedded in the CspConvNeXt Layer. The ConvNeXt Block consists of an anti-bottleneck residual structure composed of a convolutional layer with a kernel size of 7×7 and two convolutional layers with a kernel size of 1×1. For the feature layer with an input of H×W×C, a 1×1 convolution is first used to increase the number of channels to 4 times the original number, i.e., H×W×4C. Finally, a 1×1 convolution is used to reduce the number of channels to the same number C as the input feature layer. This allows information to avoid information loss caused by compressing the channel dimension when transforming information in different channel feature spaces. (3) The core structure of CspConvNeXt Layer is composed of N ConvNeXt Block residual structure blocks stacked together. For the feature layer input to the backbone network, there are two parts of the network: one part is composed of N ConvNeXt Block residual structure blocks stacked together; the other part can be regarded as a large residual edge. The output features of the large residual edge are directly spliced with the output features of the other part in the channel dimension. Finally, the output is adjusted and normalized by a 1×1 convolutional layer.
[0133] In the final stage (Dark5) of the feature extraction network, a fast cascaded spatial pooling structure (SPPF) with fewer FLOPs is employed. The network structure is as follows: Figure 9 As shown.
[0134] like Figure 9 As shown, SPPF mainly consists of three cascaded max-pooling layers with the same pooling kernel size. Max pooling is used for feature extraction, improving the network's receptive range. Compared to the spatial pooling structure SPP used in the original YOLOvx, experiments show that SPPF achieves faster speed while maintaining the same detection accuracy.
[0135] like Figure 7As shown, an H×W×3 inspection image is input. After passing through a Conv stem layer, the spatial scale is halved, and the number of image channels becomes 64. That is, the original image is transformed into an H / 2×W / 2×64 feature layer, which serves as the input to "Dark2". The number of channels in the output feature layer of "Dark2" can be set to any number C. Then, for each "Dark" layer, the spatial scale is halved, and the feature channel dimension C doubles. Finally, after feature extraction by the base network, the output features of "Dark3", "Dark4", and "Dark5" can be used as the input to the second part of the feature fusion network.
[0136] The second part is a feature fusion network based on PAFPN, used to fuse feature information from feature layers at different scales to improve target detection and recognition performance at different scales. For example... Figure 10 As shown, PAFPN connects a bottom-up path augmentation pyramid network to the output of the top-down feature pyramid network FPN. However, in both FPN and PAFPN, feature fusion occurs between feature layers of different scales across layers. For example, the output feature layer of P5 is directly fused with the upsampled output of the feature layer of N4, and the output feature layer of N3 is directly fused with the output feature layer of P4 after upsampling. This direct fusion of feature layers across layers does not fully utilize the information from features at different scales. Figure 10 As shown, the feature fusion network based on PAPPN adds a "Self-processing Layer" to the output of the feature layers (P5, P4, P3) of different scales of FPN. The "Self-processing Layer" is composed of N cascaded ConvNeXt Block residual structures, which perform self-processing on the output feature layers (P5, P4, P3) of each FPN to achieve deep information fusion.
[0137] The third part is the network's classification and localization detection head. Typical one-stage object detection networks stack multiple ordinary convolutional layers directly after the output of the FPN feature fusion network. Then, a regression convolutional sub-network and a classification convolutional sub-network are connected after each convolutional layer. During training, these are used to calculate the regression loss for bounding box localization and the classification loss for the object category, respectively. During detection, they are used to detect the localization of the bounding box and the classification of the object. This project reintroduces a dynamic network detection head framework, Dyhead, into the improved YOLOv object detection network. It introduces attention mechanisms between feature layers, at the spatial location of feature layers, and within feature channels to achieve scale awareness, spatial location awareness, and task awareness for object detection tasks, respectively. Figure 11As shown, the three perception modules can be stacked to form a "Dyhead Block," which can then be cascaded multiple times to construct the regression and classification branches of the detection network head. The detection network head based on Dyhead significantly improves the representation capability of the target detection head without increasing computational cost.
[0138] It should be understood that although the steps in the flowcharts of the embodiments described above are shown sequentially according to the arrows, these steps are not necessarily executed in the order indicated by the arrows. Unless explicitly stated herein, there is no strict order restriction on the execution of these steps, and they can be executed in other orders. Moreover, at least some steps in the flowcharts of the embodiments described above may include multiple steps or multiple stages. These steps or stages are not necessarily completed at the same time, but can be executed at different times. The execution order of these steps or stages is not necessarily sequential, but can be performed alternately or in turn with other steps or at least some of the steps or stages of other steps.
[0139] Based on the same inventive concept, this application also provides a disconnector status identification device for implementing the disconnector status identification method described above. The solution provided by this device is similar to the implementation described in the above method; therefore, the specific limitations in one or more disconnector status identification device embodiments provided below can be found in the limitations of the disconnector status identification method described above, and will not be repeated here.
[0140] In one embodiment, such as Figure 12 As shown, a disconnector status identification device 120 is provided, including: an acquisition module 1201, a segmentation module 1202, and a status determination module 1203, wherein:
[0141] The acquisition module 1201 is used to acquire the image to be detected;
[0142] The segmentation module 1202 is used to perform target segmentation on the image to be detected in order to obtain the target region, wherein the image to be detected includes a knife switch image;
[0143] The state determination module 1203 is used to determine the opening and closing state of the knife switch in the image to be detected based on the reference image and the target area, wherein the knife switch in the reference image is in a closed state.
[0144] In one embodiment, the state determination module 1203 includes: a first determination unit, a second determination unit, and a third determination unit; the first determination unit is used to determine the baseline in the image to be detected based on the baseline in the reference image, wherein the straight line where the switch arm is located in the reference image is the baseline in the reference image; the second determination unit is used to determine the edge line of the switch arm in the target area; the third determination unit is used to determine the candidate separation / combination state based on the angle between the edge line and the baseline in the image to be detected.
[0145] In one embodiment, the segmentation module 1202 includes: a first segmentation unit, a second segmentation unit, a fusion unit, and a first target segmentation unit; the first segmentation unit is used to perform image segmentation on the image to be detected according to a trained first image segmentation model to obtain a first candidate region; the second segmentation unit is used to perform image segmentation on the image to be detected according to a preset second image segmentation model to obtain a second candidate region; the fusion unit is used to perform fusion processing on the first candidate region and the second candidate region to obtain a third candidate region; and the target segmentation unit is used to perform target segmentation based on the third candidate region to obtain a target region.
[0146] In one embodiment, the second segmentation unit is further configured to perform YUV color space conversion on the image to be detected; separate each YUV channel, cluster the image of the Y channel based on an unsupervised clustering algorithm, and separate a first region; perform binarization processing on the first region to segment a second region; and perform repair and segmentation processing on the second region to obtain a second candidate region.
[0147] In one embodiment, the segmentation module 1202 includes: a target detection unit and a second target segmentation unit. The target detection unit performs target detection on the image to be detected based on a trained target detection model; the second target segmentation unit performs target segmentation on the image to be detected based on the detection results of the target detection.
[0148] Each module in the aforementioned disconnector status identification device 120 can be implemented entirely or partially through software, hardware, or a combination thereof. These modules can be embedded in or independent of the processor in a computer device, or stored in the memory of a computer device as software, so that the processor can call and execute the corresponding operations of each module.
[0149] In one embodiment, a computer device is provided, which may be a terminal, and its internal structure diagram may be as follows: Figure 13As shown, the computer device includes a processor, memory, input / output interface, communication interface, display unit, and input device. The processor, memory, and input / output interface are connected via a system bus, and the communication interface, display unit, and input device are also connected to the system bus via the input / output interface. The processor provides computing and control capabilities. The memory includes non-volatile storage media and internal memory. The non-volatile storage media stores the operating system and computer programs. The internal memory provides an environment for the operation of the operating system and computer programs stored in the non-volatile storage media. The input / output interface is used for exchanging information between the processor and external devices. The communication interface is used for wired or wireless communication with external terminals; wireless communication can be achieved through Wi-Fi, mobile cellular networks, NFC (Near Field Communication), or other technologies. When executed by the processor, the computer program implements a method for identifying the status of a switch. The display unit is used to form a visually visible image and can be a display screen, projection device, or virtual reality imaging device. The display screen can be an LCD screen or an e-ink screen. The input device of the computer device can be a touch layer covering the display screen, or buttons, trackballs, or touchpads set on the casing of the computer device, or external keyboards, touchpads, or mice, etc.
[0150] Those skilled in the art will understand that Figure 13 The structure shown is merely a block diagram of a portion of the structure related to the present application and does not constitute a limitation on the computer device to which the present application is applied. Specific computer devices may include more or fewer components than those shown in the figure, or combine certain components, or have different component arrangements.
[0151] In one embodiment, a computer device is provided, including a memory and a processor, wherein the memory stores a computer program, and the processor executes the computer program to perform the following steps:
[0152] Acquire the image to be detected;
[0153] The image to be detected is segmented to obtain the target region, wherein the image to be detected includes a knife switch image;
[0154] The candidate open / closed state of the switch in the image to be detected is determined based on the reference image and the target region, wherein the switch in the reference image is in the closed state;
[0155] The contact state between the blades of the gate in the target area is obtained based on the trained blade detection model;
[0156] The opening and closing state of the disconnector is determined based on the contact state and the candidate opening and closing state.
[0157] In one embodiment, when the processor executes the computer program, it further performs the following steps: determining a baseline in the image to be detected based on a baseline in the reference image, wherein the straight line where the switch arm is located in the reference image is the baseline in the reference image; determining the edge line of the switch arm in the target region; and determining the candidate separation / combination state based on the angle between the edge line and the baseline in the image to be detected.
[0158] In one embodiment, when the processor executes the computer program, it further performs the following steps: performing image segmentation on the image to be detected according to a trained first image segmentation model to obtain a first candidate region; performing image segmentation on the image to be detected according to a preset second image segmentation model to obtain a second candidate region; performing fusion processing on the first candidate region and the second candidate region to obtain a third candidate region; and performing target segmentation based on the third candidate region to obtain a target region.
[0159] In one embodiment, when the processor executes the computer program, it further performs the following steps: performing YUV color space conversion on the image to be detected; separating each YUV channel, clustering the image of the Y channel based on an unsupervised clustering algorithm, and separating out a first region; performing binarization processing on the first region to segment out a second region; and performing repair and segmentation processing on the second region to obtain a second candidate region.
[0160] In one embodiment, when the processor executes the computer program, it further performs the following steps: performing target detection on the image to be detected based on a trained target detection model; and performing target segmentation on the image to be detected based on the detection results.
[0161] In one embodiment, a computer-readable storage medium is provided having a computer program stored thereon, the computer program performing the following steps when executed by a processor:
[0162] Acquire the image to be detected;
[0163] The image to be detected is segmented to obtain the target region, wherein the image to be detected includes a knife switch image;
[0164] The candidate open / closed state of the switch in the image to be detected is determined based on the reference image and the target region, wherein the switch in the reference image is in the closed state;
[0165] The contact state between the blades of the gate in the target area is obtained based on the trained blade detection model;
[0166] The opening and closing state of the disconnector is determined based on the contact state and the candidate opening and closing state.
[0167] In one embodiment, when the computer program is executed by a processor, it further performs the following steps: determining a baseline in the image to be detected based on a baseline in the reference image, wherein the straight line where the switch arm is located in the reference image is the baseline in the reference image; determining the edge line of the switch arm in the target region; and determining the candidate separation / combination state based on the angle between the edge line and the baseline in the image to be detected.
[0168] In one embodiment, when the computer program is executed by a processor, it further performs the following steps: performing image segmentation on the image to be detected according to a trained first image segmentation model to obtain a first candidate region; performing image segmentation on the image to be detected according to a preset second image segmentation model to obtain a second candidate region; performing fusion processing on the first candidate region and the second candidate region to obtain a third candidate region; and performing target segmentation based on the third candidate region to obtain a target region.
[0169] In one embodiment, when the computer program is executed by the processor, it further performs the following steps: performing YUV color space conversion on the image to be detected; separating each YUV channel, clustering the image of the Y channel based on an unsupervised clustering algorithm to separate a first region; performing binarization processing on the first region to segment a second region; and performing repair and segmentation processing on the second region to obtain a second candidate region.
[0170] In one embodiment, when the computer program is executed by a processor, it further performs the following steps: performing target detection on the image to be detected based on a trained target detection model; and performing target segmentation on the image to be detected based on the target detection results.
[0171] In one embodiment, a computer program product is provided, including a computer program that, when executed by a processor, performs the following steps:
[0172] Acquire the image to be detected;
[0173] The image to be detected is segmented to obtain the target region, wherein the image to be detected includes a knife switch image;
[0174] The candidate open / closed state of the switch in the image to be detected is determined based on the reference image and the target region, wherein the switch in the reference image is in the closed state;
[0175] The contact state between the blades of the gate in the target area is obtained based on the trained blade detection model;
[0176] The opening and closing state of the disconnector is determined based on the contact state and the candidate opening and closing state.
[0177] In one embodiment, when the computer program is executed by a processor, it further performs the following steps: determining a baseline in the image to be detected based on a baseline in the reference image, wherein the straight line where the switch arm is located in the reference image is the baseline in the reference image; determining the edge line of the switch arm in the target region; and determining the candidate separation / combination state based on the angle between the edge line and the baseline in the image to be detected.
[0178] In one embodiment, when the computer program is executed by a processor, it further performs the following steps: performing image segmentation on the image to be detected according to a trained first image segmentation model to obtain a first candidate region; performing image segmentation on the image to be detected according to a preset second image segmentation model to obtain a second candidate region; performing fusion processing on the first candidate region and the second candidate region to obtain a third candidate region; and performing target segmentation based on the third candidate region to obtain a target region.
[0179] In one embodiment, when the computer program is executed by the processor, it further performs the following steps: performing YUV color space conversion on the image to be detected; separating each YUV channel, clustering the image of the Y channel based on an unsupervised clustering algorithm to separate a first region; performing binarization processing on the first region to segment a second region; and performing repair and segmentation processing on the second region to obtain a second candidate region.
[0180] In one embodiment, when the computer program is executed by a processor, it further performs the following steps: performing target detection on the image to be detected based on a trained target detection model; and performing target segmentation on the image to be detected based on the target detection results.
[0181] It should be noted that the user information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data used for analysis, data stored, data displayed, etc.) involved in this application are all information and data authorized by the user or fully authorized by all parties, and the collection, use and processing of the relevant data shall comply with the relevant laws, regulations and standards of the relevant countries and regions.
[0182] Those skilled in the art will understand that all or part of the processes in the methods of the above embodiments can be implemented by a computer program instructing related hardware. The computer program can be stored in a non-volatile computer-readable storage medium, and when executed, it can include the processes of the embodiments of the above methods. Any references to memory, databases, or other media used in the embodiments provided in this application can include at least one of non-volatile and volatile memory. Non-volatile memory can include read-only memory (ROM), magnetic tape, floppy disk, flash memory, optical memory, high-density embedded non-volatile memory, resistive random access memory (ReRAM), magnetic random access memory (MRAM), ferroelectric random access memory (FRAM), phase change memory (PCM), graphene memory, etc. Volatile memory can include random access memory (RAM) or external cache memory, etc. By way of illustration and not limitation, RAM can take many forms, such as Static Random Access Memory (SRAM) or Dynamic Random Access Memory (DRAM). The databases involved in the embodiments provided in this application may include at least one type of relational database and non-relational database. Non-relational databases may include, but are not limited to, blockchain-based distributed databases. The processors involved in the embodiments provided in this application may be general-purpose processors, central processing units, graphics processing units, digital signal processors, programmable logic devices, quantum computing-based data processing logic devices, etc., and are not limited to these.
[0183] The technical features of the above embodiments can be combined in any way. For the sake of brevity, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.
[0184] The embodiments described above are merely illustrative of several implementation methods of this application, and while the descriptions are specific and detailed, they should not be construed as limiting the scope of this patent application. It should be noted that those skilled in the art can make various modifications and improvements without departing from the concept of this application, and these all fall within the protection scope of this application. Therefore, the protection scope of this application should be determined by the appended claims.
Claims
1. A method of identifying a state of a switch, characterized by, The method comprises: acquiring a to-be-detected image; performing target segmentation on the to-be-detected image to acquire a target region, wherein the to-be-detected image comprises a knife gate image; determining a candidate open-close state of a knife gate in the to-be-detected image according to a reference image and the target region, wherein the knife gate in the reference image is in a closed state; acquiring a contact state between knife heads of the knife gate in the target region based on a trained knife head detection model; determining an open-close state of the knife gate according to the contact state and the candidate open-close state; the determination of the candidate open-close state of the knife gate in the to-be-detected image according to the reference image and the target region comprises: determining a reference line in the to-be-detected image according to a reference line in the reference image, wherein a straight line where a knife gate arm is located in the reference image is the reference line in the reference image; determining an edge line of the knife gate arm in the target region; determining the candidate open-close state according to an included angle between the edge line and the reference line in the to-be-detected image; the determination of the candidate open-close state according to the included angle between the edge line and the reference line in the to-be-detected image comprises: the position of the reference line in the to-be-detected image can be obtained through image registration of the to-be-detected image and the reference image; calculating an included angle between the edge line and the reference line, and determining the candidate open-close state according to the included angle.
2. The method of claim 1, wherein, the target segmentation on the to-be-detected image comprises: performing image segmentation on the to-be-detected image according to a trained first image segmentation model to acquire a first candidate region; performing image segmentation on the to-be-detected image according to a preset second image segmentation model to acquire a second candidate region; performing fusion processing on the first candidate region and the second candidate region to acquire a third candidate region; performing target segmentation according to the third candidate region to acquire the target region.
3. The method of claim 2, wherein, the image segmentation on the to-be-detected image according to the preset second image segmentation model comprises: performing YUV color space conversion on the to-be-detected image; separating YUV channels, clustering images of a Y channel based on an unsupervised clustering algorithm, and separating out a first region; performing binarization processing on the first region to segment out a second region; performing repair and segmentation processing on the second region to acquire the second candidate region.
4. The method according to any one of claims 1 to 3, characterized in that, the target segmentation on the to-be-detected image comprises: performing target detection on the to-be-detected image based on a trained target detection model; performing target segmentation on the to-be-detected image according to a detection result of the target detection.
5. The method of claim 4, wherein, The target detection model is a deep learning model improved based on a YOLOx algorithm, and the target detection model comprises a basic feature extraction network improved based on a CSPDarknet, a feature fusion network improved based on a PAFPN, and a detection head of YOLOx improved based on a Dynamic head.
6. A disconnect switch status identification device, characterized in that, The device comprises: an acquisition module configured to acquire a to-be-detected image; a segmentation module configured to perform target segmentation on the to-be-detected image to acquire a target region, wherein the to-be-detected image comprises a knife gate image; The state determining module is configured to determine a candidate open-close state of the knife switch in the to-be-detected image according to a reference image and the target region, wherein the knife switch in the reference image is in a closed state; obtain a contact state between the knife heads of the knife switch in the target region based on the trained knife head detection model; and determine an open-close state of the knife switch according to the contact state and the candidate open-close state. The state determining module comprises: A first determining unit configured to determine a reference line in the to-be-detected image according to a reference line in the reference image, wherein a straight line where the knife switch arm is located in the reference image is the reference line in the reference image. A second determining unit configured to determine an edge line of the knife switch arm in the target region. A third determining unit configured to determine the candidate open-close state according to an included angle between the edge line and the reference line in the to-be-detected image, wherein the determination of the candidate open-close state according to the included angle between the edge line and the reference line in the to-be-detected image comprises: obtaining the position of the reference line in the to-be-detected image through image registration of the to-be-detected image and the reference image; calculating the included angle between the edge line and the reference line, and determining the candidate open-close state according to the included angle.
7. The apparatus of claim 6, wherein, The segmentation module comprises: A first segmentation unit configured to perform image segmentation on the to-be-detected image according to the trained first image segmentation model to obtain a first candidate region. A second segmentation unit configured to perform image segmentation on the to-be-detected image according to the preset second image segmentation model to obtain a second candidate region. A fusion unit configured to perform fusion processing on the first candidate region and the second candidate region to obtain a third candidate region. A first target segmentation unit configured to perform target segmentation on the third candidate region to obtain the target region.
8. A computer device comprising a memory and a processor, the memory storing a computer program, characterized in that, The processor executes the computer program to realize the steps of the method in any one of claims 1 to 5.
9. A computer readable storage medium having stored thereon a computer program, characterized in that, The computer program is executed by the processor to realize the steps of the method in any one of claims 1 to 5.
10. A computer program product comprising a computer program, characterized in that, The computer program is executed by the processor to realize the steps of the method in any one of claims 1 to 5.
Citation Information
Patent Citations
Knife switch state refined detection and identification method
CN110728171A