Intelligent identification method, device, equipment and storage medium for inadequate opening and closing of switch
By improving the yolov8 twin network to identify the opening and closing status in the substation, the problems of missed detection and false detection in the existing technology are solved, the accuracy and reliability of identification are improved, and the safe operation of the substation is ensured.
Patent Information
- Application Number
- CN202410599090.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-05-15
- Publication Date
- 2024-09-06
- Estimated Expiration
- 2044-05-15
AI Technical Summary
The existing technology has problems of missed detection and false detection in the opening and closing identification in substations, and it is difficult to collect samples when the opening and closing are not in place, which affects the safe operation of the substation.
The twin network based on the improved yolov8 is used to collect image data through preset collection points, build a training data set, and input the twin network to generate the opening and closing failure recognition model. This model is used to identify the image to be detected, and perform post-processing operations to Determine the final opening and closing status.
It reduces the false detection and missed detection rates of opening and closing status identification, improves the accuracy and reliability of substation opening and closing status identification, meets the actual identification needs of the substation, and enhances operational safety.
Smart Images

Figure CN118196086B
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of substation operation and maintenance, and in particular to a method, device, equipment and storage medium for intelligently identifying inadequate opening and closing of a switch. Background Art
[0002] Since the failure to identify the opening and closing of the switch occurs frequently, this poses a great hidden danger to the safe operation of the substation.
[0003] At present, there are two main types of substation opening and closing detection methods. The first type is traditional detection plus manual inspection confirmation. If the detection method has a large number of missed detections and false detections, it will greatly increase the workload of substation operation and maintenance personnel. If the confirmation is not timely, it will also endanger the normal operation of the substation. Traditional detection methods require manual extraction of corresponding features for detection, such as extracting HOG (Histogram of Oriented Gradients) features and using svm (support vector machines) for classification; the second type is the method of using LSD (aLineSegmentDetector) to detect line segments in the opening and closing ROI area (Region of Interest).
[0004] The above method has certain omissions and false detections for images collected under different natural conditions, and in actual substations, it is difficult to collect samples of the incomplete opening and closing states. Summary of the invention
[0005] In view of this, the purpose of the present invention is to overcome the deficiencies in the prior art and to provide a method, device, equipment and storage medium for intelligently identifying inadequate opening and closing of the switch.
[0006] The present invention provides the following technical solutions:
[0007] In a first aspect, an embodiment of the present disclosure provides a method for intelligently identifying a switch not in position, the method comprising:
[0008] Collect image data according to preset collection points, the image data including images of the open state in place, images of the closed state in place, and images of the open and close state not in place;
[0009] Constructing a training data set according to the image data, inputting the training data set into a twin network based on improved yolov8 to obtain a switch opening and closing in-place recognition model;
[0010] Acquire an image to be detected, and identify the image to be detected, the closed state in-place image, and the open state in-place image through the open / closed switch in-place recognition model to obtain a first detection result and a second detection result respectively;
[0011] Post-processing operations are performed on the first detection result and the second detection result to obtain a final opening and closing inadequate state of the image to be detected, and a final detection result is obtained according to the final opening and closing inadequate state.
[0012] Furthermore, constructing a training data set according to the image data includes:
[0013] Combining two kinds of image data in different states according to the preset acquisition points to obtain multiple groups of image data sets, wherein each group of the image data sets includes a reference image and a test image;
[0014] Annotating the changed areas of the reference image and the test image in each group of the image data set to obtain a corresponding annotation file;
[0015] All the reference images, all the test images and all the annotation files are merged to obtain the training data set.
[0016] Furthermore, the twin network based on the improved yolov8 includes two Backbone networks, an improved Neck network, a Head network and a weight sharing network.
[0017] Furthermore, the training data set is input into the twin network based on the improved yolov8 to obtain the in-place recognition model of opening and closing, including:
[0018] The reference image and the test image in each group of the image data set are resized and input into the twin network based on the improved yolov8, and the resized reference image and the test image are extracted through the Backbone backbone network to generate multiple feature maps;
[0019] Inputting all the feature maps into the Neck network, performing feature fusion on the feature maps of the same layer in all the feature maps through the Neck network to generate a fusion map;
[0020] The fusion graph is input into the Head network, and the fusion graph is detected by the Head network to obtain multiple initial opening and closing switch inadequate recognition models, and each of the initial opening and closing switch inadequate recognition models is verified by a preset test set. The accuracy, recall rate and F1 score are used to evaluate the performance of each of the initial opening and closing switch inadequate recognition models, and the optimal initial opening and closing switch inadequate recognition model is used as the opening and closing switch inadequate recognition model.
[0021] Furthermore, the image to be detected, the image of the closed state being in place and the image of the open state being in place are identified by the open / closed switch not in place identification model to obtain a first detection result and a second detection result respectively, including:
[0022] Combining the image to be detected with the image of the closed state to obtain a first image, and inputting the first image into the opening and closing switch in-place recognition model to obtain a first detection result;
[0023] The image to be detected is combined with the image of the switch opening and closing state being in place to obtain a second image, and the second image is input into the switch opening and closing state not in place recognition model to obtain a second detection result.
[0024] Further, the post-processing operation is performed on the first detection result and the second detection result to obtain the final opening and closing in-place state of the image to be detected, including:
[0025] Determine whether the first detection result and the second detection result are of the change type;
[0026] If both the first detection result and the second detection result are of the change type, determining that the final opening and closing inadequate state of the image to be detected is the opening and closing inadequate state;
[0027] If the first detection result is a change type and the second detection result is a non-change type, determining that the final opening and closing inadequate state of the image to be detected is a closed state;
[0028] If the first detection result is a non-change type and the second detection result is a change type, it is determined that the final opening and closing inadequate state of the image to be detected is a closing and in place state.
[0029] Further, obtaining a final detection result according to the final opening and closing inadequate state includes:
[0030] If the final opening and closing inadequate state is the opening and closing inadequate state, obtaining a first rectangular frame in the first detection result, obtaining a second rectangular frame in the second detection result, filtering the first rectangular frame and the second rectangular frame to obtain a filtered rectangular frame, and using the coordinate position and the corresponding confidence of the filtered rectangular frame as the final detection result;
[0031] If the final opening / closing incomplete state is the closing state, obtaining a second rectangular frame in the second detection result, and taking the coordinate position and the corresponding confidence level of the second rectangular frame as the final detection result;
[0032] If the final opening / closing inadequate state is the opening / closing in place state, the first rectangular frame in the first detection result is obtained, and the coordinate position and the corresponding confidence level of the first rectangular frame are used as the final detection result.
[0033] In a second aspect, an embodiment of the present disclosure provides an intelligent identification device for inadequate opening and closing of a switch, the device comprising:
[0034] An acquisition module is used to acquire image data according to preset acquisition points, wherein the image data includes an image of an open state in place, an image of a closed state in place, and an image of an open / closed state that is not in place;
[0035] A construction module is used to construct a training data set according to the image data, and input the training data set into a twin network based on improved yolov8 to obtain a switch opening and closing in-place recognition model;
[0036] A recognition module, used for acquiring an image to be detected, and identifying the image to be detected, the closed state in place image and the open state in place image through the open / closed switch in-place recognition model, to obtain a first detection result and a second detection result respectively;
[0037] A processing module is used to perform post-processing operations on the first detection result and the second detection result to obtain a final opening and closing inadequate state of the image to be detected, and obtain a final detection result according to the final opening and closing inadequate state.
[0038] In a third aspect, a computer device is provided in an embodiment of the present disclosure, the computer device comprising a memory and a processor, the memory storing a computer program, and the processor implementing the steps of the method for intelligently identifying inadequate opening and closing of the switch as described in the first aspect when executing the computer program.
[0039] In a fourth aspect, a computer-readable storage medium is provided in an embodiment of the present disclosure, wherein the computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the steps of the intelligent identification method for inadequate opening and closing of the switch are implemented as described in the first aspect.
[0040] Beneficial effects of this application:
[0041] The embodiment of the present application provides an intelligent identification method for the switch-off and closing not being in place, the method comprising: collecting image data according to preset collection points, the image data comprising an image of the switch-off state in place, an image of the switch-off state in place and an image of the switch-off and closing not being in place; constructing a training data set according to the image data, inputting the training data set into a twin network based on improved yolov8, and obtaining a switch-off and closing not being in place identification model; obtaining an image to be detected, and identifying the image to be detected, the switch-off state in place image and the switch-off state in place image through the switch-off and closing not being in place identification model, and obtaining a first detection result and a second detection result respectively; performing post-processing operations on the first detection result and the second detection result, and obtaining a final switch-off and closing not being in place state of the image to be detected, and obtaining a final detection result according to the final switch-off and closing not being in place state. The present application meets the actual needs of the switch-off and closing state identification of substations, and reduces the incidence of substation operation safety problems caused by missed detection and false detection problems of identification technology.
[0042] In order to make the above-mentioned objects, features and advantages of the present invention more obvious and understandable, preferred embodiments are given below and described in detail with reference to the accompanying drawings. BRIEF DESCRIPTION OF THE DRAWINGS
[0043] In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the following briefly introduces the drawings required for use in the embodiments. It should be understood that the following drawings only illustrate certain embodiments of the present invention and should not be regarded as limiting the scope. For ordinary technicians in this field, other related drawings can be obtained based on these drawings without creative work. In each of the drawings, similar components are numbered similarly.
[0044] Figure 1 A flow chart of an intelligent identification method for in-position opening and closing of a switch provided in an embodiment of the present application is shown;
[0045] Figure 2 An example diagram of a switch opening and closing out-of-position recognition model based on an improved twin network of yolov8 provided in an embodiment of the present application is shown;
[0046] Figure 3 A network structure diagram of a switch opening and closing out-of-position recognition model based on an improved twin network of yolov8 provided in an embodiment of the present application is shown;
[0047] Figure 4 A schematic diagram of the structure of an intelligent identification device for in-position opening and closing of a switch provided in an embodiment of the present application is shown;
[0048] Figure 5 A schematic diagram of the structure of a computer device provided in an embodiment of the present application is shown. DETAILED DESCRIPTION
[0049] Embodiments of the present invention are described in detail below, examples of which are shown in the accompanying drawings, wherein the same or similar reference numerals throughout represent the same or similar elements or elements having the same or similar functions. The embodiments described below with reference to the accompanying drawings are exemplary and are only used to explain the present invention, and cannot be understood as limiting the present invention.
[0050] It should be noted that when an element is referred to as being "fixed to" another element, it may be directly on the other element or there may be a central element. When an element is considered to be "connected to" another element, it may be directly connected to the other element or there may be a central element at the same time. In contrast, when an element is referred to as being "directly on" another element, there is no intermediate element. The terms "vertical", "horizontal", "left", "right" and similar expressions used herein are for illustrative purposes only.
[0051] In the present invention, unless otherwise clearly specified and limited, the terms "installed", "connected", "connected", "fixed" and the like should be understood in a broad sense, for example, it can be a fixed connection, a detachable connection, or an integral connection; it can be a mechanical connection or an electrical connection; it can be a direct connection or an indirect connection through an intermediate medium, it can be the internal connection of two elements or the interaction relationship between two elements. For ordinary technicians in this field, the specific meanings of the above terms in the present invention can be understood according to specific circumstances.
[0052] In addition, the terms "first" and "second" are used for descriptive purposes only and should not be understood as indicating or implying relative importance or implicitly indicating the number of the indicated technical features. Therefore, the features defined as "first" and "second" may explicitly or implicitly include one or more of the features. In the description of the present invention, the meaning of "plurality" is two or more, unless otherwise clearly and specifically defined.
[0053] Unless otherwise defined, all technical and scientific terms used herein have the same meaning as those commonly understood by those skilled in the art to which this application belongs. The terms used herein in the specification of the template are only for the purpose of describing specific embodiments and are not intended to limit the present invention. The term "and / or" used herein includes any and all combinations of one or more of the related listed items.
[0054] Example 1
[0055] like Figure 1 , which is a flow chart of a method for intelligently identifying a switch-opening or switch-closing failure in an embodiment of the present application, and the method for intelligently identifying a switch-opening or switch-closing failure in an embodiment of the present application comprises the following steps:
[0056] Step S110, collecting image data according to preset collection points, wherein the image data includes an image of an open state in place, an image of a closed state in place, and an image of an open / closed state that is not in place.
[0057] In this embodiment, image acquisition equipment (cameras, patrol robots, etc.) is used to collect images of the open state in place, the closed state in place, and the open and close state not in place in different time periods, different shooting angles, and different natural environments according to the preset collection points set at the substation site and the pre-planned patrol route. The storage format of the collected image data is a 3-channel RGB (Red-Green-Blue) image.
[0058] Step S120, constructing a training data set according to the image data, inputting the training data set into a twin network based on improved yolov8, and obtaining a switch opening and closing inadequate recognition model.
[0059] Specifically, two image data of different states collected are combined into a group in pairs according to the same preset acquisition point. For example, the image of the split state in place and the image of the closed state in place, the image of the split state in place and the image of the split and closed switch not in place, the image of the closed state in place and the image of the split and closed switch not in place, etc. are combined, and a certain number of copy-move data enhancements are performed, and finally multiple groups of image data sets are generated. Any one of them is set as a reference image, and the other is set as a test image. It should be noted that if the preset acquisition points of the two image data are different, they will not be combined.
[0060] Then, only the changed areas of the reference image and the test image in each group of image data sets are labeled with labelimg software, and the labeled category is diff. For example: if the reference image is a closed state in place image, and the test image is a split state in place image, then the rectangular area where the test image change area is located is labeled, and the coordinate position and category are recorded, and the reference image is not labeled; if the reference image is a split state in place image, and the test image is a split state in place image, then the test image is not labeled, and the corresponding annotation file is generated. Finally, all reference images, all test images and all annotation files are merged to obtain a training data set. It should be noted that in the present invention, the category is only the change category, rather than being labeled as different states of splitting and closing.
[0061] The above method breaks through the bottleneck of existing deep learning methods that are difficult to identify a small number of training samples of incomplete opening and closing switches. The opening and closing state detection of a single test image is improved to the identification of the change area of the test image relative to the reference image, reducing the impact of the small number of samples on the training of deep learning models due to the difficulty in collecting data samples of incomplete opening and closing states.
[0062] In this embodiment, if Figure 3As shown in the figure, it is a twin network based on improved yolov8. The twin network based on improved yolov8 includes two Backbone networks, an improved Neck network, a Head network and a weight sharing network. Among them, the Backbone network is mainly composed of CSPDarknet53 units, that is, it is composed of CBS, C2f, SPPF3 subunits and SiLU activation functions; the improved Neck network is between the Backbone network and the Head network. The improved Neck network is mainly composed of SPP units and PAN-FPN feature pyramid structures; the Head network is mainly composed of channel attention units and decoupling head structures. It should be noted that the yolov8 network model before the improvement requires the input of a single 3-channel RGB image, while the improved yolov8 network model inputs two 3-channel RGB images of the benchmark image and the test image.
[0063] First, if Figure 2 As shown in the figure, the specific process of resizing the reference image and the test image is as follows: divide the width and height of the test image and the reference image by 3, then resize the reference image and the test image to a size that is divisible by 3, fill the length and width of the test image and the reference image, and fill the smaller side with 0, that is, fill the length and width of the reference image and the test image to be consistent, and then scale them to a size of 640*640. Then, the resized reference image and the test image are input into the twin network based on the improved yolov8, and the features of the reference image and the test image are extracted through the Backbone backbone network composed of convolution modules, c2f modules, and SPPF modules to generate multiple feature maps.
[0064] Then, all feature maps are input into the Neck network composed of upsampling, c2f and other modules for feature fusion, and three feature maps of different levels F1, F2, F3, F1', F2', F3' are obtained respectively. Then, the feature maps of the same level are processed by absolute difference in dimension to generate the final three fusion maps F1final, F2final, F3final.
[0065] Finally, the fusion graph is input into the Head network composed of a channel attention unit and a decoupling head structure. The fusion graph is detected and verified through the Head network to obtain an inadequate opening and closing recognition model. The Head network introduces an improved channel attention mechanism, which can adaptively learn the importance of each channel, thereby improving the recognition ability of the model. The above-mentioned channel attention mechanism can be divided into two parts: compression and activation function. The feature vector of each channel of the initial input, in which the compression process Fsq performs global average pooling on each channel of the input feature map and compresses it into a scalar; after the excitation process Fex, the compressed feature vector is converted into a weight vector through a fully connected layer, which is used to weight the feature map of each channel to obtain the weight of each channel.
[0066] At the same time, the Head network adopts a decoupled head structure to separate classification and regression, using BCE Loss (anchor box type) as the classification loss and DFL Loss (anchor box coordinate offset) and SIoU Loss (anchor box overlap) as the regression loss. The three are combined into the final training loss function according to certain weights. The loss function L is the sum of the anchor box overlap, anchor box type, and anchor box coordinate offset, that is:
[0067]
[0068] The Task Aligned Assigner positive and negative sample matching method is used during the training process. At the same time, the Mosaic operation is closed during the last 10 epochs of training to improve the recognition accuracy of the model.
[0069] The trained multiple initial opening and closing switch inadequate position recognition models are verified through the preset test set, and the performance of each initial opening and closing switch inadequate position recognition model is evaluated using the accuracy P, recall rate R, and F1 score. The optimal initial opening and closing switch inadequate position recognition model is selected as the opening and closing switch inadequate position recognition model for the next step of the opening and closing switch inadequate position state recognition analysis of the test diagram.
[0070] The above method, based on the existing mature target detection algorithm, utilizes the twin network deep learning target detection technology based on the improved yolov8, and intelligently recognizes the image by training the generated opening and closing in-place recognition model through a large number of data samples. It greatly reduces the false detection rate and missed detection rate of the recognition of the opening and closing in-place state of the substation, and makes the recognition of the opening and closing in-place state of the substation have better use effect in practical applications.
[0071] Step S130, obtaining an image to be detected, and identifying the image to be detected, the closed state in place image and the open state in place image through the open / close in-place recognition model to obtain a first detection result and a second detection result respectively.
[0072] Specifically, after obtaining the image to be detected, the image to be detected is combined with the image of the closed state to obtain a first image, and the first image is input into the opening and closing switch out of position recognition model to obtain a first detection result; the image to be detected is combined with the image of the open state to obtain a second image, and the second image is input into the opening and closing switch out of position recognition model to obtain a second detection result.
[0073] Step S140, performing post-processing operations on the first detection result and the second detection result to obtain a final opening and closing inadequate state of the image to be detected, and obtaining a final detection result according to the final opening and closing inadequate state.
[0074] Furthermore, a post-processing operation is performed on the first detection result and the second detection result, that is, it is determined whether the first detection result and the second detection result are of a change type.
[0075] If both the first detection result and the second detection result are of the change type, it is determined that the final opening and closing inadequate state of the image to be detected is the opening and closing inadequate state, and the first rectangular box in the first detection result is obtained, and the second rectangular box in the second detection result is obtained. The first rectangular box and the second rectangular box are subjected to soft-nms (Soft Non-Maximum Suppression) filtering to obtain a filtered rectangular box, and the filtered rectangular box and the corresponding confidence level are output as the final detection result.
[0076] If the first detection result is a change type and the second detection result is a non-change type, the final opening and closing state of the image to be detected is determined to be a closed state, and the second rectangular box in the second detection result is obtained, and the coordinate position of the second rectangular box and the corresponding confidence level are output as the final detection result.
[0077] If the first detection result is a non-change type and the second detection result is a change type, the final opening and closing inadequate state of the image to be detected is determined to be an opening and closing in place state, and the first rectangular box in the first detection result is obtained, and the coordinate position of the first rectangular box and the corresponding confidence level are output as the final detection result.
[0078] The above method performs post-processing on the detection results to obtain the final rectangular frame and confidence of the opening and closing state that is not in place, which greatly reduces the false detection rate and missed detection rate of the substation opening and closing state that is not in place, and makes the substation opening and closing state that is not in place identification have better use effect in practical applications.
[0079] The embodiment of the present application provides an intelligent identification method for the switch-off and closing not-in-place state, collects image data according to preset collection points, and the image data includes an image of the switch-off state in place, an image of the switch-off state in place, and an image of the switch-off and closing not-in-place state; constructs a training data set according to the image data, and inputs the training data set into a twin network based on improved yolov8 to obtain a switch-off and closing not-in-place identification model; obtains an image to be detected, and identifies the image to be detected, the switch-off state in place image, and the switch-off state in place image through the switch-off and closing not-in-place identification model to obtain a first detection result and a second detection result respectively; performs post-processing operations on the first detection result and the second detection result to obtain the final switch-off and closing not-in-place state of the image to be detected, and obtains a final detection result according to the final switch-off and closing not-in-place state. The present application meets the actual needs of the switch-off and closing state identification of substations, and reduces the incidence of substation operation safety problems caused by missed detection and false detection problems of identification technology.
[0080] Example 2
[0081] like Figure 4 , which is a schematic diagram of the structure of an intelligent identification device 400 for inadequate opening and closing of a switch in an embodiment of the present application, and the device comprises:
[0082] The acquisition module 410 is used to acquire image data according to preset acquisition points, wherein the image data includes an image of an open state in place, an image of a closed state in place, and an image of an open / closed state not in place;
[0083] A construction module 420 is used to construct a training data set according to the image data, and input the training data set into a twin network based on improved yolov8 to obtain a switch opening and closing in-place recognition model;
[0084] The recognition module 430 is used to obtain the image to be detected, and recognize the image to be detected, the closed state in place image and the open state in place image through the open / closed switch in-place recognition model to obtain a first detection result and a second detection result respectively;
[0085] The processing module 440 is used to perform post-processing operations on the first detection result and the second detection result to obtain a final opening and closing inadequate state of the image to be detected, and obtain a final detection result according to the final opening and closing inadequate state.
[0086] Optionally, the above-mentioned intelligent identification device 400 for inadequate opening and closing of the switch further includes:
[0087] A first combining module, used for combining two kinds of image data in different states according to the preset acquisition points to obtain multiple groups of image data sets, wherein each group of the image data sets includes a reference image and a test image;
[0088] A labeling module, used for labeling the changed areas of the reference image and the test image in each group of the image data set to obtain a corresponding labeling file;
[0089] A merging module is used to merge all the reference images, all the test images and all the annotation files to obtain the training data set.
[0090] Optionally, the above-mentioned intelligent identification device 400 for inadequate opening and closing of the switch further includes:
[0091] An adjustment module, used for resizing the reference image and the test image in each group of the image data set and inputting them into the twin network based on the improved yolov8, extracting features of the resized reference image and the test image through the Backbone backbone network, and generating multiple feature maps;
[0092] A fusion module is used to input all the feature maps into the Neck network, and perform feature fusion on the feature maps of the same level in all the feature maps through the Neck network to generate a fusion map;
[0093] A detection module is used to input the fusion graph into the Head network, detect the fusion graph through the Head network, obtain multiple initial opening and closing switch inadequate recognition models, verify each of the initial opening and closing switch inadequate recognition models through a preset test set, and use accuracy, recall rate and F1 score to evaluate the performance of each of the initial opening and closing switch inadequate recognition models, and use the optimal initial opening and closing switch inadequate recognition model as the opening and closing switch inadequate recognition model.
[0094] Optionally, the above-mentioned intelligent identification device 400 for inadequate opening and closing of the switch further includes:
[0095] A second combination module is used to combine the image to be detected with the image of the closed state to obtain a first image, and input the first image into the opening and closing switch in-place recognition model to obtain a first detection result;
[0096] The third combination module is used to combine the image to be detected with the image of the switch opening and closing state to obtain a second image, and input the second image to the switch opening and closing state out of position recognition model to obtain a second detection result.
[0097] Optionally, the above-mentioned intelligent identification device 400 for inadequate opening and closing of the switch further includes:
[0098] A judging module, used for judging whether the first detection result and the second detection result are of a change type;
[0099] A first determining module, configured to determine that the final switch-opening-closing-not-in-place state of the image to be detected is the switch-opening-closing-not-in-place state if both the first detection result and the second detection result are of the change type;
[0100] A second determination module, configured to determine that the final opening / closing incomplete state of the image to be detected is a closing state if the first detection result is a change type and the second detection result is a non-change type;
[0101] The third determination module is used to determine that the final opening and closing inadequate state of the image to be detected is the opening and closing in place state if the first detection result is a non-change type and the second detection result is a change type.
[0102] Optionally, the above-mentioned intelligent identification device 400 for inadequate opening and closing of the switch further includes:
[0103] A first acquisition module is used for acquiring a first rectangular frame in the first detection result and a second rectangular frame in the second detection result if the final opening and closing switch not in place state is the opening and closing switch not in place state, and filtering the first rectangular frame and the second rectangular frame to obtain a filtered rectangular frame, and using the coordinate position and the corresponding confidence of the filtered rectangular frame as the final detection result;
[0104] A second acquisition module is used to acquire a second rectangular frame in the second detection result if the final opening and closing incomplete state is the closing state, and use the coordinate position and corresponding confidence of the second rectangular frame as the final detection result;
[0105] The third acquisition module is used to obtain the first rectangular frame in the first detection result if the final opening and closing inadequate state is the opening and closing in place state, and use the coordinate position and corresponding confidence of the first rectangular frame as the final detection result.
[0106] The intelligent identification device for incomplete opening and closing of the switch provided in the embodiment of the present application meets the actual needs of identifying the opening and closing status of the substation, and reduces the incidence of substation operation safety problems caused by missed detection and false detection problems of the identification technology.
[0107] Example 3
[0108] The present application also provides a computer device. Figure 5 , Figure 5 This is a basic structural block diagram of the computer device in this embodiment.
[0109] The computer device 5 includes a memory 51, a processor 52, and a network interface 53 that are interconnected through a system bus. It should be noted that the figure only shows a computer device 5 with components 51-53, but it should be understood that it is not required to implement all the components shown, and more or fewer components can be implemented instead. Among them, those skilled in the art can understand that the computer device here is a device that can automatically perform numerical calculations and / or information processing according to pre-set or stored instructions, and its hardware includes but is not limited to microprocessors, application specific integrated circuits (Application Specific Integrated Circuit, ASIC), programmable gate arrays (Field-Programmable Gate Array, FPGA), digital processors (Digital Signal Processor, DSP), embedded devices, etc.
[0110] The computer device may be a computing device such as a desktop computer, a notebook, a PDA, a cloud server, etc. The computer device may interact with a user through a keyboard, a mouse, a remote controller, a touch pad, or a voice control device.
[0111] The memory 51 includes at least one type of readable storage medium, and the readable storage medium includes flash memory, hard disk, multimedia card, card-type memory (for example, SD or D slot compatibility test memory, etc.), random access memory (RAM), static random access memory (SRAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), programmable read-only memory (PROM), magnetic memory, disk, optical disk, etc. In some embodiments, the memory 51 can be an internal storage unit of the computer device 5, such as a hard disk or memory of the computer device 5. In other embodiments, the memory 51 can also be an external storage device of the computer device 5, such as a plug-in hard disk, a smart memory card (Smart Media Card, SMC), a secure digital (Secure Digital, SD) card, a flash card (Flash Card), etc. equipped on the computer device 5. Of course, the memory 51 can also include both the internal storage unit of the computer device 5 and its external storage device. In this embodiment, the memory 51 is generally used to store the operating system and various application software installed on the computer device 5, such as computer-readable instructions of the slot compatibility test method, etc. In addition, the memory 51 can also be used to temporarily store various types of data that have been output or are to be output.
[0112] In some embodiments, the processor 52 may be a central processing unit (CPU), a controller, a microcontroller, a microprocessor, or other intelligent identification chip for inadequate opening and closing of the switch. The processor 52 is generally used to control the overall operation of the computer device 5. In this embodiment, the processor 52 is used to run computer-readable instructions or process data stored in the memory 51, such as computer-readable instructions for running the slot compatibility test method.
[0113] The network interface 53 may include a wireless network interface or a wired network interface. The network interface 53 is generally used to establish a communication connection between the computer device 5 and other electronic devices.
[0114] The computer device provided in this embodiment can execute the above-mentioned intelligent identification method for inadequate opening and closing of the switch. The intelligent identification method for inadequate opening and closing of the switch can be the intelligent identification method for inadequate opening and closing of the switch in the above-mentioned embodiments.
[0115] Example 4
[0116] This embodiment also provides a computer-readable storage medium, on which a computer program is stored. When the computer program is executed by a processor, the steps of the intelligent identification method for inadequate opening and closing of the switch in the embodiment are implemented.
[0117] In this embodiment, the computer-readable storage medium includes flash memory, hard disk, multimedia card, card-type memory (for example, SD or DX memory, etc.), random access memory (RAM), static random access memory (SRAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), programmable read-only memory (PROM), magnetic memory, disk, optical disk, etc. In some embodiments, the computer-readable storage medium can be an internal storage unit of a computer device, such as a hard disk or memory of the computer device. In other embodiments, the computer-readable storage medium can also be an external storage device of a computer device, such as a plug-in hard disk equipped on the computer device, a smart memory card (Smart Media Card, referred to as SMC), a secure digital (Secure Digital, referred to as SD) card, a flash card, etc. Of course, the computer-readable storage medium can also include both the internal storage unit of the computer device and its external storage device. In this embodiment, the computer-readable storage medium is generally used to store an operating system and various application software installed on the computer device. In addition, the computer-readable storage medium can also be used to temporarily store various types of data that have been output or are to be output.
[0118] In several embodiments provided in the present application, it should be understood that the disclosed devices and methods can also be implemented in other ways. The device embodiments described above are merely schematic. For example, the flowcharts and structure diagrams in the accompanying drawings show the possible architecture, functions and operations of the devices, methods and computer program products according to multiple embodiments of the present invention. In this regard, each box in the flowchart or block diagram can represent a module, a program segment or a part of a code, and the module, a program segment or a part of a code contains one or more executable instructions for implementing the specified logical function. It should also be noted that in an alternative implementation, the functions marked in the box can also occur in a different order from the order marked in the accompanying drawings. For example, two consecutive boxes can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each box in the structure diagram and / or the flow chart, and the combination of boxes in the structure diagram and / or the flow chart, can be implemented with a dedicated hardware-based system that performs a specified function or action, or can be implemented with a combination of dedicated hardware and computer instructions.
[0119] In addition, the functional modules or units in the various embodiments of the present invention may be integrated together to form an independent part, or each module may exist independently, or two or more modules may be integrated to form an independent part.
[0120] If the function is implemented in the form of a software function module and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present invention, or the part that contributes to the prior art or the part of the technical solution, can be embodied in the form of a software product. The computer software product is stored in a storage medium, including several instructions to enable a computer device (which can be a smart phone, a personal computer, a server, or a network device, etc.) to perform all or part of the steps of the method described in each embodiment of the present invention. The aforementioned storage medium can be a non-volatile storage medium or a volatile storage medium. For example, the storage medium can be: a U disk, a mobile hard disk, a read-only memory (ROM, Read-Only Memory), a random access memory (RAM, Random Access Memory), a disk or an optical disk, and other media that can store program codes.
[0121] The above description is only a specific implementation mode of the present invention, but the protection scope of the present invention is not limited thereto. Any technician familiar with the technical field can easily think of changes or substitutions within the technical scope disclosed by the present invention, which should be covered by the protection scope of the present invention.
Claims
1. A method for intelligently identifying inadequate opening and closing of a switch, characterized in that: The method comprises: Collect image data according to preset collection points, the image data including images of the open state in place, images of the closed state in place, and images of the open and close state not in place; A training data set is constructed according to the image data, and the training data set is input into the twin network based on the improved yolov8 to obtain a switch opening and closing inadequate recognition model, wherein the twin network of the improved yolov8 includes a Backbone network, an improved Neck network and a Head network, and the Backbone network is mainly composed of CSPDarknet53 units, that is, CBS, C2f, SPPF3 subunits and SiLU activation functions, wherein the CBS includes multiple convolutional layers, the C2f includes multiple channel-to-pixel layers, the SPPF3 subunit includes a spatial pyramid, and the improved Neck network is mainly composed of SPP units and PAN-FPN feature pyramid structures, wherein the SPP unit includes multiple The PAN-FPN feature pyramid structure includes multiple upsampling layers, and the Head network is mainly composed of a channel attention unit and a decoupling head structure, wherein the channel attention unit includes multiple channel attention mechanism layers, multiple convolutional layers and multiple connection layers, and the decoupling head structure includes multiple channel-to-pixel layers; two channel-to-pixel layers in the Backbone network are connected to two connection layers of the improved Neck network, a spatial pyramid in the Backbone network is respectively connected to an upsampling layer of the improved Neck network and a connection layer of the Head network, and a channel-to-pixel layer of the improved Neck network is connected to a channel attention mechanism layer of the Head network; Acquire an image to be detected, and identify the image to be detected, the closed state in-place image, and the open state in-place image through the open / closed switch in-place recognition model to obtain a first detection result and a second detection result respectively; Post-processing the first detection result and the second detection result to obtain a final opening and closing in-place state of the image to be detected, and obtaining a final detection result according to the final opening and closing in-place state; The post-processing operation on the first detection result and the second detection result to obtain the final opening and closing in-place state of the image to be detected includes: Determine whether the first detection result and the second detection result are of the change type; If both the first detection result and the second detection result are of the change type, determining that the final opening and closing inadequate state of the image to be detected is the opening and closing inadequate state; If the first detection result is a change type and the second detection result is a non-change type, determining that the final opening and closing inadequate state of the image to be detected is a closed state; If the first detection result is a non-change type and the second detection result is a change type, it is determined that the final opening and closing inadequate state of the image to be detected is a closing and in place state.
2. The intelligent identification method for inadequate opening and closing of the switch according to claim 1 is characterized in that: The step of constructing a training data set according to the image data comprises: Combining two kinds of image data in different states according to the preset acquisition points to obtain multiple groups of image data sets, wherein each group of the image data sets includes a reference image and a test image; Annotating the changed areas of the reference image and the test image in each group of the image data set to obtain a corresponding annotation file; All the reference images, all the test images and all the annotation files are merged to obtain the training data set.
3. The intelligent identification method for inadequate opening and closing of the switch according to claim 2 is characterized in that: The twin network based on improved yolov8 includes two Backbone networks, an improved Neck network, a Head network and a weight sharing network.
4. The intelligent identification method for inadequate opening and closing of the switch according to claim 3 is characterized in that: The training data set is input into the twin network based on the improved yolov8 to obtain the in-place recognition model of the opening and closing switch, including: The reference image and the test image in each group of the image data set are resized and input into the twin network based on the improved yolov8, and the resized reference image and the test image are extracted through the Backbone backbone network to generate multiple feature maps; Inputting all the feature maps into the Neck network, performing feature fusion on the feature maps of the same layer in all the feature maps through the Neck network to generate a fusion map; The fusion graph is input into the Head network, and the fusion graph is detected by the Head network to obtain multiple initial opening and closing switch inadequate recognition models, and each of the initial opening and closing switch inadequate recognition models is verified by a preset test set. The accuracy, recall rate and F1 score are used to evaluate the performance of each of the initial opening and closing switch inadequate recognition models, and the optimal initial opening and closing switch inadequate recognition model is used as the opening and closing switch inadequate recognition model.
5. The intelligent identification method for inadequate opening and closing of the switch according to claim 1 is characterized in that: The image to be detected, the image of the closed state being in place and the image of the open state being in place are identified by the open / closed switch not in place identification model to obtain a first detection result and a second detection result respectively, including: Combining the image to be detected with the image of the closed state to obtain a first image, and inputting the first image into the opening and closing switch in-place recognition model to obtain a first detection result; The image to be detected is combined with the image of the switch opening and closing state being in place to obtain a second image, and the second image is input into the switch opening and closing state not in place recognition model to obtain a second detection result.
6. The intelligent identification method for inadequate opening and closing of the switch according to claim 1 is characterized in that: The obtaining of the final detection result according to the final opening and closing in-place state includes: If the final opening and closing inadequate state is the opening and closing inadequate state, obtaining a first rectangular frame in the first detection result, obtaining a second rectangular frame in the second detection result, filtering the first rectangular frame and the second rectangular frame to obtain a filtered rectangular frame, and using the coordinate position and the corresponding confidence of the filtered rectangular frame as the final detection result; If the final opening / closing incomplete state is the closing state, obtaining a second rectangular frame in the second detection result, and taking the coordinate position and the corresponding confidence level of the second rectangular frame as the final detection result; If the final opening / closing inadequate state is the opening / closing in place state, the first rectangular frame in the first detection result is obtained, and the coordinate position and the corresponding confidence level of the first rectangular frame are used as the final detection result.
7. An intelligent identification device for inadequate opening and closing of the switch, characterized in that: The device comprises: An acquisition module, used to acquire image data according to preset acquisition points, wherein the image data includes an image of an open state in place, an image of a closed state in place, and an image of an open / closed state not in place; A construction module is provided for constructing a training data set according to the image data, and inputting the training data set into a twin network based on the improved yolov8 to obtain a recognition model for inadequate opening and closing of the switch, wherein the twin network of the improved yolov8 includes a Backbone network, an improved Neck network and a Head network, wherein the Backbone network is mainly composed of CSPDarknet53 units, namely, CBS, C2f, SPPF3 subunits and SiLU activation functions, wherein the CBS includes multiple convolutional layers, the C2f includes multiple channel-to-pixel layers, the SPPF3 subunit includes a spatial pyramid, and the improved Neck network is mainly composed of an SPP unit and a PAN-FPN feature pyramid structure, wherein the SPP unit includes The PAN-FPN feature pyramid structure includes multiple upsampling layers, and the Head network is mainly composed of a channel attention unit and a decoupling head structure, wherein the channel attention unit includes multiple channel attention mechanism layers, multiple convolution layers and multiple connection layers, and the decoupling head structure includes multiple channel-to-pixel layers; two channel-to-pixel layers in the Backbone network are connected to two connection layers of the improved Neck network, a spatial pyramid in the Backbone network is respectively connected to an upsampling layer of the improved Neck network and a connection layer of the Head network, and a channel-to-pixel layer of the improved Neck network is connected to a channel attention mechanism layer of the Head network; A recognition module, used for acquiring an image to be detected, and identifying the image to be detected, the closed state in place image and the open state in place image through the open / closed switch in-place recognition model, to obtain a first detection result and a second detection result respectively; a processing module, configured to perform post-processing operations on the first detection result and the second detection result to obtain a final opening and closing inadequate state of the image to be detected, and obtain a final detection result according to the final opening and closing inadequate state; Wherein, the processing module further includes: A judging module, used for judging whether the first detection result and the second detection result are of a change type; A first determining module, configured to determine that the final switch-opening-closing-not-in-place state of the image to be detected is the switch-opening-closing-not-in-place state if both the first detection result and the second detection result are of the change type; A second determination module, configured to determine that the final opening / closing incomplete state of the image to be detected is a closing state if the first detection result is a change type and the second detection result is a non-change type; The third determination module is used to determine that the final opening and closing inadequate state of the image to be detected is the opening and closing in place state if the first detection result is a non-change type and the second detection result is a change type.
8. A computer device, characterized in that: The method comprises a memory and a processor, wherein the memory stores a computer program, and the processor implements the steps of the method for intelligently identifying in-position opening and closing of any one of claims 1 to 6 when executing the computer program.
9. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the steps of the method for intelligently identifying in-position opening and closing of any one of claims 1 to 6 are implemented.
