Switch state target detection method, device, equipment, medium and product
Through intelligent detection methods, the loss function is optimized using the object detection model and the switch knowledge base, and the traditional switching state monitoring problems are solved, efficient and reliable switching state detection is achieved, and the maintenance efficiency and reliability of the power system are improved.
Patent Information
- Application Number
- CN202510210716.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-02-25
- Publication Date
- 2025-07-04
AI Technical Summary
The traditional switch state monitoring method relies on manual detection and simple sensor data analysis, which has problems such as low efficiency, insufficient detection accuracy and poor scalability, especially in large-scale data processing capabilities and real-time performance, which reduces the reliability and maintenance efficiency of the power system.
Intelligent detection method is adopted to obtain image features and spatial features of power equipment, and to use a pre-trained object detection model to detect switch states, and combine dynamic bias adjustment mechanism and switch knowledge base to optimize loss function to improve detection accuracy and efficiency.
It significantly improves the efficiency and accuracy of switching state detection, improves the reliability and maintenance efficiency of the power system, and can generate reliable alarm information in real time in complex environments.
Smart Images

Figure CN120259624A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of artificial intelligence, and particularly to a method, device, equipment, medium and product for detecting the target state of a switch. Background Art
[0002] With the rapid increase in the number of power equipment and the complexity of the system, traditional switch state monitoring methods rely on manual detection and simple sensor data analysis, which have problems such as low efficiency, insufficient detection accuracy, and poor scalability. In particular, traditional target detection methods are difficult to maintain high accuracy in different switch states, and when faced with large-scale data, the processing ability and real-time performance are insufficient, reducing the reliability and maintenance efficiency of the power system. Summary of the Invention
[0003] The present invention provides a method, device, equipment, medium and product for detecting the target state of a switch, which can preferentially process important alarms through intelligent detection and differential processing, effectively reduce the impact of alarm storms on system resources, and improve the fault management efficiency.
[0004] The present invention provides a method for detecting the target state of a switch, including: Obtaining a to-be-detected image of a power equipment; Inputting the to-be-detected image into a pre-trained target detection model, where the target detection model is used to extract the image features and spatial features of the to-be-detected image, and perform target detection based on a pre-determined switch knowledge base, the image features and the spatial features of the power equipment to obtain a target detection result, and the target detection result is used to represent whether there is a switch in the to-be-detected image and the state of the switch; Wherein, the loss function of the target detection model is optimized by a dynamic bias adjustment mechanism and / or the switch knowledge base.
[0005] As an embodiment, the training steps of the target detection model include: Obtaining switch images of different states of the power equipment and switch state images during the use of the power equipment, and annotating the switch images and the switch state images to construct a data set; Taking a convolutional neural network as the initial model of the target detection model, and optimizing the loss function of the target detection model based on a dynamic bias adjustment mechanism and / or the switch knowledge base; Performing iterative training on the convolutional neural network according to the data set until the optimized loss function reaches a preset value or a preset number of iterations, to obtain the target detection model.
[0006] As an embodiment, optimizing the loss function of the target detection model based on a dynamic bias adjustment mechanism includes: Determine the bias value of the loss function for the current iteration based on the bias value of the loss function in the previous iteration, a preset momentum factor, a learning rate, and the current loss gradient to optimize the loss function; Optimize the loss function of the target detection model based on the switch knowledge base, including: Adjust the bias value of the loss function according to the similarity between the switch features in the switch knowledge base and the switch features extracted by the convolutional neural network to optimize the loss function.
[0007] As an embodiment, the steps for constructing the switch knowledge base include: Assign a unique identification code to the switch represented by the switch image and record the switch appearance features; Extract the switch image fingerprint from the switch image; Construct the switch knowledge base according to the unique identification code, the switch appearance features, and the switch image fingerprint.
[0008] As an embodiment, the target detection based on the switch knowledge base, the image features, and the spatial features of the power equipment determined in advance includes: Perform multi-modal feature fusion and normalization processing on the switch appearance features, the switch image fingerprint, the image features, and the spatial features to achieve target detection.
[0009] As an embodiment, the multi-modal feature fusion of the switch appearance features, the switch image fingerprint, the image features, and the spatial features includes: Perform multi-modal feature fusion on the switch appearance features, the switch image fingerprint, the image features, and the spatial features based on a dynamically adjusted weight matrix; Wherein, the weight matrix includes weights corresponding to the switch appearance features, the switch image fingerprint, the image features, and the spatial features respectively, and is dynamically adjusted according to the confidence of the target detection result and / or the application scenario.
[0010] The present invention also provides a switch state target detection device, including: An acquisition module for acquiring an image to be detected of a power equipment; A detection module for inputting the image to be detected into a pre-trained target detection model, where the target detection model is used to extract the image features and spatial features of the image to be detected, and perform target detection based on the switch knowledge base, the image features, and the spatial features of the power equipment determined in advance to obtain a target detection result, and the target detection result is used to characterize whether there is a switch in the image to be detected and the state of the switch; Among them, the loss function of the target detection model is optimized by a dynamic bias adjustment mechanism and / or the switch knowledge base optimization.
[0011] The present invention also provides an electronic device, including a memory, a processor, and a computer program stored on the memory and executable on the processor. When the processor executes the computer program, the switch state target detection method or the switch state target detection method as described above is implemented.
[0012] The present invention also provides a non-transitory computer-readable storage medium, on which a computer program is stored. When the computer program is executed by a processor, the switch state target detection method or the switch state target detection method as described above is implemented.
[0013] The present invention also provides a computer program product, including a computer program. When the computer program is executed by a processor, the switch state target detection method or the switch state target detection method as described above is implemented.
[0014] The switch state target detection method, device, equipment, medium, and product provided by the present invention use a target detection model to detect the switch state. Compared with manual detection and sensor data analysis, the detection efficiency is greatly improved. In addition, the loss function of the target detection model is optimized by a dynamic bias adjustment mechanism and / or a switch knowledge base, the detection accuracy of the target detection model is improved, and the reliability and maintenance efficiency of the power system are improved. BRIEF DESCRIPTION OF THE DRAWINGS
[0015] In order to more clearly illustrate the technical solutions in the present invention or the prior art, the following will briefly introduce the drawings required for the description of the embodiments or the prior art. Obviously, the drawings in the following description are some embodiments of the present invention. For those of ordinary skill in the art, other drawings can be obtained based on these drawings without creative efforts.
[0016] Figure 1 is one of the flowcharts of the switch state target detection method provided by the present invention.
[0017] Figure 2 is the second flowchart of the switch state target detection method provided by the present invention.
[0018] Figure 3 is an experimental schematic diagram of the dynamic bias adjustment mechanism provided by the present invention.
[0019] Figure 4 is the structural schematic diagram of the switch state target detection device provided by the present invention.
[0020] Figure 5It is a schematic structural diagram of the model training unit provided by the present invention.
[0021] Figure 6 It is a schematic structural diagram of the model inference unit provided by the present invention.
[0022] Figure 7 It is a schematic structural diagram of the electronic device provided by the present invention. Detailed implementation manners
[0023] To make the objectives, technical solutions and advantages of the present invention clearer, the technical solutions in the present invention will be clearly and completely described below with reference to the accompanying drawings in the present invention. Obviously, the described embodiments are some, but not all, of the embodiments of the present invention. All other embodiments obtained by those of ordinary skill in the art based on the embodiments in the present invention without creative efforts shall fall within the protection scope of the present invention.
[0024] A large number of switches are generally provided on existing power equipment. Power workers can control and switch circuits through the switches to achieve the scheduling and distribution of power. To ensure the normal operation of the power system, it is very necessary to detect the switch states on the power equipment.
[0025] A method, device, equipment, medium and product for target detection of switch states provided by the present invention will be described in detail below with reference to the accompanying drawings.
[0026] Figure 1 It is one of the flow schematic diagrams of the method for target detection of switch states provided by the present invention. Figure 2 It is the second flow schematic diagram of the method for target detection of switch states provided by the present invention. As Figure 1 and Figure 2 shown, the present invention provides a method for target detection of switch states, which can be used in a fault management system and at least includes step S100-step S200.
[0027] Step S100, obtain a to-be-detected image of a power equipment. A high-resolution camera installed around the power equipment can be used to shoot a video of the power equipment, and the to-be-detected image is obtained by extracting frames from the video.
[0028] Step S200, input the to-be-detected image into a pre-trained target detection model. The target detection model is used to extract the image features and spatial features of the to-be-detected image, and perform target detection based on the pre-determined switch knowledge base, the image features and the spatial features of the power equipment, so as to obtain a target detection result, and the target detection result is used to characterize whether there is a switch and the state of the switch in the to-be-detected image.
[0029] Among them, the loss function of the target detection model is optimized by a dynamic bias adjustment mechanism and / or the switch knowledge base is optimized.
[0030] Optionally, before inputting the image to be detected into a pre-trained target detection model, data augmentation operations can be performed on the image to be detected, including: geometric transformation, color jitter, normalization, color space transformation, blur and noise, and Mixup, etc. Among them, Mixup linearly combines two different images.
[0031] Optionally, the target detection model extracts the image features of the image to be detected through a convolutional neural network (CNN), self-attention mechanism, and downsampling technology. The image features are used to describe the attributes such as the classification, position, shape, and size of the targets in the image, and are mainly extracted through a convolutional neural network (CNN) or self-attention mechanism. The image features provide basic target classification and localization information, encode the attributes of each target in the image, and provide key data for subsequent fusion, which can improve the recognition accuracy of smaller switches and have better robustness, model interpretability, and accuracy. Spatial features are extracted from the geometric information of the image and include attributes such as the relative position, distance, and direction of the targets, which can provide spatial relationship constraints between the targets and are used to verify the rationality of the target detection results.
[0032] The switch knowledge base contains the physical attributes, category attributes, image feature attributes corresponding to the switch states of any switch applied in the power equipment, and the mapping relationships between the attributes. The switch knowledge base includes knowledge base features. The knowledge base features are extracted from prior knowledge and include attributes such as object category, shape, state, color, etc., and the subordinate relationships between the attributes. The knowledge base features provide prior target attribute and relationship information, which can improve the recognition accuracy of the model for targets in complex scenarios. Correspondingly, the target detection model compares the knowledge base features in the switch knowledge base with the image features and spatial features respectively to determine the switch and switch state corresponding to the most matching knowledge base features.
[0033] Specifically, the switch states of each switch when the power equipment is in use and when it is turned off are preset. The target detection result obtained by the target detection model indicates whether there is a switch in the image to be detected and the state of the switch. The switch state in the target detection result is compared with the preset switch state of the power equipment. If they are inconsistent, an alarm is issued. The alarm information includes the switch, the switch state, and the position where the switch is located, etc., which is convenient for the staff to handle.
[0034] It is understandable that the present invention uses a target detection model for switch state detection, which greatly improves the detection efficiency compared with manual detection and sensor data analysis. In addition, the loss function of the target detection model is optimized through a dynamic bias adjustment mechanism and / or a switch knowledge base, improving the detection accuracy of the target detection model and enhancing the reliability and maintenance efficiency of the power system.
[0035] As an embodiment, the training steps of the target detection model include steps S010 - S030.
[0036] Step S010: Obtain switch images of different states of the power equipment and switch state images during the use of the power equipment, and annotate the switch images and the switch state images to construct a data set.
[0037] Deploy a high-resolution camera around the power equipment. The camera captures different states of the switch in both the working state and the non-working state of the power equipment to obtain switch images and switch state images, and uses target detection annotation tools such as labelImg to annotate the switch images and switch state images. Combine the switch images and switch state images and their respective annotation data to construct a data set.
[0038] To improve the robustness and accuracy of the target detection model, a switch knowledge base can be pre-constructed. The switch knowledge base can be used not only in the target detection process but also in the training process of the target detection model. Specifically, as an embodiment, the construction steps of the switch knowledge base include the following steps.
[0039] Assign a unique identification code to the switch represented by the switch image and record the switch appearance features; Extract the switch image fingerprint from the switch image; Construct the switch knowledge base based on the unique identification code, the switch appearance features, and the switch image fingerprint.
[0040] The switch knowledge base assigns a unique identification code to different styles of switches, records the physical attributes of the switches, such as appearance features like shape, size, and state, annotates the subordinate relationships between switch styles, and generates switch image fingerprints based on a convolutional neural network.
[0041] Step S020: Use a convolutional neural network as the initial model of the target detection model, and optimize the loss function of the target detection model based on a dynamic bias adjustment mechanism and / or the switch knowledge base.
[0042] Step S030: Iteratively train the convolutional neural network according to the data set until the optimized loss function reaches a preset value or a preset number of iterations, and obtain the target detection model.
[0043] Optionally, optimizing the loss function of the target detection model based on a dynamic bias adjustment mechanism includes: Determining the bias value of the loss function for the current iteration based on the bias value of the loss function in the previous iteration, a preset momentum factor, a learning rate, and the current loss gradient to optimize the loss function.
[0044] The main loss function of the target detection model aims to optimize the target classification accuracy, the target box position accuracy, and enhance the attention characteristics for small targets. The present invention introduces a dynamic bias adjustment mechanism based on momentum, enabling the bias value to dynamically respond to changes in the gradient during the target detection process, thereby further enhancing the model performance. The calculation formula for the bias value of the loss function for the current iteration is as follows: ; where, is the bias value for the current iteration, is the bias value for the previous iteration, is the momentum factor, used to control the cumulative degree of historical updates of the bias, and typical values are 0.9 or 0.99, is the learning rate, used to control the bias update step size, is the current loss gradient.
[0045] As Figure 3 shown, through experimental verification, the dynamic bias adjustment mechanism improves the target detection model by 12% in terms of the mAP metric, increases the recall rate of small target detection by 18%, speeds up the convergence rate by 20%, and significantly improves the inference accuracy in actual scenarios.
[0046] Optionally, optimizing the loss function of the target detection model based on the switch knowledge base includes: Adjusting the bias value of the loss function according to the similarity between the switch features in the switch knowledge base and the switch features extracted by the convolutional neural network to optimize the loss function.
[0047] The calculation formula for the similarity between the switch features in the switch knowledge base and the switch features extracted by the convolutional neural network is as follows: where, is the feature extracted by the target detection network, is the feature extracted from the knowledge base, and the similarity between the two is calculated through the Euclidean distance. This loss function encourages the detection network to learn the alignment with the knowledge base features, thereby enhancing the expressiveness of the model.
[0048] Optionally, after step S010, data augmentation operations are performed on the switch images and switch state images in the dataset, including: geometric transformation, color jitter, normalization, color space transformation, blur and noise, and Mixup, etc. The augmented dataset is divided into a training set, a validation set, and a test set.
[0049] Optionally, a feature consistency loss based on the multi-head self-attention mechanism can also be introduced to effectively improve the classification ability at the pixel level of the image. By optimizing the feature extraction and representation of small targets, the influence of small switch target sizes on the recognition accuracy is significantly reduced. Compared with the traditional switch state recognition model based on object detection algorithms, it has significant advantages in detection robustness, model interpretability, and classification accuracy.
[0050] It can be understood that the present invention uses the momentum mechanism for bias update, which can effectively alleviate the problem of unstable convergence caused by gradient oscillation in traditional optimization. The dynamic adjustment of the bias strengthens the detection performance of small targets, especially in complex backgrounds and low-contrast scenarios, significantly improving the detection accuracy. Optimizing the loss function of the object detection model based on the switch knowledge base can realize the combination of object detection features and prior information in the knowledge base, and dynamically adjust the influence of each category through similarity measurement, thereby effectively improving the object recognition performance in complex environments.
[0051] Based on the above embodiments, as an optional embodiment, the object detection based on the pre-determined switch knowledge base, image features, and spatial features of the power equipment includes: Performing multi-modal feature fusion and normalization processing on the switch appearance features, switch image fingerprints, image features, and spatial features to achieve object detection.
[0052] Optionally, the multi-modal feature fusion of the switch appearance features, switch image fingerprints, image features, and spatial features includes: Performing multi-modal feature fusion on the switch appearance features, switch image fingerprints, image features, and spatial features based on a dynamically adjusted weight matrix; wherein, the weight matrix includes weights corresponding to the switch appearance features, switch image fingerprints, image features, and spatial features respectively, and is dynamically adjusted according to the confidence of the object detection result and / or the application scenario.
[0053] Specifically, the object detection model can also be used to fuse image features, knowledge base features (including switch appearance features, switch image fingerprints), and spatial features through the following formula to obtain the final multi-modal fusion inference result, that is, the object detection result: Among them, represents the target detection result finally inferred, is the image feature, is the knowledge base feature, is the spatial feature, is the weight matrix for feature fusion, and the softmax function is used to normalize the fused features to determine the most likely switch state.
[0054] The weight matrix of the image feature is responsible for adjusting its contribution ratio in the final fusion result, The dynamic update of optimizes the adaptability of the features through the bias adjustment mechanism. The weight matrix of the knowledge base feature adjusts the contribution value by measuring the similarity between the knowledge base information and the detection result, affects the result accuracy and interpretability of the multi-modal fusion inference, and is extracted from the geometric information of the image, including attributes such as the relative position, distance, and direction of the target. The weight matrix of the spatial feature
[0055] The weight matrix of the image feature is used to measure the credibility and importance of the target detection features in the image; when the confidence of the detection result is relatively high, its weight is relatively increased. The weight matrix of the knowledge base feature dynamically adjusts its contribution in the fusion through the similarity between the knowledge base and the detection features. The weight matrix of the spatial feature verifies the rationality of the result according to the geometric relationship and enhances the model's understanding of the spatial relationship between the targets. Controls the contribution ratio of the features in the fusion. The function is used to normalize the fused features to ensure the stability and reliability of the inference result.
[0056] It can be understood that the present invention adopts a multi-modal fusion inference mechanism, which organically combines the target detection result, the knowledge base feature, and the switch geometry and appearance features. Through the efficient integration and inference of multi-modal features, the accuracy of switch state classification in complex environments is significantly improved, and reliable state alarm information can be generated in real time.
[0057] Next, the switch state target detection device provided by the present invention will be described. The switch state target detection device described below can be mutually referred to the switch state target detection method described above.
[0058] Figure 4 is the structural schematic diagram of the switch state target detection device provided by the present invention, as Figure 4As shown in the figure, the present invention also provides a target detection device for switch states, including: An acquisition module 410, configured to acquire a to-be-detected image of an electrical device; A detection module 420, configured to input the to-be-detected image into a pre-trained target detection model, where the target detection model is used to extract image features and spatial features of the to-be-detected image, and perform target detection based on a pre-determined switch knowledge base of the electrical device, the image features, and the spatial features to obtain a target detection result, and the target detection result is used to characterize whether there is a switch in the to-be-detected image and the state of the switch; Wherein, the loss function of the target detection model is optimized by a dynamic bias adjustment mechanism and / or the switch knowledge base.
[0059] As an embodiment, it further includes: A training module, configured to acquire switch images in different states of the electrical device and switch state images during the use of the electrical device, label the switch images and the switch state images to construct a data set; use a convolutional neural network as an initial model of the target detection model, and optimize the loss function of the target detection model based on a dynamic bias adjustment mechanism and / or the switch knowledge base; perform iterative training on the convolutional neural network according to the data set until the optimized loss function reaches a preset value or a preset number of iterations to obtain the target detection model.
[0060] As an embodiment, the training module is further configured to: Determine the bias value of the loss function of the current iteration based on the bias value of the loss function of the previous iteration, a preset momentum factor, a learning rate, and the current loss gradient to optimize the loss function; Optimizing the loss function of the target detection model based on the switch knowledge base includes: Adjusting the bias value of the loss function according to the similarity between the switch features in the switch knowledge base and the switch features extracted by the convolutional neural network to optimize the loss function.
[0061] As an embodiment, it further includes: A construction module, configured to assign a unique identification code to the switch represented by the switch image and record the switch appearance features; extract a switch image fingerprint from the switch image; construct the switch knowledge base according to the unique identification code, the switch appearance features, and the switch image fingerprint.
[0062] As an embodiment, the detection module 420 is further configured to: Perform multi-modal feature fusion and normalization processing on the appearance features of the switch, the image fingerprint of the switch, the image features, and the spatial features to achieve target detection.
[0063] As an embodiment, the detection module 420 is further configured to: Perform multi-modal feature fusion on the appearance features of the switch, the image fingerprint of the switch, the image features, and the spatial features based on a dynamically adjusted weight matrix; Wherein, the weight matrix includes weights corresponding to the appearance features of the switch, the image fingerprint of the switch, the image features, and the spatial features respectively, and is dynamically adjusted according to the confidence of the target detection result and / or the application scenario.
[0064] It should be noted that the switch state target detection device provided by the present invention can execute the switch state target detection method described in any of the above embodiments during specific operation, and has the corresponding technical effects of the method, which will not be elaborated in this embodiment.
[0065] Figure 5 is a schematic structural diagram of the model training unit provided by the present invention, Figure 6 is a schematic structural diagram of the model inference unit provided by the present invention. As Figure 5 and Figure 6 shown, the present invention also provides a switch state target detection system, including a model training unit and a model inference unit. The model training unit includes a raw image and knowledge base management module, a data annotation module, a data augmentation module, a data partitioning module, a model training and fusion module, and a model call interface module. The model inference unit includes an image target detection module, a switch knowledge base module, a switch state recognition module, a multi-modal fusion inference module, and a result return module.
[0066] The raw image and knowledge base management module is used to manage the collected raw images and configure and maintain the object knowledge base.
[0067] The data annotation module is used to annotate the images to obtain switch classification information at the pixel level.
[0068] The data augmentation module is used to perform data augmentation operations on the images.
[0069] The data partitioning module is used to implement the partitioning and management of training data, validation data, and test data.
[0070] The model training and fusion module is used to train the target detection model, match and output the final result according to the knowledge base, and further optimize the model according to the comparison between the recognition result and the annotation result.
[0071] The model call interface module is used to encapsulate the training service of the target detection model into an API interface for external systems to call.
[0072] The image target detection module is used to detect all switch objects in the image and obtain the structured information of all switch objects, including position, shape, color, etc.
[0073] The switch knowledge base module is used to manage the object knowledge base manually entered, including object shape, state and color, as well as information such as the subordinate relationship between object categories.
[0074] The switch state recognition module is used to perform multimodal fusion by combining the target detection results and the data in the object knowledge base to obtain the switch state and position information in the image, and return an alarm for the current state of the switch according to the predefined object knowledge base and state inference algorithm.
[0075] The multimodal fusion inference module is used to fuse the target detection features, knowledge base features and spatial features through the following formula during the multimodal fusion inference process to obtain the final inference result: Among them, represents the target detection result finally inferred, is the image feature, is the knowledge base feature, is the spatial feature, is the weight matrix for feature fusion, and the softmax function is used to normalize the fused features to determine the most likely switch state.
[0076] The result return module is used to encapsulate the model inference service into an API interface for external systems to call.
[0077] Figure 7 An example of the entity structure diagram of an electronic device is shown in Figure 7As shown, the electronic device may include: a processor 710, a communications interface 720, a memory 730, and a communication bus 740. Among them, the processor 710, the communications interface 720, and the memory 730 complete communication with each other through the communication bus 740. The processor 710 may call logic instructions in the memory 730 to execute a switch state target detection method, including: obtaining a to-be-detected image of a power device; inputting the to-be-detected image into a pre-trained target detection model, where the target detection model is used to extract image features and spatial features of the to-be-detected image, and performing target detection based on a pre-determined switch knowledge base of the power device, the image features, and the spatial features to obtain a target detection result, where the target detection result is used to characterize whether there is a switch in the to-be-detected image and the state of the switch; where the loss function of the target detection model is optimized by a dynamic bias adjustment mechanism and / or the switch knowledge base is optimized.
[0078] In addition, when the logic instructions in the above-mentioned memory 730 are implemented in the form of software functional units and sold or used as an independent product, they may be stored in a computer-readable storage medium. Based on such an understanding, the technical solution of the present invention, in essence, or the part that contributes to the prior art, or a part of this technical solution, may be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions for causing a computer device (which may be a personal computer, a server, or a network device, etc.) to execute all or part of the steps of the methods described in various embodiments of the present invention. The foregoing storage medium includes: various media such as a USB flash drive, a mobile hard disk, a read-only memory (ROM, Read-Only Memory), a random access memory (RAM, Random Access Memory), a magnetic disk, or an optical disc that can store program codes.
[0079] On the other hand, the present invention also provides a computer program product, which includes a computer program. The computer program can be stored on a non-transitory computer-readable storage medium. When the computer program is executed by a processor, the computer can execute the switch state target detection method provided by each of the above methods, including: obtaining a to-be-detected image of an electrical device; inputting the to-be-detected image into a pre-trained target detection model, where the target detection model is used to extract the image features and spatial features of the to-be-detected image, and performing target detection based on the pre-determined switch knowledge base of the electrical device, the image features, and the spatial features to obtain a target detection result, where the target detection result is used to represent whether there is a switch in the to-be-detected image and the state of the switch; wherein, the loss function of the target detection model is optimized by a dynamic bias adjustment mechanism and / or the switch knowledge base is optimized.
[0080] In another aspect, the present invention also provides a non-transitory computer-readable storage medium, on which a computer program is stored. When the computer program is executed by a processor, it is configured to execute the switch state target detection method provided by each of the above methods, including: obtaining a to-be-detected image of an electrical device; inputting the to-be-detected image into a pre-trained target detection model, where the target detection model is used to extract the image features and spatial features of the to-be-detected image, and performing target detection based on the pre-determined switch knowledge base of the electrical device, the image features, and the spatial features to obtain a target detection result, where the target detection result is used to represent whether there is a switch in the to-be-detected image and the state of the switch; wherein, the loss function of the target detection model is optimized by a dynamic bias adjustment mechanism and / or the switch knowledge base is optimized.
[0081] The device embodiments described above are merely illustrative. The units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place, or may be distributed to multiple network units. Some or all of the modules can be selected according to actual needs to achieve the purpose of the solution of this embodiment. A person of ordinary skill in the art can understand and implement it without creative efforts.
[0082] Through the description of the above embodiments, those skilled in the art can clearly understand that each embodiment can be implemented by means of software plus a necessary general hardware platform, and of course, it can also be implemented by hardware. Based on such an understanding, the above technical solution, in essence, or the part that contributes to the prior art can be embodied in the form of a software product. This computer software product can be stored in a computer-readable storage medium, such as ROM / RAM, magnetic disk, optical disk, etc., and includes several instructions for causing a computer device (which can be a personal computer, a server, or a network device, etc.) to execute the methods described in each embodiment or some parts of the embodiments.
[0083] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention and are not intended to limit them; although the present invention has been described in detail with reference to the foregoing embodiments, those of ordinary skill in the art should understand that they can still modify the technical solutions described in the foregoing embodiments, or perform equivalent replacements for some of the technical features; and these modifications or replacements do not cause the essence of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of the embodiments of the present invention.
Claims
1. A method for detecting a target switch state, characterized in that, Including: Obtain the image to be detected of the power equipment; Input the image to be detected into a pre-trained object detection model, which is used to extract the image features and spatial features of the image to be detected, and perform object detection based on the pre-determined switch knowledge base, the image features and the spatial features of the power equipment to obtain an object detection result, where the object detection result is used to characterize whether there is a switch in the image to be detected and the state of the switch; Among them, the loss function of the object detection model is optimized by a dynamic bias adjustment mechanism and / or the switch knowledge base.
2. The switch state target detection method according to claim 1, characterized in that, The training steps of the object detection model include: Obtain switch images of different states of the power equipment and switch state images during the use of the power equipment, and annotate the switch images and the switch state images to construct a data set; Take the convolutional neural network as the initial model of the object detection model, and optimize the loss function of the object detection model based on the dynamic bias adjustment mechanism and / or the switch knowledge base; Iteratively train the convolutional neural network according to the data set until the optimized loss function reaches a preset value or a preset number of iterations to obtain the object detection model.
3. The switch state target detection method according to claim 2, characterized in that, Optimizing the loss function of the object detection model based on the dynamic bias adjustment mechanism includes: Determine the bias value of the loss function of the current iteration based on the bias value of the loss function of the previous iteration, a preset momentum factor, a learning rate, and the current loss gradient to optimize the loss function; Optimizing the loss function of the object detection model based on the switch knowledge base includes: Adjust the bias value of the loss function according to the similarity between the switch features in the switch knowledge base and the switch features extracted by the convolutional neural network to optimize the loss function.
4. The switch state target detection method according to any one of claims 1-3, characterized in that, The construction steps of the switch knowledge base include: Assign a unique identification code to the switch represented by the switch image and record the switch appearance features; Extract the switch image fingerprint from the switch image; Construct the switch knowledge base according to the unique identification code, the switch appearance features, and the switch image fingerprint.
5. The switch state target detection method according to claim 4, characterized in that Performing object detection based on the pre-determined switch knowledge base, the image features, and the spatial features of the power equipment includes: Perform multi-modal feature fusion and normalization processing on the switch appearance features, the switch image fingerprint, the image features, and the spatial features to achieve object detection.
6. The method for detecting a target switch state according to claim 5, wherein The multi-modal feature fusion of the switch appearance features, the switch image fingerprint, the image features, and the spatial features includes: Perform multi-modal feature fusion on the switch appearance features, the switch image fingerprint, the image features, and the spatial features based on a dynamically adjusted weight matrix; Among them, the weight matrix includes weights corresponding to the switch appearance features, the switch image fingerprint, the image features, and the spatial features respectively, and is dynamically adjusted according to the confidence of the object detection result and / or the application scenario.
7. A switch state target detection device, characterized in that, Including: An acquisition module for acquiring the image to be detected of the power equipment; A detection module, configured to input the image to be detected into a pre-trained target detection model, where the target detection model is used to extract the image features and spatial features of the image to be detected, and perform target detection based on a pre-determined switch knowledge base of the power equipment, the image features, and the spatial features to obtain a target detection result, and the target detection result is used to indicate whether there is a switch and the state of the switch in the image to be detected; Wherein, the loss function of the target detection model is optimized by a dynamic bias adjustment mechanism and / or the switch knowledge base optimization.
8. An electronic device, comprising a memory, a processor, and a computer program stored on the memory and executable on the processor, characterized in that, When the processor executes the computer program, it implements the switch state target detection method according to any one of claims 1 to 6.
9. A non-transitory computer-readable storage medium having a computer program stored thereon, characterized in that, When the computer program is executed by a processor, it implements the switch state target detection method according to any one of claims 1 to 6.
10. A computer program product, comprising a computer program, characterized in that, When the computer program is executed by a processor, it implements the switch state target detection method according to any one of claims 1 to 6.