A power equipment state detection method, device and equipment
Patent Information
- Application Number
- CN202611301347.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-08-26
- Publication Date
- 2026-10-23
AI Technical Summary
[0004]然而,现有技术电力设备缺陷检测中,因缺陷类别长尾分布严重、不同设备部件缺陷特征差异大、且正常运行状态缺乏有效建模,导致少样本缺陷识别性能差、误报率高的问题
[0057](1)本发明采用两阶段检测框架,将电力设备部件定位与运行状态识别进行解耦,降低了复杂多类别检测任务的学习难度,提高了缺陷检测的准确性和鲁棒性。
Smart Images

Figure CN122966630A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of equipment testing, and specifically to a method, apparatus, and equipment for detecting the condition of power equipment. Background Technology
[0002] Power equipment is a crucial infrastructure for ensuring the safe and stable operation of power systems. During long-term operation, it is susceptible to factors such as material aging, mechanical wear, and complex environments, leading to various defects and malfunctions. Equipment defects typically manifest as visible abnormalities such as insulator damage, meter failure, corrosion, and deformation. Failure to detect and address these defects promptly can result in equipment failure or even power grid operational accidents. Therefore, rapid and accurate defect detection of power equipment is of paramount importance for ensuring the safe operation of the power grid.
[0003] With the development of intelligent inspection technology, a large number of deep learning-based object detection and image segmentation methods have been applied to power equipment inspection tasks. Early methods mainly targeted specific equipment types or single defect categories for detection; in recent years, with the development of object detection technology, more and more methods have adopted a unified multi-category object detection framework to achieve simultaneous detection of various power equipment and their defects, thereby improving the automation level of intelligent inspection systems.
[0004] However, in the existing technology for detecting defects in power equipment, the long-tail distribution of defect categories, the large differences in defect characteristics among different equipment components, and the lack of effective modeling of normal operating conditions lead to poor defect identification performance and high false alarm rate with few samples. Summary of the Invention
[0005] The purpose of this invention is to provide a method, apparatus, and device for detecting the condition of power equipment, which solves the problems in the prior art.
[0006] This invention is achieved through the following technical solution:
[0007] In a first aspect, embodiments of the present invention provide a method for detecting the condition of power equipment, comprising:
[0008] The acquired power equipment inspection images are input into a pre-trained target detector. The target detector detects and locates the power equipment components in the power equipment inspection images, and obtains the component category, bounding box coordinates, and component image regions cropped from the inspection images based on the bounding box coordinates.
[0009] The component image region is input into the visual encoder in the pre-trained state recognition model, and the visual features of the component image region are extracted based on the visual encoder to obtain the visual feature representation of the component.
[0010] Based on the component category, the operating state prototypes of the corresponding equipment components are selected from the state memory in the state recognition model to obtain a set of state prototypes associated with the component category;
[0011] The visual features of the components are compared with the similarity of each state prototype in the state prototype set, and the operating status of the equipment is determined based on the similarity matching results.
[0012] Preferably, the training process of the state recognition model is as follows:
[0013] At the beginning of each training round, the visual features of all device component images in the training dataset are extracted using the visual encoder at the current time, so as to obtain the visual feature representation of all training components corresponding to the current round.
[0014] Based on the visual feature representations of all trained components and the corresponding component category labels for the current round, calculate the component feature center for each category of components;
[0015] The semantic prototypes of each component in the component memory are updated based on the component feature centers of each category of components.
[0016] Based on the visual feature representations of all training components and the corresponding running status labels for the current round, calculate the state feature center for each category of running status.
[0017] The state prototypes in the state memory are updated based on the recalculated state feature centers.
[0018] In each training round, a class-balanced PK sampling strategy is used to construct the current training batch. The PK sampling strategy is to randomly select P running state categories from the training dataset, randomly sample K component images from each running state category, and construct multiple training batches containing P×K training samples based on the sampling results.
[0019] In each training batch, the network parameters of the visual encoder are updated with gradients based on the training samples in the training batch and the part category label and running state label corresponding to each training sample, and the semantic prototypes of the parts in the part memory and the state prototypes in the state memory are updated with momentum.
[0020] Repeat the training process for each training batch until all training samples corresponding to the training round have been traversed, thus completing the training round.
[0021] Repeat the training rounds until convergence, and then store the network parameters of the trained visual encoder, the semantic prototypes of the components in the component memory, and the prototypes of the states in the state memory in a fixed manner to obtain the trained state recognition model.
[0022] Preferably, in each training batch, the network parameters of the visual encoder are updated with gradients based on the training samples in the training batch and the part category label and running state label corresponding to each training sample, and the momentum of the part semantic prototypes in the part memory and the state prototypes in the state memory is updated, including:
[0023] In each training batch, each training sample in the training batch is input into the visual encoder, and the visual features of each training sample are extracted according to the visual encoder to obtain the visual feature representation of the training component of each sample in the training batch.
[0024] Based on the component category label of each training sample in the training batch, the corresponding component semantic prototype is selected from the component memory as a positive sample, and the component semantic prototypes of other component categories are selected as negative samples. The component-level contrast loss of each sample is calculated.
[0025] The running state space corresponding to each training sample is determined based on the component category label of each training sample in the training batch. The running state space is the set of all running state categories of the equipment component corresponding to each component category label.
[0026] Based on the running state label of each training sample in the training batch, select the state prototype corresponding to the running state label in the running state space from the state memory as positive sample, select the state prototype corresponding to the other running states in the running state space as negative sample, and calculate the state level contrast loss of each sample.
[0027] The joint optimization objective function value is obtained by weighted summation of the component-level contrastive loss and the state-level contrastive loss of all training samples in the training batch;
[0028] The network parameters of the visual encoder are updated by gradient based on the joint optimization objective function value, and the semantic prototypes of the parts in the part memory and the state prototypes in the state memory are updated by momentum based on the visual feature representations of the training parts of each training sample in the training batch.
[0029] Preferably, the formula for calculating the component-level contrast loss is:
[0030] ,
[0031] in, This refers to the sample index in the current training batch; For the first Visual feature representation of training components for each training sample; express and The dot product; For the first Part category labels for each training sample The corresponding component semantic prototype; Temperature coefficient; Total number of component categories; For the first The semantic prototype of each component category;
[0032] The formula for calculating the state-level contrast loss is:
[0033] ,
[0034] in, For the first The running status of each training sample The corresponding state prototype; For the first Part category labels for each training sample The corresponding runtime state space; For the running state space The Middle The state prototype corresponding to each running state;
[0035] The joint optimization objective function value is:
[0036] ,
[0037] in, For training batches, These are the weighting coefficients for the component-level contrast loss. These are the weighting coefficients for the state-level contrast loss.
[0038] Preferably, the formula for calculating momentum update is:
[0039] ,
[0040] ;
[0041] in, For category The corresponding prototype vector, This is the momentum coefficient.
[0042] Preferably, the target detector is a YOLOv12 target detection network; the visual encoder is a Siglip2 visual encoder.
[0043] Preferably, the component image region is input into the visual encoder in the pre-trained state recognition model, and the visual features of the component image region are extracted based on the visual encoder to obtain the component visual feature representation, including:
[0044] The component image region is input into the visual encoder, and the d-dimensional visual features of the component image region are extracted according to the visual encoder to obtain the initial visual feature vector;
[0045] The initial visual feature vector is subjected to L2 normalization, and the normalized features are used as the visual feature representation of the component.
[0046] Preferably, cosine similarity or dot product similarity is used for similarity calculation;
[0047] The visual feature representation of the component is compared with the similarity of each state prototype in the state prototype set to obtain the similarity score corresponding to each state prototype.
[0048] Based on the similarity score, select the state prototype corresponding to the highest similarity score, and determine the operating state associated with the state prototype corresponding to the highest similarity score as the device operating state.
[0049] Secondly, embodiments of the present invention provide a power equipment condition detection device, comprising:
[0050] The target detection module is used to input the acquired power equipment inspection images into the pre-trained target detector, and to detect and locate the power equipment components in the power equipment inspection images according to the target detector, so as to obtain the component category, bounding box coordinates, and component image regions cropped from the inspection images according to the bounding box coordinates.
[0051] The visual encoding module is used to input the component image region into the visual encoder in the pre-trained state recognition model, and extract the visual features of the component image region based on the visual encoder to obtain the component visual feature representation.
[0052] The state prototype filtering module is used to filter the operating state prototypes of corresponding equipment components from the state memory in the state recognition model according to the component category, and obtain a set of state prototypes associated with the component category.
[0053] The state determination module is used to calculate the similarity between the visual feature representation of the component and each state prototype in the state prototype set, and determine the operating state of the device based on the similarity matching result.
[0054] Thirdly, embodiments of the present invention provide an electronic device, including: at least one processor, at least one memory, and computer program instructions stored in the memory, which, when executed by the processor, implement the method of the first aspect described above.
[0055] Fourthly, embodiments of the present invention provide a storage medium storing computer program instructions, which, when executed by a processor, implement the method of the first aspect described above.
[0056] Compared with the prior art, the present invention has the following advantages and beneficial effects:
[0057] (1) The present invention adopts a two-stage detection framework to decouple the positioning of power equipment components from the identification of operating status, thereby reducing the learning difficulty of complex multi-category detection tasks and improving the accuracy and robustness of defect detection.
[0058] (2) This invention proposes a dual-memory hierarchical contrast learning mechanism, which learns coarse-grained component semantics through the component memory and fine-grained operating state features through the state memory, thereby achieving discriminative feature learning from coarse to fine and effectively improving the ability to distinguish between visually similar defects.
[0059] (3) The present invention uses component category to constrain the state recognition range and combines dual memory library to perform state prototype matching, which effectively reduces state confusion between different devices and reduces the false alarm rate in actual inspection scenarios.
[0060] (4) The present invention adopts a class-balanced PK sampling strategy and a prototype learning mechanism based on memory bank, which effectively alleviates the class imbalance problem caused by the long tail distribution of power equipment defect samples and improves the recognition performance of few samples and rare defect categories. Attached Figure Description
[0061] To more clearly illustrate the technical solutions of the exemplary embodiments of the present invention, the accompanying drawings used in the embodiments will be briefly described below. It should be understood that the following drawings only show some embodiments of the present invention and should not be considered as a limitation of the scope. For those skilled in the art, other related drawings can be obtained based on these drawings without creative effort. In the drawings:
[0062] Figure 1 A flowchart of the power equipment defect detection method provided by the present invention;
[0063] Figure 2 A schematic diagram illustrating the overall process of the training and inference phases provided by this invention;
[0064] Figure 3 This is a schematic diagram of the dataset annotation statistics provided by the present invention;
[0065] Figure 4 This is a visual schematic diagram of the power equipment defect detection results provided by the present invention;
[0066] Figure 5 The t-SNE visualization distribution diagram for different device feature representations provided by the present invention. Detailed Implementation
[0067] To make the objectives, technical solutions, and advantages of the present invention clearer, the present invention will be further described in detail below with reference to the embodiments and accompanying drawings. The illustrative embodiments and descriptions of the present invention are only used to explain the present invention and are not intended to limit the present invention.
[0068] It should be noted that, in this document, relational terms such as "first" and "second" are used merely to distinguish one entity or operation from another, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Furthermore, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or apparatus. Without further limitations, an element defined by the phrase "comprising..." does not exclude the presence of additional identical elements in the process, method, article, or apparatus that includes the element.
[0069] It should be noted that all actions involving the acquisition of signals, information, or data in this invention are carried out in compliance with the relevant data protection laws and regulations of the locality and with authorization from the owner of the relevant device.
[0070] Example 1
[0071] Please see Figure 1 This invention provides a method for detecting the condition of power equipment, comprising:
[0072] S1. Input the acquired power equipment inspection image into the pre-trained target detector. The target detector detects and locates the power equipment components in the power equipment inspection image to obtain the component category, bounding box coordinates, and component image regions cropped from the inspection image based on the bounding box coordinates.
[0073] Among them, power equipment inspection images refer to raw image data containing power equipment collected by visible light cameras in actual inspection scenarios. The objects of collection include various types of power equipment in scenarios such as substations and transmission lines. The images may contain single or multiple equipment components, as well as complex background information, such as non-equipment elements like supports, conductors, and frameworks. The raw inspection images serve as input data for the entire inspection process, and their quality directly affects the processing effectiveness of subsequent steps.
[0074] An object detector is a deep learning-based object detection network used to detect and locate equipment components in input inspection images. The object detector is pre-optimized on a training dataset labeled with component categories and bounding box coordinates to enable it to identify different power equipment components. Preferably, the object detector can be a YOLOv12 object detection network. The output of the object detector includes three parts: component category, bounding box coordinates, and component image region. The component category indicates the type of the detected equipment component. The bounding box coordinates mark the position of the component in the original inspection image in the form of a rectangle, typically in the format (x, y, w, h), where (x, y) are the coordinates of the top-left corner of the rectangle, and (w, h) are the width and height of the rectangle. Cropping the original inspection image based on the bounding box coordinates segments a local image region containing only the equipment component, which serves as the input for the subsequent state recognition model. By separating the equipment component from the complex inspection background using the object detector, the subsequent state recognition process only needs to process the cropped component image, thereby reducing the impact of background interference on state determination.
[0075] Specifically, in power equipment inspection images, different types of equipment components may appear simultaneously in the same image, and these components differ in size, shape, and appearance. If the original inspection image is directly input into the state recognition model for end-to-end processing, the model would need to simultaneously handle both component localization and state determination, resulting in significant learning difficulties. Therefore, a target detector is used to decouple component localization from state recognition. Each component is first cropped from the image, ensuring that each subsequent component image region contains only a single equipment component. Through this cascaded processing method, the state recognition model only needs to focus on the visual features within the cropped component image region, without needing to handle full-image location search and background separation, thus reducing the information load of a single processing step. The cropped component image region is much smaller than the original image, and its content focuses on a single equipment component. This allows the subsequent visual feature extraction process to be performed under cleaner input conditions, which is beneficial for improving the purity of the component's visual feature representation.
[0076] S2. Input the component image region into the visual encoder in the pre-trained state recognition model, and extract the visual features of the component image region based on the visual encoder to obtain the component visual feature representation;
[0077] The state recognition model consists of a visual encoder, a component memory, and a state memory. It is a static semantic prior knowledge stored after joint optimization of the visual encoder, component memory, and state memory through hierarchical contrastive learning during the training phase. This prior knowledge is used for state recognition in subsequent inference processes. The component memory stores semantic prototypes of different device component categories, with each category corresponding to a semantic prototype vector representing the global semantic center of that component category in the feature space. The state memory stores state prototypes corresponding to different operating states of each device component, with each operating state corresponding to a state prototype vector representing the global semantic center of that operating state category in the feature space.
[0078] A visual encoder is an image feature extraction model based on deep neural networks, used to convert input component image regions into high-dimensional vector numerical representations. This encoder can employ a Transformer or convolutional neural network architecture and, after pre-training on large-scale image data, possesses the ability to extract general visual features. Preferably, the visual encoder can be a Siglip2 visual encoder. After inputting the component image region, the visual encoder uses multiple nonlinear transformations to progressively abstract the original pixel information into semantic-level feature vectors. Taking the component image region of a meter as an example, the feature vector output by the visual encoder contains visual information related to state discrimination, such as pointer position, dial texture, and dial color distribution. Taking the component image region of a circuit breaker as an example, the feature vector output by the visual encoder contains visual information related to the closing / opening state, such as the angle of the switch arm and the relative position of the contacts.
[0079] The visual feature representation of a component refers to the resulting vector obtained by l2 normalizing the original feature vector output by the visual encoder. L2 normalization divides the original feature vector by its Euclidean norm, ensuring the feature vector has a magnitude of 1. The purpose of L2 normalization is to eliminate the influence of the feature vector magnitude on similarity calculations, ensuring that subsequent steps calculating the similarity between the feature vector and the prototype vector reflect only directional similarity, unaffected by differences in feature vector magnitudes. The normalized visual feature representation serves as a unified feature format for subsequent similarity calculations and prototype matching. Visually, a meter reading error state and a normal state may only differ in pointer deflection angle. After L2 normalization, the directional differences in the feature vectors corresponding to the two states are highlighted. These minute directional differences are amplified in cosine similarity calculations, thus facilitating the differentiation between visually similar operating states.
[0080] Furthermore, the component image region is input into the visual encoder in the pre-trained state recognition model. Visual features of the component image region are extracted based on the visual encoder to obtain a visual feature representation of the component, including:
[0081] The component image region is input into the visual encoder, and the d-dimensional visual features of the component image region are extracted according to the visual encoder to obtain the initial visual feature vector;
[0082] The initial visual feature vector is subjected to L2 normalization, and the normalized features are used as the visual feature representation of the component.
[0083] S3. Based on the component category, filter the corresponding device component's operating state prototype from the state memory in the state recognition model to obtain a set of state prototypes associated with the component category;
[0084] The state memory is a component of the state recognition model, used to store state prototypes corresponding to different operating states of various equipment parts. Operating states include normal states and various defect states. For example, the operating states of metering equipment can be divided into four categories: normal, meter reading error, meter damage, and blurred dial. During the training phase, each state prototype in the state memory is continuously optimized through momentum updates, and finally fixed as static semantic prior knowledge. Each operating state corresponds to a state prototype vector, which represents the global semantic center of that state type in the feature space. Taking a meter as an example, the state memory stores four state prototype vectors, corresponding to the typical feature centers of the four operating states: normal meter, meter reading error, meter damage, and blurred dial.
[0085] A runtime state prototype refers to the semantic center vector in the state memory corresponding to a specific runtime state category. This vector is obtained by statistically aggregating the features of all training samples under that state category during the training phase. As a typical feature template for that type of state, the runtime state prototype is used in the inference phase for similarity comparison with the feature representation of the part to be detected. For few-sample defect categories, the state prototype employs a class-balanced sampling strategy and a momentum update mechanism to ensure that features from minority class samples continuously participate in prototype updates, thereby guaranteeing that reliable state prototypes can also be obtained for few-sample defect categories.
[0086] Filtering refers to the process of searching and retrieving all operational state prototypes corresponding to a component from the state memory based on its category. The state memory stores all operational state prototypes for all equipment components, but there is no direct correspondence between the operational states of different components. For example, the operational states of a circuit breaker (open / close / abnormal) and the operational states of a respirator (normal / silicone discoloration / silicone tank damage / oil seal damage / abnormal oil seal level) are semantically unrelated and should not compete with each other in the feature space. Therefore, based on the component category output by the target detector, only the operational state prototypes corresponding to that component category are retrieved from the state memory, discarding those of other component categories. This narrows the scope of state recognition from all global state categories to a subset of the current component's corresponding state categories.
[0087] The state prototype set refers to the set of all operating state prototypes corresponding to the current component category. The number of prototypes in this set is equal to the total number of state categories defined for that device component. The state prototype set corresponding to meters includes four prototype vectors: meter normal, meter reading error, meter damaged, and meter blurred. The state prototype set corresponding to circuit breaker opening and closing includes three prototype vectors: circuit breaker open, circuit breaker closed, and circuit breaker abnormal. In the subsequent matching process, the feature representation of the component to be detected only needs to be calculated for similarity with the prototypes in the set, without having to compare it with all state prototypes globally one by one, thus eliminating interference from state prototypes of other device components. Insulator surface contamination and insulator breakage both appear as abnormal morphologies on the insulator surface, but belong to two different defect states of the insulator component. If the state recognition range is not constrained, the feature vector of insulator surface contamination may incorrectly generate a high similarity score with the state prototype of meter damage, thus causing misjudgment of state across devices. Therefore, after filtering the state prototype set according to component category, the insulator surface contamination is only similar to each prototype in the state prototype set of the insulator component. The matching range is limited to three states: normal insulator, contaminated insulator surface, and broken insulator, which fundamentally eliminates the possibility of cross-equipment state confusion.
[0088] S4. Calculate the similarity between the visual feature representation of the component and each state prototype in the state prototype set, and determine the operating status of the equipment based on the similarity matching results.
[0089] Similarity calculation refers to the mathematical operation that measures the degree of similarity between the visual feature representation of a component and each state prototype in the set of state prototypes. Commonly used similarity measures include cosine similarity and dot product similarity. Since both the visual feature representation of the component and the state prototype are unit vectors normalized by l2, cosine similarity and dot product similarity are equivalent under this condition and can both be obtained by calculating the dot product of the two vectors. The closer the dot product value is to 1, the more consistent the direction of the features of the component to be detected with the corresponding state prototype in the feature space, and the more similar they are at the semantic level. Taking a meter component as an example, if the dot product value of the feature vector of a meter image with the meter reading error state prototype is 0.85, with the meter normal state prototype is 0.52, with the meter damaged state prototype is 0.31, and with the meter dial blurred state prototype is 0.28, then the highest value corresponds to the meter reading error state prototype.
[0090] Equipment operating status refers to the current actual operating condition category of the component under inspection, including normal status and various defect states. The equipment operating status is determined by comparing the magnitudes of all similarity scores: the state prototype with the highest similarity score to the component's visual features is selected from the set of state prototypes; the operating status corresponding to this state prototype is the detection result. Taking an insulator component as an example, if the surface contamination state has the highest similarity score after similarity calculation, then the equipment operating status is determined to be surface contamination, indicating that the insulator has a surface contamination defect. After the equipment operating status is determined, the status information is fused with the component category and bounding box coordinates output by the target detector to output a complete detection result containing the three elements of component location, component category, and operating status.
[0091] Furthermore, similarity calculation employs cosine similarity or dot product similarity;
[0092] The visual feature representation of the component is compared with the similarity of each state prototype in the state prototype set to obtain the similarity score corresponding to each state prototype.
[0093] Based on the similarity score, select the state prototype corresponding to the highest similarity score, and determine the operating state associated with the state prototype corresponding to the highest similarity score as the device operating state.
[0094] In some implementations, the training process of the state recognition model is as follows:
[0095] S21. At the beginning of each training round, use the visual encoder at the current time to extract the visual features of all device component images in the training dataset to obtain the visual feature representation of all training components corresponding to the current round.
[0096] Among them, training rounds refer to the process of completely traversing all training samples once during the model training process.
[0097] The visual feature representation of a training component refers to the feature vector obtained by inputting images of device components from the training dataset into a visual encoder and then performing L2 normalization.
[0098] Specifically, at the beginning of each training epoch, the visual features of all device component images in the training dataset are re-extracted using the visual encoder at the current time step. Since the network parameters of the visual encoder are continuously updated during training, the feature representations extracted from the same device component image will change in different training epochs. Class centers are calculated based on the current feature distribution, ensuring that subsequent prototype reset operations are performed based on the latest feature space distribution.
[0099] S22. Based on the visual feature representations of all trained components and the corresponding component category labels for the current round, calculate the component feature center for each category of components.
[0100] Among them, the component feature center refers to the vector obtained by averaging the component visual feature representations of all training samples under a certain component category, which represents the global semantic center position of that type of component in the current feature space.
[0101] Specifically, based on the visual feature representations of all trained components and their corresponding category labels for the current round, the feature centers of each component category are calculated. For the j-th component category, the visual feature representations of all training samples in that category are summed and then divided by the number of samples in that category to obtain the feature center of that category.
[0102] S23. Update the semantic prototypes of each component in the component memory based on the component feature centers of each category of components;
[0103] The component memory is a component of the state recognition model, used to store component semantic prototypes for different device component categories. Each component category corresponds to a component semantic prototype vector.
[0104] A component semantic prototype refers to the semantic center vector in the component memory that corresponds to a certain component category, serving as a typical feature template for that type of component.
[0105] Overwrite update refers to the operation of replacing the original value with the newly calculated value.
[0106] Specifically, based on the calculated component feature centers of each category of components, the original component semantic prototypes of the corresponding component categories in the component memory are replaced with the newly calculated component feature centers, so that the component semantic prototypes are consistent with the feature distribution under the current visual encoder.
[0107] S24. Based on the visual feature representations of all training components and the corresponding running status labels for the current round, calculate the state feature center for each category of running status.
[0108] Among them, the state feature center refers to the vector obtained by averaging the component visual feature representations of all training samples under a certain operating state category, which represents the global semantic center position of that operating state in the current feature space.
[0109] Specifically, based on the visual feature representations of all training components and the corresponding running state labels for the current round, the state feature center for each category of running state is calculated. For the l-th running state category, the visual feature representations of all training samples in that category are summed and then divided by the number of samples in that category to obtain the state feature center corresponding to that category.
[0110] S25. Update each state prototype in the state memory bank based on the recalculated state feature center;
[0111] The state memory is a component of the state recognition model, used to store the state prototypes corresponding to different operating states of each device component. Each operating state corresponds to a state prototype vector.
[0112] A state prototype refers to the semantic center vector in the state memory that corresponds to a specific running state category, serving as a typical feature template for that type of running state.
[0113] Specifically, based on the calculated state feature centers of each category of operating state, the original state prototypes of the corresponding operating states in the state memory are replaced with the newly calculated state feature centers, so that the state prototypes are consistent with the feature distribution under the current visual encoder.
[0114] S26. In each training round, a class-balanced PK sampling strategy is used to construct the current training batch. The PK sampling strategy is to randomly select P running state categories from the training dataset, randomly sample K component images from each running state category, and construct multiple training batches containing P×K training samples based on the sampling results.
[0115] The PK sampling strategy refers to a sampling method that randomly selects P running state categories from the training dataset, randomly samples K component images from each selected running state category, and constructs a training batch containing P×K training samples.
[0116] A training batch refers to a batch of data containing P×K training samples constructed according to the PK sampling strategy.
[0117] Specifically, following the PK sampling strategy, P operating state categories are randomly selected from the training dataset, and then K component images are randomly sampled from each selected operating state category, forming a training batch containing P×K training samples. This process is repeated until all training samples in the current training round are assigned to a training batch, resulting in multiple training batches corresponding to the current training round. In the power equipment defect detection dataset, the number of samples in different operating state categories varies significantly. The PK sampling strategy randomly selects samples at the operating state category level to ensure that each batch contains samples from multiple state categories, and that the number of samples selected for each category is the same.
[0118] S27. In each training batch, the network parameters of the visual encoder are updated with gradients based on the training samples in the training batch and the component category label and running state label corresponding to each training sample, and the component semantic prototype in the component memory and the state prototype in the state memory are updated with momentum.
[0119] Gradient update refers to the process of adjusting the network parameters along the gradient descent direction after calculating the gradient of the visual encoder network parameters according to the joint optimization objective function.
[0120] Momentum update refers to the process of merging the feature vectors of the current training samples into the prototype vectors in the memory bank at a certain ratio. For the prototype vector corresponding to category y... and the feature vector of the current training sample The momentum update is calculated as follows:
[0121] ,
[0122] ;
[0123] in, For category The corresponding prototype vector, This is the momentum coefficient.
[0124] Specifically, in each training batch, P×K training samples from the current batch are sequentially input into the visual encoder to extract the visual feature representations of each sample's components. Component-level contrastive loss and state-level contrastive loss are calculated based on the component category label and running state label of each sample. These losses are then weighted and summed to obtain the joint optimization objective function value, which is used to update the network parameters of the visual encoder using gradients. Simultaneously, momentum updates are performed on the component memory and state memory: the component semantic prototypes corresponding to the component categories of each sample in the component memory are updated according to the momentum update formula, and the state prototypes corresponding to the running states of each sample in the state memory are updated according to the momentum update formula.
[0125] S28. Repeat the training process for each training batch until all training samples corresponding to the training round have been traversed, and the training round is completed.
[0126] Specifically, gradient update and momentum update operations are performed sequentially on each batch in the current training round. After each training batch is processed, the same operation is performed on the next batch until all training batches in the current training round have been processed. At this point, all training samples in the current training round have participated in one forward propagation and parameter update, and the current training round is completed.
[0127] S29. Repeat the training rounds until convergence, and store the network parameters of the trained visual encoder, the semantic prototypes of the components in the component memory, and the state prototypes in the state memory in a fixed manner to obtain the trained state recognition model.
[0128] Convergence refers to the state where the value of the joint optimization objective function no longer decreases significantly in multiple consecutive training rounds.
[0129] Fixed storage refers to the operation of saving the data obtained after training in a static form to a storage medium.
[0130] Specifically, multiple training rounds are repeated, with each round executing steps S21 to S28 sequentially, until the joint optimization objective function converges. After training convergence, the network parameters of the visual encoder and the prototype vectors in the dual memory are fully optimized. All network parameters of the visual encoder, the semantic prototype vectors of each component in the component memory, and the prototype vectors of each state in the state memory are saved to a storage medium, resulting in a trained state recognition model. In subsequent inference, the stored data is loaded, and state recognition can be performed directly.
[0131] In some implementations, S27, in each training batch, performs gradient updates on the network parameters of the visual encoder based on the training samples in the training batch and the component category label and running state label corresponding to each training sample, and performs momentum updates on the component semantic prototypes in the component memory and the state prototypes in the state memory, including:
[0132] S271. In each training batch, each training sample in the training batch is input into the visual encoder, and the visual features of each training sample are extracted according to the visual encoder to obtain the visual feature representation of the training component of each sample in the training batch.
[0133] Specifically, in each training batch, each training sample within that batch is input into the visual encoder. Through forward propagation calculation using the visual encoder, each sample is mapped from the image space to the feature space, yielding the visual feature representation of the corresponding training part for each sample. This feature representation is used for subsequent contrastive loss calculation and memory momentum update. The feature extraction within a training batch differs in purpose from the full feature extraction at the beginning of each training epoch: features extracted within a batch are used to calculate the loss value for the current batch, while the full features extracted at the beginning of each training epoch are used to calculate class centers to reset the memory prototype.
[0134] S272. Based on the component category label of each training sample in the training batch, select the corresponding component semantic prototype from the component memory as a positive sample, select the component semantic prototype of the other component categories as a negative sample, and calculate the component-level contrast loss for each sample.
[0135] Among them, component-level contrastive loss is a loss metric for contrastive learning at the component level, used to measure the degree of matching between the component visual feature representation of each training sample and the semantic prototype of each component in the component memory.
[0136] For each training sample in the current training batch, based on the component category label of the sample, the semantic prototype of the corresponding component category is selected from the component memory as a positive sample, and the semantic prototypes of the component categories other than the sample's component category are selected as negative samples. The closer the visual feature representation of the training sample is to the positive sample prototype in the feature space, and the farther it is from the negative sample prototype, the smaller the component-level contrast loss value. Through the optimization of the component-level contrast loss, the features of samples belonging to the same component category are clustered together in the feature space, while the features of samples from different component categories are separated. The formula for calculating the component-level contrast loss is:
[0137] ,
[0138] in, This refers to the sample index in the current training batch; For the first Visual feature representation of training components for each training sample; express and The dot product; For the first Part category labels for each training sample The corresponding component semantic prototype; Temperature coefficient; Total number of component categories; For the first The semantic prototype of a component category.
[0139] S273. Determine the running state space corresponding to each training sample based on the component category label of each training sample in the training batch. The running state space is the set of all running state categories of the equipment components corresponding to each component category label.
[0140] The operating state space refers to the set of all operating state categories of equipment components corresponding to a certain component category. The operating state space of the meter component includes four operating state categories: meter normal, meter reading error, meter damaged, and meter display unclear; the operating state space of the circuit breaker component includes three operating state categories: circuit breaker open, circuit breaker closed, and circuit breaker abnormal.
[0141] Specifically, for each training sample in the current training batch, the running state space corresponding to that component category is determined based on the component category label of the sample. This running state space defines the range of state discrimination for that training sample during state-level contrastive learning, ensuring that state-level contrastive learning is only performed between different running states of the same component category, without involving the state categories of other component categories.
[0142] S274. Based on the running state labels of each training sample in the training batch, select the state prototypes corresponding to the running state labels in the running state space from the state memory as positive samples, and select the state prototypes corresponding to the other running states in the running state space as negative samples, and calculate the state level contrast loss of each sample.
[0143] Among them, state-level contrastive loss is a loss metric for contrastive learning at the runtime state level, used to measure the degree of matching between the visual feature representation of each training sample and the corresponding runtime state prototype in the state memory.
[0144] Specifically, for each training sample in the current training batch, based on the sample's running state space, the state prototype corresponding to the running state label within that running state space is selected from the state memory as a positive sample, and the state prototypes corresponding to the remaining running states within that running state space (excluding the positive samples) are selected as negative samples. The closer the visual feature representation of the training sample is to the positive sample prototype in the feature space, and the farther it is from the negative sample prototype, the smaller the state-level contrastive loss value. Since positive and negative samples are selected only from the running state space corresponding to the current sample's component category, there is no direct competition between states of different component categories, reducing the interference of visually similar but different component states on feature learning. The formula for calculating the state-level contrastive loss is:
[0145] ,
[0146] in, For the first The running status of each training sample The corresponding state prototype; For the first Part category labels for each training sample The corresponding runtime state space; For the running state space The Middle The state prototype corresponding to each running state.
[0147] S275. The joint optimization objective function value is obtained by weighted summation of the component-level contrastive loss and the state-level contrastive loss of all training samples in the training batch.
[0148] The joint optimization objective function value is a scalar value obtained by weighting the component-level contrast loss and the state-level contrast loss by weight coefficients and then taking the batch average. It is used to drive the joint optimization of the visual encoder network parameters and the memory prototype.
[0149] For all training samples in the current training batch, the component-level contrastive loss and state-level contrastive loss of each sample are multiplied by their respective weight coefficients and then summed to obtain the comprehensive loss value of each sample. The comprehensive loss values of all samples in the current batch are then averaged to obtain the joint optimization objective function value. This objective function integrates the contrastive learning objectives at both the component-level and state-level layers into a unified optimization objective, allowing the visual encoder to share the same set of network parameters when learning features at both the component-level structural semantics and state-level fine-grained semantics levels. The joint optimization objective function value is:
[0150] ,
[0151] in, For training batches, These are the weighting coefficients for the component-level contrast loss. These are the weighting coefficients for the state-level contrast loss.
[0152] S276. Update the network parameters of the visual encoder with gradients based on the joint optimization objective function value, and update the momentum of the semantic prototype of the component in the component memory and the state prototype in the state memory based on the visual feature representation of the training components of each training sample in the training batch.
[0153] The present invention will be further described below with reference to the accompanying drawings and examples.
[0154] like Figure 2 As shown, in the embodiments of the present invention, the target detector is built based on YOLOv12, the visual encoder adopts the Siglip2 model, the input is a complete substation inspection image, and the output is a detection result that detects and classifies the status of the equipment.
[0155] First, the dataset was hierarchically labeled and partitioned. This dataset covers various operating conditions, inspection perspectives, lighting changes, and defect patterns encountered in real-world environments. Specifically, each instance is labeled with a bounding box, a device component category label, and a status label describing the corresponding operating condition of that component (covering everything from normal status to various defects). Detailed category definitions and representative examples are shown below. Figure 3 As shown, this dataset contains a total of 2685 inspection images and 6460 labeled instances. Following standard practice, we divided the dataset into training and testing sets in approximately a 7:3 ratio, resulting in 1851 training images and 834 testing images.
[0156] The experimental training mainly consists of two stages: the first stage is to train the target detection model, and the second stage is to train Siglip2 using hierarchical contrastive learning.
[0157] Phase 1: YOLOv12x was used as the default object detector in this phase. For comparison, YOLO26x was also evaluated. The batch size was set to 8, and training lasted for 200 epochs.
[0158] Phase 2: This phase uses SigLIP2-Large-Patch16-384 as the visual encoder, with an input resolution of 384×384. During training, the batch size is set to 16, training is conducted for 300 epochs, and the initial learning rate is 5×10⁻⁻⁶. 5 SGD was used as the optimizer. The loss weights were set to λc=0.6 and λs=0.8, and the temperature parameter and memory momentum for the second stage were set to τ=0.05 and µ=0.12, respectively. For the PK sampling strategy, we set P=8 and K=2.
[0159] To demonstrate the rationality of this invention, we also directly trained YOLOv12x and YOLO26x using state-level annotations, with the same training configuration as in Phase 1, and then compared the results with those of this invention. The main evaluation metric is mAP@50: Mean Average Precision (MAP) for samples with a confidence level of 0.5 or higher, calculated as follows:
[0160] ;
[0161] Where C is the number of species, and AP is the average accuracy per species, calculated as follows:
[0162] ;
[0163] P represents accuracy, TP represents correctly detected positive samples, and FP represents incorrectly detected negative samples. The calculation formula is:
[0164] ;
[0165] This indicator can effectively reflect the model's detection capability.
[0166] Evaluation metrics also include mAP@50:95, which calculates the average accuracy across 10 thresholds from IoU=0.50 to IoU=0.95 (with a step size of 0.05) and takes the average; and the composite false alarm rate (FPR). comp This is used to measure the false alarm tendency of the complete inspection process under different state categories. The filtering confidence threshold for the prediction results is set to τ. det =0.5, and a greedy one-to-one matching is performed with an IoU threshold of 0.5. This metric is defined as the macro-average of the false alarm rates for all evaluated state categories, where FP... c and Pred c Let represent the number of false positives (false alarms) and the total number of predicted instances for category c, respectively, where |C| represents the total number of categories being evaluated. FPR comp The lower the value, the fewer false alarms there are, and therefore the better the model performance.
[0167] ;
[0168] To demonstrate the rationality of this invention, we also directly trained YOLOv12x and YOLO26x using state-level annotations. The training configuration was the same as that of Phase 1, and this will be referred to as single-stage training. The results will then be compared with those of this invention (two-stage training).
[0169] Table 1 summarizes the quantitative comparison between the direct single-stage paradigm and the proposed two-stage framework. Overall, the proposed framework consistently improves detection performance on both YOLO26 and YOLOv12 detectors while reducing the false alarm rate. In particular, the framework achieves the greatest performance improvement when using YOLOv12 as the first-stage detector: mAP@50 increases from 0.6891 to 0.8008, and mAP@50:95 increases from 0.5405 to 0.6577. Simultaneously, the composite false alarm rate decreases from 0.1711 to 0.1219. Similar improvements were observed when using YOLO26, demonstrating that the proposed two-stage framework can consistently benefit different detector architectures.
[0170] Table 1 Comparison of Main Results
[0171]
[0172] Table 2 further reports the class-by-class mAP@50 results for device-associated states. Under both YOLO26 and YOLOv12, the proposed framework consistently improves the recognition performance for most "device-state" categories. The largest performance gains occur in visually easily confused anomalous states, such as surface contamination, incorrect instrument readings, abnormal oil seal levels, and pressure plate anomalies, demonstrating the advantage of the two-stage framework in fine-grained state discrimination. Although slight performance degradation occurred in a few categories (such as expander top damage and several normal state categories) when using YOLO26, the overall improvement across different device types remained consistent, resulting in a significant increase in overall mAP.
[0173] Table 2 Comparison of fine-grained state mAP@50
[0174]
[0175] This performance improvement is primarily attributed to decoupling target localization from fine-grained state recognition. In the single-stage paradigm, the detector must jointly optimize bounding box localization and discriminate across all "device-state" categories, making visually similar states from different device types highly susceptible to confusion. In contrast, the proposed framework first determines the device category and then performs state recognition within the corresponding device-specific state space. This device-conditional reasoning effectively eliminates unnecessary cross-device competition and allows the memory to fully utilize the discriminative semantic representations learned for each device type. Consequently, device states (especially normal states) are less likely to be misclassified as anomalous states of other device categories, resulting in higher recognition accuracy and a lower false positive rate.
[0176] Figure 4 Representative qualitative results are presented. It can be observed that direct single-stage detectors, including YOLOv12 and YOLO26, still produce a large number of erroneous state predictions, especially for visually similar defect categories. In contrast, the two-stage framework proposed in this paper first accurately locates the device components and then performs component-condition-based state recognition, thus making the prediction results more reliable. Thanks to the decoupling of target localization and fine-grained state discrimination, our method can correctly identify the component category and its operating state even for difficult samples with extremely subtle appearance differences.
[0177] To further explore the learned feature representations Figure 5The feature embeddings of the single-stage detector and the proposed two-stage framework were visualized using t-SNE technology. Compared with the single-stage paradigm, the proposed framework learns a more structurally clear embedding space. Features belonging to the same part category exhibit significantly higher intra-class compactness, while the different operational states within each part are also more clearly separated. This improvement in feature distribution demonstrates that the proposed hierarchical representation learning effectively captures part-level structural semantics and fine-grained state features, thus providing a more discriminative representation for defect identification.
[0178] Example 2
[0179] This invention provides a power equipment condition detection device, comprising:
[0180] The target detection module is used to input the acquired power equipment inspection images into the pre-trained target detector, and to detect and locate the power equipment components in the power equipment inspection images according to the target detector, so as to obtain the component category, bounding box coordinates, and component image regions cropped from the inspection images according to the bounding box coordinates.
[0181] The visual encoding module is used to input the component image region into the visual encoder in the pre-trained state recognition model, and extract the visual features of the component image region based on the visual encoder to obtain the component visual feature representation.
[0182] The state prototype filtering module is used to filter the operating state prototypes of corresponding equipment components from the state memory in the state recognition model according to the component category, and obtain a set of state prototypes associated with the component category.
[0183] The state determination module is used to calculate the similarity between the visual feature representation of the component and each state prototype in the state prototype set, and determine the operating state of the device based on the similarity matching result.
[0184] It should be noted that each module and unit in the power equipment status detection device in this embodiment corresponds one-to-one with each step in the power equipment status detection method in the aforementioned embodiment. Therefore, the specific implementation of this embodiment can refer to the implementation of the aforementioned power equipment status detection method, and will not be repeated here.
[0185] Example 3
[0186] This embodiment provides an electronic device, including at least one processor and a memory. Optionally, the device further includes a communication component. The processor, memory, and communication component are connected via a bus.
[0187] In a specific implementation, at least one processor executes computer execution instructions stored in memory, causing at least one processor to perform the above-described method.
[0188] The specific implementation process of the processor can be found in the above method embodiments, and its implementation principle and technical effect are similar, so it will not be repeated here.
[0189] In the above embodiments, it should be understood that the processor can be a Central Processing Unit (CPU), or other general-purpose processors, digital signal processors (DSPs), application-specific integrated circuits (ASICs), etc. The general-purpose processor can be a microprocessor or any conventional processor. The steps of the method disclosed in this invention can be directly implemented by a hardware processor, or implemented by a combination of hardware and software modules within the processor.
[0190] The memory may include random access memory (RAM) and may also include non-volatile memory (NVM), such as at least one disk storage device.
[0191] The bus can be an Industry Standard Architecture (ISA) bus, a Peripheral Component Interconnect (PCI) bus, or an Extended Industry Standard Architecture (EISA) bus, etc. Buses can be categorized as address buses, data buses, control buses, etc. For ease of illustration, the buses shown in the accompanying drawings are not limited to a single bus or a single type of bus.
[0192] This application also provides a computer program product, including a computer program that, when executed by a processor, implements the above-described method.
[0193] This application also provides a computer-readable storage medium storing computer-executable instructions, which, when executed by a processor, implement the above-described method.
[0194] The aforementioned readable storage medium can be implemented by any type of volatile or non-volatile storage device or a combination thereof, such as static random access memory (SRAM), electrically erasable programmable read-only memory (EEPROM), erasable programmable read-only memory (EPROM), programmable read-only memory (PROM), read-only memory (ROM), magnetic storage, flash memory, magnetic disk, or optical disk. The readable storage medium can be any available medium accessible to a general-purpose or special-purpose computer.
[0195] An exemplary readable storage medium is coupled to a processor, enabling the processor to read information from and write information to the readable storage medium. Of course, the readable storage medium can also be a component of the processor. The processor and the readable storage medium can reside in an Application Specific Integrated Circuit (ASIC). Alternatively, the processor and the readable storage medium can exist as discrete components in the device.
[0196] The division of units is merely a logical functional division; in actual implementation, there may be other division methods. For example, multiple units or components may be combined or integrated into another system, or some features may be ignored or not executed. Furthermore, the coupling or direct coupling or communication connection shown or discussed may be indirect coupling or communication connection through some interfaces, devices, or units, and may be electrical, mechanical, or other forms.
[0197] The units described as separate components may or may not be physically separate. The components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple network units. Some or all of the units can be selected to achieve the purpose of this embodiment according to actual needs.
[0198] In addition, the functional units in the various embodiments of the present invention can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit.
[0199] If a function is implemented as a software functional unit 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 this invention, or the part that contributes to the prior art, or a part of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods of the various embodiments of this invention. The aforementioned storage medium includes various media capable of storing program code, such as USB flash drives, portable hard drives, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks.
[0200] Those skilled in the art will understand that all or part of the steps of the above-described method embodiments can be implemented by hardware related to program instructions. The aforementioned program can be stored in a computer-readable storage medium. When executed, the program performs the steps of the above-described method embodiments; and the aforementioned storage medium includes various media capable of storing program code, such as ROM, RAM, magnetic disks, or optical disks.
[0201] The specific embodiments described above further illustrate the purpose, technical solution, and beneficial effects of the present invention. It should be understood that the above description is only a specific embodiment of the present invention and is not intended to limit the scope of protection of the present invention. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of the present invention should be included within the scope of protection of the present invention.
Claims
1. A method for detecting the condition of power equipment, characterized in that, include: The acquired power equipment inspection images are input into a pre-trained target detector. The target detector detects and locates the power equipment components in the power equipment inspection images to obtain the component category, bounding box coordinates, and component image regions cropped from the inspection images based on the bounding box coordinates. The component image region is input into the visual encoder in the pre-trained state recognition model, and the visual features of the component image region are extracted according to the visual encoder to obtain the component visual feature representation; Based on the component category, the operating state prototypes of the corresponding device components are selected from the state memory in the state recognition model to obtain a set of state prototypes associated with the component category; The visual feature representation of the component is compared with the similarity of each state prototype in the state prototype set, and the operating state of the device is determined based on the similarity matching result.
2. The method according to claim 1, characterized in that, The training process of the state recognition model is as follows: At the beginning of each training round, the visual features of all device component images in the training dataset are extracted using the visual encoder at the current time, so as to obtain the visual feature representation of all training components corresponding to the current round. Based on the visual feature representations of all trained components and the corresponding component category labels for the current round, calculate the component feature center for each category of components; The semantic prototypes of each component in the component memory are updated based on the component feature centers of each category of components. Based on the visual feature representations of all training components and the corresponding running status labels for the current round, calculate the state feature center for each category of running status. The state prototypes in the state memory are updated based on the recalculated state feature centers. In each training round, a class-balanced PK sampling strategy is used to construct the current training batch. The PK sampling strategy involves randomly selecting P running state categories from the training dataset, randomly sampling K component images from each running state category, and constructing multiple training batches containing P×K training samples based on the sampling results. In each training batch, the network parameters of the visual encoder are updated with gradients based on the training samples in the training batch and the component category label and running state label corresponding to each training sample, and the component semantic prototype in the component memory and the state prototype in the state memory are updated with momentum. Repeat the training process for each training batch until all training samples corresponding to the training round have been traversed, thus completing the training round; Repeat the training rounds until convergence, and store the network parameters of the trained visual encoder, the semantic prototypes of the components in the component memory, and the state prototypes in the state memory in a fixed manner to obtain the trained state recognition model.
3. The method according to claim 2, characterized in that, In each training batch, the network parameters of the visual encoder are updated with gradients based on the training samples in the batch and the component category label and running state label corresponding to each training sample. The component semantic prototypes in the component memory and the state prototypes in the state memory are also updated with momentum, including: In each training batch, each training sample in the training batch is input into the visual encoder, and the visual features of each training sample are extracted according to the visual encoder to obtain the visual feature representation of the training component of each sample in the training batch. Based on the component category label of each training sample in the training batch, the corresponding component semantic prototype is selected from the component memory as a positive sample, and the component semantic prototypes of other component categories are selected as negative samples. The component-level contrast loss of each sample is calculated. The running state space corresponding to each training sample is determined based on the component category label of each training sample in the training batch. The running state space is the set of all running state categories of the equipment components corresponding to each component category label. Based on the running state label of each training sample in the training batch, select the state prototype corresponding to the running state label in the running state space from the state memory as a positive sample, select the state prototype corresponding to the other running states in the running state space as a negative sample, and calculate the state level contrast loss of each sample. The joint optimization objective function value is obtained by weighted summation of the component-level contrastive loss and the state-level contrastive loss of all training samples in the training batch. The network parameters of the visual encoder are updated by gradient based on the joint optimization objective function value, and the semantic prototypes of the components in the component memory and the state prototypes in the state memory are updated by momentum based on the visual feature representations of the training components of each training sample in the training batch.
4. The method according to claim 3, characterized in that, The formula for calculating the component-level contrast loss is as follows: , in, This refers to the sample index in the current training batch; For the first Visual feature representation of training components for each training sample; express and The dot product; For the first Part category labels for each training sample The corresponding component semantic prototype; Temperature coefficient; Total number of component categories; For the first The semantic prototype of each component category; The formula for calculating the state-level contrast loss is: , in, For the first The running status of each training sample The corresponding state prototype; For the first Part category labels for each training sample The corresponding runtime state space; For the running state space The Middle The state prototype corresponding to each running state; The joint optimization objective function value is: , in, For training batches, The weighting coefficients for the component-level contrast loss are... is the weighting coefficient for the state-level contrast loss.
5. The method according to claim 3, characterized in that, The formula for calculating the momentum update is: , ; in, For category The corresponding prototype vector, This is the momentum coefficient.
6. The method according to claim 1, characterized in that, The target detector is a YOLOv12 target detection network; the visual encoder is a Siglip2 visual encoder.
7. The method according to claim 1, characterized in that, The step of inputting the component image region into the visual encoder of the pre-trained state recognition model, and extracting the visual features of the component image region based on the visual encoder to obtain the component visual feature representation includes: The component image region is input into a visual encoder, and the d-dimensional visual features of the component image region are extracted based on the visual encoder to obtain an initial visual feature vector; The initial visual feature vector is subjected to L2 normalization, and the normalized features are used as the visual feature representation of the component.
8. The method according to claim 1, characterized in that, The similarity calculation uses cosine similarity or dot product similarity. The visual feature representation of the component is compared with the similarity of each state prototype in the state prototype set to obtain the similarity score corresponding to each state prototype. Based on the similarity score, select the state prototype corresponding to the highest similarity score, and determine the operating state associated with the state prototype corresponding to the highest similarity score as the device operating state.
9. A power equipment condition monitoring device, characterized in that, include: The target detection module is used to input the acquired power equipment inspection image into a pre-trained target detector, and detect and locate the power equipment components in the power equipment inspection image according to the target detector, so as to obtain the component category, bounding box coordinates, and component image region cropped from the inspection image according to the bounding box coordinates. The visual encoding module is used to input the component image region into the visual encoder in the pre-trained state recognition model, and extract the visual features of the component image region according to the visual encoder to obtain the component visual feature representation; The state prototype filtering module is used to filter the operating state prototypes of the corresponding equipment components from the state memory in the state recognition model according to the component category, so as to obtain a set of state prototypes associated with the component category. The state determination module is used to calculate the similarity between the visual feature representation of the component and each state prototype in the state prototype set, and determine the operating state of the device based on the similarity matching result.
10. An electronic device, characterized in that, include: At least one processor, at least one memory, and computer program instructions stored in the memory, which, when executed by the processor, implement the method as described in any one of claims 1-8.