An incremental training data screening method based on historical representation similarity
By building a correlation mechanism between historical and current data during the continuous model update process, and performing structured screening and dynamic management of incremental data, the problem of controlling the scale of incremental training data is solved, and the controllable growth of training data and the stability and consistency of model updates are achieved.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- NANJING UNIV
- Filing Date
- 2026-03-20
- Publication Date
- 2026-06-26
AI Technical Summary
In scenarios where models are continuously updated, existing technologies struggle to effectively control the scale of incremental training data, leading to increased computational and storage overhead. Furthermore, newly arriving data may contain samples with similar structures to historical data or those that contribute little to model parameter updates, affecting the stability of model updates.
By constructing representational relationships between historical and current data, calculating similarity and performing structured filtering, a complete processing flow is established, including historical data maintenance, representational feature extraction, similarity calculation, sample sorting, and model update control, thereby achieving a balance between training scale and model performance.
It achieves orderly growth and scale control of training data, reduces computational and storage overhead, and enhances the stability and consistency of model updates.
Smart Images

Figure CN122285745A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the fields of artificial intelligence and machine learning technology, and specifically to an incremental training data selection method based on historical representation similarity. Background Technology
[0002] With the rapid development of artificial intelligence technology, deep learning models have been widely used in fields such as computer vision and natural language processing. These models acquire knowledge and capabilities by learning from training data, and their performance largely depends on the scale and structural characteristics of the training data.
[0003] In practical applications, the model is first constructed, trained, and deployed based on existing data. As the operating environment or task requirements change, it needs to continuously update with newly arriving data to maintain its adaptability to environmental changes. During this continuous update process, data is typically input into the model in multiple incremental batches arriving in chronological order, and the model updates its parameters based on each incremental batch.
[0004] If all data from each incremental batch is used for training, the size of the training data will accumulate over time, increasing computational and storage costs. Furthermore, newly arriving data may include samples with similar structures to historical data or those that contribute little to model parameter updates. Using these indiscriminately for training could waste training resources and affect the stability of model updates.
[0005] To address the data size control issue in incremental training scenarios, existing techniques typically employ methods such as fixed-ratio pruning, random sampling, or filtering based on the statistical characteristics within the current batch. While these methods can reduce the training size to some extent, they largely rely on information specific to the current batch and lack a comprehensive consideration of the overall structure of historical training data within the model representation space, making it difficult to achieve systematic evaluation across batches over time.
[0006] Therefore, in scenarios involving continuous model updates, it is necessary to improve the incremental data filtering mechanism. To this end, this invention proposes an incremental training data filtering method based on historical representation similarity. By establishing the representational correlation between historical data and current data, incremental data is statistically evaluated and structurally filtered, thereby achieving dynamic control of the training scale and improving the stability of the continuous update process. Summary of the Invention
[0007] To address the problems mentioned in the background, this invention proposes an incremental training data filtering method based on historical representation similarity. This method is designed for continuously updated scenarios and constructs a complete processing flow including historical data maintenance, representation feature extraction, similarity calculation, sample sorting and filtering, and model update control. It uniformly manages and regulates incremental data during the evolution of model parameters, thereby achieving a balance between training scale and model performance. This invention achieves this through the following technical solutions.
[0008] An incremental training data filtering method based on historical representation similarity, characterized by the following steps: Step 1) Input the incremental data stream D for continuous training and the target model M, wherein the incremental data stream D includes multiple incremental batches D_t that arrive in time order; Step 2) Establish a historical dataset H_0 for storing historical training data; Step 3) When the t-th incremental batch D_t arrives, read the data of that batch as the current batch data set; Step 4) Under the current parameter state, use the target model M to extract the representation features of the historical data set H_{t-1} and the current batch data set D_t respectively, to obtain the historical representation set G_{t-1} and the current representation set F_t; Step 5) For each sample in the current representation set F_t, calculate its representation similarity with each sample in the historical representation set G_{t-1}, select the top k historical samples with the highest similarity to construct a Top-k similarity set, and calculate the similarity statistical score of the current sample based on the statistics of the similarity values in the Top-k similarity set. Step 6) Sort the current batch data set D_t according to the similarity statistics score, and filter the samples according to the preset filtering rules to obtain the filtered training data set S_t; Step 7) Update the parameters of the target model M using the training data set S_t, and update the historical data set to obtain the updated historical data set H_t. The historical data set H_t is used for subsequent incremental batch data processing.
[0009] Preferably, the target model M is a deep neural network model, including ResNet, VGG convolutional neural network models, or BERT, RoBERTa pre-trained language models.
[0010] Furthermore, the specific steps for extracting representational features in step 4) include: Step 41) Construct a historical data loader and a current batch data loader based on the historical data set H_{t-1} and the current batch data set D_t, and perform preset data preprocessing and standardization transformation on the input samples; Step 42) Register a forward propagation hook function in the preset feature layer of the target model M, which is used to obtain the output of the feature layer as the sample representation feature during the forward propagation process; Step 43) Under the current parameter state, input the samples in the historical data loader into the target model M according to the preset batch size to perform forward propagation, obtain the feature representation of the historical samples through the hook function, and aggregate the results of each batch to form a historical representation set G_{t-1}. Step 44) Under the current parameter state, input the samples in the current batch data loader into the target model M in sequence according to the preset batch size to perform forward propagation, obtain the feature representation of the current batch samples through the hook function, and aggregate the results of each batch to form the current representation set F_t; Step 45) Flatten the feature representation to transform each sample representation into a vector form of uniform dimension; Step 46) Remove the forward propagation hook function after feature extraction is complete.
[0011] Furthermore, step 5) specifically includes the following steps: Step 51) Determine the feature dimension d, divide the historical representation set G_{t-1} into multiple subsets according to a preset batch size, perform partial fitting operation on each subset in turn to train the dimensionality reduction model, and use the dimensionality reduction model to perform consistent transformation on the historical representation set G_{t-1} and the current representation set F_t respectively to obtain the dimensionality-reduced historical representation set and the current representation set. Step 52) Perform vector normalization on the reduced-dimensional historical representation set G_{t-1} and the current representation set F_t respectively, so that the norm of each sample representation vector satisfies the preset constraints; Step 53) Construct a nearest neighbor retrieval index structure based on inner product metric, and add the normalized historical representation set G_{t-1} to the index structure; the index structure includes KD-Tree, Ball Tree or an approximate nearest neighbor index structure implemented based on FAISS; Step 54) Set the number of nearest neighbors to k, and search the index structure for each current sample representation vector to obtain the k historical samples with the highest similarity and their corresponding similarity values. Step 55) Extract the first k similarity values to construct a similarity value set, calculate the statistics for it, and use the statistics as the similarity statistical score of the current sample. The statistics are the mean statistics or the weighted mean statistics. Step 56) Aggregate the similarity statistics scores of all samples in the current batch to form a similarity score sequence.
[0012] Preferably, the dimensionality reduction model includes principal component analysis (PCA), t-SNE, UMAP, or an autoencoder.
[0013] Furthermore, in step 53), the normalized sample representation vectors are used to calculate the similarity through inner product. The historical representation similarity is obtained by calculating the similarity between sample representation vectors. The similarity measure includes cosine similarity or Euclidean distance.
[0014] Furthermore, step 6) specifically includes the following steps: Step 61) Establish a sorting index for the current batch of samples based on the similarity score sequence; Step 62) Determine the boundary of the filtering interval according to the preset filtering ratio parameter; the preset filtering ratio parameter is used to control the incremental data filtering ratio, and its value ranges from 5% to 90%; Step 63) Select the sample index set corresponding to the sorted index sequence according to the filtering interval to obtain the filtered sample index set; Step 64) Extract from the current batch data set D_t according to the filtered sample index set to obtain the filtered training data set S_t.
[0015] Furthermore, step 7) specifically includes the following steps: Step 71) Construct an incremental training data loader using the filtered training data set S_t; Step 72) Randomly select a portion of historical samples from the historical data set H_{t-1} according to a preset replay ratio to form a replay sample set, and merge the replay sample set with the filtered training data set S_t; Step 73) Use a preset optimizer and loss function to perform incremental training on the target model M based on the merged sample set to update the model parameters; Step 74) Merge and update the filtered training data set S_t and the historical data set H_{t-1} to obtain the updated historical data set H_t. The merge and update includes a splicing update method that appends the current filtered sample to the back end of the historical set, or a pruning update of the historical data set when the size of the historical set exceeds the preset capacity, so as to control the size of the historical set. Step 75) Use the updated historical data set H_t for the representation extraction and similarity calculation of the subsequent incremental batch D_{t+1}.
[0016] Furthermore, the preset replay ratio is used to control the proportion of the number of replay samples to the total amount of current training data, and the preset replay ratio is 1% to 50%.
[0017] Preferably, the preset optimizer includes stochastic gradient descent (SGD), Adam, or AdamW optimizer.
[0018] The present invention adopts the above technical solution and has the following beneficial effects: This method constructs a complete processing flow around the continuous training scenario, including historical data maintenance, representation extraction, similarity statistics, and interval filtering. It performs structured management of newly arriving data during the evolution of model parameters, realizing the orderly growth and scale control of training data. Compared with the existing methods that make decisions based only on the current batch information, this invention can make full use of the historical representation structure for cross-time evaluation, reducing training resource consumption while enhancing the stability and consistency of continuous model updates. Attached Figure Description
[0019] Figure 1 This is a flowchart illustrating the incremental training data filtering method based on historical representation similarity as described in a specific implementation.
[0020] Figure 2 The flowchart for feature extraction is shown in the specific implementation method.
[0021] Figure 3 This is a schematic diagram of the similarity calculation and sample selection mechanism based on historical representation as described in a specific implementation.
[0022] Figure 4 This is a schematic diagram illustrating the model update and historical data update mechanism described in a specific implementation. Detailed Implementation
[0023] The present invention will be further described in detail below with reference to the accompanying drawings and specific embodiments.
[0024] like Figure 1 , Figure 2 As shown, this embodiment provides an incremental training data filtering method based on historical representation similarity. By introducing historical data representations into the incremental data evaluation during the continuous model update process, a correlation mechanism between historical data and the current batch of data is constructed. This allows for structured filtering and dynamic management of newly arriving incremental data, achieving controllable growth in training data scale and maintaining the stability of the model update process while reducing computational and storage overhead. Figure 1 As shown, Figure 1 This is a flowchart illustrating the incremental training data filtering method based on historical representation similarity according to an embodiment of the present invention. The method in this embodiment specifically includes the following steps: Step 1) Input the continuously trained incremental data stream D and the target model M, where the incremental data stream D includes multiple incremental batches D_t that arrive in time order, and the target model M is a deep neural network model, including but not limited to convolutional neural network models such as ResNet and VGG, or pre-trained language models such as BERT and RoBERTa. Step 2) Establish a historical dataset H_0 for storing historical training data; Step 3) When the t-th incremental batch D_t arrives, read the data of that batch as the current batch data set; Step 4) Under the current parameter state, use the target model M to extract the representation features of the historical data set H_{t-1} and the current batch data set D_t, respectively, to obtain the historical representation set G_{t-1} and the current representation set F_t; see [link to relevant documentation]. Figure 2 , Figure 2 This is a schematic diagram illustrating the feature extraction process according to an embodiment of the present invention. Step 4) specifically includes the following steps: Step 41) Construct a historical data loader and a current batch data loader based on the historical data set H_{t-1} and the current batch data set D_t, and perform preset data preprocessing and standardization transformation on the input samples; Step 42) Register a forward propagation hook function in the preset feature layer of the target model M, which is used to obtain the output of the feature layer as the sample representation feature during the forward propagation process; Step 43) Under the current parameter state, input the samples in the historical data loader into the target model M according to the preset batch size to perform forward propagation, obtain the feature representation of the historical samples through the hook function, and aggregate the results of each batch to form a historical representation set G_{t-1}. Step 44) Under the current parameter state, input the samples in the current batch data loader into the target model M in sequence according to the preset batch size to perform forward propagation, obtain the feature representation of the current batch samples through the hook function, and aggregate the results of each batch to form the current representation set F_t; Step 45) Flatten the feature representations to transform each sample representation into a vector form of uniform dimension; Step 46) Remove the forward propagation hook function after feature extraction is complete.
[0025] Step 5) For each sample in the current representation set F_t, calculate its representation similarity with each sample in the historical representation set G_{t-1}, and select the top k historical samples with the highest similarity to construct a Top-k similarity set. Calculate the similarity score of the current sample based on the statistics of the similarity values in the Top-k similarity set; see [link to relevant documentation]. Figure 3 , Figure 3This is a schematic diagram of the similarity calculation and sample selection mechanism based on historical representation in an embodiment of the present invention. Step 5) specifically includes the following steps: Step 51) Determine the feature dimension d, and divide the historical representation set G_{t-1} into multiple subsets according to a preset batch size. Perform partial fitting operations on each subset in turn to train the dimensionality reduction model. The dimensionality reduction model can adopt dimensionality reduction methods such as principal component analysis (PCA), t-SNE, UMAP, or autoencoder. Then, use the dimensionality reduction model to perform consistent transformation on the historical representation set G_{t-1} and the current representation set F_t respectively to obtain the dimensionality-reduced representation. Step 52) Perform vector normalization on the reduced-dimensional historical representation set G_{t-1} and the current representation set F_t respectively, so that the norm of each sample representation vector satisfies the preset constraints, ensuring the scale consistency of similarity calculation; Step 53) Construct a nearest neighbor retrieval index structure based on inner product metric, and add the normalized historical representation set G_{t-1} to the index. The normalized sample representation vectors are used to calculate the cosine similarity metric through inner product calculation, and the historical representation similarity is obtained by calculating the similarity metric between sample representation vectors. The similarity metric includes cosine similarity or Euclidean distance. The index structure can be KD-Tree, Ball Tree, or an approximate nearest neighbor index structure based on FAISS. Step 54) Set the number of nearest neighbors to k, and for each current sample representation vector, retrieve the k historical samples with the highest similarity and their corresponding similarity values from the index structure; Step 55) Construct a similarity value set based on k similarity values in advance, calculate the statistics for it, including the mean statistics or the weighted mean statistics, and use it as the similarity score of the current sample. Step 56) Aggregate the similarity statistics scores of all samples in the current batch to form a similarity score sequence for subsequent screening.
[0026] Step 6) Sort the current batch dataset D_t according to the similarity statistics score, and filter the samples according to the preset filtering rules to obtain the filtered training dataset S_t; Step 6) specifically includes the following steps: Step 61) Build a sorting index for the current batch of samples based on the similarity score sequence; Step 62) Determine the boundary of the screening interval according to the preset screening ratio parameter. The value range of the screening ratio parameter can be 5% to 90%, which is used to control the proportion of data participating in model training in the current batch of data. Step 63) Select the sample index set corresponding to the sorted index sequence according to the filtering interval to obtain the filtered sample index set; Step 64) Extract from the current batch data set D_t based on the filtered sample index set to obtain the filtered training data set S_t.
[0027] Step 7) Update the parameters of the target model M using the filtered training dataset S_t, and update the historical dataset to obtain the updated historical dataset H_t, which will be used for subsequent incremental batch data processing. See also Figure 4 , Figure 4 This is a schematic diagram of the model update and historical data update mechanism in an embodiment of the present invention. Step 7) specifically includes the following steps: Step 71) Construct an incremental training data loader using the filtered training data set S_t; Step 72) Randomly select a portion of historical samples from the historical data set H_{t-1} according to a preset replay ratio to form a replay sample set, and merge the replay sample set with the filtered training data set S_t, where the replay ratio can be 1% to 50%; Step 73) Use a preset optimizer and loss function to perform incremental training on the target model M based on the merged sample set. The optimizer can be stochastic gradient descent (SGD), Adam or AdamW optimizer, etc., to update the model parameters. Step 74) Merge and update the selected training data set S_t and the historical data set H_{t-1} to obtain the updated historical data set H_t. The merging and updating includes a splicing update method that appends the current selected sample to the back end of the historical set, or a pruning update of the historical data set when the size of the historical set exceeds the preset capacity, so as to control the size of the historical set. Step 75) Use the updated historical data set H_t for the representation extraction and similarity calculation of the subsequent incremental batch D_{t+1}.
[0028] The above descriptions are embodiments of the present invention, but the specific embodiments described herein are merely illustrative and not intended to limit the invention. Any omissions, modifications, or equivalent substitutions made within the scope of the claims of this invention without departing from the principles and spirit of the invention should be included within the scope of protection of the claims.
Claims
1. A method for filtering incremental training data based on historical representation similarity, characterized in that, The method includes the following steps: Step 1) Input the incremental data stream D for continuous training and the target model M, wherein the incremental data stream D includes multiple incremental batches D_t that arrive in time order; Step 2) Establish a historical dataset H_0 for storing historical training data; Step 3) When the t-th incremental batch D_t arrives, read the data of that batch as the current batch data set; Step 4) Under the current parameter state, use the target model M to extract the representation features of the historical data set H_{t-1} and the current batch data set D_t respectively, to obtain the historical representation set G_{t-1} and the current representation set F_t; Step 5) For each sample in the current representation set F_t, calculate its representation similarity with each sample in the historical representation set G_{t-1}, select the top k historical samples with the highest similarity to construct a Top-k similarity set, and calculate the similarity statistical score of the current sample based on the statistics of the similarity values in the Top-k similarity set. Step 6) Sort the current batch data set D_t according to the similarity statistics score, and filter the samples according to the preset filtering rules to obtain the filtered training data set S_t; Step 7) Update the parameters of the target model M using the training data set S_t, and update the historical data set to obtain the updated historical data set H_t. The historical data set H_t is used for subsequent incremental batch data processing. 2.The method of claim 1, wherein, The target model M is a deep neural network model, including ResNet, VGG convolutional neural network models, or BERT, RoBERTa pre-trained language models. 3.The history representation similarity based incremental training data screening method of claim 1, wherein, The specific steps for extracting representation features in step 4) include: Step 41) Construct a historical data loader and a current batch data loader based on the historical data set H_{t-1} and the current batch data set D_t, and perform preset data preprocessing and standardization transformation on the input samples; Step 42) Register a forward propagation hook function in the preset feature layer of the target model M, which is used to obtain the output of the feature layer as the sample representation feature during the forward propagation process; Step 43) Under the current parameter state, input the samples in the historical data loader into the target model M according to the preset batch size to perform forward propagation, obtain the feature representation of the historical samples through the hook function, and aggregate the results of each batch to form a historical representation set G_{t-1}. Step 44) Under the current parameter state, input the samples in the current batch data loader into the target model M in sequence according to the preset batch size to perform forward propagation, obtain the feature representation of the current batch samples through the hook function, and aggregate the results of each batch to form the current representation set F_t; Step 45) Flatten the feature representation to transform each sample representation into a vector form of uniform dimension; Step 46) Remove the forward propagation hook function after feature extraction is complete. 4.The method of claim 1, wherein, Step 5) specifically includes the following steps: Step 51) Determine the feature dimension d, divide the historical representation set G_{t-1} into multiple subsets according to a preset batch size, perform partial fitting operation on each subset in turn to train the dimensionality reduction model, and use the dimensionality reduction model to perform consistent transformation on the historical representation set G_{t-1} and the current representation set F_t respectively to obtain the dimensionality-reduced historical representation set and the current representation set. Step 52) Perform vector normalization on the reduced-dimensional historical representation set G_{t-1} and the current representation set F_t respectively, so that the norm of each sample representation vector satisfies the preset constraints; Step 53) Construct a nearest neighbor retrieval index structure based on inner product metric, and add the normalized historical representation set G_{t-1} to the index structure; the index structure includes KD-Tree, Ball Tree or an approximate nearest neighbor index structure implemented based on FAISS; Step 54) Set the number of nearest neighbors to k, and search the index structure for each current sample representation vector to obtain the k historical samples with the highest similarity and their corresponding similarity values. Step 55) Extract the first k similarity values to construct a similarity value set, calculate the statistics for it, and use the statistics as the similarity statistical score of the current sample. The statistics are the mean statistics or the weighted mean statistics. Step 56) Aggregate the similarity statistics scores of all samples in the current batch to form a similarity score sequence.
5. The method of claim 4, wherein the historical representation similarity-based incremental training data screening method is characterized by, The dimensionality reduction model includes principal component analysis (PCA), t-SNE, UMAP, or an autoencoder. 6.The method of claim 4, wherein, In step 53), the normalized sample representation vectors are used to measure similarity through inner product calculation. The historical representation similarity is obtained by calculating the similarity measure between sample representation vectors. The similarity measure includes cosine similarity or Euclidean distance. 7.The history representation similarity based incremental training data screening method of claim 1, wherein, Step 6) specifically includes the following steps: Step 61) Establish a sorting index for the current batch of samples based on the similarity score sequence; Step 62) Determine the boundary of the filtering interval according to the preset filtering ratio parameter; the preset filtering ratio parameter is used to control the incremental data filtering ratio, and its value ranges from 5% to 90%; Step 63) Select the sample index set corresponding to the sorted index sequence according to the filtering interval to obtain the filtered sample index set; Step 64) Extract from the current batch data set D_t according to the filtered sample index set to obtain the filtered training data set S_t. 8.The method of claim 1, wherein, Step 7) specifically includes the following steps: Step 71) Construct an incremental training data loader using the filtered training data set S_t; Step 72) Randomly select a portion of historical samples from the historical data set H_{t-1} according to a preset replay ratio to form a replay sample set, and merge the replay sample set with the filtered training data set S_t; Step 73) Use a preset optimizer and loss function to perform incremental training on the target model M based on the merged sample set to update the model parameters; Step 74) Merge and update the filtered training data set S_t and the historical data set H_{t-1} to obtain the updated historical data set H_t. The merge and update includes a splicing update method that appends the current filtered sample to the back end of the historical set, or a pruning update of the historical data set when the size of the historical set exceeds the preset capacity, so as to control the size of the historical set. Step 75) Use the updated historical data set H_t for the representation extraction and similarity calculation of the subsequent incremental batch D_{t+1}. 9.The history representation similarity based incremental training data screening method of claim 8, wherein, The preset replay ratio is used to control the proportion of the number of replay samples to the total amount of current training data, and the preset replay ratio is 1% to 50%.
10. The incremental training data filtering method based on historical representation similarity according to claim 8, characterized in that, The preset optimizer includes stochastic gradient descent (SGD), Adam, or AdamW optimizer.