Adaptive uncertainty pu learning model training method for video surveillance scenarios
Patent Information
- Application Number
- CN202511785446.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-12-01
- Publication Date
- 2026-08-18
- Estimated Expiration
- 2045-12-01
AI Technical Summary
[0004]本发明的目的在于提供面向视频监控场景的自适应不确定性PU学习模型训练方法,旨在解决背景技术中所提到的问题
[0059] This invention labels and divides surveillance video data, defining the labeled portions as positive samples and the unlabeled portions as unlabeled data. This establishes clear input boundaries for subsequent training, avoiding data label ambiguity caused by the mixing of positive and unlabeled samples. It not only ensures the purity of the positive sample set but also provides an independent computation set for unlabeled data, allowing for iterative reasoning and comparison of stability and uncertainty in subsequent calculations. The entire data flow already possesses good hierarchical characteristics before entering the model, making the computational paths for training and prediction clear and avoiding unnecessary cross-contamination and label conflicts.
Smart Images

Figure CN121617008B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of data processing technology, and in particular to an adaptive uncertainty PU learning model training method for video surveillance scenarios. Background Technology
[0002] In video surveillance, the automatic recognition and understanding of video content typically relies on supervised learning models. However, in practical applications, only a small amount of data with positive sample annotations is often available, leaving a large amount of video data unlabeled. Traditional supervised learning methods require complete annotations of both positive and negative samples, making them difficult to apply directly. Therefore, PU learning methods have been proposed, including two-step methods, bias learning methods, generative adversarial networks, and self-stepping learning methods, to improve video content recognition capabilities in the absence of negative sample annotations.
[0003] However, existing PU learning methods still have shortcomings. For example, in transparent kitchen monitoring, the supervised learning model needs to continuously process complex kitchen operation video streams, but most methods may not consider the uncertainty of the prediction results of the supervised learning model, which may easily misclassify samples with high uncertainty as reliable samples. This leads to the accumulation of errors in the supervised learning model during iterative training, affecting the accuracy of identifying illegal operation behaviors and increasing the risk of false alarms and false negatives. Summary of the Invention
[0004] The purpose of this invention is to provide an adaptive uncertainty PU learning model training method for video surveillance scenarios, aiming to solve the problems mentioned in the background art.
[0005] To solve the above-mentioned technical problems, the technical solution of the present invention is as follows:
[0006] An adaptive uncertainty PU learning model training method for video surveillance scenarios, the method comprising:
[0007] Acquire surveillance video data and label and segment it. Define data with positive sample labels as positive sample data and unlabeled data as unlabeled data to obtain segmented data.
[0008] The positive sample data is trained by a supervised learning model to obtain a basic predicted score sequence; the unlabeled data is input into the supervised learning model to obtain unlabeled predicted scores, thus forming the predicted data.
[0009] Based on the prediction data, the stability of the sample under multiple rounds of prediction is calculated to obtain the dynamic stable value;
[0010] By comparing the dynamic stability values of different iterations pairwise, the degree of fluctuation of the prediction results of the sample between different iterations is calculated, and the uncertainty intensity value is obtained.
[0011] The uncertainty intensity value is mapped to a weight value, and the update magnitude of each sample during training is adjusted to obtain the weight data.
[0012] Based on the weighted data, the unlabeled data is divided into reliable samples, suspicious samples, and uncertain samples to obtain the partitioning results data. The parameters of the supervised learning model are then updated based on these results to obtain the optimized model.
[0013] Based on the optimization model, the process of calculating dynamic stable values, calculating uncertainty intensity values, weight mapping, sample partitioning, and iterative training is repeated until the training process converges, resulting in a video recognition model.
[0014] Furthermore, the surveillance video data is acquired and labeled, with data bearing positive labels defined as positive data and unlabeled data defined as unlabeled data, resulting in segmented data, including:
[0015] Frame-level extraction is performed on the surveillance video data to divide the video content into several independent frame images, thus obtaining frame image data.
[0016] The frame image data is labeled, and the frame images with positive sample labels are extracted to obtain labeled frame data.
[0017] Based on the labeled frame data, all labeled frame images are integrated according to the index to obtain positive sample data;
[0018] Based on the frame image data and positive sample data, the frame images that did not match the annotations were extracted to obtain the unannotated data.
[0019] Furthermore, a supervised learning model is trained on the positive sample data to obtain a basic predicted score sequence; unlabeled data is then input into the supervised learning model to obtain unlabeled predicted scores, forming the predicted data, including:
[0020] Based on the partitioned data, the positive sample data is organized into a batch training format to obtain the training input set;
[0021] The training input set is fed into the supervised learning model, the parameters of the supervised learning model are updated, and the score results for the positive sample data are output to obtain the basic prediction score sequence.
[0022] Based on the partitioned data, the unlabeled data is organized into a batch prediction format to obtain the prediction input set;
[0023] Based on the predicted input set and the updated supervised learning model, the output is the score for the unlabeled data, thus obtaining the unlabeled predicted score.
[0024] Furthermore, based on the prediction data, the stability of the sample under multiple rounds of prediction is calculated to obtain the dynamic stable value, including:
[0025] Based on the predicted data, a time weighting table is obtained to ensure that the latest round has higher memory strength;
[0026] Calculate the mean term based on the time weight table and the basic predicted score sequence; calculate the fluctuation term based on the time weight table and the unlabeled predicted scores; calculate the magnitude of change term based on the difference sequence of scores between adjacent rounds; calculate the baseline consistency term based on the closeness between the mean of scores in each round and the score of the first round; calculate the combined stabilizing effect of low transitions and baseline fit based on the magnitude of change term and the baseline consistency term, and obtain the coupling term; calculate the suppression strength against sudden transitions based on the magnitude of change term, and obtain the transition penalty term.
[0027] The mean, fluctuation, variation, baseline consistency, coupling, and transition penalty terms are fused to obtain a fused stability metric, which is then compressed into a fixed score range to obtain a dynamic stability value.
[0028] Furthermore, the dynamic stability values of different iterations are compared pairwise to calculate the degree of fluctuation in the prediction results of the samples across different iterations, thus obtaining the uncertainty intensity value, including:
[0029] Based on the dynamic stable value sequence of each iteration, the energy proportion of the dynamic stable value in the rapidly changing region is calculated to obtain the high change ratio term; the average distance of the dynamic stable values in the numerical arrangement is calculated to obtain the window drift term; based on the difference sequence of dynamic stable values of adjacent iterations, the sign reversal ratio from positive to negative or from negative to positive is calculated to obtain the direction reversal term; based on the continuous sign segments of the difference between adjacent iterations, the degree of imbalance between the lengths of each continuous segment is calculated to obtain the segment imbalance term; based on the mean sequence of the difference between adjacent iterations, the ratio of the cumulative offset range to the overall fluctuation is calculated to obtain the mutation cumulative term.
[0030] Based on the direction reversal term and the segment imbalance term, the instability enhancement amount when the direction is frequently reversed and the continuous segments are broken is calculated, and the direction structure coupling term is obtained; based on the window drift term and the high change ratio term, the instability superposition intensity when cross-window drift and rapid change coexist is calculated, and the cross-window change coupling term is obtained; based on the mutation accumulation term, the instability coordination amount when sudden offset occurs is calculated, and the mutation order coupling term is obtained.
[0031] The directional structure coupling term, the cross-window change coupling term, and the mutation order coupling term are weighted and fused, and then interval-mapped to obtain the uncertainty intensity value.
[0032] Furthermore, the uncertainty intensity values are mapped to weight values, and the update magnitude of each sample during training is adjusted to obtain weight data, including:
[0033] Based on the uncertainty intensity value, the uncertainty intensity values corresponding to each sample are aggregated according to the sample index and missing records are removed to obtain the sorted data;
[0034] Based on the collected data, multiple non-overlapping mapping intervals are determined in ascending order of uncertainty intensity values, and the interval boundaries are recorded to obtain the mapping interval data.
[0035] Based on the mapping interval data, each mapping interval is assigned an interval benchmark weight that is inversely proportional to the uncertainty intensity value, and a correspondence rule from interval to weight is formed to obtain the mapping template data;
[0036] Based on the mapping template data, the uncertainty intensity value of each sample is used to determine the sample benchmark weight according to its mapping interval, thus obtaining the initial weight table.
[0037] Furthermore, mapping the uncertainty intensity values to weight values and adjusting the update magnitude of each sample during training to obtain weight data also includes:
[0038] Based on the initial weight table and the weight table that has been effective in the previous round, an upper limit is set on the change range of the weight of the same sample in two adjacent rounds to obtain the constrained weight table.
[0039] Based on the constraint weight table, the weights of adjacent samples within the same batch are locally smoothed while maintaining index consistency, resulting in a smoothed weight table.
[0040] Based on the smoothed weight table, the weights of all samples in the batch are mapped to a uniform numerical range on a fixed scale while maintaining comparability of the total amount, thus obtaining the normalized weight table.
[0041] Based on the normalized weight table, abnormal or missing records are replaced or removed and rearranged according to the sample index to obtain the weight data.
[0042] Furthermore, based on the weighted data, the unlabeled data is divided into reliable samples, doubtful samples, and uncertain samples to obtain the partitioning results. The parameters of the supervised learning model are then updated based on these results to obtain an optimized model, including:
[0043] The index is merged based on the weighted data and unlabeled data. The sample identifier is matched and stored with the corresponding weight. The samples are sorted from largest to smallest weight and their positions in the sequence are recorded to obtain the sorting table.
[0044] Based on the sorting table, determine two non-overlapping threshold positions to form three consecutive intervals and fix the interval boundaries to obtain the threshold interval data;
[0045] Based on the threshold interval data, samples in the highest interval are marked as reliable samples, samples in the middle interval are marked as suspicious samples, and samples in the lowest interval are marked as uncertain samples, thus obtaining a preliminary partitioning table;
[0046] Based on the preliminary partitioning table, missing and duplicate records are removed while maintaining the continuity of the sample index to obtain the partitioning result data.
[0047] Furthermore, based on the weighted data, the unlabeled data is divided into reliable samples, doubtful samples, and uncertain samples to obtain the partitioning results. The parameters of the supervised learning model are then updated based on these results to obtain an optimized model. This also includes:
[0048] Based on the partitioning results, update strategies are set for reliable samples, correction strategies are set for suspicious samples, and delay strategies are set for uncertain samples, resulting in a strategy table;
[0049] Based on the strategy table, reliable samples are converted into parameter increment records, suspicious samples are converted into parameter correction records, and uncertain samples are converted into delay records, thus obtaining the update plan table;
[0050] Based on the update schedule and the current model parameters, the parameter increment record and parameter correction record are superimposed on the current parameters respectively, while keeping the delay record from being triggered, to obtain the stage parameter set;
[0051] The stage parameter set is written into the supervised learning model and output to obtain the optimized model.
[0052] Furthermore, based on the optimized model, the steps of calculating the dynamic stability value, calculating the uncertainty intensity value, weight mapping, sample partitioning, and iterative training are executed repeatedly until the training process converges, resulting in a video recognition model, including:
[0053] Based on the optimization model, set the round counter and termination threshold, and record the parameter information of the previous round model to obtain the loop control table;
[0054] Based on the cyclic control table and optimization model, the unlabeled data is merged with the previous round state to generate the batch structure required for prediction, thus obtaining the cyclic input set;
[0055] Based on the cyclic input set, the following steps are performed: calculating the dynamic stability value, calculating the uncertainty intensity value, weight mapping, sample partitioning, and iterative training, to obtain the cyclic optimization model.
[0056] Convergence evaluation is performed based on the cyclic optimization model and the previous model. The consistency count and parameter variation magnitude are calculated and compared with the preset termination threshold group to obtain convergence judgment data.
[0057] Based on the convergence judgment data, if the convergence condition is not met, the loop control table is written back and the next round is entered. If the convergence condition is met, the current model parameter information is fixed and output to obtain the video recognition model.
[0058] The above-described solution of the present invention has at least the following beneficial effects:
[0059] This invention labels and divides surveillance video data, defining the labeled portions as positive samples and the unlabeled portions as unlabeled data. This establishes clear input boundaries for subsequent training, avoiding data label ambiguity caused by the mixing of positive and unlabeled samples. It not only ensures the purity of the positive sample set but also provides an independent computation set for unlabeled data, allowing for iterative reasoning and comparison of stability and uncertainty in subsequent calculations. The entire data flow already possesses good hierarchical characteristics before entering the model, making the computational paths for training and prediction clear and avoiding unnecessary cross-contamination and label conflicts.
[0060] This invention calculates the stability under multiple rounds of prediction to obtain a dynamic stable value, compressing the prediction output of different rounds into a comprehensive stability index. This allows the credibility of the sample to be quantitatively expressed in the time dimension, rather than just remaining at the surface value of a single frame or a single prediction. It ensures that the model can identify samples that remain consistent throughout multiple iterations, while also exposing those samples whose prediction results fluctuate significantly in different rounds. This provides a fine-grained data characterization mechanism, transforming the originally isolated prediction score sequence into a highly comparable and noise-resistant stability index.
[0061] This invention obtains an uncertainty intensity value by comparing the dynamic stable values of different iteration rounds pairwise. This not only measures the score difference in a single round but also captures the fluctuation structure across rounds, revealing the behavioral patterns of samples in long-term series, such as direction reversal, numerical drift, or sudden changes. The uncertainty intensity value includes not only information on the fluctuation amplitude but also the stability characteristics of the time series structure, avoiding the excessive influence of random errors in a single prediction on the final judgment and providing a basis for subsequent weight mapping.
[0062] This invention establishes a logical channel for sample governance and parameter updates through a data-driven three-part mechanism, ensuring that reliable data can directly drive parameter updates, suspicious data is handled with care, and uncertain data is isolated or weakened. The input set for parameter updates is structurally optimized into a hierarchical system rather than an indiscriminate set. This structured input set enables the parameter update process to maintain consistency and controllability, avoids interference between samples of different categories within the dataset, and makes the training path logically closed and verifiable.
[0063] This invention establishes a terminateable dynamic closed loop for the entire data processing flow by cyclically executing operation steps until convergence. This loop not only ensures the continuous iteration of dynamic stable values, uncertainty intensity values, and weight mappings, but also restricts unlimited training through convergence conditions. In multiple iterations, the data is continuously remeasured, reclassified, and reweighted, forming a dynamically updated system. When the system reaches convergence, it indicates that the input data and model parameters have reached a statistical balance, ensuring the predictive consistency and parameter stability of the output model and avoiding the risks caused by data feature drift during training. Attached Figure Description
[0064] Figure 1 This is a flowchart of an adaptive uncertainty PU learning model training method for video surveillance scenarios provided by an embodiment of the present invention. Detailed Implementation
[0065] Exemplary embodiments of the present disclosure will now be described in more detail with reference to the accompanying drawings. While exemplary embodiments of the present disclosure are shown in the drawings, it should be understood that the present disclosure may be implemented in various forms and should not be limited to the embodiments set forth herein. Rather, these embodiments are provided so that this disclosure will be thorough and complete, and will fully convey the scope of the disclosure to those skilled in the art.
[0066] like Figure 1 As shown, embodiments of the present invention propose an adaptive uncertainty PU learning model training method for video surveillance scenarios, the method comprising:
[0067] Acquire surveillance video data and label and segment it. Define data with positive sample labels as positive sample data and unlabeled data as unlabeled data to obtain segmented data.
[0068] The positive sample data is trained by a supervised learning model to obtain a basic predicted score sequence; the unlabeled data is input into the supervised learning model to obtain unlabeled predicted scores, thus forming the predicted data.
[0069] Based on the prediction data, the stability of the sample under multiple rounds of prediction is calculated to obtain the dynamic stable value;
[0070] By comparing the dynamic stability values of different iterations pairwise, the degree of fluctuation of the prediction results of the sample between different iterations is calculated, and the uncertainty intensity value is obtained.
[0071] The uncertainty intensity value is mapped to a weight value, and the update magnitude of each sample during training is adjusted to obtain the weight data.
[0072] Based on the weighted data, the unlabeled data is divided into reliable samples, suspicious samples, and uncertain samples to obtain the partitioning results data. The parameters of the supervised learning model are then updated based on these results to obtain the optimized model.
[0073] Based on the optimization model, the process of calculating dynamic stable values, calculating uncertainty intensity values, weight mapping, sample partitioning, and iterative training is repeated until the training process converges, resulting in a video recognition model.
[0074] In this embodiment of the invention, surveillance video data is acquired and labeled, with data labeled with positive samples defined as positive sample data and unlabeled data defined as unlabeled data, thus obtaining segmented data. This avoids the label confusion problem caused by unlabeled samples directly entering the training process. A supervised learning model is used to train the positive sample data to obtain a basic predicted score sequence. The unlabeled data is input into the supervised learning model to obtain unlabeled predicted scores, forming predicted data. A score reference baseline is established through positive samples, and comparable numerical outputs are generated for the unlabeled data, providing an original numerical basis for subsequent calculations. Based on the predicted data, the stability of the samples under multiple rounds of prediction is calculated to obtain dynamic stable values, revealing the consistency and abnormal fluctuations of the samples over time, laying the foundation for subsequent steps. The dynamic stable values of different iteration rounds are compared pairwise to calculate the degree of fluctuation of the prediction results of the samples between different iterations, obtaining an uncertainty intensity value. The fluctuation behavior of the samples in multiple rounds of prediction is quantified into a structural indicator, avoiding interference from a single anomaly on the overall judgment.
[0075] By mapping uncertainty intensity values to weight values and adjusting the update magnitude of each sample during training, weight data is obtained. This quantifies abstract uncertainty into data weights that can directly participate in training, effectively connecting data risk with model training. Based on the weight data, unlabeled data is divided into reliable, suspicious, and uncertain samples, resulting in partitioning data. The parameters of the supervised learning model are then updated based on this partitioning to obtain an optimized model. A weight-driven sample governance mechanism is established, making the input set for parameter updates more reasonable, effectively isolating potential noise, and ensuring that the parameter update process remains consistent with the quality of the input samples. Based on the optimized model, the steps of calculating dynamic stability values, calculating uncertainty intensity values, weight mapping, sample partitioning, and iterative training are executed cyclically until the training process converges, resulting in a video recognition model. All the aforementioned processing flows are organized into a closed-loop iterative system, allowing data to be continuously re-evaluated and reused in multiple loops. The convergence condition ensures that training terminates at an appropriate time, avoiding model oscillations and resource waste caused by excessive iteration.
[0076] In a preferred embodiment of the present invention, surveillance video data is acquired and labeled and segmented. Data with positive sample labels is defined as positive sample data, and unlabeled data is defined as unlabeled data, resulting in segmented data, including:
[0077] Frame-level extraction is performed on the surveillance video data to divide the video content into several independent frame images, thus obtaining frame image data.
[0078] The frame image data is labeled, and the frame images with positive sample labels are extracted to obtain labeled frame data.
[0079] Based on the labeled frame data, all labeled frame images are integrated according to the index to obtain positive sample data;
[0080] Based on the frame image data and positive sample data, the frame images that did not match the annotations were extracted to obtain the unannotated data.
[0081] In this embodiment of the invention, frame-level extraction is performed based on surveillance video data, dividing the video content into several independent frame images to obtain frame image data. This decomposes a continuous video stream into independent frames, avoiding redundant calculations and boundary ambiguity issues that occur when directly processing long video streams, and also provides a foundation for data management and index retrieval. The frame image data is then labeled, extracting frame images with positive sample labels to obtain labeled frame data. This provides labeled training input for the supervised learning model, ensuring the reliability of the supervision signal during training and avoiding bias caused by a lack of labels in subsequent prediction stages. Based on the labeled frame data, all labeled frame images are integrated according to the index to obtain positive sample data. The labeled frames are then uniformly collected into a structured dataset, providing stable input for subsequent model training. Based on the frame image data and positive sample data, frame images that do not match the labels are extracted to obtain unlabeled data. This ensures that the data can distinguish between data with supervision signals and data to be inferred during training, providing the necessary data structure for PU learning.
[0082] In a preferred embodiment of the present invention, a basic predicted score sequence is obtained by training positive sample data using a supervised learning model; unlabeled data is input into the supervised learning model to obtain unlabeled predicted scores, forming predicted data, including:
[0083] Based on the partitioned data, the positive sample data is organized into a batch training format to obtain the training input set;
[0084] The training input set is fed into the supervised learning model, the parameters of the supervised learning model are updated, and the score results for the positive sample data are output to obtain the basic prediction score sequence.
[0085] Based on the partitioned data, the unlabeled data is organized into a batch prediction format to obtain the prediction input set;
[0086] Based on the predicted input set and the updated supervised learning model, the output is the score for the unlabeled data, thus obtaining the unlabeled predicted score.
[0087] In this embodiment of the invention, based on the partitioned data, positive sample data is organized into a batch training format to obtain a training input set. This ensures that the model can update parameters on evenly distributed data, avoiding model bias caused by uneven data distribution. The training input set is input into the supervised learning model, and the parameters of the supervised learning model are updated. The model outputs scores for positive sample data to obtain a basic predicted score sequence, establishing the ability to recognize positive sample features, enabling the model to memorize the core features of the positive sample distribution. Based on the partitioned data, unlabeled data is organized into a batch prediction format to obtain a prediction input set, ensuring that the data enters the supervised learning model in batches, providing a foundation for subsequent large-scale input. Based on the predicted input set and the updated supervised learning model, the model outputs scores for unlabeled data to obtain unlabeled predicted scores. This allows for the rapid acquisition of score information for a large number of unlabeled samples, providing input for subsequent large-scale input.
[0088] The process involves feeding the training input set into the supervised learning model, updating the model parameters, and outputting the scores for positive sample data to obtain the basic predicted score sequence, specifically including:
[0089] First, the training input set is loaded into the supervised learning model, and the positive sample data is processed frame by frame through forward propagation to extract features and perform convolution calculations to obtain the corresponding predicted score vectors. Then, the predicted score vectors are compared with the pre-set positive sample labels, and the difference value is calculated using cross-entropy loss or mean squared error loss. This difference value is then converted into parameter gradients through the backpropagation algorithm. The gradients are then combined with the learning rate to update the parameter weights of the supervised learning model, enabling the model to gradually converge to the true distribution of positive sample features. After several training rounds, the predicted score results corresponding to each positive sample are saved in index order to form a time-series-based basic predicted score sequence.
[0090] Specifically, based on the predicted input set and the updated supervised learning model, the output is the score for the unlabeled data, resulting in the unlabeled predicted score, which includes:
[0091] The predicted input set is sequentially fed into a supervised learning model whose parameters have been updated. The model's forward propagation capability is used to extract features and calculate classification scores for the unlabeled data, resulting in a predicted score for each unlabeled sample. During this process, the prediction results are not updated via backpropagation. Instead, the output scores are stored as an unlabeled predicted score sequence in the order of sample indices, remaining independent of the basic predicted score sequence for positive samples. In this way, a numerical mapping of similarity between each unlabeled sample and a positive sample can be established without providing negative sample labels, thus obtaining a basic predicted score sequence.
[0092] In a preferred embodiment of the present invention, the stability of the sample under multiple rounds of prediction is calculated based on the prediction data to obtain a dynamic stable value, including:
[0093] Based on the predicted data, a time weighting table is obtained to ensure that the latest round has higher memory strength;
[0094] Calculate the mean term based on the time weight table and the basic predicted score sequence; calculate the fluctuation term based on the time weight table and the unlabeled predicted scores; calculate the magnitude of change term based on the difference sequence of scores between adjacent rounds; calculate the baseline consistency term based on the closeness between the mean of scores in each round and the score of the first round; calculate the combined stabilizing effect of low transitions and baseline fit based on the magnitude of change term and the baseline consistency term, and obtain the coupling term; calculate the suppression strength against sudden transitions based on the magnitude of change term, and obtain the transition penalty term.
[0095] The mean, fluctuation, variation, baseline consistency, coupling, and transition penalty terms are fused to obtain a fused stability metric, which is then compressed into a fixed score range to obtain a dynamic stability value.
[0096] In this embodiment of the invention, based on the predicted data, a time weight table is obtained to ensure that the latest round has higher memory strength, thus reflecting the prediction trend of the model under the latest parameter state more quickly. Based on the time weight table and the basic prediction score sequence, a mean term is calculated to reflect the overall prediction level of positive samples in different rounds, providing a standardized reference for subsequent fluctuation analysis of unlabeled data. A fluctuation term is calculated based on the time weight table and unlabeled prediction scores to capture the consistency or inconsistency of unlabeled sample predictions over time. A change magnitude term is calculated based on the difference sequence of scores between adjacent rounds to measure the continuous rate of change of the model's predictions for the same sample during iterative updates. A baseline consistency term is calculated based on the closeness between the mean score of each round and the score of the first round, reflecting whether there is significant drift in model predictions over time. The algorithm is as follows: Based on the variation magnitude term and the baseline consistency term, the comprehensive stabilizing effect of low-transition and baseline-fitting parameters is calculated to obtain the coupling term, ensuring that stable and long-term consistent prediction samples are preferentially used in subsequent weight allocation; Based on the variation magnitude term, the suppression strength against sudden transitions is calculated to obtain the transition penalty term, which suppresses the interference of abnormal jumps in the prediction sequence on stability evaluation and avoids the model from over-relying on sudden abnormal samples in subsequent training; The mean term, fluctuation term, variation magnitude term, baseline consistency term, coupling term, and transition penalty term are fused to obtain the fused stability metric, which unifies the prediction features of multiple dimensions into a single dynamic stable value, ensuring comparability between different samples, and then compresses it to a fixed score range to obtain the dynamic stable value, ensuring that the results of different samples are consistent and easy to sort, providing accurate input for subsequent processing.
[0097] In a preferred embodiment of the present invention, the dynamic stability values of different iterations are compared pairwise to calculate the degree of fluctuation in the prediction results of the samples between different iterations, thereby obtaining an uncertainty intensity value, including:
[0098] Based on the dynamic stable value sequence of each iteration, the energy proportion of the dynamic stable value in the rapidly changing region is calculated to obtain the high change ratio term; the average distance of the dynamic stable values in the numerical arrangement is calculated to obtain the window drift term; based on the difference sequence of dynamic stable values of adjacent iterations, the sign reversal ratio from positive to negative or from negative to positive is calculated to obtain the direction reversal term; based on the continuous sign segments of the difference between adjacent iterations, the degree of imbalance between the lengths of each continuous segment is calculated to obtain the segment imbalance term; based on the mean sequence of the difference between adjacent iterations, the ratio of the cumulative offset range to the overall fluctuation is calculated to obtain the mutation cumulative term.
[0099] Based on the direction reversal term and the segment imbalance term, the instability enhancement amount when the direction is frequently reversed and the continuous segments are broken is calculated, and the direction structure coupling term is obtained; based on the window drift term and the high change ratio term, the instability superposition intensity when cross-window drift and rapid change coexist is calculated, and the cross-window change coupling term is obtained; based on the mutation accumulation term, the instability coordination amount when sudden offset occurs is calculated, and the mutation order coupling term is obtained.
[0100] The directional structure coupling term, the cross-window change coupling term, and the mutation order coupling term are weighted and fused, and then interval-mapped to obtain the uncertainty intensity value.
[0101] In this embodiment of the invention, based on the dynamic stable value sequence of each iteration, the energy proportion of the dynamic stable value in the rapidly changing region is calculated to obtain a high change ratio term, accurately capturing whether the sample frequently experiences drastic fluctuations between different iterations, avoiding the use of frequently changing samples as stable samples during training; the average distance of the dynamic stable values in the numerical arrangement is calculated to obtain a window drift term, reflecting the stability trend of the sample over a longer time scale, and determining whether the sample exhibits an overall shift in different training stages; based on the difference sequence of dynamic stable values in adjacent iterations, the sign reversal ratio from positive to negative or from negative to positive is calculated to obtain a direction reversal term, revealing whether the prediction results of the sample exhibit frequent directional repetitive changes between different iterations; based on the continuous segment of the sign of the difference between adjacent iterations, the degree of imbalance between the lengths of each continuous segment is calculated to obtain a segment imbalance term, identifying whether the sample prediction exhibits an imbalance phenomenon of long-term stability but short-term fluctuations over a period of time; based on the mean sequence of the difference between adjacent iterations, the ratio of the cumulative offset range to the overall fluctuation is calculated to obtain a mutation accumulation term, reflecting whether the prediction results have concentrated mutations in a few iterations and form a cumulative effect, effectively distinguishing between occasional small fluctuations and systemic instability. The study investigates several key aspects of instability. First, based on the direction reversal term and the segment imbalance term, it calculates the instability enhancement when direction reversals are frequent and continuous segments are broken, resulting in a direction structure coupling term. This strengthens the description of instability caused by short-term direction repetition and segment length imbalance, preventing such high-risk samples from being classified as reliable. Second, based on the window drift term and the high change ratio term, it calculates the instability superposition intensity when cross-window drift and rapid change coexist, resulting in a cross-window change coupling term. This reflects the complex instability of samples exhibiting both macro-trends and local drastic fluctuations, effectively identifying such multi-scale uncertain samples and preventing them from misleading training. Third, based on the mutation accumulation term, it calculates the instability coordination quantity when sudden shifts occur, resulting in a mutation order coupling term. This captures the abnormal arrangement of sample predictions on the time axis, avoiding sudden overall interference to the training process. Fourth, it weights and fuses the direction structure coupling term, cross-window change coupling term, and mutation order coupling term, and performs interval mapping to obtain uncertainty intensity values. Through fusion and interval mapping, it not only ensures the comprehensive utilization of different unstable features but also ensures the comparability of uncertainty intensity values, facilitating subsequent mapping as weights and application to the training process, thus achieving closed-loop control of the overall training process.
[0102] In a preferred embodiment of the present invention, the uncertainty intensity value is mapped to a weight value, and the update magnitude of each sample during training is adjusted to obtain weight data, including:
[0103] Based on the uncertainty intensity value, the uncertainty intensity values corresponding to each sample are aggregated according to the sample index and missing records are removed to obtain the sorted data;
[0104] Based on the collected data, multiple non-overlapping mapping intervals are determined in ascending order of uncertainty intensity values, and the interval boundaries are recorded to obtain the mapping interval data.
[0105] Based on the mapping interval data, each mapping interval is assigned an interval benchmark weight that is inversely proportional to the uncertainty intensity value, and a correspondence rule from interval to weight is formed to obtain the mapping template data;
[0106] Based on the mapping template data, the uncertainty intensity value of each sample is used to determine the sample benchmark weight according to its mapping interval, thus obtaining the initial weight table.
[0107] In this embodiment of the invention, based on the uncertainty intensity value, the uncertainty intensity values corresponding to each sample are collected by sample index and missing records are removed to obtain organized data. By indexing and removing missing data from the sample data, the integrity and consistency of subsequent input data are ensured, avoiding mapping errors caused by missing or misaligned data. Based on the organized data, multiple non-overlapping mapping intervals are determined in ascending order of uncertainty intensity values, and the interval boundaries are recorded to obtain mapping interval data. By managing the distribution of uncertainty intensity values in intervals, samples of different intensity ranges are grouped and classified, establishing a numerical basis for weight allocation and realizing the measurement of sample differentiation. Based on the mapping interval data, an interval benchmark weight inversely proportional to the uncertainty intensity value is assigned to each mapping interval, forming a correspondence rule from interval to weight, resulting in mapping template data. This allows the model to automatically favor low-uncertainty samples during training, reducing the influence of high-uncertainty samples and avoiding the accumulation of erroneous gradients. Based on the mapping template data, the uncertainty intensity value of each sample is determined according to its corresponding mapping interval to obtain an initial weight table. A benchmark weight is generated for each sample, enabling differentiated weight control during gradient updates of the training data, improving the robustness and convergence speed of the overall training process.
[0108] Based on the processed data, multiple non-overlapping mapping intervals are determined in ascending order of uncertainty intensity, and the interval boundaries are recorded to obtain the mapping interval data, specifically including:
[0109] First, the uncertainty intensity values of all samples are sorted in ascending order to form a continuous numerical sequence. The numerical sequence is then segmented according to a preset partitioning rule. This partitioning rule can be a fixed-interval partitioning, that is, dividing the entire numerical interval into segments of the same length, or a quantile partitioning, that is, setting interval boundaries at specified quantile points based on the statistical characteristics of the data distribution. After the segmentation is completed, the upper and lower boundaries of each interval are recorded and stored together with the corresponding sample index to form mapped interval data.
[0110] Specifically, based on the mapping interval data, an interval benchmark weight inversely proportional to the uncertainty intensity value is assigned to each mapping interval, forming a correspondence rule from interval to weight, thus obtaining mapping template data, which specifically includes:
[0111] After obtaining multiple mapping intervals and their boundary information, a benchmark weight value is set for each interval. The magnitude of the benchmark weight is inversely proportional to the magnitude of the uncertainty intensity corresponding to the interval. That is, the smaller the uncertainty intensity value of the interval, the larger its corresponding weight, and the larger the uncertainty intensity value of the interval, the smaller its corresponding weight. Specifically, a linear inverse proportional function can be used to numerically calculate the weight to ensure that the weight allocation between intervals is smooth and continuous. After the calculation is completed, a mapping relationship is established between each interval and the corresponding benchmark weight, and a correspondence rule from interval to weight is formed to obtain mapping template data.
[0112] Specifically, based on the mapping template data, the uncertainty intensity value of each sample is used to determine the sample baseline weight according to its mapping interval, resulting in an initial weight table, which includes:
[0113] After obtaining the weight mapping rules for each interval, the uncertainty intensity values of all samples are matched one by one with the mapping interval to determine the interval range to which the sample belongs; according to the benchmark weight value corresponding to the interval, the sample is assigned a corresponding weight value, and the sample index is bound to the weight value to form a sample weight pair; after all samples have been matched and weighted, the weight information of all samples is summarized into an initial weight table.
[0114] In a preferred embodiment of the present invention, the uncertainty intensity value is mapped to a weight value, and the update magnitude of each sample during training is adjusted to obtain weight data. The method further includes:
[0115] Based on the initial weight table and the weight table that has been effective in the previous round, an upper limit is set on the change range of the weight of the same sample in two adjacent rounds to obtain the constrained weight table.
[0116] Based on the constraint weight table, the weights of adjacent samples within the same batch are locally smoothed while maintaining index consistency, resulting in a smoothed weight table.
[0117] Based on the smoothed weight table, the weights of all samples in the batch are mapped to a uniform numerical range on a fixed scale while maintaining comparability of the total amount, thus obtaining the normalized weight table.
[0118] Based on the normalized weight table, abnormal or missing records are replaced or removed and rearranged according to the sample index to obtain the weight data.
[0119] In this embodiment of the invention, based on the initial weight table and the weight table that has taken effect in the previous round, an upper limit is set on the change range of the weight of the same sample in adjacent rounds to obtain a constrained weight table. This limits the change range of the weight of a single sample in adjacent rounds, avoids drastic changes in weight due to fluctuations in single-round prediction, and prevents parameter oscillations during training. Based on the constrained weight table, the weights of adjacent samples in the same batch are locally smoothed while maintaining index consistency to obtain a smoothed weight table. This weakens isolated outliers or spikes in the weight distribution and avoids disproportionate impacts of a single abnormal weight on model updates. Based on the smoothed weight table, the weights of all samples in the batch are mapped to a uniform numerical range according to a fixed scale while maintaining comparability of total weights to obtain a normalized weight table. This eliminates the impact of inconsistent weight scales between different batches and ensures that the weights have a clear range meaning in training optimization. Based on the normalized weight table, abnormal or missing records are replaced or removed and rearranged according to the sample index to obtain weight data. This ensures the integrity and consistency of the weight data and avoids gradient errors or training failures caused by abnormal weights during training.
[0120] Specifically, based on the initial weight table and the weight table that has already taken effect in the previous round, an upper limit is set on the change range of the weight of the same sample in adjacent rounds, resulting in a constrained weight table, which includes:
[0121] First, the initial weight table calculated in the current round is extracted and compared sample-by-sample with the weight table used by the model in the previous round. For the weight difference of the same sample between the two rounds, if it exceeds a preset change threshold, the difference is corrected to the threshold range. For example, if an unlabeled sample had a weight of 0.45 in the previous round, and it increases to 0.75 in the initial weight table of this round, and the preset threshold is 0.2, then only the weight of that sample is allowed to increase to 0.65, and the excess is reduced. The resulting constrained weight table can avoid excessive weight jumps due to prediction fluctuations and ensure smooth weight evolution.
[0122] Specifically, based on the constraint weight table, the weights of adjacent samples within the same batch are locally smoothed while maintaining index consistency, resulting in a smoothed weight table, which includes:
[0123] First, the weights of adjacent samples are processed using a sliding window method, with each sample's final weight taken as the weighted average of its number of neighboring samples. The weight factor decreases as distance increases, achieving smoothing within a local range. For example, for five samples with adjacent indices, the system can use a weighted average with a window size of 3, ensuring that each sample's weight reflects not only its own uncertainty intensity but also the trend characteristics of its neighboring samples. Simultaneously, the sample indices remain unchanged, ensuring that the correspondence in subsequent mapping and sorting operations is not disrupted.
[0124] Specifically, based on the smoothed weight table, the weights of all samples within the batch are mapped to a uniform numerical range on a fixed scale while maintaining comparability of total values, resulting in a normalized weight table, which includes:
[0125] First, the smoothed weight values are linearly normalized, with the interval set to [0,1]. During this process, the maximum and minimum weight values within a batch are used as endpoints to proportionally scale the weights of all samples to this interval. Simultaneously, to avoid the impact of differences in total weights between different batches, the system proportionally adjusts the sum of the normalized weights to ensure that the total weight of each batch remains consistent with the initially set reference value.
[0126] Specifically, based on the normalized weight table, abnormal or missing records are replaced or removed and rearranged according to the sample index to obtain weight data, which includes:
[0127] First, the system checks the normalized weight table for outliers, such as negative numbers, weight values exceeding 1, or missing records from data storage and transmission. For recoverable cases, such as a single missing sample weight, the system replaces it with the average weight of adjacent samples. For irreparable cases, such as multiple consecutive missing records or samples with weight values significantly deviating from the distribution, they are directly removed. After replacement or removal, the system rearranges the remaining samples according to their index order to form a weight data table.
[0128] In a preferred embodiment of the present invention, unlabeled data is divided into reliable samples, suspicious samples, and uncertain samples based on weight data to obtain partitioning result data. The parameters of the supervised learning model are then updated based on this partitioning result data to obtain an optimized model, including:
[0129] The index is merged based on the weighted data and unlabeled data. The sample identifier is matched and stored with the corresponding weight. The samples are sorted from largest to smallest weight and their positions in the sequence are recorded to obtain the sorting table.
[0130] Based on the sorting table, determine two non-overlapping threshold positions to form three consecutive intervals and fix the interval boundaries to obtain the threshold interval data;
[0131] Based on the threshold interval data, samples in the highest interval are marked as reliable samples, samples in the middle interval are marked as suspicious samples, and samples in the lowest interval are marked as uncertain samples, thus obtaining a preliminary partitioning table;
[0132] Based on the preliminary partitioning table, missing and duplicate records are removed while maintaining the continuity of the sample index to obtain the partitioning result data.
[0133] In this embodiment of the invention, the indexes of weighted data and unlabeled data are merged, sample identifiers are matched and stored with their corresponding weights, and the samples are arranged in descending order of weight and their positions in the sequence are recorded to obtain a sorting table. This achieves ordered management of unlabeled samples along the weight dimension, avoiding the chaos caused by random or disordered partitioning. Based on the sorting table, two non-overlapping threshold positions are determined to form three continuous intervals and the interval boundaries are fixed to obtain threshold interval data. This achieves hierarchical partitioning of unlabeled samples, allowing samples from different weight intervals to enter a differentiated processing flow. Based on the threshold interval data, samples in the highest interval are marked as reliable samples, samples in the middle interval are marked as suspicious samples, and samples in the lowest interval are marked as uncertain samples, resulting in a preliminary partitioning table. This enables hierarchical management of samples and effectively reduces the risk of erroneous samples being introduced into training. Based on the preliminary partitioning table, missing and duplicate records are removed while maintaining the continuity of the sample index to obtain partitioning result data. This ensures the integrity and consistency of the partitioning results and avoids conflicts or imbalances caused by missing or duplicate samples in updating model parameters.
[0134] Specifically, based on the sorting table, two non-overlapping threshold positions are determined to form three consecutive intervals, and the interval boundaries are fixed to obtain the threshold interval data, which includes:
[0135] First, based on the number of samples in the sorted table... The size of the threshold candidate point determines the selection rules. For example, the first threshold point can be set at a cumulative proportion of 1 / 2 * ... The second threshold point is located at the cumulative ratio of The location, among which and A fixed ratio, such as 0.3 and 0.7, is used to ensure that the division results are consistent across different batches.
[0136] If the distribution of sample weights in the ranking table is not uniform, relying solely on a fixed ratio may result in too many or too few reliable or uncertain samples. Further analysis of the differences in the weight sequences can be conducted based on the calculation of the cumulative ratio. When a weight sequence experiences a sudden change or a significantly accelerated rate of decline at a certain position, that position can be considered a candidate threshold point. By combining the fixed ratio division with the weight difference abrupt change point, a threshold position that better reflects the data distribution characteristics can be dynamically determined.
[0137] After the threshold points are determined, the two threshold positions are fixed to form three continuous and non-overlapping intervals. The first interval corresponds to samples with higher weight values, which usually represent samples with strong stability and high reliability in multiple rounds of prediction; the second interval corresponds to samples with weights in the middle range, which usually represent samples with some uncertainty; the third interval corresponds to samples with lower weight values, which often fluctuate significantly during the prediction process and have strong instability. Through this interval division, the threshold interval data is obtained.
[0138] In a preferred embodiment of the present invention, unlabeled data is divided into reliable samples, suspicious samples, and uncertain samples according to weight data to obtain partitioning result data, and the parameters of the supervised learning model are updated based on the partitioning result data to obtain an optimized model. The method further includes:
[0139] Based on the partitioning results, update strategies are set for reliable samples, correction strategies are set for suspicious samples, and delay strategies are set for uncertain samples, resulting in a strategy table;
[0140] Based on the strategy table, reliable samples are converted into parameter increment records, suspicious samples are converted into parameter correction records, and uncertain samples are converted into delay records, thus obtaining the update plan table;
[0141] Based on the update schedule and the current model parameters, the parameter increment record and parameter correction record are superimposed on the current parameters respectively, while keeping the delay record from being triggered, to obtain the stage parameter set;
[0142] The stage parameter set is written into the supervised learning model and output to obtain the optimized model.
[0143] In this embodiment of the invention, based on the partitioning results data, update strategies are set for reliable samples, correction strategies for suspicious samples, and delay strategies for uncertain samples, resulting in a strategy table. This avoids samples with different confidence levels causing equal impact on the model during training, reducing interference from erroneous samples. Based on the strategy table, reliable samples are converted into parameter increment records, suspicious samples into parameter correction records, and uncertain samples into delay records, resulting in an update plan table. This achieves visualization and structured management of the training process, preventing misclassification of samples from directly affecting the model. Based on the update plan table and the current model parameters, parameter increment records and parameter correction records are superimposed on the current parameters while keeping delay records from triggering, resulting in a stage parameter set. This enables hierarchical control of the parameter update process, effectively preventing error propagation and overfitting. The stage parameter set is written into the supervised learning model and output, resulting in an optimized model. This solidifies and continues the differentiated training results, avoiding negative impacts from suspicious and uncertain samples on the model.
[0144] Based on the partitioning results, update strategies are set for reliable samples, correction strategies for suspicious samples, and delay strategies for uncertain samples, resulting in a strategy table, which specifically includes:
[0145] First, based on the segmentation results, unlabeled samples are individually identified and categorized according to their positions within the confidence, doubtful, and uncertain intervals, ensuring each sample has a unique index number. Next, an update strategy is set for confidence samples, generating a record for each sample containing its sample index, corresponding weight value, and update method flag. The update method flag is set to incremental, indicating that this type of sample will directly participate in model parameter updates during training in the form of normal parameter increments. Then, a correction strategy is set for doubtful samples, generating a record for each sample containing its sample index, corresponding weight value, and correction upper limit parameter. The correction upper limit parameter is used to constrain the magnitude of model parameter changes it can cause in subsequent training iterations, preventing over-adjustment of parameters. Finally, a delay strategy is set for uncertain samples, generating a record for each uncertain sample containing its sample index and delay flag, but without any parameter update information. The delay flag indicates that the sample will not trigger an update in the current round, only retaining its potential participation in subsequent rounds. The strategy information for the three types of samples is integrated into a unified data structure to obtain a strategy table.
[0146] Based on the strategy table, reliable samples are converted into parameter increment records, suspicious samples into parameter correction records, and uncertain samples into delay records, resulting in an update plan table, which specifically includes:
[0147] First, reliable sample records are read from the policy table. Based on their index and weight information, the corresponding feature gradients in the supervised learning model are invoked to generate parameter increment records. These records contain the sample index, sample feature gradient, weight value, and stacking factor. The stacking factor is used to amplify or reduce the contribution value during subsequent parameter updates, forming a complete incremental update instruction. Next, suspicious samples are processed. Based on their correction upper limit parameter in the policy table, their feature gradients are truncated or normalized to ensure that the adjustment does not exceed a preset threshold. Then, parameter correction records are generated. These records contain the sample index, corrected gradient information, and correction upper limit identifier, used to perform limited-range adjustments during parameter updates. Then, uncertain samples are processed, generating delay records for them. These records only contain the sample index and delay flag, without any parameter information that could trigger model updates, thus ensuring that uncertain samples will not cause parameter changes in the current training batch. Finally, the three types of records are reordered in index order and integrated into a unified data table structure within the batch to form an update plan table.
[0148] Specifically, based on the update schedule and current model parameters, the parameter increment record and parameter correction record are superimposed on the current parameters while keeping the delay record from being triggered, resulting in the stage parameter set, which includes:
[0149] First, the parameters of the current supervised learning model are copied as the baseline parameter set to establish a temporary parameter space to be updated. Then, each parameter increment record in the update plan table is read, and the feature gradients contained therein are weighted according to their corresponding weights and stacking factors. The weighted result is then directly stacked onto the corresponding position in the temporary parameter space, achieving positive enhancement of the model parameters by reliable samples. Next, the parameter correction record is read, and the correction gradient is amplitude-limited according to the correction upper limit parameter in the record. After processing, the correction gradient is stacked onto the corresponding parameter position in the temporary parameter space, achieving limited correction of suspicious samples. Then, the delay record is read. For uncertain samples corresponding to the delay record, no calculations are triggered in the temporary parameter space; only the sample index and delay flag information are retained for re-evaluation of their stability in subsequent rounds. Finally, the temporary parameter space, after incremental stacking and correction adjustment, is written back into the supervised learning model, replacing the original parameter values to form the stage parameter set.
[0150] In a preferred embodiment of the present invention, based on the optimization model, the steps of calculating the dynamic stability value, calculating the uncertainty intensity value, weight mapping, sample partitioning, and iterative training are executed cyclically until the training process converges, resulting in a video recognition model, including:
[0151] Based on the optimization model, set the round counter and termination threshold, and record the parameter information of the previous round model to obtain the loop control table;
[0152] Based on the cyclic control table and optimization model, the unlabeled data is merged with the previous round state to generate the batch structure required for prediction, thus obtaining the cyclic input set;
[0153] Based on the cyclic input set, the following steps are performed: calculating the dynamic stability value, calculating the uncertainty intensity value, weight mapping, sample partitioning, and iterative training, to obtain the cyclic optimization model.
[0154] Convergence evaluation is performed based on the cyclic optimization model and the previous model. The consistency count and parameter variation magnitude are calculated and compared with the preset termination threshold group to obtain convergence judgment data.
[0155] Based on the convergence judgment data, if the convergence condition is not met, the loop control table is written back and the next round is entered. If the convergence condition is met, the current model parameter information is fixed and output to obtain the video recognition model.
[0156] In this embodiment of the invention, based on the optimization model, a round counter and a termination threshold are set, and the parameter information of the previous round model is recorded to obtain a loop control table. This ensures that subsequent iterative training has target boundaries and comparison references, avoiding endless training. Based on the loop control table and the optimization model, unlabeled data is merged with the previous round state to generate the batch structure required for prediction, resulting in a loop input set. This achieves continuous processing of unlabeled data, avoiding missed samples or repeated calculations. Based on the loop input set, the following steps are performed: calculating the dynamic stability value, calculating the uncertainty intensity value, weight mapping, sample partitioning, and iterative training. This yields a loop optimization model, which suppresses uncertain samples and strengthens training on reliable samples. The process involves training to gradually improve the model's accuracy and robustness in recognizing video data. Convergence evaluation is performed based on the iteratively optimized model and the previous model, calculating consistency counts and parameter variation amplitudes and comparing them with preset termination thresholds to obtain convergence judgment data. This comprehensively measures whether the model is truly stable, preventing premature termination or overtraining. Based on the convergence judgment data, if the convergence condition is not met, the iterative control table is written back and the next round begins. If the convergence condition is met, the current model parameter information is fixed and output, resulting in the video recognition model. This ensures that the model can be continuously optimized until stable and can also be frozen in a converged state, effectively identifying violations in video surveillance scenarios and reducing the risk of false alarms and missed alarms.
[0157] Based on the optimization model, a round counter and a termination threshold are set, and the parameter information of the previous round model is recorded to obtain the loop control table, which specifically includes:
[0158] At the beginning of the training phase, to ensure that the training process can be effectively tracked and terminated, the system first sets a round counter to record the training round in which the current iteration is located; at the same time, a termination threshold is set, which may include a consistency count threshold and a parameter variation threshold. The consistency count threshold is used to measure the minimum number of consecutive prediction results that are stable, and the parameter variation threshold is used to measure the maximum allowable variation of model parameters between adjacent rounds; the model parameter information obtained from the previous training round is completely written into the loop control table as the benchmark value for subsequent comparisons.
[0159] Specifically, based on the cyclic control table and optimization model, unlabeled data is merged with the previous round's state to generate the batch structure required for prediction, resulting in the cyclic input set, which includes:
[0160] When entering a new iteration, the previous round's state information is first called from the loop control table to merge the sample states that were not updated in the previous round with the new unlabeled data, ensuring the continuity of sample processing. During the merging process, each sample is assigned a unique index identifier, along with its classification state information from the previous round, such as a reliable sample, a suspicious sample, or an uncertain sample. Then, according to the input format requirements of the supervised learning model, the merged sample set is organized into a batch structure, with each batch containing a fixed number of sample data, index information, and state labels, ensuring that the input set is compatible with subsequent calculation and prediction steps.
[0161] The convergence evaluation is performed based on the iterative optimization model and the previous model. The consistency count and parameter variation magnitude are calculated and compared with a preset termination threshold group to obtain convergence judgment data, specifically including:
[0162] After each iteration, the output of the cyclic optimization model is compared with that of the previous model. On the one hand, the prediction results of unlabeled samples are statistically analyzed for consecutive rounds. If the output results of the same sample are consistent in multiple prediction rounds, the consistency count is accumulated. On the other hand, the difference between the current model parameters and the parameters of the previous round is compared, and the parameter change amplitude is calculated. When the amplitude is lower than the preset range, it is considered to be approaching stability. Then, the obtained consistency count and parameter change amplitude are compared with the termination threshold set in the loop control table one by one. If the consistency count reaches or exceeds the threshold and the parameter change amplitude is lower than the threshold, it is determined that the current model has met the convergence condition, and convergence judgment data is generated.
[0163] Specifically, based on the convergence judgment data, if the convergence condition is not met, the loop control table is written back and the next round is entered; if the convergence condition is met, the current model parameter information is fixed and output, thus obtaining the video recognition model, which includes:
[0164] When the convergence determination data shows that the termination condition has not been met, the parameter information, consistency count, and parameter change magnitude of the current round are rewritten into the loop control table, the record status of the table is updated, and the round counter is incremented to point to the next iteration, ensuring the continuity of training. When the convergence determination data shows that the termination condition has been met, the parameter information of the current loop optimization model is fixed in the storage module and no further updates are made. This model is then used as the final video recognition model output. This ensures that the iteration process can continue to run when convergence has not been reached, and that the model state can be effectively frozen after convergence, ensuring the stability of the output video recognition model.
[0165] The above description represents the preferred embodiments of the present invention. It should be noted that those skilled in the art can make various improvements and modifications without departing from the principles of the present invention, and these improvements and modifications should also be considered within the scope of protection of the present invention.
Claims
1. A training method for an adaptive uncertainty PU learning model for video surveillance scenarios, characterized in that, The method includes: Acquire surveillance video data and label and segment it. Define data with positive sample labels as positive sample data and unlabeled data as unlabeled data to obtain segmented data. The positive sample data is trained by a supervised learning model to obtain a basic predicted score sequence; the unlabeled data is input into the supervised learning model to obtain unlabeled predicted scores, thus forming the predicted data. Based on the prediction data, the stability of the sample under multiple prediction rounds is calculated to obtain the dynamic stable value, including: Based on the predicted data, a time weighting table is obtained to ensure that the latest round has higher memory strength; Calculate the mean term based on the time weight table and the basic predicted score sequence; calculate the fluctuation term based on the time weight table and the unlabeled predicted scores; calculate the magnitude of change term based on the difference sequence of scores between adjacent rounds; calculate the baseline consistency term based on the closeness between the mean of scores in each round and the score of the first round; calculate the combined stabilizing effect of low transitions and baseline fit based on the magnitude of change term and the baseline consistency term, and obtain the coupling term; calculate the suppression strength against sudden transitions based on the magnitude of change term, and obtain the transition penalty term. The mean, fluctuation, variation, baseline consistency, coupling, and transition penalty terms are fused to obtain a fused stability metric, which is then compressed into a fixed score range to obtain a dynamic stability value. The dynamic stability values from different iterations are compared pairwise to calculate the degree of fluctuation in the prediction results between iterations, yielding an uncertainty intensity value, including: Based on the dynamic stable value sequence of each iteration, the energy proportion of the dynamic stable value in the rapidly changing region is calculated to obtain the high change ratio term; the average distance of the dynamic stable values in the numerical arrangement is calculated to obtain the window drift term; based on the difference sequence of dynamic stable values of adjacent iterations, the sign reversal ratio from positive to negative or from negative to positive is calculated to obtain the direction reversal term; based on the continuous sign segments of the difference between adjacent iterations, the degree of imbalance between the lengths of each continuous segment is calculated to obtain the segment imbalance term; based on the mean sequence of the difference between adjacent iterations, the ratio of the cumulative offset range to the overall fluctuation is calculated to obtain the mutation cumulative term. Based on the direction reversal term and the segment imbalance term, the instability enhancement amount when the direction is frequently reversed and the continuous segments are broken is calculated, and the direction structure coupling term is obtained; based on the window drift term and the high change ratio term, the instability superposition intensity when cross-window drift and rapid change coexist is calculated, and the cross-window change coupling term is obtained; based on the mutation accumulation term, the instability coordination amount when sudden offset occurs is calculated, and the mutation order coupling term is obtained. The directional structure coupling term, the cross-window change coupling term, and the abrupt change order coupling term are weighted and fused, and then interval-mapped to obtain the uncertainty intensity value. The uncertainty intensity value is mapped to a weight value, and the update magnitude of each sample during training is adjusted to obtain the weight data. Based on the weighted data, the unlabeled data is divided into reliable samples, suspicious samples, and uncertain samples to obtain the partitioning results data. The parameters of the supervised learning model are then updated based on these results to obtain the optimized model. Based on the optimization model, the process of calculating dynamic stable values, calculating uncertainty intensity values, weight mapping, sample partitioning, and iterative training is repeated until the training process converges, resulting in a video recognition model.
2. The adaptive uncertainty PU learning model training method for video surveillance scenarios according to claim 1, characterized in that, Acquire surveillance video data and label and segment it. Data with positive sample labels is defined as positive sample data, and unlabeled data is defined as unlabeled data, resulting in segmented data, including: Frame-level extraction is performed on the surveillance video data to divide the video content into several independent frame images, thus obtaining frame image data. The frame image data is labeled, and the frame images with positive sample labels are extracted to obtain labeled frame data. Based on the labeled frame data, all labeled frame images are integrated according to the index to obtain positive sample data; Based on the frame image data and positive sample data, the frame images that did not match the annotations were extracted to obtain the unannotated data.
3. The adaptive uncertainty PU learning model training method for video surveillance scenarios according to claim 2, characterized in that, A supervised learning model is used to train the positive sample data to obtain a basic predicted score sequence. Unlabeled data is then input into the supervised learning model to obtain unlabeled predicted scores, forming the predicted data, including: Based on the partitioned data, the positive sample data is organized into a batch training format to obtain the training input set; The training input set is fed into the supervised learning model, the parameters of the supervised learning model are updated, and the score results for the positive sample data are output to obtain the basic prediction score sequence. Based on the partitioned data, the unlabeled data is organized into a batch prediction format to obtain the prediction input set; Based on the predicted input set and the updated supervised learning model, the output is the score for the unlabeled data, thus obtaining the unlabeled predicted score.
4. The adaptive uncertainty PU learning model training method for video surveillance scenarios according to claim 3, characterized in that, By mapping uncertainty intensity values to weight values and adjusting the update magnitude of each sample during training, weight data is obtained, including: Based on the uncertainty intensity value, the uncertainty intensity values corresponding to each sample are aggregated according to the sample index and missing records are removed to obtain the sorted data; Based on the collected data, multiple non-overlapping mapping intervals are determined in ascending order of uncertainty intensity values, and the interval boundaries are recorded to obtain the mapping interval data. Based on the mapping interval data, each mapping interval is assigned an interval benchmark weight that is inversely proportional to the uncertainty intensity value, and a correspondence rule from interval to weight is formed to obtain the mapping template data; Based on the mapping template data, the uncertainty intensity value of each sample is used to determine the sample benchmark weight according to its mapping interval, thus obtaining the initial weight table.
5. The adaptive uncertainty PU learning model training method for video surveillance scenarios according to claim 4, characterized in that, Mapping uncertainty intensity values to weight values and adjusting the update magnitude of each sample during training to obtain weight data also includes: Based on the initial weight table and the weight table that has been effective in the previous round, an upper limit is set on the change range of the weight of the same sample in two adjacent rounds to obtain the constrained weight table. Based on the constraint weight table, the weights of adjacent samples within the same batch are locally smoothed while maintaining index consistency, resulting in a smoothed weight table. Based on the smoothed weight table, the weights of all samples in the batch are mapped to a uniform numerical range on a fixed scale while maintaining comparability of the total amount, thus obtaining the normalized weight table. Based on the normalized weight table, abnormal or missing records are replaced or removed and rearranged according to the sample index to obtain the weight data.
6. The adaptive uncertainty PU learning model training method for video surveillance scenarios according to claim 5, characterized in that, Based on the weighted data, the unlabeled data is divided into reliable samples, doubtful samples, and uncertain samples to obtain the classification results. The parameters of the supervised learning model are then updated based on these results to obtain an optimized model, including: The index is merged based on the weighted data and unlabeled data. The sample identifier is matched and stored with the corresponding weight. The samples are sorted from largest to smallest weight and their positions in the sequence are recorded to obtain the sorting table. Based on the sorting table, determine two non-overlapping threshold positions to form three consecutive intervals and fix the interval boundaries to obtain the threshold interval data; Based on the threshold interval data, samples in the highest interval are marked as reliable samples, samples in the middle interval are marked as suspicious samples, and samples in the lowest interval are marked as uncertain samples, thus obtaining a preliminary partitioning table; Based on the preliminary partitioning table, missing and duplicate records are removed while maintaining the continuity of the sample index to obtain the partitioning result data.
7. The adaptive uncertainty PU learning model training method for video surveillance scenarios according to claim 6, characterized in that, Based on the weighted data, the unlabeled data is divided into reliable samples, doubtful samples, and uncertain samples to obtain the classification results. The parameters of the supervised learning model are then updated based on these results to obtain an optimized model. This also includes: Based on the partitioning results, update strategies are set for reliable samples, correction strategies are set for suspicious samples, and delay strategies are set for uncertain samples, resulting in a strategy table; Based on the strategy table, reliable samples are converted into parameter increment records, suspicious samples are converted into parameter correction records, and uncertain samples are converted into delay records, thus obtaining the update plan table; Based on the update schedule and the current model parameters, the parameter increment record and parameter correction record are superimposed on the current parameters respectively, while keeping the delay record from being triggered, to obtain the stage parameter set; The stage parameter set is written into the supervised learning model and output to obtain the optimized model.
8. The adaptive uncertainty PU learning model training method for video surveillance scenarios according to claim 7, characterized in that, Based on the optimized model, the following steps are iteratively executed: calculating the dynamic stability value, calculating the uncertainty intensity value, weight mapping, sample partitioning, and iterative training, until the training process converges, resulting in the video recognition model, including: Based on the optimization model, set the round counter and termination threshold, and record the parameter information of the previous round model to obtain the loop control table; Based on the cyclic control table and optimization model, the unlabeled data is merged with the previous round state to generate the batch structure required for prediction, thus obtaining the cyclic input set; Based on the cyclic input set, the following steps are performed: calculating the dynamic stability value, calculating the uncertainty intensity value, weight mapping, sample partitioning, and iterative training, to obtain the cyclic optimization model. Convergence evaluation is performed based on the cyclic optimization model and the previous model. The consistency count and parameter variation magnitude are calculated and compared with the preset termination threshold group to obtain convergence judgment data. Based on the convergence judgment data, if the convergence condition is not met, the loop control table is written back and the next round is entered. If the convergence condition is met, the current model parameter information is fixed and output to obtain the video recognition model.
Citation Information
Patent Citations
Framework for semi-supervised learning when no labeled data is given
US20190164086A1
URL attack detection method and apparatus, and electronic device
WO2019109743A1