Cross-time-domain feature decoupling power grid few-sample operation behavior recognition model optimization method, system and device and medium

Through the dual-stream feature decoupling network and virtual sample generation technology, the problem of feature inconsistency and labeling cost caused by day and night lighting changes in power grid construction operations is solved, the accuracy and adaptability of the power grid operation behavior recognition model are improved, and efficient power grid operation behavior recognition is achieved.

CN120766360APending Publication Date: 2025-10-10GUIZHOU POWER GRID CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202510940354.2
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-07-09
Publication Date
2025-10-10

AI Technical Summary

Technical Problem

In power grid construction operations, changes in day and night lighting conditions lead to feature inconsistency, insufficient cross-domain generalization capabilities, and high labeling costs, which limit the performance stability of traditional visual recognition algorithms and the application effect of supervised learning models.

Method used

A power grid few-sample operation behavior recognition model is adopted with cross-time domain feature decoupling. The domain-private features and domain-shared features of daytime and nighttime videos are decomposed through a dual-stream feature decoupling network. Virtual sample features are generated by combining a cross-domain attention module and a multi-layer perceptron. The model parameters are optimized through a total loss function to improve the model's recognition ability under different lighting conditions.

Benefits of technology

It significantly improves the accuracy and robustness of the power grid's few-sample operation behavior recognition model, reduces the labeling cost of night operation data, and improves the model's adaptability and generalization ability in complex lighting environments.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120766360A_ABST
    Figure CN120766360A_ABST
Patent Text Reader

Abstract

The invention relates to the technical field of power grid outage operation behavior recognition, and discloses a cross-time-domain feature decoupling power grid few-sample operation behavior recognition model optimization method, system and device and a medium, and the method comprises the steps: obtaining a first video data set of a target power grid outage operation scene, and providing basic data for feature decomposition and optimization, and model training and optimization are ensured to aim at specific operation scenes. And a double-flow feature decoupling network is established for feature decomposition, domain private and domain shared features of daytime and night videos are distinguished, and the recognition capability of the model for operation behaviors under different illumination is improved. A day and night feature hybrid generation mechanism is preset to generate virtual sample features, the diversity of training samples is enriched, and the generalization ability of the model under the condition of few samples is improved. The operation behavior identification model is optimized based on the virtual sample features, so that the model can better adapt to a power grid outage operation scene, and technical support is provided for safe operation and efficient management of a power grid.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of power grid power outage operation behavior recognition, and in particular to a power grid few-sample operation behavior recognition model optimization method, system, equipment and medium with cross-time domain feature decoupling. Background Art

[0002] As the construction of new power systems continues to advance towards full coverage and all-weather operation, grid construction scenarios present complex characteristics that are cross-regional, multi-time, and dynamically changing. In such complex environments, the recognition of worker behavior faces severe challenges, especially under the conditions of drastic changes in lighting caused by the alternation of day and night. The feature expression of the same type of work behavior under different lighting conditions varies significantly, seriously restricting the performance stability and generalization ability of traditional visual recognition algorithms. At the same time, with the continuous refinement and updating of the definition of illegal behaviors in power safety operation regulations, new types of work behavior continue to increase, resulting in a scarcity of relevant labeled samples. In addition, due to regional differences, the sample reusability is poor, further limiting the application effect of supervised learning models in cross-time or cross-regional scenarios. In addition, when facing the migration of day and night environments, traditional supervised learning methods are prone to coupling problems between the source domain and the target domain feature space, resulting in a significant decline in model migration performance.

[0003] In recent years, domain adaptation and few-shot learning techniques have provided new research paths for power grid operation behavior recognition. For example, Time-WDA algorithm proposed by Wang et al. [HUILING WANG, YAPANI RAIKO, LASSE LENSU, et al. Semi-supervised domain adaptation for weakly labeled semantic video object segmentation [C]. Asian conference on computer vision. Springer, Cham, 2016: 163-179.] can adjust the pre-trained model in the target domain by using the time sequence semantic information in the image sequence, thus improving the recognition performance in the target domain. Weakly supervised domain adaptation method SSPS designed by Bearman et al. [AMY BEARMAN, OLGARUSSAKOVSKY, VITTORIO FERRARI, et al. What's the point: Semantic segmentation with point supervision [C]. European conference on computer vision. Springer, Cham, 2016: 549-565.] introduces a small number of positioning points on the basis of image-level labels, and optimizes the loss function by introducing prior constraints, thus improving the inference accuracy of the target region and reducing the dependence of the model on high-quality labeled data, which is helpful for the rapid iteration and update of the model in the power grid scene. For the domain shift problem under small sample, Chen et al. [WENTAO CHEN, ZHANG ZHANG, WEI WANG, et al. Cross-Domain Cross-Set Few-Shot Learning via Learning Compact and Aligned Representations [C]. European conference on computer vision. Tel Aviv, Israel 2022: 383-399.] proposed a cross-domain cross-set few-shot learning task setting, which alleviated the feature shift problem between the training (support set) and testing (query set) stages of new class data by designing a bidirectional alignment compact representation learning strategy.

[0004] In addition, for the cross-domain few-shot image classification problem with non-equivalent feature space, Kaveh et al. [KAVEH HASSANI. Cross-Domain Few-Shot Graph Classification [C]. Proceedings of the AAAI Conference on Artificial Intelligence, 2022: 6856-6864.] constructed three cross-domain image recognition benchmark datasets, and proposed a graph encoder based on attention mechanism, which can simultaneously learn task-related and task-independent feature representation, and achieved excellent classification accuracy in multiple meta-learning test tasks. To further solve the two key problems of "unknown class" and "insufficient samples" in few-shot learning, Hou et al. [RUIBING HOU, HONG CHANG, BINGPENG MA, et al. Cross Attention Network for Few-shot Classification [C]. NeurIPS. Vancouver, BC, Canada, 2019: 4005-4016.] designed an interactive attention network structure, which can effectively locate the key area of the target object and enhance the discriminability of feature representation.

[0005] However, although the prior art has made certain progress in standard field adaptation and small sample recognition tasks, under the conditions of significant day-night scene switching and complex environmental interference existing in power grid construction operations, there are still practical application bottlenecks such as large feature inconsistency, insufficient cross-domain generalization ability, and high labeling cost. SUMMARY

[0006] In view of the above existing problems, the present application is proposed.

[0007] Therefore, the present application provides a power grid few-shot operation behavior recognition model optimization method, system, device and medium across time domain feature decoupling, which can solve the problems of large feature inconsistency, insufficient cross-domain generalization ability and high labeling cost existing in cross-time period operation behavior recognition.

[0008] To solve the above technical problems, the present application provides the following technical solutions:

[0009] In a first aspect, the present application provides a power grid few-shot operation behavior recognition model optimization method across time domain feature decoupling, comprising:

[0010] obtaining a first video data set under a target power grid outage operation scene;

[0011] The first video data set comprises a cross-period operation data set of a diurnal source domain video and a few-sample night target domain video;

[0012] A double-flow feature decoupling network is established, feature decomposition is performed on the first video data set according to the double-flow feature decoupling network, and domain private features and domain shared features of diurnal and nocturnal videos are obtained;

[0013] A preset diurnal and nocturnal feature mixing generation mechanism is established, and virtual sample features are generated based on the domain private features and the domain shared features of the diurnal and nocturnal videos;

[0014] An operation behavior recognition model is optimized based on the virtual sample features, and an optimized operation behavior recognition model is obtained.

[0015] As a preferred scheme of the power grid few-sample operation behavior recognition model optimization method based on cross-time domain feature decoupling, wherein: the double-flow feature decoupling network is established, feature decomposition is performed on the first video data set according to the double-flow feature decoupling network, and domain private features and domain shared features of diurnal and nocturnal videos are obtained, which comprises:

[0016] A double-flow feature decoupling network is established, and the input of the double-flow feature decoupling network is a cross-period operation data set of a diurnal source domain video and a few-sample night target domain video;

[0017] The double-flow feature decoupling network is used to obtain diurnal spatial features nocturnal spatial features diurnal motion features and nocturnal motion features

[0018] As a preferred scheme of the power grid few-sample operation behavior recognition model optimization method based on cross-time domain feature decoupling, wherein: the double-flow feature decoupling network is established, feature decomposition is performed on the first video data set according to the double-flow feature decoupling network, and domain private features and domain shared features of diurnal and nocturnal videos are obtained, which further comprises:

[0019] A dynamic gating function is established The dynamic gating function is used for feature re-decomposition;

[0020] The diurnal spatial features and the diurnal motion features are decomposed into domain private features and domain shared features of diurnal videos

[0021] The nocturnal spatial features and the nocturnal motion features are decomposed into domain private features and domain shared features of nocturnal videos

[0022] The decomposition form is defined as follows:

[0023]

[0024] Where *∈{d,n}, ⊙ represents channel-by-channel multiplication. Given an input z, the dynamic gating function is designed as:

[0025]

[0026] Among them, W1 and W2 are learnable parameters, ReLU(·) is the activation function, GAP(·) represents global average pooling, and σ(·) is the Sigmoid function.

[0027] As a preferred solution of the power grid few-sample operation behavior recognition model optimization method with cross-time domain feature decoupling described in the present invention, the day and night feature hybrid generation mechanism includes:

[0028] Preset cross-domain attention module and multi-layer perceptron;

[0029] Establish feature mixing logic composed of cross-domain attention modules and multi-layer perceptrons;

[0030] Establish a day and night feature mixing generation mechanism based on feature mixing logic;

[0031] The formal definition of this mechanism is as follows:

[0032]

[0033] Where α is the adaptive mixing coefficient, Attn(·) is the cross-domain attention module, MLP(·) is the multi-layer perceptron, and [·;·] represents feature concatenation. Given inputs F1 and F2, the cross-domain attention module is calculated as follows:

[0034]

[0035] Among them, W Q , W K , is the projection matrix and d is the feature dimension.

[0036] This preferred solution improves the integration of daytime and nighttime features, enabling the model to more accurately capture key information from videos of different time periods when identifying low-sample power grid operations. The pre-defined cross-domain attention module strengthens the model's understanding of the correlation between daytime and nighttime video features, while the multilayer perceptron further enhances the accuracy and efficiency of feature blending, thereby optimizing the model's performance in identifying low-sample power grid operations.

[0037] As a preferred solution of the method for optimizing a power grid small-sample operation behavior recognition model with cross-time domain feature decoupling according to the present invention, the optimization operation of the operation behavior recognition model based on the virtual sample features includes:

[0038] Constructing a target optimization module, wherein the target optimization module is used to perform optimization operations according to the total loss of the operation behavior recognition model;

[0039] The total loss includes the weighted sum of domain decoupling consistency loss, virtual-real feature alignment loss, adversarial domain sharing loss, and few-shot prototype contrast loss;

[0040] Based on the total loss, iteratively update the parameters of the task behavior recognition model through gradient back propagation;

[0041] The total loss is of the form:

[0042]

[0043] Where λ and β are weight factors, and the decoupled consistency loss is defined as:

[0044]

[0045] Where ‖·‖2 represents the L2 norm, and the virtual-real feature alignment loss is defined as:

[0046]

[0047] Among them, cos(·,·) represents the cosine similarity function, KL(·||·) represents the KL divergence function, and denote the predicted probabilities of real samples and virtual samples respectively, and the adversarial domain sharing loss is defined as:

[0048]

[0049] where D(·) represents the domain discriminator and the few-shot prototype contrast loss is defined as:

[0050]

[0051] Where C is the number of categories, represents the prototype (feature mean) of the daytime and nighttime categories c, is the feature of category c in the generated virtual night sample, and δ is the maximum allowed distance between the feature of the virtual night sample and the prototype of the same type;

[0052] Based on the total loss, the parameters of the task behavior recognition model are iteratively updated through gradient backpropagation in the following form:

[0053]

[0054] in, are the model parameters after model optimization, θ is the model parameter of the previous cycle, and γ is the learning rate.

[0055] As a preferred solution of the method for optimizing the power grid few-sample operation behavior recognition model with cross-time domain feature decoupling described in the present invention, the method of obtaining a first video dataset in the target power grid power outage operation scenario includes:

[0056] Obtaining a daytime operation video in a target power grid outage operation scenario, performing a first classification operation labeling on the daytime operation video, and defining the labeled daytime operation video as a daytime source domain video;

[0057] Obtain a nighttime operation video in a target power grid outage operation scenario, perform a second classification operation labeling on the nighttime operation video, and define the labeled nighttime operation video as a nighttime target domain few-sample video;

[0058] The annotation amount of the second classification operation is much smaller than the annotation amount of the first classification operation.

[0059] As a preferred solution of the method for optimizing the power grid few-sample operation behavior recognition model with cross-time domain feature decoupling described in the present invention, it also includes:

[0060] The optimized operation behavior recognition model is used to test the collected night operation samples to obtain the behavior recognition results of night operations.

[0061] In a second aspect, the present invention provides a power grid few-sample operation behavior recognition model optimization system with cross-time domain feature decoupling, comprising:

[0062] A data acquisition module, configured to acquire a first video data set in a target power grid outage operation scenario;

[0063] The first video dataset includes a cross-time operation dataset of daytime source domain videos and nighttime target domain few-sample videos;

[0064] a network construction module, configured to establish a dual-stream feature decoupling network, and perform feature decomposition on the first video dataset according to the dual-stream feature decoupling network to obtain domain-private features and domain-shared features for daytime and nighttime videos;

[0065] a mechanism establishment module, configured to preset a daytime and nighttime feature hybrid generation mechanism and generate virtual sample features based on the domain-private features and domain-shared features of the daytime and nighttime videos;

[0066] The optimization module is used to optimize the operation behavior recognition model based on the virtual sample characteristics to obtain the optimized operation behavior recognition model.

[0067] In a third aspect, the present invention provides an electronic device comprising a memory and a processor, wherein the memory stores a computer program, and the processor implements the steps of the method described above when executing the computer program.

[0068] In a fourth aspect, the present invention provides a computer-readable storage medium having a computer program stored thereon, which implements the steps of the method described above when the computer program is executed by a processor.

[0069] Compared with the existing technology, the beneficial effects of the present invention are as follows: the present invention proposes a method for optimizing a power grid few-sample operation behavior recognition model with cross-time domain feature decoupling, obtains the first video data set under the target power grid power outage operation scenario, provides basic data support for subsequent feature decomposition and optimization, and ensures that the model training and optimization can be carried out for specific operation scenarios. A dual-stream feature decoupling network is established and feature decomposition is performed, which effectively distinguishes the domain-private features and domain-shared features of daytime and nighttime videos, and improves the model's ability to recognize operation behaviors under different lighting conditions. A pre-set day and night feature hybrid generation mechanism and the generation of virtual sample features enrich the diversity of training samples, help the model better generalize under few-sample conditions, and improve the robustness and accuracy of the model. The operation behavior recognition model is optimized based on the virtual sample features, so that the model can better adapt to various situations under the power grid power outage operation scenario, and improves the practicality and reliability of the model. The method proposed in the present invention can significantly improve the performance of the power grid few-sample operation behavior recognition model, and provide strong technical support for the safe operation and efficient management of the power grid. BRIEF DESCRIPTION OF THE DRAWINGS

[0070] In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the following briefly introduces the drawings required for use in the description of the embodiments. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative labor.

[0071] Figure 1 A flowchart of a method for optimizing a power grid few-sample operation behavior recognition model with cross-time domain feature decoupling provided by an embodiment of the present invention.

[0072] Figure 2 A schematic diagram of test results of a typical power grid operation scenario for a power grid few-sample operation behavior recognition model optimization method with cross-time domain feature decoupling provided by an embodiment of the present invention.

[0073] Figure 3 An internal structure diagram of an electronic device for a method for optimizing a power grid few-sample operation behavior recognition model with cross-time domain feature decoupling provided by an embodiment of the present invention. DETAILED DESCRIPTION

[0074] To make the above-mentioned objects, features, and advantages of the present invention more clearly understood, the following detailed description of the specific embodiments of the present invention is given in conjunction with the accompanying drawings. It is obvious that the described embodiments are only part of the embodiments of the present invention, not all of them. Based on the embodiments of the present invention, all other embodiments obtained by ordinary persons in this field without creative work should fall within the scope of protection of the present invention.

[0075] Example 1, with reference to Figures 1 and 2 , which is the first embodiment of the present invention, provides a method for optimizing a power grid few-sample operation behavior recognition model with cross-time domain feature decoupling, including:

[0076] Existing technologies face several challenges. For example, traditional supervised learning methods suffer from significant performance degradation when migrating from daytime to nighttime environments due to coupling between the source and target domain feature spaces. Furthermore, the complexity and dynamic nature of power grid construction scenarios further challenges the recognition of operational activities. This is especially true given the scarcity of labeled samples for nighttime operation videos, which limits the model's generalization and recognition accuracy.

[0077] The present invention provides a method that can effectively solve the above-mentioned problems. Next, we will use multiple embodiments to elaborate on how to implement the optimization method of the power grid small-sample operation behavior recognition model with cross-time domain feature decoupling.

[0078] Figure 1 A flowchart of a method for optimizing a power grid few-sample operation behavior recognition model with cross-time domain feature decoupling is shown, including:

[0079] S101, obtaining a first video dataset in a target power grid outage operation scenario;

[0080] In an embodiment of the present invention, the first video dataset includes a cross-time operation dataset of daytime source domain videos and nighttime target domain few-sample videos;

[0081] In an embodiment of the present invention, obtaining a first video data set in a target power grid outage operation scenario includes:

[0082] Obtain daytime operation videos in the target power grid outage operation scenario, perform first-category operation labeling on the daytime operation videos, and define the labeled daytime operation videos as daytime source domain videos.

[0083] Obtain nighttime operation videos in the target power grid outage operation scenario, perform second-category operation labeling on the nighttime operation videos, and define the labeled nighttime operation videos as nighttime target domain few-sample videos.

[0084] The amount of annotations for the second category of assignments is much smaller than that for the first category of assignments.

[0085] It should be noted that the first category of job annotation is a detailed and accurate annotation of the work behaviors in the daytime source domain video. These annotation information records the various behavioral characteristics of the workers in detail, providing rich data support for subsequent model training. In contrast, due to the small number of nighttime work videos and the greater difficulty of annotation, the second category of job annotation, although with a smaller amount of annotation, still strives to accurately reflect the characteristics of nighttime work behaviors to ensure that the model can learn effective cross-time recognition capabilities. Through such an annotation strategy, the present invention can maximize the recognition performance and generalization ability of the model under limited annotation resources.

[0086] In some specific implementations, the specific steps of the first classification task labeling may be:

[0087] First, a certain number of daytime source-domain videos are selected for annotation. These videos should cover a variety of typical behaviors in power grid outage operation scenarios. Professional annotators then meticulously and accurately annotate the work behaviors in the videos, including information such as the operator's movements, location, and tools used. This annotation process ensures the accuracy and completeness of this information to provide reliable data support for subsequent model training. Furthermore, to improve annotation efficiency and accuracy, semi-automatic annotation tools or algorithms can be used to assist annotators. This annotation process constructs a dataset of daytime source-domain videos containing rich behavioral features, laying a solid foundation for subsequent model training.

[0088] In some specific implementations, the specific steps of the first classification job labeling may be:

[0089] For nighttime source videos, the labeling process requires greater detail due to challenges such as poor lighting conditions and blurred details. Nighttime videos can be preprocessed, such as by enhancing contrast and adjusting brightness, to improve video quality. Subsequently, labelers must carefully identify and annotate the worker's behavioral characteristics, particularly details that are difficult to observe in daytime videos, such as gestures and tool usage under dim lighting. To ensure labeling consistency, detailed labeling specifications and examples can be developed for labelers' reference. Furthermore, advanced automatic labeling techniques or algorithms can be used to perform preliminary labeling of nighttime videos, followed by manual review and optimization to further improve labeling efficiency and accuracy. This meticulous labeling allows the construction of a high-quality nighttime source video dataset, providing strong support for comprehensive model training.

[0090] In some specific implementations, in a power grid outage operation scenario, data is collected from the operation process by combining on-site video recording equipment with a real-time monitoring system. The collected videos are in 1080P high-definition resolution format, and the average length of each video is about 10 minutes. The collected daytime operation videos are manually labeled by personnel with professional knowledge according to preset operation behavior categories (for example, climbing, hanging ground wires), and the labeled daytime operation videos are defined as daytime source domain videos. In addition, only a small amount of labeling is performed on the collected nighttime operation videos, and the labeled nighttime operation videos are defined as nighttime target domain few-sample videos. Finally, the daytime source domain videos and the nighttime target domain few-sample videos are combined to form a cross-time operation dataset.

[0091] In some specific implementations, the collected data includes 500 daytime work videos, all of which are labeled as daytime source domain videos. The collected data also includes 270 nighttime work videos, 20% of which are randomly selected and labeled as nighttime target domain few-shot videos. Therefore, the combination of the daytime source domain videos and the nighttime target domain few-shot videos constitutes a cross-time work dataset, containing a total of 554 labeled work videos: 500 daytime source domain videos and 54 nighttime target domain videos.

[0092] It should be noted that obtaining the first video data set under the target power grid power outage operation scenario can ensure that the data basis for model training in subsequent steps is closer to the actual operation scenario, thereby improving the model's recognition accuracy and generalization ability for power grid power outage operation behaviors. By specifically collecting video data under the target power grid power outage operation scenario, the model can learn more about the feature information of this specific scenario, which is especially important for few-sample learning because it can help the model still complete the task well with limited training samples. In addition, the accuracy and representativeness of the first video data set will also directly affect the effect of subsequent model optimization, so this step plays a vital role in the entire method.

[0093] S102, establishing a dual-stream feature decoupling network, performing feature decomposition on the first video dataset based on the dual-stream feature decoupling network, and obtaining domain-private features and domain-shared features of daytime and nighttime videos;

[0094] In an embodiment of the present invention, a dual-stream feature decoupling network is established, and feature decomposition is performed on the first video dataset based on the dual-stream feature decoupling network to obtain domain-private features and domain-shared features for daytime and nighttime videos, including:

[0095] A two-stream feature decoupling network is established. The input of the two-stream feature decoupling network is a cross-time operation dataset consisting of daytime source domain videos and nighttime target domain few-sample videos.

[0096] The two-stream feature decoupling network is used to obtain daytime spatial features, nighttime spatial features, daytime motion features, and nighttime motion features.

[0097] In an embodiment of the present invention, establishing a dual-stream feature decoupling network, performing feature decomposition on the first video dataset based on the dual-stream feature decoupling network, and obtaining domain-private features and domain-shared features for daytime and nighttime videos further includes:

[0098] Establish a dynamic gating function, which is used to perform feature decomposition again;

[0099] Decompose the daytime spatial features and daytime motion features into domain-private features and domain-shared features of daytime videos;

[0100] The nighttime spatial features and nighttime motion features are decomposed into domain-private features and domain-shared features of nighttime videos.

[0101] Specifically, a pre-trained 3D convolutional neural network is used to construct a two-stream feature decoupling network for daytime video X d and Night Video X n Feature decomposition is performed separately to obtain domain-private features and domain-shared features of daytime and nighttime videos.

[0102] Furthermore, a pre-trained 3D convolutional neural network (such as I3D network) is used to construct a dual-stream feature extraction branch, and the daytime video X is input. d and Night Video X n , extracting spatial features of daytime and nighttime respectively and diurnal / nocturnal movement characteristics

[0103] Furthermore, based on the spatial features of daytime / nighttime and the motion features of daytime / nighttime, a dynamic gating function is used to decompose the daytime / nighttime video into domain-specific (lighting-related) features. Shared (action-related) features with the domain

[0104] Preferably, a dynamic gating function is used Decomposition of day / night video features:

[0105]

[0106] Among them, *∈{d,n}, ⊙ represents channel-by-channel multiplication.

[0107] Preferably, given the input z, the dynamic gating function is designed as:

[0108]

[0109] Among them, W1 and W2 are learnable parameters, ReLU(·) is the activation function, GAP(·) represents global average pooling, σ( · ) is the Sigmoid function.

[0110] It should be noted that establishing a two-stream feature decoupling network and performing feature decomposition on the first video dataset based on the two-stream feature decoupling network to obtain domain-private features and domain-shared features for daytime and nighttime videos can significantly improve the model's adaptability to different lighting conditions during power outage operations. Through the two-stream feature decoupling network, domain-private features and domain-shared features in daytime and nighttime videos can be effectively distinguished, which helps the model more accurately understand the video content and thus improve the accuracy of task behavior recognition. In particular, domain-private features mainly capture features related to lighting conditions, while domain-shared features focus on features related to the task behavior itself. This feature decomposition method enables the model to better generalize under low-sample conditions, improving the model's robustness and practicality. In addition, this feature decomposition method also provides strong support for subsequent virtual sample generation and optimization operations, further enhancing the model's performance.

[0111] S103, presetting a day and night feature hybrid generation mechanism, and generating virtual sample features based on domain-private features and domain-shared features of daytime and nighttime videos;

[0112] It should be noted that the mixed generation mechanism of day and night characteristics is

[0113] An innovative strategy aims to create new and diverse training samples by fusing the domain-private features and domain-shared features of daytime and nighttime videos. The mechanism first defines a set of rules for intelligently combining feature elements of daytime and nighttime in the feature space. Specifically, it can selectively mix daytime domain-shared features (such as the action patterns of workers) with nighttime domain-private features (such as specific lighting conditions) according to a certain probability distribution, or vice versa, to simulate various possible day-night work scenarios. Through this mixing process, the generated virtual sample features not only enrich the diversity of the training set, but also encourage the model to learn how to stably recognize work behavior under different lighting conditions, thereby significantly enhancing the model's adaptability to power outage work scenarios. In addition, the introduction of the day-night feature mixing generation mechanism further enhances the model's generalization ability under the condition of few samples, providing more reliable technical support for the safe operation of the power grid.

[0114] In the embodiments of the present application, the day-night feature mixing generation mechanism includes:

[0115] a pre-set cross-domain attention module and a multi-layer perceptron;

[0116] establishing a feature mixing logic composed of the cross-domain attention module and the multi-layer perceptron;

[0117] establishing the day-night feature mixing generation mechanism based on the feature mixing logic.

[0118] Specifically, the day-night feature mixing generation mechanism is designed to generate virtual nighttime sample features through cross-domain cross-fusion in the following form:

[0119]

[0120] where α is the adaptive mixing coefficient, Attn(·) is the cross-domain attention module, MLP(·) is the multi-layer perceptron, denotes feature concatenation. Given inputs F1 and F2, the cross-domain attention module is calculated as:

[0121]

[0122] where W Q , W K , is the projection matrix, and d is the feature dimension.

[0123] It should be noted that a mixed generation mechanism for day and night features is preset, and based on the domain-private features and domain-shared features of daytime and nighttime videos, a fusion of domain-private features and domain-shared features of virtual sample features is generated. By generating virtual sample features, the model's ability to recognize operating behaviors in different time periods (daytime and nighttime) can be significantly improved. This mechanism not only enhances the model's adaptability to specific environmental conditions, but also effectively fuses feature information from different time periods by introducing a cross-domain attention module and an adaptive mixing coefficient, thereby improving the generalization performance under few-sample conditions. Specifically, the generation of virtual sample features enables the model to be exposed to a more diverse data distribution during training, which helps the model learn more robust and generalized feature representations, thereby improving the recognition accuracy in actual application scenarios.

[0124] S104: Optimize the operation behavior recognition model based on the virtual sample features to obtain an optimized operation behavior recognition model.

[0125] In an embodiment of the present invention, the operation of optimizing the work behavior recognition model based on the virtual sample features includes:

[0126] Construct a target optimization module, which is used to perform optimization operations based on the total loss of the job behavior recognition model;

[0127] The total loss includes the weighted sum of domain disentanglement consistency loss, virtual-real feature alignment loss, adversarial domain sharing loss, and few-shot prototype contrast loss;

[0128] Based on the total loss, the parameters of the task behavior recognition model are iteratively updated through gradient backpropagation.

[0129] In an embodiment of the present invention, the optimized operation behavior recognition model is used to test the collected night operation samples to obtain the behavior recognition results of the night operation.

[0130] In some embodiments, the consistency loss is decoupled by the day / night domain Domain-specific (lighting-dependent) features for constrained daytime / nighttime videos Shared (action-related) features with the domain Orthogonal, to avoid information redundancy, the form is as follows:

[0131]

[0132] Here, ‖·‖2 represents the L2 norm.

[0133] In some specific implementations, to ensure that the generated virtual sample features are consistent with the real sample distribution, a virtual-real feature alignment loss is used in the shared feature space. Constrained virtual nighttime sample features Compared with the real night sample characteristics The form is as follows:

[0134]

[0135] Among them, cos(·,·) represents the cosine similarity function, KL(·||·) represents the KL divergence function, and represent the predicted probabilities of real samples and virtual samples respectively.

[0136] To enhance the robustness of domain adaptation, an adversarial domain sharing loss is adopted Align the shared feature distribution of daytime and nighttime real samples, calculated as follows:

[0137]

[0138] Where D(·) represents the domain discriminator. At the same time, the few-shot prototype loss is used Aligning the same prototypes during the day and at night to address cross-domain distribution shifts and constraining the virtual sample features to be close to the real prototypes, thus enhancing the feature density of the few-sample category. The form is as follows:

[0139]

[0140] Where C is the number of categories, represents the prototype (feature mean) of the daytime and nighttime categories c, is the feature of category c in the generated virtual nighttime sample, and δ is the maximum allowed distance between the feature of the virtual nighttime sample and the prototype of the same type.

[0141] Therefore, the day / night domain decoupling consistency loss is calculated Virtual-real feature alignment loss Adversarial Domain Sharing Loss and few-shot prototype contrast loss The weighted sum of , we get the total loss:

[0142]

[0143] Among them, λ and β are weight factors.

[0144] In a preferred embodiment of the present invention, δ=0.2, λ=0.4, and β=0.2.

[0145] Preferably, based on the total loss, the parameters of the task behavior recognition model are iteratively updated through gradient back propagation in the following form:

[0146]

[0147] in, are the model parameters after model optimization, θ is the model parameter of the previous cycle, and γ is the learning rate.

[0148] In a preferred embodiment of the present invention, the SGD optimizer is used as the training optimizer, the initial value of the learning rate γ is set to 1e-3, the batch size is set to 128, and after the 40th and 70th training cycles, the learning rate becomes 0.1 times the original value, and a total of 80 training cycles are performed.

[0149] It is worth noting that in the preferred embodiment of the present invention, the network training method and the parameter configuration of the learning rate optimization strategy are non-restrictive and preferred choices. Those skilled in the art can select the model training method and parameter configuration based on various indicators such as classification accuracy and efficiency.

[0150] In summary, the present invention proposes a method for optimizing a power grid few-sample operation behavior recognition model with cross-time domain feature decoupling, obtains the first video data set under the target power grid power outage operation scenario, provides basic data support for subsequent feature decomposition and optimization, and ensures that the model training and optimization can be carried out for specific operation scenarios. A dual-stream feature decoupling network is established and feature decomposition is performed, which effectively distinguishes the domain-private features and domain-shared features of daytime and nighttime videos, and improves the model's ability to recognize operation behaviors under different lighting conditions. A pre-set day and night feature hybrid generation mechanism and the generation of virtual sample features enrich the diversity of training samples, help the model to better generalize under few-sample conditions, and improve the robustness and accuracy of the model. The operation behavior recognition model is optimized based on the virtual sample features, so that the model can better adapt to various situations under the power grid power outage operation scenario, and improves the practicality and reliability of the model. The method proposed in the present invention can significantly improve the performance of the power grid few-sample operation behavior recognition model, and provide strong technical support for the safe operation and efficient management of the power grid.

[0151] Example 2. In a preferred embodiment, for the optimal operation behavior recognition model obtained in the preferred embodiment of the present invention, 150 unlabeled night operation sample data newly collected in the power grid outage operation scene were used for 10 tests, and the average value was taken to record the recognition accuracy. The results (average accuracy) are shown in Table 1. Among them, the night operation video training data of the baseline method contains 270 labeled samples. The results show that the average recognition accuracy of the operation behavior recognition model in this embodiment reached 84.82%, which is 2.26% higher than the 82.56% of the baseline method. In addition, the total training time of this method is significantly lower than that of the baseline method, which further shows that this method reduces the manual labeling cost of night operation data and achieves high-precision recognition of cross-time domain power grid operation behaviors under the condition of few samples.

[0152] Table 1 Comparison of model results on test data

[0153] method Average accuracy Total training time (seconds) Baseline Method 82.56% 1587.35 This method 84.82% 603.17

[0154] Some test effect screenshots are as follows Figure 2 As shown in the test result diagram, it can be seen that the work behavior recognition model of this embodiment can accurately identify the work behaviors in the test set samples.

[0155] By constructing a dual-stream feature decoupling network and designing a hybrid generation mechanism for integrating day and night features, we achieve high-precision recognition of cross-temporal grid operation behaviors with a small sample size. This technical solution effectively addresses the issue of decreased behavior recognition accuracy in power outage scenarios due to the significant difference in day and night lighting conditions. It significantly reduces the cost of manual labeling of nighttime operation data and improves the robustness and adaptability of the behavior recognition model in complex lighting environments such as those during daytime and nighttime shifts.

[0156] Example 3, reference Figure 3 This embodiment also provides a power grid few-sample operation behavior recognition model optimization system with cross-time domain feature decoupling, including:

[0157] A data acquisition module, configured to acquire a first video data set in a target power grid outage operation scenario;

[0158] The first video dataset includes a cross-time operation dataset of daytime source domain videos and nighttime target domain few-sample videos;

[0159] A network construction module is used to establish a dual-stream feature decoupling network, perform feature decomposition on the first video dataset according to the dual-stream feature decoupling network, and obtain domain-private features and domain-shared features of daytime and nighttime videos;

[0160] A mechanism establishment module is used to preset a day-night feature hybrid generation mechanism and generate virtual sample features based on domain-private features and domain-shared features of daytime and nighttime videos;

[0161] The optimization module is used to optimize the operation behavior recognition model based on the virtual sample characteristics to obtain the optimized operation behavior recognition model.

[0162] The above-mentioned unit modules can be embedded in or independent of the processor in the electronic device in the form of hardware, or can be stored in the memory of the electronic device in the form of software, so that the processor can call and execute the corresponding operations of the above-mentioned modules.

[0163] This embodiment also provides an electronic device, which may be a terminal, and its internal structure diagram may be as shown in FIG. Figure 3As shown. The electronic device includes a processor, a memory, a communication interface, a display screen and an input device connected via a system bus. The processor of the electronic device is used to provide computing and control capabilities. The memory of the electronic device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system and a computer program. The internal memory provides an environment for the operation of the operating system and the computer program in the non-volatile storage medium. The communication interface of the electronic device is used to communicate with an external terminal in a wired or wireless manner. The wireless manner can be achieved through WIFI, an operator network, NFC (near field communication) or other technologies. When the computer program is executed by the processor, it implements a method for optimizing a power grid few-sample operation behavior recognition model with cross-time domain feature decoupling. The display screen of the electronic device can be a liquid crystal display screen or an electronic ink display screen. The input device of the electronic device can be a touch layer covering the display screen, or a key, trackball or touchpad provided on the electronic device housing, or an external keyboard, touchpad or mouse.

[0164] This embodiment further provides a computer-readable storage medium having a computer program stored thereon. When the computer program is executed by a processor, the following steps are implemented:

[0165] Acquire a first video dataset in a target power grid outage operation scenario;

[0166] The first video dataset includes a cross-time operation dataset of daytime source domain videos and nighttime target domain few-sample videos;

[0167] Establishing a dual-stream feature decoupling network, performing feature decomposition on the first video dataset based on the dual-stream feature decoupling network, and obtaining domain-private features and domain-shared features of daytime and nighttime videos;

[0168] A mixed generation mechanism of day and night features is preset, and virtual sample features are generated based on the domain-private features and domain-shared features of daytime and nighttime videos;

[0169] The operation behavior recognition model is optimized based on the virtual sample features to obtain the optimized operation behavior recognition model.

[0170] 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 the present invention. Although the present invention has been described in detail with reference to the preferred embodiments, those skilled in the art should understand that the technical solutions of the present invention may be modified or replaced by equivalents without departing from the spirit and scope of the technical solutions of the present invention, which should all be included in the scope of the claims of the present invention.

[0171] Although the preferred embodiments of the present invention have been described, those skilled in the art may make additional changes and modifications to these embodiments once they have learned the basic creative concept. Therefore, the appended claims are intended to be interpreted as including the preferred embodiments and all changes and modifications that fall within the scope of the present invention.

[0172] Obviously, those skilled in the art may make various changes and modifications to the present invention without departing from the spirit and scope of the present invention. Thus, if such changes and modifications fall within the scope of the claims and their equivalents, the present invention is intended to include such changes and modifications.

Claims

1. A method for optimizing a power grid few-sample operation behavior recognition model with cross-time domain feature decoupling, characterized by: include: Acquire a first video dataset in a target power grid outage operation scenario; The first video dataset includes a cross-time operation dataset of daytime source domain videos and nighttime target domain few-sample videos; Establishing a dual-stream feature decoupling network, and performing feature decomposition on the first video dataset according to the dual-stream feature decoupling network to obtain domain-private features and domain-shared features of daytime and nighttime videos; A daytime and nighttime feature hybrid generation mechanism is preset, and virtual sample features are generated based on the domain-private features and domain-shared features of the daytime and nighttime videos; An optimization operation is performed on the operation behavior recognition model based on the virtual sample features to obtain an optimized operation behavior recognition model.

2. The method for optimizing a power grid small-sample operation behavior recognition model with cross-time domain feature decoupling according to claim 1, characterized in that: The establishing of a dual-stream feature decoupling network and performing feature decomposition on the first video dataset according to the dual-stream feature decoupling network to obtain domain-private features and domain-shared features of daytime and nighttime videos include: Establish a two-stream feature decoupling network, the input of which is a cross-time operation dataset of daytime source domain videos and nighttime target domain few-sample videos; The dual-stream feature decoupling network is used to obtain daytime spatial features Night space characteristics Diurnal movement characteristics and nighttime movement characteristics 3. The method for optimizing a power grid small-sample operation behavior recognition model with cross-time domain feature decoupling according to claim 2, characterized in that: The step of establishing a dual-stream feature decoupling network and performing feature decomposition on the first video dataset according to the dual-stream feature decoupling network to obtain domain-private features and domain-shared features for daytime and nighttime videos further includes: Creating a dynamic gating function The dynamic gating function is used to perform feature decomposition again; Decompose daytime spatial features and daytime motion features into domain-specific features of daytime videos and domain-shared features Decompose nighttime spatial features and nighttime motion features into domain-specific features of nighttime videos and domain-shared features The decomposition form is defined as follows: Where *∈{d,n}, ⊙ represents channel-by-channel multiplication. Given an input z, the dynamic gating function is designed as: Among them, W1 and W2 are learnable parameters, ReLU(·) is the activation function, GAP(·) represents global average pooling, and σ(·) is the Sigmoid function.

4. The method for optimizing a power grid small-sample operation behavior recognition model with cross-time domain feature decoupling according to claim 3, characterized in that: The day and night feature mixed generation mechanism includes: Preset cross-domain attention module and multi-layer perceptron; Establish feature mixing logic composed of cross-domain attention modules and multi-layer perceptrons; Establish a day and night feature mixing generation mechanism based on feature mixing logic; The formal definition of this mechanism is as follows: Where α is the adaptive mixing coefficient, Attn(·) is the cross-domain attention module, MLP(·) is the multi-layer perceptron, and [·;·] represents feature concatenation. Given inputs F1 and F2, the cross-domain attention module is calculated as follows: in, is the projection matrix and d is the feature dimension.

5. The method for optimizing a power grid small-sample operation behavior recognition model with cross-time domain feature decoupling according to claim 4, characterized in that: The operation of optimizing the operation behavior recognition model based on the virtual sample features includes: Constructing a target optimization module, wherein the target optimization module is used to perform optimization operations according to the total loss of the operation behavior recognition model; The total loss includes the weighted sum of domain decoupling consistency loss, virtual-real feature alignment loss, adversarial domain sharing loss, and few-shot prototype contrast loss; Based on the total loss, iteratively updating the parameters of the task behavior recognition model through gradient back propagation; The total loss is of the form: Where λ and β are weight factors, and the decoupled consistency loss is defined as: Where ‖·‖2 represents the L2 norm, and the virtual-real feature alignment loss is defined as: Among them, cos(·,·) represents the cosine similarity function, KL(·||·) represents the KL divergence function, and denote the predicted probabilities of real samples and virtual samples respectively, and the adversarial domain sharing loss is defined as: where D(·) represents the domain discriminator and the few-shot prototype contrast loss is defined as: Where C is the number of categories, represents the prototype (feature mean) of the daytime and nighttime categories c, is the feature of category c in the generated virtual night sample, and δ is the maximum allowed distance between the feature of the virtual night sample and the prototype of the same type; Based on the total loss, the parameters of the task behavior recognition model are iteratively updated through gradient backpropagation in the following form: in, are the model parameters after model optimization, θ is the model parameter of the previous cycle, and γ is the learning rate.

6. The method for optimizing a power grid small-sample operation behavior recognition model with cross-time domain feature decoupling according to claim 5, characterized in that: The obtaining of a first video data set in a target power grid outage operation scenario includes: Obtaining a daytime operation video in a target power grid outage operation scenario, performing a first classification operation labeling on the daytime operation video, and defining the labeled daytime operation video as a daytime source domain video; Obtain a nighttime operation video in a target power grid outage operation scenario, perform a second classification operation labeling on the nighttime operation video, and define the labeled nighttime operation video as a nighttime target domain few-sample video; The annotation amount of the second classification operation is much smaller than the annotation amount of the first classification operation.

7. The method for optimizing a power grid small sample operation behavior recognition model with cross-time domain feature decoupling according to claim 6, characterized in that: Also includes: The optimized operation behavior recognition model is used to test the collected night operation samples to obtain the behavior recognition results of night operations.

8. A power grid few-sample operation behavior recognition model optimization system with cross-time domain feature decoupling, applying the method according to any one of claims 1 to 7, characterized in that: include: A data acquisition module, configured to acquire a first video data set in a target power grid outage operation scenario; The first video dataset includes a cross-time operation dataset of daytime source domain videos and nighttime target domain few-sample videos; a network construction module, configured to establish a dual-stream feature decoupling network, and perform feature decomposition on the first video dataset according to the dual-stream feature decoupling network to obtain domain-private features and domain-shared features for daytime and nighttime videos; a mechanism establishment module, configured to preset a daytime and nighttime feature hybrid generation mechanism and generate virtual sample features based on the domain-private features and domain-shared features of the daytime and nighttime videos; The optimization module is used to optimize the operation behavior recognition model based on the virtual sample characteristics to obtain the optimized operation behavior recognition model.

9. An electronic device comprising a memory and a processor, wherein the memory stores a computer program, wherein: When the processor executes the computer program, the steps of the method for optimizing a power grid few-sample operation behavior recognition model with cross-time domain feature decoupling according to any one of claims 1 to 7 are implemented.

10. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the steps of a method for optimizing a power grid few-sample operation behavior recognition model with cross-time domain feature decoupling according to any one of claims 1 to 7 are implemented.