A lightweight test-time adaptation method for non-stationary data streams

By constructing a two-branch adaptive mechanism for the shadow observation branch, the response and stability issues of the adaptive method in single-sample and non-stationary data flow scenarios during lightweight testing are solved, realizing dynamic response and selective updates, and improving the model's adaptability and robustness.

CN122366660APending Publication Date: 2026-07-10HOHAI UNIV
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202610491094.X
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2026-04-14
Publication Date
2026-07-10

Smart Images

  • Figure CN122366660A_ABST
    Figure CN122366660A_ABST
Patent Text Reader

Abstract

This invention relates to a lightweight adaptive method for testing non-stationary data streams. Its core lies in constructing a two-branch adaptive architecture that decouples observation and execution statistics. A shadow observation branch, independent of the main inference branch, maintains a statistical reference baseline in real time, unaffected by adaptive calibration actions, thus suppressing the closed-loop coupling problem between drift perception and statistical updates at the mechanism level. Based on this decoupled architecture, the shadow branch calculates a composite drift surrogate metric to map and generate dynamic momentum parameters, and introduces relaxed cumulative variables to perform three-level state determination and spatiotemporal misalignment mask generation. Finally, during inference forward propagation, dynamic online calibration of statistics is performed only for the key levels selected by the mask. This invention alleviates the adaptation lag and statistical oscillation risks caused by fixed momentum, suppresses the statistical degradation risk caused by single-sample noise, and is suitable for real-time model optimization in single-sample, non-stationary streaming scenarios.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to a lightweight adaptive testing method for non-stationary data streams, belonging to the fields of artificial intelligence and edge computing technology. Background Technology

[0002] In recent years, deep neural networks (DNNs) have made significant progress in computer vision tasks. However, in real-world open-world deployments, such as autonomous driving, security monitoring, and industrial inspection, test data often arrives in streaming form, and its distribution changes dynamically over time, leading to a sharp decline in the inference accuracy of pre-trained models.

[0003] To address this issue, researchers proposed Test-Time Adaptation (TTA), a technique that allows models to be adjusted online during the inference phase using unlabeled test data. Among these, methods based on Batch Normalization (BN) statistics updates have become the mainstream solution for real-time adaptation on edge devices due to their low computational cost and lack of need for backpropagation gradients. However, existing lightweight TTA methods based on BN updates still suffer from the following major technical drawbacks in practical engineering applications, especially in scenarios with single-sample (batch size=1) and non-stationary continuous data streams:

[0004] On the one hand, the fixed momentum parameter leads to a rigid knowledge aging rate. Existing Batch Normalization (BN) update methods typically use a fixed momentum parameter to smooth statistics throughout the inference process. However, in non-stationary data streams, the drift rate of the data distribution is dynamically changing. If a high momentum parameter is set to retain more historical information, the model cannot update statistics in a timely manner when the environment changes abruptly, resulting in adaptive lag. If a low momentum parameter is set, in single-sample inference, the model is highly susceptible to noise from individual samples or outliers, causing model oscillations. This static parameter setting cannot simultaneously meet the dual requirements of fast response and noise-resistant stability. Logically, the momentum parameter defines the model's aging rate for historical prior knowledge. Existing technologies, lacking a dynamic adjustment mechanism, make it difficult for the system to balance response speed and statistical stability.

[0005] On the other hand, there is the risk of cognitive structure collapse caused by blindly updating all network layers. Existing adaptive strategies typically update the statistics of all batch normalization (BN) layers in a deep neural network without differentiation. However, different layers of a deep network are not equally sensitive to distribution drift. In the absence of supervision signals and with very few observed samples, blind updates may introduce noise interference due to the lack of a screening mechanism based on the intensity of cognitive conflict. This can lead to unexpected parameter drift in the model's feature extraction layer, affecting the model's ability to represent features in the source domain. Furthermore, during the adaptation process when only batch normalization layer statistics are calibrated online, the update of batch normalization layer statistics can change the normalization results of subsequent features, further affecting the calculation and update of subsequent statistics. This creates a closed-loop coupling between the statistical proxy signal used to perceive drift and the statistics used to perform calibration. This coupling means that the statistics used for drift perception are negatively affected by their own update behavior, causing the observed signal to gradually become distorted during the adaptation process. This is particularly serious under single-sample or small-batch conditions, leading to erroneous triggering or oscillating updates. In severe cases, it can cause the model's statistics to diverge and its inference ability to deteriorate irreversibly. Therefore, a technical solution is needed that decouples drift observations from statistical calibration at the statistical level while maintaining lightweight computational overhead. Summary of the Invention

[0006] The technical problem to be solved by this invention is to provide a lightweight adaptive method for testing non-stationary data streams. The core of this method is to construct a two-branch adaptive mechanism that decouples observation and execution statistics. By providing a stable drift sensing signal that is not disturbed by its own update behavior through an independent shadow observation branch, the closed-loop coupling problem between statistical updates and drift observations in traditional methods is suppressed from the mechanism level. This decoupling architecture is the structural prerequisite for the reliable operation of subsequent dynamic momentum adjustment and selective mask updates.

[0007] To solve the above-mentioned technical problems, the present invention adopts the following technical solution: The present invention designs a lightweight adaptive test method for non-stationary data streams, based on the shadow observation branches corresponding to each batch normalization layer in the trained deep neural network model, and the shadow observation branches do not participate in the backpropagation gradient calculation of the parameters of the corresponding batch normalization layers. While each batch normalization layer receives the test data stream in real time, the corresponding shadow observation branch receives the same test data stream and executes the following steps A to D. Then, the batch normalization layer executes the following step E.

[0008] Step A. The shadow observation branch receives the current time step of the corresponding batch normalization layer. The received test data stream is updated with a preset first exponential moving average coefficient. The shadow statistics are recursively updated and then processed by the statistical difference term. robust difference items The calculation further calculates the current time step of the corresponding batch normalization layer. Lower composite drift score Then proceed to step B;

[0009] Step B. The shadow observation branch is based on the current time step of the corresponding batch normalization layer. Lower composite drift score Through target momentum Apply temporal change rate constraints to limit the abrupt change in target momentum between adjacent time steps, and obtain the current time step of the corresponding batch normalization layer. Lower dynamic momentum Then proceed to step C;

[0010] Step C. The shadow observation branch is based on the current time step of the corresponding batch normalization layer. Lower composite drift score Calculate the current time step of the corresponding batch normalization layer. Relaxed cumulative variables with leakage and cutoff mechanisms and determine the current time step The target distribution drift state is then determined, and then proceed to step D;

[0011] Step D. The shadow observation branch is adjusted according to the current time step. If the target distribution is in a drift state and it is not an instantaneous circuit breaker state, then partially refresh the mask bits or reuse historical mask bits to generate the current time step. The spatiotemporal misalignment mask is then sent to the corresponding batch normalization layer, and then proceed to step E;

[0012] If it is a momentary circuit breaker state, a freeze mask with all mask bits set to 0 is forcibly generated as the current time step. The spatiotemporal misalignment mask is then sent to the corresponding batch normalization layer, and then proceed to step E;

[0013] Among them, the spatiotemporal misalignment mask is a set of binary control vectors. Each mask bit in the binary control vector corresponds one-to-one with each batch of normalization layers in the trained deep neural network model. The mask bits are used to control whether the corresponding batch of normalization layers performs statistical updates at the corresponding time step.

[0014] Step E. Based on the current time step The spatiotemporal misalignment mask is used by the batch normalization layer based on its corresponding mask bits and the current time step. Lower dynamic momentum Update the corresponding global statistics.

[0015] As a preferred technical solution of the present invention: the shadow observation branch in step A performs the following steps A1 to A4;

[0016] Step A1. Receive the current time step of the corresponding batch normalization layer. The received test data stream is processed according to the following formula:

[0017] ;

[0018] Update coefficients using the preset first exponential moving average Recursively update the shadow statistics to obtain the current time step. Shadow mean in the lower shadow statistic With shadow variance ,in, , They represent the previous time step, respectively. The shadow mean and shadow variance in the shadow statistics , These represent the current time step. Find the mean and variance of the received test data stream, and then proceed to step A2;

[0019] Step A2. According to the Kullback-Leibler divergence principle, the following formula applies:

[0020] ;

[0021] Calculate the current time step Lower shadow statistics and the previous time step The statistical distance between the shadow statistics constitutes the statistical difference term. ,in, Represents the Gaussian distribution function. This represents the operation of relative entropy. Indicates the previous time step The shadow standard deviation in the shadow statistic. Indicates the current time step Find the shadow standard deviation in the shadow statistic, and then proceed to step A3;

[0022] Step A3. Use the following formula:

[0023] ;

[0024] Calculate the time step before Mean of lower shadow Shadow variance Respectively compared with the previous time step Mean of lower shadow Shadow variance The sum of the distances between the lower-order moments constitutes the robust difference term. ,in, Describes the L1 norm function. This represents the preset variance adjustment factor. Indicate the preset minimum positive constant used for division by zero, and then proceed to step A4;

[0025] Step A4. Use the following formula:

[0026] ;

[0027] Calculate the current time step of the corresponding batch normalization layer Lower composite drift score ,in, This indicates the preset balance weight factor, and then proceeds to step B.

[0028] As a preferred technical solution of the present invention: the shadow observation branch in step B performs the following steps B1 to B3;

[0029] Step B1. Determine the current time step of the corresponding batch normalization layer. Lower composite drift score Is it greater than the preset silence threshold? If yes, proceed to step B2; otherwise, determine the current time step. The adaptive process is in the silent maintenance region, allowing the target momentum to... Equal to the preset upper limit of momentum Then proceed to step B3;

[0030] Step B2. Use the following formula:

[0031] ;

[0032] The target momentum is calculated using the tanh activation function and inverse linear interpolation. ,in, Indicates the preset temperature coefficient. This indicates the preset lower limit value of momentum, and then proceeds to step B3;

[0033] Step B3. Based on the previous time step Lower dynamic momentum According to the following formula:

[0034] ;

[0035] Calculate the current time step of the corresponding batch normalization layer Lower dynamic momentum ,in, This represents a numerical truncation function. This indicates the preset maximum rate of change threshold, and then proceeds to step C.

[0036] As a preferred technical solution of the present invention: the shadow observation branch in step C performs the following steps C1 to C3;

[0037] Step C1. Based on the current time step of the corresponding batch normalization layer. Lower composite drift score According to the following formula:

[0038] ;

[0039] Calculate the current time step of the corresponding batch normalization layer Relaxed cumulative variables with leakage and cutoff mechanisms ,in, This indicates the preset decay rate factor for adjusting historical drift. This indicates the previous time step of the corresponding batch normalization layer. The following is a relaxed cumulative variable with leakage and truncation mechanisms. This indicates the preset saturation cutoff threshold. This represents a numerical truncation function. This indicates the preset noise floor tolerance, and then proceeds to step C2;

[0040] Step C2. Determine the cooling counter. If the value is greater than 0, then determine the current time step. If the target distribution drift state is a momentary circuit breaker state, proceed to step D; otherwise, proceed to step C3.

[0041] Step C3. Based on the preset extreme value safety threshold Perform the following processing to determine the current time step. The target distribution drift state is then determined, and then proceed to step D;

[0042] like Then determine the current time step. The target distribution drift state is an inertial hold-through state;

[0043] like Then determine the current time step. The target distribution drift state is an accumulated trigger state;

[0044] like Then determine the current time step. The target distribution drift state is in a transient fuse-failure state, and the cooling counter is reset. The initial value is preset to be greater than 0. .

[0045] As a preferred embodiment of the present invention: the shadow observation branch in step D is executed as follows;

[0046] If the current time step If the target distribution drift state is an inertial hold-through state, then the previous time step is reused. The spatiotemporal misalignment mask below is used as the current time step. The spatiotemporal misalignment mask is then used to proceed to step E; where the spatiotemporal misalignment mask is a set of binary control vectors, and each mask bit in the binary control vector corresponds one-to-one with each batch of normalization layers in the trained deep neural network model. The mask bits are used to control whether the corresponding batch of normalization layers performs statistical updates at the corresponding time step.

[0047] If the current time step If the target distribution drift state is in the cumulative trigger state, then determine the current time step of the corresponding batch normalization layer. Relaxed cumulative variables Is it greater than the preset integral trigger threshold? If so, a priority-based filtering process is executed to obtain the current time step. The spatiotemporal misalignment mask is used to reset the current time step of the corresponding batch normalization layer. Relaxed cumulative variables Then proceed to step E; otherwise, reuse the previous time step. The spatiotemporal misalignment mask below is used as the current time step. The spatiotemporal misalignment mask is then applied, and then step E is performed.

[0048] If the current time step If the target distribution drift state is a transient circuit breaker state, then a frozen mask with all mask bits set to 0 is forcibly generated as the current time step. Apply a spatiotemporal misalignment mask and reset the current time step of the corresponding batch normalization layer. Relaxed cumulative variables and cooling counter Decrease by 1 to update, then proceed to step E.

[0049] As a preferred embodiment of the present invention: the shadow observation branch performs a priority-based filtering process according to steps D1 to D4 to obtain the current time step. The following is a spatiotemporal misalignment mask;

[0050] Step D1. Obtain the current time step corresponding to each batch of normalized layers in the trained deep neural network model. Lower composite drift score ,in, , This indicates the number of batch normalized layers in a trained deep neural network model. This indicates the first [unit / item] in the trained deep neural network model. Each batch of normalization layers corresponds to the current time step. Calculate the composite drift score, then proceed to step D2;

[0051] Step D2. For each batch of normalized layers in the trained deep neural network model, apply the following formula:

[0052] ;

[0053] Calculate the current time step corresponding to the batch normalization layer. The following stable risk items ,in, This indicates the first [unit / item] in the trained deep neural network model. Each batch of normalization layers corresponds to the current time step. The following stable risk items, This indicates the first [unit / item] in the trained deep neural network model. Each batch of normalization layers corresponds to the current time step. The global mean in the global statistics. This indicates the first [unit / item] in the trained deep neural network model. Each batch of normalization layers corresponds to the previous time step. The global mean in the global statistics. Denotes the square of the L2 norm. This represents the moving average function, and then proceeds to step D3;

[0054] Step D3. For each batch of normalized layers in the trained deep neural network model, apply the following formula:

[0055] ;

[0056] Calculate the current time step corresponding to the batch normalization layer. Priority scores ,in, This indicates the first [unit / item] in the trained deep neural network model. Each batch of normalization layers corresponds to the current time step. Priority scores below, This indicates the preset risk penalty coefficient, and then proceeds to step D4;

[0057] Step D4. Normalize the batch layer corresponding to the current time step. The priority scores are used to sort the normalized layers in each batch of the trained deep neural network model in descending order, and the priority scores are defined for the top layers in the sorting. The mask bits corresponding to each batch of normalization layers are set to 1, and the mask bits corresponding to the remaining batches of normalization layers are set to 0. The mask bits corresponding to each batch of normalization layers then form the current time step. The following is a spacetime misalignment mask. This indicates the preset scaling factor.

[0058] As a preferred technical solution of the present invention: in step E, the current time step is used as the basis for the following technical solution: The spatiotemporal misalignment mask below, and the batch normalization layer are executed as follows:

[0059] If the mask bits corresponding to the batch normalization layer are equal to 0, then the batch normalization layer utilizes the previous time step. Global mean in global statistics Global variance This constitutes the current time step. Global mean in global statistics Global variance Regarding the current time step The received test data stream is normalized.

[0060] If the mask bit corresponding to the batch normalization layer is equal to 1, then the batch normalization layer uses its corresponding current time step. Lower dynamic momentum According to the following formula:

[0061] ;

[0062] Get the current time step of the batch normalized layer Global mean in global statistics Global variance Regarding the current time step The received test data stream is normalized; among which, , They represent the previous time step, respectively. The mean and variance of the global statistics are given below. , These represent the current time step. The mean and variance of the received test data stream. This indicates the preset lower bound threshold of variance.

[0063] As a preferred technical solution of the present invention: the trained deep neural network model takes the continuous streaming image frames acquired in real time by the vehicle-mounted camera as input and the category and location bounding boxes of the target in the image frames as output, so as to realize the target detection and recognition in an open non-stationary environment.

[0064] The lightweight adaptive test time method for non-stationary data streams described in this invention has the following technical advantages compared with existing technologies:

[0065] (1) This invention designs a lightweight test-time adaptive method for non-stationary data streams. The core is to construct a dual-branch adaptive architecture that decouples observation and execution statistics. The shadow observation branch, which is independent of the main inference branch, maintains the statistical reference baseline in real time without being disturbed by the adaptive calibration action, thereby suppressing the closed-loop coupling problem between drift perception and statistical update in traditional methods from the mechanism level. On this decoupled architecture, the shadow branch is used to maintain the knowledge base mirror in real time and calculate the surrogate metric that reflects the difference in statistical distribution. Based on this, dynamic momentum parameters based on the surrogate metric are generated. At the same time, by introducing a relaxed cumulative variable with leakage and truncation mechanism, the continuous change of statistical distribution is quantified, a three-level state determination is performed, and a spatiotemporal misalignment mask based on update priority is generated. Finally, in the forward propagation of inference, dynamic online calibration of statistics is performed only for the key level selected by the mask. This invention mitigates the risks of adaptation lag and statistical oscillation caused by fixed momentum. It establishes a suppression mechanism to prevent single-sample noise using time-series filtering logic, reducing the risk of cognitive structure degradation from a structural perspective. Furthermore, it adopts a gradient-free update strategy to reduce computational redundancy of edge devices. Combined with the aforementioned risk perception mechanism, it alleviates the problem of statistical bias accumulation in the unsupervised adaptation process, making it suitable for real-time model optimization in single-sample, non-stationary streaming scenarios.

[0066] (2) In the lightweight test time adaptive method designed for non-stationary data streams in this invention, the contradiction of rigid knowledge aging rate in traditional methods is alleviated by the shadow observation mechanism. This dynamic adjustment capability gives the model the ability to dynamically respond to changes in the statistical distribution of data streams, which helps to suppress high-frequency noise of single samples in the stationary period and improves the response capability of knowledge iteration in the abrupt change period, thereby reducing the risk of performance degradation of the model due to improper parameter settings in complex streaming data.

[0067] (3) In the lightweight test-time adaptive method designed for non-stationary data flow in this invention, by constructing a physically shared and statistically decoupled dual time-scale architecture, the shadow observation branch can be used as an independent "slow time-scale" reference benchmark. This mechanism reduces the interference caused by the dynamic parameter injection of the main inference branch (fast time-scale). This design helps to ensure the effectiveness of the statistical proxy signal used to trigger the update and alleviates the potential risk of observation distortion caused by the update action of the traditional adaptive method.

[0068] (4) The lightweight adaptive test method designed in this invention for non-stationary data streams addresses the extremely high risk of random interference in single-sample inference by employing an accumulated decision logic with a leakage mechanism, which suppresses occasional noise. This strategy differs from the previous blind adaptation mode, making the system more inclined to respond to changes in the statistical distribution with continuous characteristics, thereby reducing the probability of parameter drift caused by extreme noise interference to a certain extent.

[0069] (5) In the lightweight test time adaptive method designed for non-stationary data flow in this invention, the inefficient mode of blind calibration of the whole layer is changed by the sparse update strategy driven by update priority. By selectively updating only the key layers, the influence of statistical bias on the overall parameter distribution of the model is suppressed and the stability of the model feature expression is maintained, while reducing unnecessary computational overhead of edge devices and promoting the balance optimization of robustness and inference efficiency. Attached Figure Description

[0070] Figure 1 This is a flowchart of a lightweight adaptive testing method for non-stationary data streams according to the present invention.

[0071] Figure 2 This is a schematic diagram of the system architecture of the present invention. Detailed Implementation

[0072] The specific embodiments of the present invention will be further described in detail below with reference to the accompanying drawings.

[0073] This invention designs a lightweight adaptive test-time method for non-stationary data streams. In practical applications, each batch normalization layer in the trained deep neural network model corresponds to a shadow observation branch, and the shadow observation branch does not participate in the backpropagation gradient calculation of the corresponding batch normalization layer parameters. That is, the shadow observation branch and the main inference branch share the same set of weight-frozen feature extractors, but the global statistics of its batch normalization (BN) layer follow independent update logic. When the test data of the time step arrives, the system injects the data into both branches simultaneously through the data distribution unit. The batch normalization layer is used to perform feature extraction and target task prediction, and the shadow observation branch is used to monitor changes in environmental distribution in real time. That is, the data input of the shadow observation branch is not associated with gradient information (such as using torch.no_grad() environment), and only uses forward propagation to extract the activation feature statistics of the current sample in each layer.

[0074] The necessity of constructing a statistically decoupled shadow observation branch lies in solving the problem of self-feedback contamination of the monitoring signal. If distribution monitoring is performed directly on the main inference branch, the monitoring signal will contain the model's own adjustment bias because the statistics of the main branch will continuously change with the adaptive process, leading to feedback loop failure. By constructing a decoupled shadow branch, those skilled in the art can obtain a stable environmental distribution reference system that is not affected by the current adaptive action, thus providing a statistical reference baseline that maintains consistency under the current system conditions for subsequent drift detection. Compared with the conventional method of performing statistical monitoring directly on the main inference branch, this invention reduces the functional dependency between the observed and updated variables at the statistical level through an independent shadow branch, suppressing the backlash from the adaptive calibration action on the drift sensing signal, thereby alleviating the self-feedback bias problem in traditional single-branch methods. This decoupling design is a structural prerequisite for the reliable operation of subsequent dynamic momentum adjustment and selective mask update.

[0075] In the practical implementation of the lightweight testing adaptive method, the design involves each batch of normalization layers receiving the test data stream in real time, while the corresponding shadow observation branch receives the same test data stream, such as... Figure 1 and Figure 2 As shown, the following steps A to D are performed, and then step E is performed by the batch normalization layer.

[0076] Step A. The shadow observation branch receives the current time step of the corresponding batch normalization layer. The received test data stream is updated with a preset first exponential moving average coefficient. The shadow statistics are recursively updated and then processed by the statistical difference term. robust difference items The calculation further calculates the current time step of the corresponding batch normalization layer. Lower composite drift score Then proceed to step B.

[0077] In the shadow observation branch, an exponential moving average strategy is applied to maintain a set of shadow statistics independent of the main inference branch, rather than solely relying on KL divergence. This invention constructs a composite metric system including a statistical difference term and a robust difference term. The statistical difference term (KL divergence) is used to capture asymmetric changes in the distribution shape, while the robust difference term (L1 norm distance between the first and second moments) is used to capture numerical fluctuations in the statistical moments. A composite drift score is obtained through weighted fusion. This score serves as a statistical proxy for environmental change, robustly quantifying the deviation between current observations and historical benchmarks under single-sample noise interference. In practical applications, the shadow observation branch in step A above specifically executes steps A1 to A4 as follows.

[0078] Step A1. Establish a shadow statistic maintenance mechanism based on exponential moving average (EMA). In the shadow observation branch, backpropagation updates are not performed; instead, a preset fixed smoothing coefficient is used. (The value ranges from 0.9 to 0.99, preferably 0.99), for the current time step The test data stream statistics (including batch mean and batch variance) are time-weighted smoothed, and the shadow mean is iteratively updated. With shadow variance This shadow statistic serves as an observational benchmark for generating control signals, independent of the main inference branch parameter updates, and is a smoothing coefficient. The setting is intended to give the shadow statistics a longer memory window, thereby filtering out individual instantaneous noise in single-sample inference; in actual execution, the shadow observation branch receives the current time step of the corresponding batch normalization layer. The received test data stream is processed according to the following formula:

[0079] ;

[0080] Update coefficients using the preset first exponential moving average Recursively update the shadow statistics to obtain the current time step. Shadow mean in the lower shadow statistic With shadow variance ,in, , They represent the previous time step, respectively. The shadow mean and shadow variance in the shadow statistics , These represent the current time step. The mean and variance of the received test data stream are calculated, and then the process proceeds to step A2.

[0081] The technical logic behind introducing the exponential moving average (EMA) maintenance mechanism in this step is to achieve signal denoising. In single-sample inference, the statistical characteristics of a single frame image... It exhibits a high degree of randomness. Directly using single-frame features to calculate drift will result in a composite drift score. Violent oscillations make it impossible to stably represent the statistical trend of the data stream. Through the EMA strategy, those skilled in the art can utilize... The magnitude of the value is used to adjust the smoothness of the background: a larger value indicates a smoother background. It can filter out high-frequency sample noise, while having a smaller... It can more sensitively capture abrupt changes in distribution. Calculating a composite measure between two generations of shadow statistics essentially compares the difference between the environmental background containing the latest observations and the old environmental background. This design helps to make the generated... It has continuity, providing a monotonic logical input for the mapping of dynamic momentum in the subsequent step B.

[0082] To achieve robust perception of environmental changes and suppress single-sample noise with low computational overhead, this invention calculates a statistical difference term. robust difference item The composite drift score. The statistical difference term is calculated using the divergence between parameterized probability distribution models. This measures the distance between the distribution shapes; simultaneously, it calculates the low-order moment norm distance between the current batch statistic and the shadow statistic as a robust difference term. This is used to measure the intensity of numerical fluctuations. Finally, the composite score, obtained by weighted fusion of the two, is used as a statistical proxy indicator to characterize the degree of disruption to distribution consistency: composite drift score. Continue with the above design and proceed with steps A2 to A4.

[0083] Step A2. According to the Kullback-Leibler divergence principle, the following formula applies:

[0084] ;

[0085] Calculate the current time step Lower shadow statistics and the previous time step The statistical distance between the shadow statistics constitutes the statistical difference term. ,in, Represents the Gaussian distribution function. This represents the operation of relative entropy. Indicates the previous time step The shadow standard deviation in the shadow statistic. Indicates the current time step Find the shadow standard deviation in the shadow statistic, and then proceed to step A3.

[0086] Step A3. Use the following formula:

[0087] ;

[0088] Calculate the time step before Mean of lower shadow Shadow variance Respectively compared with the previous time step Mean of lower shadow Shadow variance The sum of the distances between the lower-order moments constitutes the robust difference term. ,in, Describes the L1 norm function. This represents the preset variance term adjustment coefficient (range 0.1-1.0). This indicates the minimum preset positive constant used to prevent division by zero, and then proceeds to step A4.

[0089] Step A4. Use the following formula:

[0090] ;

[0091] Calculate the current time step of the corresponding batch normalization layer Lower composite drift score ,in, This indicates the preset balance weight factor (within the range of 0.5-0.7), and then proceeds to step B.

[0092] Composite drift score It is not directly equivalent to real-world drift, but rather serves as a robust control signal used to schedule the model's update intensity in subsequent steps. Compared to the single KL metric, the composite drift score... It can effectively filter out occasional outlier noise commonly found in single-sample inference.

[0093] Step B. The shadow observation branch is based on the current time step of the corresponding batch normalization layer. Lower composite drift score Through target momentum Apply temporal change rate constraints to limit the abrupt change in target momentum between adjacent time steps, and obtain the current time step of the corresponding batch normalization layer. Lower dynamic momentum Then proceed to step C.

[0094] To avoid model parameter oscillations caused by instantaneous jitter in the drift signal, this invention introduces a dual constraint mechanism of silent dead zone and rate of change limit. Specifically, when the drift score falls below the silent threshold, momentum is forced to remain at its maximum value to suppress noise updates. When momentum adjustment is needed, a target value is calculated through nonlinear mapping, and its change in momentum relative to the previous moment is limited. In practical applications, the shadow observation branch in step B is specifically designed to execute steps B1 to B3 as follows.

[0095] Step B1. Perform noise filtering prediction based on silent dead zones. For background noise commonly present in single-sample data streams, the system will calculate the composite drift score. With preset silent threshold By comparing the drift scores, if the drift score falls within a low-level quiescent region, the system determines that the current statistical fluctuation is insignificant background noise and directly forces the momentum parameter to remain at a preset upper limit. This mechanism aims to construct a highly stable inertial region, avoiding frequent parameter adjustments due to minor statistical fluctuations, thereby maximizing the retention of historical prior knowledge. In actual implementation, this specifically involves determining the current time step of the corresponding batch normalization layer. Lower composite drift score Is it greater than the preset silence threshold? If yes, proceed to step B2; otherwise, determine the current time step. The adaptive process is in the silent maintenance region, allowing the target momentum to... Equal to the preset upper limit of momentum Then proceed to step B3.

[0096] Step B2. Calculate the target momentum parameter reflecting the drift intensity. When the composite drift score breaks through the silent zone, it indicates that the statistical proxy signal has significantly escaped the background noise region. The system utilizes the saturation characteristics of the tanh activation function and inverse linear interpolation to calculate the target momentum value negatively correlated with the drift intensity. This mapping mechanism establishes a response logic where the larger the drift, the smaller the momentum, aiming to adjust the retention weights of historical information to enhance the model's ability to follow changes in the current statistical distribution.

[0097] In practical implementation, firstly, in order to eliminate the difference in the absolute values ​​of drift scores under different application scenarios and to adjust the system's sensitivity to drift changes, a preset quiescent threshold is used. and temperature coefficient The composite drift score Perform standardized mapping and calculate the dimensionless relative deviation value. ,in, It defines the critical reference point for the transition of the environment from a stable to a non-stationary state; The steepness of the mapping function was controlled. The smaller the value, the more sensitive the system is to changes in drift.

[0098] Then the relative deviation value By inputting the standard tanh activation function, the normalized nonlinear response coefficients are calculated. By utilizing the saturation at both ends and linearity in the middle of the tanh function, soft thresholding of drift signals is achieved: when the drift is weak, the response coefficient approaches 0; when the drift is significantly enhanced, the response coefficient rises rapidly and approaches 1.

[0099] Finally, using the preset upper limit of momentum. and momentum lower limit Based on the nonlinear response coefficient Perform inverse linear interpolation:

[0100] ;

[0101] Calculate the target momentum ,in, Indicates the preset temperature coefficient. This indicates the preset lower limit value of momentum, and then proceeds to step B3. The calculations established a negatively correlated response mechanism, which changes with the intensity of environmental drift (i.e., the response coefficient). As the value increases, the target momentum parameter adaptively slides from the upper limit to the lower limit, thereby reducing the model's dependence on historical statistics and accelerating the adoption of current environmental characteristics. In specific parameter configurations... It is usually set to 0.9 to 0.999 to maintain long-term memory during the plateau period, while Set it to 0.01 to 0.1 to ensure the minimum update step size during the mutation period.

[0102] Step B3. Perform smoothing damping processing based on rate of change constraints. Considering that directly applying the target momentum might cause parameter jumps due to instantaneous signal jitter, the system introduces a maximum rate of change threshold as a damper. By limiting the final momentum parameter at the current moment to the neighborhood of the momentum value at the previous moment, the model update trajectory is forced to maintain temporal smoothness. This attempts to avoid the risk of oscillations or collapse of the BN layer statistics caused by excessively high scores from individual outlier samples, ensuring the numerical stability of the adaptive process. In practical applications, the specific design is based on the previous time step... Lower dynamic momentum According to the following formula:

[0103] ;

[0104] Calculate the current time step of the corresponding batch normalization layer Lower dynamic momentum ,in, This represents a numerical truncation function, used to restrict a value to a range. Inside, This represents a preset maximum rate of change threshold. Through calculation, the system enforces a fixed magnitude of momentum change between adjacent time steps. No more than Then proceed to step C.

[0105] In practical applications, a preset maximum rate of change threshold is used. The value range is set to (0.05, 0.2), with a preferred value of 0.1. This constraint acts as a numerical damper for the system, transforming the adjustment process of the momentum parameter into a controllable, continuous, and smooth process in engineering. This reduces the risk of batch normalization layer statistics collapse due to parameter mutations and improves the robustness of the adaptive process in extreme non-stationary environments.

[0106] The next steps, C through D, design and construct a time-series state decision-making mechanism based on relaxed cumulative variables to determine the environment state and generate the corresponding execution mask.

[0107] Step C. The shadow observation branch is based on the current time step of the corresponding batch normalization layer. Lower composite drift score Calculate the current time step of the corresponding batch normalization layer. Relaxed cumulative variables with leakage and cutoff mechanisms The current time step is determined by comparing the numerical relationships between the composite drift score, the relaxed cumulative variable, and the preset noise floor tolerance and extreme value safety threshold. The target distribution drift state is then determined, and then proceed to step D.

[0108] Step C defines the dynamic momentum parameter as a time-varying update weight for risk perception. The necessity of this technical design lies in resolving multiple physical contradictions between adaptive hysteresis, noise sensitivity, and parameter oscillation. In non-stationary data streams, the severity of distribution shift determines the effectiveness of historical knowledge. Through the aforementioned nonlinear mapping and multi-constraint composite mechanism, this embodiment establishes a three-level adjustment logic based on composite drift scores: when the composite drift score significantly increases and breaks through the quiescent zone, the system automatically accelerates the aging and elimination of outdated knowledge by reducing the momentum parameter, forcing the model to quickly accept the observed features of the current step; conversely, when the drift score is in the quiescent zone, high momentum values ​​are locked to enhance the retention of historical prior knowledge; simultaneously, a rate-of-change constraint mechanism is used to limit step-like abrupt changes in the momentum parameter. This design helps the system adjust the update weights according to the changing trends of statistical indicators and maintain temporal smoothness, thereby reducing the risk of model degradation and uncertainty caused by unconstrained adaptation and single-sample noise in non-stationary data stream scenarios.

[0109] In practical applications, the shadow observation branch in step C above is specifically executed as follows: steps C1 to C3.

[0110] Step C1. Calculate and maintain the relaxed cumulative variable with leakage and truncation mechanisms. Energy is accumulated using the composite drift score to calculate the relaxed cumulative variable for the current time step. This accumulation mechanism is configured to perform the following logical operations: at each time step, the current composite drift score is superimposed on the historical cumulative value, and a preset noise floor tolerance is subtracted to automatically filter out minor background noise (i.e., leakage mechanism); simultaneously, a historical forgetting factor is applied to attenuate past cumulative values, and a saturation truncation function is applied to limit the upper limit of accumulation, ensuring the bounded stability of the system state.

[0111] In practical implementation, the design is based on the current time step of the corresponding batch normalization layer. Lower composite drift score According to the following formula:

[0112] ;

[0113] Calculate the current time step of the corresponding batch normalization layer Relaxed cumulative variables with leakage and cutoff mechanisms ,in, This indicates the preset decay rate factor for adjusting historical drift. This indicates the previous time step of the corresponding batch normalization layer. The following is a relaxed cumulative variable with leakage and truncation mechanisms. This indicates the preset saturation cutoff threshold. This represents a numerical truncation function. This indicates the preset noise floor tolerance, and then proceeds to step C2.

[0114] Step C2. Determine the cooling counter. If the value is greater than 0, then determine the current time step. If the target distribution drift state is an instantaneous circuit breaker state, proceed to step D; otherwise, proceed to step C3.

[0115] The cooling counter is a system-level global variable whose value is shared across all batch normalization layers. It is used to apply a uniform freeze constraint to the statistical update process of the entire model after triggering the transient circuit breaker state. The cooling counter is used to control whether the entire system performs adaptive updates.

[0116] Step C3. Based on the preset extreme value safety threshold And satisfy Perform the following processing to determine the current time step. The target distribution drift state is then determined, and then proceed to step D;

[0117] like Then determine the current time step. The target distribution drift state is an inertial hold state, that is, when the system determines that the change of the current statistical index does not exceed the range of random background noise, the system maintains a silent state to minimize computational overhead.

[0118] like Then determine the current time step. The target distribution drift state is the cumulative trigger state, that is, the system determines that the statistical characteristics are in the gradual deviation range, and it is necessary to further determine whether the relaxed cumulative variable has exceeded the preset integral trigger threshold.

[0119] like Then determine the current time step. The target distribution drift state is in a transient fuse-failure state, and the cooling counter is reset. The initial value is preset to be greater than 0. When the system determines that a statistical observation indicator has experienced a drastic change or an abnormal extreme value, in order to prevent the model weights from being corrupted by erroneous data, the system implements a freeze strategy under abnormal observations. This means that after the circuit breaker is triggered, the system must maintain at least [a certain value]. The parameters are frozen at each time step, or until the drift score continuously falls below the safety threshold. In practical applications... The value range is (3, 10), preferably 5. This cooling timer will stop at step H and not perform any update operation if the system triggers the circuit breaker state. The value is usually set to (0.5, 1.5), depending on the noise level of the drift score, with a preferred value of 0.8.

[0120] Step D. The shadow observation branch is adjusted according to the current time step. If the target distribution is in a drift state and it is not an instantaneous circuit breaker state, then partially refresh the mask bits or reuse historical mask bits to generate the current time step. The spatiotemporal misalignment mask is generated and sent to the corresponding batch normalization layer, then proceeds to step E; if it is an instantaneous circuit breaker state, a frozen mask with all mask bits set to 0 is forcibly generated as the current time step. The spatiotemporal misalignment mask is sent to the corresponding batch normalization layer, and then the process proceeds to step E. The spatiotemporal misalignment mask is a set of binary control vectors. Each mask bit in the binary control vector corresponds one-to-one with each batch normalization layer in the trained deep neural network model. The mask bits are used to control whether the corresponding batch normalization layer performs statistical updates at the corresponding time step.

[0121] In actual implementation, the shadow observation branch in step D above is executed as follows;

[0122] If the current time step If the target distribution drift state is an inertial hold-through state, then the previous time step is reused. The spatiotemporal misalignment mask below is used as the current time step. The spatiotemporal misalignment mask is then used to proceed to step E; wherein, the spatiotemporal misalignment mask is a set of binary control vectors, and each mask bit in the binary control vector corresponds one-to-one with each batch of normalization layers in the trained deep neural network model. The mask bits are used to control whether the corresponding batch of normalization layers performs statistical updates at the corresponding time step.

[0123] If the current time step If the target distribution drift state is in the cumulative trigger state, then determine the current time step of the corresponding batch normalization layer. Relaxed cumulative variables Is it greater than the preset integral trigger threshold? If so, a priority-based filtering process is executed to obtain the current time step. The spatiotemporal misalignment mask is used to reset the current time step of the corresponding batch normalization layer. Relaxed cumulative variables Then proceed to step E; otherwise, reuse the previous time step. The spatiotemporal misalignment mask below is used as the current time step. The spatiotemporal misalignment mask is then used, and then step E is performed.

[0124] If the current time step If the target distribution drift state is a transient circuit breaker state, then a frozen mask with all mask bits set to 0 is forcibly generated as the current time step. Apply a spatiotemporal misalignment mask and reset the current time step of the corresponding batch normalization layer. Relaxed cumulative variables and cooling counter Decrease by 1 to update, then proceed to step E.

[0125] The priority-score-based filtering process involved in step D is, in practical applications, executed by the shadow observation branch according to steps D1 to D4, to obtain the current time step. The spacetime misalignment mask below.

[0126] Step D1. Obtain the current time step corresponding to each batch of normalized layers in the trained deep neural network model. Lower composite drift score ,in, , This indicates the number of batch normalized layers in a trained deep neural network model. This indicates the first [unit / item] in the trained deep neural network model. Each batch of normalization layers corresponds to the current time step. The composite drift score is calculated, and then proceed to step D2.

[0127] Step D2. Calculate the variance of the numerical jumps of the global statistic at this level within the historical time window using the EMA. Specifically, for each batch of normalized layers in the trained deep neural network model, use the following formula:

[0128] ;

[0129] Calculate the current time step corresponding to the batch normalization layer. The following stable risk items The higher this value, the more sensitive that level is to sample noise, and the higher the risk of instability in its statistical update path. This indicates the first [unit / item] in the trained deep neural network model. The batch normalization layer corresponds to the current time step. The following stable risk items, This indicates the first [unit / item] in the trained deep neural network model. Each batch of normalization layers corresponds to the current time step. The global mean in the global statistics. This indicates the first [unit / item] in the trained deep neural network model. Each batch of normalization layers corresponds to the previous time step. The global mean in the global statistics. Denotes the square of the L2 norm. This represents the moving average function, and then proceeds to step D3.

[0130] Step D3. For each batch of normalized layers in the trained deep neural network model, apply the following formula:

[0131] ;

[0132] Calculate the current time step corresponding to the batch normalization layer. Priority scores ,in, This indicates the first [unit / item] in the trained deep neural network model. Each batch of normalization layers corresponds to the current time step. Priority scores below, This indicates a preset risk penalty coefficient. Set it to (0.1, 1.0), with a preferred value of 0.5, and then proceed to step D4.

[0133] Step D4. Normalize the batch layer corresponding to the current time step. The priority scores are used to sort the normalized layers in each batch of the trained deep neural network model in descending order, and the priority scores are defined for the top layers in the sorting. The mask bits corresponding to each batch of normalization layers are set to 1, and the mask bits corresponding to the remaining batches of normalization layers are set to 0. The mask bits corresponding to each batch of normalization layers then form the current time step. The following is a spacetime misalignment mask. This represents the preset proportional coefficient, with a value ranging from 10% to 30%.

[0134] The technical logic of step D lies in mitigating the contradiction between the potential model stability risks and computational resource constraints caused by full parameter updates. Full-layer updates are not only computationally expensive, but in single-sample streaming scenarios lacking supervision, indiscriminately adjusting statistics across all layers can increase the probability of the model being affected by transient noise, thus impacting the robustness of the model's feature representation. The risk-benefit-based layer update strategy leverages the varying sensitivities of different layers in deep networks to distribution changes. Typically, shallow and deep networks respond differently to statistical drift. By updating only the Top-K sensitive layers, this embodiment aims to correct the parameters of the layer that responds most drastically to the current statistical distribution differences, thereby adapting to environmental changes while minimizing the interference of unnecessary parameter updates on the model's existing knowledge structure.

[0135] Step E. Based on the current time step The spatiotemporal misalignment mask is used by the batch normalization layer based on its corresponding mask bits and the current time step. Lower dynamic momentum This step updates the corresponding global statistics, realizing the final closed-loop injection of perception and decision signals into the main inference branch, and completing the sparse update of BN layer statistics through a condition triggering mechanism.

[0136] In actual implementation, step E above is based on the current time step. The spatiotemporal misalignment mask is applied, and the batch normalization layer is executed as follows.

[0137] If the mask bit corresponding to the batch normalization layer is equal to 0 (Mask=0), that is, the mask bit indicates that the layer is in a non-sensitive region or a noise suppression region, the system keeps the global statistics (mean and variance) of the layer unchanged, and the batch normalization layer utilizes the previous time step. Global mean in global statistics Global variance This constitutes the current time step. Global mean in global statistics Global variance Regarding the current time step The received test data stream is normalized.

[0138] If the mask bit corresponding to the batch normalization layer is equal to 1 (Mask=1), indicating that the layer is in the drift-sensitive region, the system activates a parameter update procedure with numerical constraints. Using the dynamic momentum parameter as a weighting factor to retain historical information, it performs a weighted fusion of the global statistics from the previous time step and the batch statistics of the current test data stream. To prevent variance degradation from single-sample inputs, a lower bound truncation constraint is applied to the instantaneous batch variance during the fusion process. This process, through dynamically adjusting the fusion ratio and combining it with a variance protection mechanism, achieves robust online adaptive calibration to environmental distribution changes in non-stationary data streams. In practical applications, specific batch normalization layers utilize their corresponding current time step... Lower dynamic momentum According to the following formula:

[0139] ;

[0140] Get the current time step of the batch normalized layer Global mean in global statistics Global variance Regarding the current time step The received test data stream is normalized; among which, , They represent the previous time step, respectively. The mean and variance of the global statistics are given below. , These represent the current time step. The mean and variance of the received test data stream. This represents the preset lower bound threshold of variance, which is preferably set to [value]. to This threshold acts as a numerical base for the statistics, ensuring that the variance used by the model for normalization remains within a safe range regardless of how degraded the input data may be.

[0141] Step E defines the parameter update mechanism as a sparse online calibration with numerical constraints. The necessity of this technical design lies in resolving the contradiction between variance collapse and statistical failure commonly found in single-sample streaming inference. In the absence of batch sample diversity, traditional unconstrained BN updates cause the running variance to rapidly decay to zero, leading to numerical computation overflow or loss of feature representation ability. By introducing a variance lower bound truncation mechanism, this embodiment establishes a statistical baseline protection logic: when the observed instantaneous variance is below a safety threshold (common in single-sample scenarios), the system forces the use of a preset lower bound value for momentum updates; conversely, when the observed variance is valid, data features are utilized normally. This design helps the model maintain the physical meaning and numerical stability of normalized parameters in extremely non-stationary and extremely sparse edge environments, reducing the risk of model collapse during the adaptation process.

[0142] The deep neural network model, calibrated in real-time as described in step E above, is used to perform normalization processing and subsequent forward inference operations on the test data stream at the current time step. The model utilizes the updated statistics. Remap the feature distribution to align it with the current environment. Matching results, the final prediction result is output. .

[0143] This completes the adaptive, real-time closed-loop process. Unlike traditional offline fine-tuning or multi-round optimization, this embodiment completes the entire "perception-decision-injection-inference" process in a single forward propagation. Because the update of the normalization layer statistics takes effect immediately, the calibrated model can be used immediately for prediction of the current frame, thereby alleviating the problem of the continuous decline in model inference accuracy due to distribution drift in non-stationary environments.

[0144] In the lightweight adaptive test-time method for non-stationary data streams designed in this invention, the dual-stream architecture (main inference branch and shadow observation branch) is built on the same set of pre-trained, weight-frozen deep neural network feature extractors. During the inference phase, the parameters of the feature extractors do not participate in any form of online gradient update. Therefore, the intermediate layer features received by the shadow observation branch depend only on the input data itself, structurally suppressing the potential indirect contamination of the observation benchmark by the BN statistics update of the main inference branch. Furthermore, the decoupling between the main inference branch and the shadow observation branch is essentially a statistical logical decoupling achieved through a dual-timescale EMA mechanism under the premise of sharing the feature extraction path. That is, the shadow branch is responsible for generating pure environmental prior observations unaffected by adaptive actions; the main branch is responsible for performing instantaneous dynamic calibration under the modulation of the observed signals. This design ensures extremely low computational overhead while statistically mitigating the risk of closed-loop coupling between the observed signals and the executed actions.

[0145] The composite drift score, priority score, and other metrics mentioned in this invention are statistical surrogate signals used to quantify changes in the consistency of data stream distribution. These signals are used to dynamically adjust the update intensity and range, and do not guarantee a strictly linear mapping relationship with the actual environmental distribution distance in all mathematical senses. This system allows for local fluctuations in the surrogate signals under single-sample noise, and suppresses their negative impact on model parameters through smoothing and truncation mechanisms described later.

[0146] To ensure system stability under extreme non-stationary scenarios (such as sensor failure or adversarial attacks), all adaptive variables involved in this invention are constrained by preset physical constraint boundaries. Specifically, the dynamic momentum parameter is constrained by… Interval and maximum rate of change The relaxation of cumulative variables is limited by the saturation cutoff threshold. Batch normalized variance is limited by a lower bound threshold. These hard constraints help the algorithm suppress the risk of numerical divergence or parameter collapse under various input conditions.

[0147] Applying the above design and technical solutions to practice, a trained deep neural network model takes continuous streaming image frames acquired in real time by an onboard camera as input and outputs the category and location bounding boxes of the target in the image frames, thereby realizing the detection and recognition of targets in open, non-stationary environments.

[0148] To address the stringent constraints of real-time performance and storage resources in edge computing scenarios, the computational complexity and physical feasibility of the design method of this invention are analyzed as follows:

[0149] 1. Time Complexity Analysis

[0150] Compared to traditional backpropagation-based test-time adaptive methods (which typically require...), The computational cost, of which Unlike the total number of model parameters, this invention introduces lightweight statistical computation only during the inference phase. The shadow observation branch only performs forward propagation computation and does not require maintaining a gradient graph; its computational cost is on the same order of magnitude as the main inference branch. The composite drift score calculation, priority sorting, and BN layer statistical updates only involve scalar or low-dimensional vector operations. Its additional computational complexity is... (in The number of batch normalization layers in the network, typically Therefore, the overall operating latency of this method is extremely low, meeting the processing requirements of real-time video streams or high-frequency sensor data streams.

[0151] 2. Space Complexity Analysis

[0152] This invention employs a gradient-free update strategy, eliminating the need to store large gradient tensors or optimizer states. The system only requires additional allocation... Storage space is used to maintain shadow statistics ( ), hierarchical priority scores, and a small number of scalar state variables (relaxation cumulative variables) Cooling counter This extremely low space footprint ensures that this solution can be deployed on embedded devices with extremely limited video memory resources.

[0153] Based on the same inventive concept, embodiments of the present invention provide a computer device, including a memory, a processor, and a computer program stored in the memory and executable on the processor. When the processor executes the computer program, it implements the steps of the aforementioned adaptive method for lightweight testing of non-stationary data streams.

[0154] Those skilled in the art will understand that embodiments of the present invention can be provided as methods, systems, or computer program products. Therefore, the present invention can take the form of a completely hardware embodiment, a completely software embodiment, or an embodiment combining software and hardware aspects. Furthermore, the present invention can take the form of a computer program product embodied on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.

[0155] This invention is described with reference to flowchart illustrations and / or block diagrams of methods, apparatus (systems), and computer program products according to embodiments of the invention. It will be understood that each block of the flowchart illustrations and / or block diagrams, and combinations of blocks in the flowchart illustrations and / or block diagrams, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, special-purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, generate instructions for implementing the flowchart illustrations and / or block diagrams. Figure 1 One or more processes and / or boxes Figure 1 A device that provides the functions specified in one or more boxes.

[0156] These computer program instructions may also be stored in a computer-readable storage medium that can direct a computer or other programmable data processing device to function in a particular manner, such that the instructions stored in the computer-readable storage medium produce an article of manufacture including instruction means, which are implemented in a process Figure 1 One or more processes and / or boxes Figure 1 The function specified in one or more boxes.

[0157] These computer program instructions may also be loaded onto a computer or other programmable data processing equipment to cause a series of operational steps to be performed on the computer or other programmable equipment to produce a computer-implemented process, thereby providing instructions that execute on the computer or other programmable equipment for implementing the process. Figure 1 One or more processes and / or boxes Figure 1 The steps of the function specified in one or more boxes.

[0158] The embodiments of the present invention have been described in detail above with reference to the accompanying drawings. However, the present invention is not limited to the above embodiments. Within the scope of knowledge possessed by those skilled in the art, various changes can be made without departing from the spirit of the present invention.

Claims

1. A lightweight adaptive test time method for non-stationary data streams, characterized in that: Based on the shadow observation branches corresponding to each batch of normalized layers in the trained deep neural network model, and since the shadow observation branches do not participate in the backpropagation gradient calculation of the parameters of the corresponding batch of normalized layers, each batch of normalized layers receives the test data stream in real time, while the corresponding shadow observation branches receive the same test data stream and execute steps A to D as follows, and then the batch of normalized layers executes step E as follows. Step A. The shadow observation branch receives the current time step of the corresponding batch normalization layer. The received test data stream is updated with a preset first exponential moving average coefficient. The shadow statistics are recursively updated and then processed by the statistical difference term. Robust Difference Items The calculation further calculates the current time step of the corresponding batch normalization layer. Lower composite drift score Then proceed to step B; Step B. The shadow observation branch is based on the current time step of the corresponding batch normalization layer. Lower composite drift score Through target momentum Apply temporal change rate constraints to limit the abrupt change in target momentum between adjacent time steps, and obtain the current time step of the corresponding batch normalization layer. Lower dynamic momentum Then proceed to step C; Step C. The shadow observation branch is based on the current time step of the corresponding batch normalization layer. Lower composite drift score Calculate the current time step of the corresponding batch normalization layer. Relaxed cumulative variables with leakage and cutoff mechanisms and determine the current time step The target distribution drift state is then determined, and then proceed to step D; Step D. The shadow observation branch is adjusted according to the current time step. If the target distribution is in a drift state and it is not an instantaneous circuit breaker state, then partially refresh the mask bits or reuse historical mask bits to generate the current time step. The spatiotemporal misalignment mask is then sent to the corresponding batch normalization layer, and then proceed to step E; If it is a momentary circuit breaker state, a freeze mask with all mask bits set to 0 is forcibly generated as the current time step. The spatiotemporal misalignment mask is then sent to the corresponding batch normalization layer, and then proceed to step E; Among them, the spatiotemporal misalignment mask is a set of binary control vectors. Each mask bit in the binary control vector corresponds one-to-one with each batch of normalization layers in the trained deep neural network model. The mask bits are used to control whether the corresponding batch of normalization layers performs statistical updates at the corresponding time step. Step E. Based on the current time step The spatiotemporal misalignment mask is used by the batch normalization layer based on its corresponding mask bits and the current time step. Lower dynamic momentum Update the corresponding global statistics.

2. The lightweight adaptive test time method for non-stationary data streams according to claim 1, characterized in that: In step A, the shadow observation branch performs the following steps A1 to A4; Step A1. Receive the current time step of the corresponding batch normalization layer. The received test data stream is processed according to the following formula: ; Update coefficients using the preset first exponential moving average Recursively update the shadow statistics to obtain the current time step. Shadow mean in the lower shadow statistic With shadow variance ,in, , They represent the previous time step, respectively. The shadow mean and shadow variance in the shadow statistics , These represent the current time step. Find the mean and variance of the received test data stream, and then proceed to step A2; Step A2. According to the Kullback-Leibler divergence principle, the following formula applies: ; Calculate the current time step Lower shadow statistics and the previous time step The statistical distance between the shadow statistics constitutes the statistical difference term. ,in, Represents the Gaussian distribution function. This represents the operation of relative entropy. Indicates the previous time step The shadow standard deviation in the shadow statistic. Indicates the current time step Find the shadow standard deviation in the shadow statistic, and then proceed to step A3; Step A3. Use the following formula: ; Calculate the time step before Mean of lower shadow Shadow variance Respectively compared with the previous time step Mean of lower shadow Shadow variance The sum of the distances between the lower-order moments constitutes the robust difference term. ,in, Describes the L1 norm function. This represents the preset variance adjustment factor. Indicate the preset minimum positive constant used for division by zero, and then proceed to step A4; Step A4. Use the following formula: ; Calculate the current time step of the corresponding batch normalization layer Lower composite drift score ,in, This indicates the preset balance weight factor, and then proceeds to step B.

3. The lightweight adaptive test time method for non-stationary data streams according to claim 1, characterized in that: In step B, the shadow observation branch performs the following steps B1 to B3; Step B1. Determine the current time step of the corresponding batch normalization layer. Lower composite drift score Is it greater than the preset silence threshold? If so, proceed to step B2; Otherwise, determine the current time step. The adaptive process is in the silent maintenance region, allowing the target momentum to... Equal to the preset upper limit of momentum Then proceed to step B3; Step B2. Use the following formula: ; The target momentum is calculated using the tanh activation function and inverse linear interpolation. ,in, Indicates the preset temperature coefficient. This indicates the preset lower limit value of momentum, and then proceeds to step B3; Step B3. Based on the previous time step Lower dynamic momentum According to the following formula: ; Calculate the current time step of the corresponding batch normalization layer Lower dynamic momentum ,in, This represents a numerical truncation function. This indicates the preset maximum rate of change threshold, and then proceeds to step C.

4. The lightweight adaptive test time method for non-stationary data streams according to claim 1, characterized in that: In step C, the shadow observation branch performs the following steps C1 to C3; Step C1. Based on the current time step of the corresponding batch normalization layer. Lower composite drift score According to the following formula: ; Calculate the current time step of the corresponding batch normalization layer Relaxed cumulative variables with leakage and cutoff mechanisms ,in, This indicates the preset decay rate factor for adjusting historical drift. This indicates the previous time step of the corresponding batch normalization layer. The following is a relaxed cumulative variable with leakage and truncation mechanisms. This indicates the preset saturation cutoff threshold. This represents a numerical truncation function. This indicates the preset noise floor tolerance, and then proceeds to step C2; Step C2. Determine the cooling counter. If the value is greater than 0, then determine the current time step. If the target distribution drift state is a momentary circuit breaker state, proceed to step D; otherwise, proceed to step C3. Step C3. Based on the preset extreme value safety threshold Perform the following processing to determine the current time step. The target distribution drift state is then determined, and then proceed to step D; like Then determine the current time step. The target distribution drift state is an inertial hold-through state; like Then determine the current time step. The target distribution drift state is an accumulated trigger state; like Then determine the current time step. The target distribution drift state is in a momentary fuse-breaking state, and the cooling counter is reset. The initial value is preset to be greater than 0. .

5. The lightweight adaptive test time method for non-stationary data streams according to claim 1, characterized in that: The shadow observation branch in step D is executed as follows; If the current time step If the target distribution drift state is an inertial hold-through state, then the previous time step is reused. The spatiotemporal misalignment mask below is used as the current time step. The spatiotemporal misalignment mask is then used to proceed to step E; where the spatiotemporal misalignment mask is a set of binary control vectors, and each mask bit in the binary control vector corresponds one-to-one with each batch of normalization layers in the trained deep neural network model. The mask bits are used to control whether the corresponding batch of normalization layers performs statistical updates at the corresponding time step. If the current time step If the target distribution drift state is in the cumulative trigger state, then determine the current time step of the corresponding batch normalization layer. Relaxed cumulative variables Is it greater than the preset integral trigger threshold? If so, a priority-based filtering process is executed to obtain the current time step. The spatiotemporal misalignment mask is used to reset the current time step of the corresponding batch normalization layer. Relaxed cumulative variables Then proceed to step E; otherwise, reuse the previous time step. The spatiotemporal misalignment mask below is used as the current time step. The spatiotemporal misalignment mask is then applied, and then step E is performed. If the current time step If the target distribution drift state is a momentary circuit breaker state, then a frozen mask with all mask bits set to 0 is forcibly generated as the current time step. Apply a spatiotemporal misalignment mask and reset the current time step of the corresponding batch normalization layer. Relaxed cumulative variables and cooling counter Decrease by 1 to update, then proceed to step E.

6. The lightweight adaptive test time method for non-stationary data streams according to claim 5, characterized in that: The shadow observation branch performs a priority-score-based filtering process according to steps D1 to D4 to obtain the current time step. The following is a spatiotemporal misalignment mask; Step D1. Obtain the current time step corresponding to each batch of normalized layers in the trained deep neural network model. Lower composite drift score ,in, , This indicates the number of batch normalized layers in a trained deep neural network model. This indicates the first [unit / item] in the trained deep neural network model. Each batch of normalization layers corresponds to the current time step. Calculate the composite drift score, then proceed to step D2; Step D2. For each batch of normalized layers in the trained deep neural network model, apply the following formula: ; Calculate the current time step corresponding to the batch normalization layer. The following stable risk items ,in, This indicates the first [unit / item] in the trained deep neural network model. Each batch of normalization layers corresponds to the current time step. The following stable risk items, This indicates the first [unit / item] in the trained deep neural network model. Each batch of normalization layers corresponds to the current time step. The global mean in the global statistics. This indicates the first [unit / item] in the trained deep neural network model. Each batch of normalization layers corresponds to the previous time step. The global mean in the global statistics. Denotes the square of the L2 norm. This represents the moving average function, and then proceeds to step D3; Step D3. For each batch of normalized layers in the trained deep neural network model, apply the following formula: ; Calculate the current time step corresponding to the batch normalization layer. Priority scores ,in, This indicates the first [unit / item] in the trained deep neural network model. Each batch of normalization layers corresponds to the current time step. Priority scores below, This indicates the preset risk penalty coefficient, and then proceeds to step D4; Step D4. Normalize the batch layer corresponding to the current time step. The priority scores are used to sort the normalized layers in each batch of the trained deep neural network model in descending order, and the priority scores are defined for the top layers in the sorting. The mask bits corresponding to each batch of normalization layers are set to 1, while the mask bits corresponding to the remaining batches of normalization layers are set to 0. The mask bits corresponding to each batch of normalization layers then form the current time step. The following is a spacetime misalignment mask. This indicates the preset scaling factor.

7. The lightweight adaptive test time method for non-stationary data streams according to claim 1, characterized in that: In step E, the current time step is used as the basis. The spatiotemporal misalignment mask below, and the batch normalization layer are executed as follows: If the mask bits corresponding to the batch normalization layer are equal to 0, then the batch normalization layer utilizes the previous time step. Global mean in global statistics Global variance This constitutes the current time step. Global mean in global statistics Global variance Regarding the current time step The received test data stream is normalized. If the mask bit corresponding to the batch normalization layer is equal to 1, then the batch normalization layer uses its corresponding current time step. Lower dynamic momentum According to the following formula: ; Get the current time step of the batch normalized layer Global mean in global statistics Global variance Regarding the current time step The received test data stream is normalized; among which, , They represent the previous time step, respectively. The mean and variance of the global statistics are given below. , These represent the current time step. The mean and variance of the received test data stream. This indicates the preset lower bound threshold of variance.

8. The application of a lightweight adaptive test time method for non-stationary data streams as described in any one of claims 1 to 7, characterized in that: The trained deep neural network model takes continuous streaming image frames acquired in real time by the vehicle-mounted camera as input and outputs the category and location bounding boxes of the target in the image frames to achieve target detection and recognition in open, non-stationary environments.