A model training system and method based on weight initialization
By using a closed-loop feedback mechanism for sample weight initialization and iterative optimization, the sample weights are dynamically adjusted, which solves the problem of poor model robustness in existing technologies and achieves high robustness and generalization ability under prior distribution shift.
Patent Information
- Application Number
- CN202611042599.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-07-14
- Publication Date
- 2026-11-24
AI Technical Summary
Existing iterative optimization methods are sensitive to the initial model state, resulting in poor model robustness on training data with prior distribution bias. Furthermore, existing technologies struggle to effectively address issues such as label noise, class imbalance, and covariate bias.
The sample weight initialization module obtains reliable distribution values, determines initial weights, and combines them with the iterative optimization module and the feedback optimization module to form a closed-loop feedback mechanism, dynamically adjusting sample weights, suppressing prior distribution shifts, and improving model robustness.
It effectively improves the robustness and generalization ability of the model, is applicable to various prior distribution shifts, and does not depend on specific types of prior knowledge, thus having wide applicability.
Smart Images

Figure CN123158207A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of computer application technology, and more specifically, to a model training system and method based on weight initialization. Background Technology
[0002] With the continuous advancement of big data and computer processing technology, machine learning models (or simply models) are widely used in fields such as medical diagnosis and image recognition. Before application, the machine learning model needs to be trained with a large amount of sample data so that it can learn the natural laws existing between the sample data.
[0003] In real-world model applications, due to the limited size of the sample data, the ideal assumption of independent and identically distributed data is often broken, and the sample data often exhibits the following forms of "prior distribution shift": (1) Label noise: Incorrect labels may exist in the sample data due to manual labeling errors or automated errors in the data collection process; (2) Class imbalance: The number of samples in some classes is much larger than that in other classes; (3) Covariate bias: The feature distributions of the sample data and the test data are different; (4) Prior probability shift: The prior distribution of the target variable Y is different in the sample data and the test data.
[0004] These "prior distribution shifts" cause the model to learn biased natural laws during training, leading to poor performance on real, unbiased test data and poor model robustness. To address this, iterative optimization is typically used to train the model. This involves iteratively training the model and adjusting sample weights based on the updated model to improve robustness. For example, Iteratively Reweighted Least Squares (IRLS) iteratively adjusts sample weights based on the residuals of the updated model to reduce the impact of reliable values from outlier distributions. However, these iterative optimization methods often treat each sample equally initially (i.e., all samples have an initial weight of 1). This means that existing iterative optimization methods are very sensitive to initial weights and the model state at the beginning of the iteration. This results in the initial model being heavily biased towards noisy data in training data with severe "prior distribution shifts." Subsequent iterative updates based on the initial model may get stuck in local optima, and the model trained under these conditions still suffers from poor robustness. Summary of the Invention
[0005] In view of this, the main objective of this invention is to propose a model training system and method based on weight initialization, in order to at least partially solve at least one of the above-mentioned technical problems.
[0006] To address the aforementioned technical problems, the first aspect of this invention proposes a model training system based on weight initialization, the system comprising: The sample weight initialization module is used to collect training sample sets with prior distribution offsets and obtain the distribution reliability value of each sample, and determine the initial weight of each sample based on the distribution reliability value; wherein: the distribution reliability value reflects the reliability of the sample coming from the overall distribution of the training sample set, and the higher the distribution reliability value of the sample, the higher the initial weight. The iterative optimization training module is used to perform at least one round of iterative optimization training on the model, starting from the initial training weights. In each round of iterative optimization training, the model parameters are updated using the current sample weights, and the weights of all samples are dynamically updated according to the sample bias predicted by the updated model. The sample bias is used to measure the degree of inconsistency between the true value of the sample and the predicted value of the model. The larger the sample bias, the lower the weight of the sample after the update. The feedback optimization module is used to feed back the sample bias predicted by the updated model to the sample weight initialization module after performing one or more rounds of iterative optimization training, adaptively adjust the distribution reliability value of each training sample, and input it into the iterative optimization training module. The End Training module is used to determine whether the model training meets the preset conditions after each round of iterative optimization training. If the preset conditions are met, the model training ends.
[0007] According to a preferred embodiment of the present invention, the feedback optimization module is used to adaptively adjust the distribution reliability value of each sample based on the sample bias predicted by the updated model. Alternatively, the feedback optimization module is used to determine a first distribution reliability value for each sample based on the sample bias predicted by the updated model, and to fuse the first distribution reliability value and the sub-distribution reliability value for each sample to obtain a distribution reliability value for each sample; wherein: the sub-distribution reliability value is obtained through at least one of the following methods: The reliability value of each sample's sub-distribution is determined based on the degree of consistency between the sample's label and that of its nearest neighbor samples; The reliable value of the sub-distribution for each sample is determined based on the prediction loss or confidence level of a standard model for the sample. The reliable value of the sub-distribution for each sample is determined based on the distribution density of the region in the feature space where the sample is located.
[0008] According to a preferred embodiment of the present invention, the weight initialization module obtains the reliable distribution value of each sample through one or a combination of the following methods: The distribution reliability value of each sample is determined based on the degree of consistency between the sample and the labels of its nearest neighbor samples; The reliable distribution value for each sample is determined based on the prediction loss or confidence level of a standard model. The reliable distribution value of each sample is determined based on the distribution density of the region where the sample is located in the feature space.
[0009] According to a preferred embodiment of the present invention, the weight initialization module maps the reliable distribution value of each sample to the initial weight of each sample through a monotonic function.
[0010] According to a preferred embodiment of the present invention, the iterative optimization module dynamically updates the weights of all samples by using a robust weight function to update the sample bias predicted by the updated model.
[0011] To address the aforementioned technical problems, a second aspect of the present invention provides a model training method based on weight initialization, the method comprising: Sample weight initialization: Collect a training sample set with prior distribution offset and obtain the distribution reliability value of each sample. Determine the initial weight of each sample based on the distribution reliability value; wherein: the distribution reliability value reflects the reliability of the sample coming from the overall distribution of the training sample set, and the higher the distribution reliability value of the sample, the higher the initial weight. Iterative optimization training: Starting from the initial training weights, the model is subjected to at least one round of iterative optimization training, wherein: in each round of iterative optimization training, the model parameters are updated using the current sample weights, and the weights of all samples are dynamically updated according to the sample bias predicted by the updated model; the sample bias is used to measure the degree of inconsistency between the true value of the sample and the predicted value of the model, and the larger the sample bias, the lower the weight of the sample after the update. Feedback optimization: After performing one or more rounds of the iterative optimization training steps, the sample bias predicted by the updated model is fed back to the sample weight initialization step to adaptively adjust the distribution reliability value of each training sample and perform the iterative optimization training steps. End training: After each round of iterative optimization training, determine whether the model training meets the preset conditions. If the preset conditions are met, end the model training.
[0012] According to a preferred embodiment of the present invention, the distribution reliability value of each sample is adaptively adjusted based on the sample bias predicted by the updated model; Alternatively, based on the sample bias predicted by the updated model, a first distribution reliability value is determined for each sample. The first distribution reliability value and the sub-distribution reliability value for each sample are then fused to obtain the distribution reliability value for each sample; wherein the sub-distribution reliability value is obtained through at least one of the following methods: The reliability value of each sample's sub-distribution is determined based on the degree of consistency between the sample's label and that of its nearest neighbor samples; The reliable value of the sub-distribution for each sample is determined based on the prediction loss or confidence level of a standard model for the sample. The reliable value of the sub-distribution for each sample is determined based on the distribution density of the region in the feature space where the sample is located.
[0013] According to a preferred embodiment of the present invention, in the sample weight initialization step, the reliable distribution value of each sample is obtained by one or a combination of the following methods: The distribution reliability value of each sample is determined based on the degree of consistency between the sample and the labels of its nearest neighbor samples; The reliable distribution value for each sample is determined based on the prediction loss or confidence level of a standard model. The reliable distribution value of each sample is determined based on the distribution density of the region where the sample is located in the feature space.
[0014] According to a preferred embodiment of the present invention, the reliable distribution value of each sample is mapped to the initial weight of each sample through a monotonic function.
[0015] According to a preferred embodiment of the present invention, the sample bias predicted by the updated model is dynamically updated using a robust weight function to update the weights of all samples.
[0016] To solve the above-mentioned technical problems, a third aspect of the present invention provides an electronic device, comprising: Processor; and A memory storing computer-executable instructions, which, when executed, cause the processor to perform the method described in any of the preceding descriptions.
[0017] To solve the above-mentioned technical problems, the fourth aspect of the present invention provides a computer program product, including a computer program, characterized in that the computer program, when executed by a processor, implements the method described in any of the above-mentioned embodiments.
[0018] In summary, before training the model, this invention determines the initial weights for each sample by obtaining a distribution reliability value that reflects the degree of prior distribution shift in the training sample set. This suppresses prior distribution shifts in the training sample set. Subsequent iterative optimization training is based on these suppressed initial weights, effectively avoiding local optima caused by noisy data and improving model robustness. Furthermore, after one or more rounds of iterative optimization training, this invention feeds back the sample bias predicted by the model after the iterative optimization training phase to adaptively adjust the distribution reliability value of each training sample and execute iterative optimization training steps. This forms a closed-loop feedback loop throughout the model training process. The highly robust model, optimized through multiple iterations, adaptively adjusts the initial weights of the training sample set, alternating between weight initialization and iterative optimization training. These two processes mutually promote gradual optimization, ultimately leading to the model converging to a more robust state. Compared to existing technologies, this invention offers at least the following advantages: 1. Improved Model Robustness: This invention assigns initial weights to each sample based on the reliable distribution value of the samples, providing robust initial weights for iterative optimization training and solving the problem of sensitivity to initial state in existing iterative optimization training methods. At the same time, the model after iterative optimization training is fed back to adaptively adjust the initial weights of the samples. The two work together and alternately. From the initial weights to each step of the optimization iterative training, noise and abnormal samples are identified and suppressed, making the finally trained model insensitive to the flaws in the training dataset and having extremely strong robustness and generalization ability.
[0019] 2. Applicable to all types of prior distribution shifts: This invention feeds back the iteratively optimized trained model to adaptively adjust the initial weights of the samples. The two work together and alternately to train the model. Therefore, it does not rely on prior knowledge of the specific type of prior distribution shift and can adaptively handle various forms of prior distribution shifts such as label noise, class imbalance, and covariate shift.
[0020] 3. Wide applicability: This invention can be used as a general training framework, combined with various basic machine learning models and loss functions, and has a wide range of applications. Attached Figure Description
[0021] To make the technical problems solved by this invention, the technical means adopted, and the technical effects achieved clearer, specific embodiments of this invention will be described in detail below with reference to the accompanying drawings. However, it should be noted that the drawings described below are merely drawings of exemplary embodiments of this invention. Those skilled in the art can obtain drawings of other embodiments based on these drawings without any creative effort.
[0022] Figure 1This is a schematic diagram of the structural framework of a model training system based on weight initialization provided in an embodiment of the present invention; Figure 2 This is a flowchart illustrating a model training method based on weight initialization provided in an embodiment of the present invention; Figure 3 This is a flowchart illustrating another model training method based on weight initialization provided in an embodiment of the present invention. Figure 4 This is a structural block diagram of an exemplary embodiment of an electronic device according to the present invention. Detailed Implementation
[0023] Subject to the inventive concept, the structures, performance, effects or other features described in a particular embodiment may be combined in any suitable manner with one or more other embodiments.
[0024] In the description of specific embodiments, detailed descriptions of structures, performance, effects, or other features are provided to enable those skilled in the art to fully understand the embodiments. However, it is not excluded that those skilled in the art can implement the present invention under certain circumstances with technical solutions that do not contain the above-described structures, performance, effects, or other features. The figures in the accompanying drawings are merely exemplary illustrations and do not imply that the solution of the present invention must include all the contents, operations, and steps shown in the figures, nor do they imply that the execution must be carried out in the order shown in the figures.
[0025] refer to Figure 1 , Figure 1 This is a schematic diagram of the structural framework of a model training system based on weight initialization provided in an embodiment of the present invention. Figure 1 As shown, the system includes: The sample weight initialization module 11 is used to collect a training sample set with prior distribution offset and obtain the distribution reliability value of each sample, and determine the initial weight of each sample based on the distribution reliability value; wherein: the distribution reliability value reflects the reliability of the sample coming from the overall distribution of the training sample set, and the higher the distribution reliability value of the sample, the higher the initial weight. The iterative optimization training module 12 is used to perform at least one round of iterative optimization training on the model, starting from the initial training weights. In each round of iterative optimization training, the model parameters are updated using the current sample weights, and the weights of all samples are dynamically updated according to the sample bias predicted by the updated model. The sample bias is used to measure the degree of inconsistency between the true value of the sample and the predicted value of the model. The larger the sample bias, the lower the weight of the sample after the update. The feedback optimization module 13 is used to feed back the sample bias predicted by the updated model to the sample weight initialization module after performing one or more rounds of iterative optimization training, adaptively adjust the distribution reliability value of each training sample, and input it into the iterative optimization training module. The End Training Module 14 is used to determine whether the model training meets the preset conditions after each round of iterative optimization training. If the preset conditions are met, the model training ends.
[0026] According to a preferred embodiment of the present invention, the feedback optimization module 13 is used to adaptively adjust the distribution reliability value of each sample based on the sample bias predicted by the updated model. Alternatively, the feedback optimization module 13 is used to determine the first distribution reliability value for each sample based on the sample bias predicted by the updated model, and to fuse the first distribution reliability value and the sub-distribution reliability value for each sample to obtain the distribution reliability value for each sample; wherein: the sub-distribution reliability value is obtained through at least one of the following methods: The reliability value of each sample's sub-distribution is determined based on the degree of consistency between the sample's label and that of its nearest neighbor samples; The reliable value of the sub-distribution for each sample is determined based on the prediction loss or confidence level of a standard model for the sample. The reliable value of the sub-distribution for each sample is determined based on the distribution density of the region in the feature space where the sample is located.
[0027] According to a preferred embodiment of the present invention, the weight initialization module 11 obtains the reliable distribution value of each sample through one or a combination of the following methods: The distribution reliability value of each sample is determined based on the degree of consistency between the sample and the labels of its nearest neighbor samples; The reliable distribution value for each sample is determined based on the prediction loss or confidence level of a standard model. The reliable distribution value of each sample is determined based on the distribution density of the region where the sample is located in the feature space.
[0028] According to a preferred embodiment of the present invention, the weight initialization module 11 maps the reliable distribution value of each sample to the initial weight of each sample through a monotonic function.
[0029] According to a preferred embodiment of the present invention, the iterative optimization module 12 dynamically updates the weights of all samples by using a robust weight function to update the sample bias predicted by the updated model.
[0030] based on Figure 1 The aforementioned model training system based on weight initialization, in this embodiment of the invention, also provides a model training method based on weight initialization, such as... Figure 2 As shown, the method includes: S1, Sample weight initialization In this step, a training sample set with prior distribution offset is collected and the distribution reliability value of each sample is obtained. The initial weight of each sample is determined based on the distribution reliability value.
[0031] The embodiments of this invention can be applied to any field where there is a prior distribution shift. Depending on the application field, different training datasets can be collected. For example, in the field of medical diagnosis, medical diagnostic data (such as patient weight, blood pressure, heart rate, blood lipids, and confirmed patient cases) can be collected as training datasets. In the field of image recognition, image data (image size, RGB data, etc.) can be collected as training datasets.
[0032] Before training the model, this invention does not assume that all samples are equally distributed, but rather that there is a prior distribution bias. The reliability value of the distribution reflects the reliability of the samples from the overall distribution of the training sample set (the higher the reliability value, the lower the probability that the samples have a prior distribution bias). Then, based on the reliability value of the sample distribution, an initial weight is assigned to each sample. The initial weight is used to suppress the bias of each sample on the training sample set, thereby eliminating the prior distribution bias in the training sample set as a whole. This provides a uniform and "clean" training dataset for the iterative optimization training in step S2, avoiding the trap of local optima.
[0033] It is important to emphasize that the distribution reliability value used in this step is fundamentally different from the Prioritized Experience Replay (PER) in reinforcement learning (RL). This invention is a sample weight initialization mechanism in supervised learning. Its core is to identify and suppress data that may have prior distribution biases (e.g., noisy data / out-of-distribution data) based on the distribution reliability value of the samples before model training begins. Here, the distribution reliability value is obtained based on the static distribution characteristics of the samples (the degree of prior distribution bias of the samples on the training sample set). In contrast, PER for RL agents is a data management mechanism. Its core is to configure the sampling probability for each experience based on the temporal difference error (TD-error) of the RL agent during training, accelerating the learning process by prioritizing the replay of experiences with "high sampling probabilities." Essentially, it changes the sampling distribution through TD-error.
[0034] In one possible implementation, the reliable distribution value for each sample can be obtained in any of the following ways before training the model: Method 1: Determine the distribution reliability value of each sample based on the consistency of the labels of the sample and its nearest neighbor samples; for example, K nearest neighbors can be selected. For sample xi, find its K nearest neighbors in the feature space, calculate the proportion of these K neighbors that have the same label yi as xi, and use this proportion as the distribution reliability value of sample xi.
[0035] Method 2: Determine the distribution reliability value for each sample based on the prediction loss or confidence score of a standard model. Here, the standard model is a pre-trained model on a "clean" validation set without prior distribution bias. The prediction loss of the standard model (e.g., cross-entropy, mean squared error, residual) is used as the distribution reliability value. Alternatively, for classification tasks, the confidence score, variance, or entropy predicted by the standard model is used as the distribution reliability value.
[0036] Method 3: Determine the reliable distribution value of each sample based on the distribution density of the region where the sample is located in the feature space. For example, kernel density estimation or Gaussian mixture models can be used to estimate the probability density of sample xi in the feature space of the entire training set, and the probability density can be used as the reliable distribution value to identify suspected abnormal samples in sparsely distributed regions.
[0037] In another possible implementation, the reliability values of the sample distribution can be obtained by combining two or three of the above methods, thereby improving the accuracy of the distribution reliability values. Before training the model, the sub-distribution reliability values for each sample can be obtained separately using two or three of the above methods; then, the sub-distribution reliability values are fused to obtain the distribution reliability value for each sample.
[0038] In this embodiment, the distribution reliability value reflects the reliability of a sample's origin from the overall distribution of the training sample set. It cannot be directly used as the initial weight of a sample. Instead, a mapping function can be used to map the distribution reliability value to the initial weight, such that a higher distribution reliability value corresponds to a higher initial weight. Preferably, the mapping function is a monotonic function, mapping the distribution reliability value of each sample to its corresponding initial weight. For example, a sigmoid function can be used to map the distribution reliability value of each sample to its corresponding initial weight. Samples with high distribution reliability values receive high initial weights, while samples with low distribution reliability values (potential noise or out-of-distribution samples) receive low initial weights.
[0039] The processing in step S1 outputs a training sample set with initial weights, providing a robust starting point for subsequent iterative optimization training.
[0040] S2, Iterative Optimization Training This step is an iterative optimization training loop that aims to progressively train and optimize the model and sample weights based on the initial sample weights.
[0041] For example, this step can start with the initial training weights output in step S1 and perform at least one round of iterative optimization training on the model. In each round of iterative optimization training, the model parameters are updated using the current sample weights, and the weights of all samples are dynamically updated based on the sample bias predicted by the updated model. The sample bias is used to measure the degree of inconsistency between the true sample value and the model's predicted value; the larger the sample bias, the lower the weight of the updated sample. In specific implementation, the sample bias varies depending on the model type. For example, for regression models such as linear regression, support vector machine regression, and neural network regression, the sample bias can be confirmed through sample residuals. For classification models such as logistic regression, decision tree classification, and gradient boosting models, the sample bias can be confirmed through sample loss values. The number of iterative optimization training iterations can be pre-configured or determined after each iteration by judging whether the model training meets preset conditions.
[0042] In one example, the sample bias predicted by the updated model can be dynamically updated using a robust weight function to adjust the weights of all samples. Samples with larger biases receive lower weights in the next iteration of optimization training, effectively "diminishing" (gradually suppressing) the impact of samples inconsistent with the current model's predictions on the model's training performance in each iteration. The robust weight function can be selected from... In one possible implementation, such as Figure 3 As shown, each round of optimization iteration training in this step may include: S21. Train the model using the current sample weights and minimize the weighted loss function to update the model parameters.
[0043] This step allows you to input all samples in the training sample set and the current weight of each sample into the model for training. Among them, samples with higher weights have a greater impact on the update of model parameters.
[0044] S22. Use the updated model to predict all samples and calculate the bias for each sample based on the prediction results.
[0045] The sample bias is used to measure the degree of inconsistency between the true sample value and the model's predicted value. The larger the sample bias, the lower the weight of the updated sample. In practice, the sample bias varies depending on the model type. For example, for regression models such as linear regression, support vector machine regression, and neural network regression, sample bias can be confirmed by the sample residuals. For classification models such as logistic regression, decision tree classification, and gradient boosting models, sample bias can be confirmed by the sample loss value.
[0046] S23. Input the sample bias predicted by the updated model into the robust weight function to dynamically update the weights of all samples.
[0047] S3, Feedback Optimization After performing one or more rounds of iterative optimization training, this step feeds back the sample bias predicted by the updated model to the sample weight initialization step to adaptively adjust the distribution reliability value of each training sample and perform iterative optimization training. Thus, a closed-loop feedback is formed throughout the model training process. The initial weights of the training sample set are adaptively adjusted by the highly robust model after multiple iterations of optimization. The weight initialization and iterative optimization training are performed alternately, and the two promote each other to gradually optimize, so that the model eventually converges to a better robust state.
[0048] In one possible implementation, the distribution reliability value of each sample can be adaptively adjusted based on the sample bias predicted by the updated model, thereby updating the initial weights of the samples for iterative optimization training. For example, for a regression model, the sample residuals predicted by the updated model can be used as the new distribution reliability value of the samples, and for a classification model, the sample loss value predicted by the standard model can be used as the new distribution reliability value of the samples.
[0049] In another possible implementation, the sample bias predicted by the updated model can be fused with other methods to adaptively adjust the distribution reliability value of each sample. Then, the first distribution reliability value of each sample can be determined based on the sample bias predicted by the updated model. The first distribution reliability value and the sub-distribution reliability value of each sample are fused to obtain the distribution reliability value of each sample. Wherein, the sub-distribution reliability value can be one or more, and the sub-distribution reliability value is obtained by at least one of the following methods, each method corresponding to a different sub-distribution reliability value.
[0050] Method 1: Determine the reliable value of each sample's sub-distribution based on the consistency of the sample's label with that of its nearest neighbor samples; Method 1: Determine the reliable value of the sub-distribution for each sample based on the prediction loss or confidence level of a standard model. Method 1: Determine the reliable value of the sub-distribution for each sample based on the distribution density of the region where the sample is located in the feature space.
[0051] This step is performed after several rounds of the iterative optimization training steps described above. It can be pre-configured or determined by judging the model optimization parameters.
[0052] S4, End of Training After each round of iterative optimization training, it is determined whether the model training meets the preset conditions. If the preset conditions are met, the model training ends, and the final trained, highly robust machine learning model is output. If the preset conditions are not met, the model training ends, and the next round of iterative optimization training steps is executed based on the updated sample weights.
[0053] In one example, if the model converges, the preset condition is met; otherwise, the preset condition is not met. Specifically, the model converges when its performance metrics (such as RCU, ACU, etc.) on the validation set no longer improve or reach the maximum number of iterations.
[0054] The following specific example illustrates the implementation process of the present invention in detail.
[0055] refer to Figure 3 Start: Input the original training dataset D={(xi,yi)} with prior distribution bias; where: xi and yi are the sample value and label value of the i-th sample, respectively.
[0056] Weight initialization: The distribution reliability value si for each sample xi is calculated using the "nearest neighbor label consistency" method. Specifically, for each sample xi, its K nearest neighbors in Euclidean space are found, and the proportion of these neighbors with the same label as yi is calculated as si. The distribution reliability value si is mapped to the initial weight wi using the sigmoid function.
[0057] Iterative optimization training: Set the current iteration number t=0, and the initial weight of sample xi is wi.
[0058] S21. Using {(xi, yi, wi)} as the training sample set, train a logistic regression model by minimizing the weighted cross-entropy loss function.
[0059] S22. Use the trained logistic regression model to predict all samples xi and obtain the predicted values. Calculate the loss value of the sample. As a measure of the bias of sample i.
[0060] S23. Substitute the sample bias into the Huber weight function to update the sample weights.
[0061] Determine the training status: After completing one round of iterative optimization training, determine whether the model has converged (e.g., the AUC score of the model on the validation set improves by less than 0.001 within 3 consecutive rounds, or the maximum number of iterations has been reached). If it has not converged, execute the next round of iterative optimization training based on the current sample weights; if it has converged, terminate the loop and output the finally trained robust machine learning model.
[0062] Feedback optimization: After completing 3 rounds of iterative optimization training, the loss value of the current model's samples is fed back to the sample weight initialization step to adaptively adjust the distribution reliability value of each training sample, thereby adjusting the initial weight of the samples, and executing the iterative optimization training step based on the initial weight of the samples.
[0063] Those skilled in the art will understand that the modules in the above-described device embodiments can be distributed throughout the device as described, or they can be modified accordingly and distributed in one or more devices different from the above embodiments. The modules in the above embodiments can be combined into one module, or they can be further divided into multiple sub-modules.
[0064] The following describes embodiments of the electronic device of the present invention, which can be considered as implementations of the physical form of the methods and apparatus embodiments of the present invention described above. Details described in the embodiments of the electronic device of the present invention should be considered as supplements to the methods or apparatus embodiments described above; details not disclosed in the embodiments of the electronic device of the present invention can be implemented with reference to the methods or apparatus embodiments described above.
[0065] Figure 4 This is a structural block diagram of an exemplary embodiment of an electronic device according to the present invention. Figure 4 The electronic device shown is merely an example and should not impose any limitation on the functionality and scope of use of the embodiments of the present invention.
[0066] like Figure 4 As shown, the electronic device 400 of this exemplary embodiment is manifested in the form of a general data processing device. The components of the electronic device 400 may include, but are not limited to: at least one processing unit 410, at least one storage unit 420, a bus 430 connecting different electronic device components (including storage unit 420 and processing unit 410), a display unit 440, etc.
[0067] The storage unit 420 stores a computer-readable program, which may be source code or read-only program code. The program can be executed by the processing unit 410, causing the processing unit 410 to perform the steps of various embodiments of the present invention. For example, the processing unit 410 can perform actions such as... Figure 2 The steps are shown.
[0068] Bus 430 can represent one or more of several types of bus structures, including a memory cell bus or memory cell controller, a peripheral bus, a graphics acceleration port, a processing unit, or a local bus using any of the various bus structures.
[0069] Electronic device 400 can also communicate with one or more external devices 100 (e.g., keyboard, monitor, network device, Bluetooth device, etc.), enabling users to interact with electronic device 400 via these external devices 100, and / or enabling electronic device 400 to communicate with one or more other data processing devices (e.g., router, modem, etc.). This communication can be performed via input / output (I / O) interface 450, and also via network adapter 460 to one or more networks (e.g., local area network (LAN), wide area network (WAN), and / or public network). Network adapter 460 can communicate with other modules of electronic device 400 via bus 430.
[0070] This invention also provides a computer program product, including a computer program that, when executed by a processor, implements the method described in any of the above embodiments. That is: Sample weight initialization: Collect a training sample set with prior distribution bias and obtain the distribution reliability value of each sample. Determine the initial weight of each sample based on the distribution reliability value. Wherein: The distribution reliability value reflects the reliability of the sample from the overall distribution of the training sample set. The higher the distribution reliability value of the sample, the higher the initial weight. Iterative optimization training: Starting from the initial training weights, perform at least one round of iterative optimization training on the model. Wherein: In each round of iterative optimization training, update the model parameters using the current sample weights and dynamically update the weights of all samples according to the sample bias predicted by the updated model. The sample bias is used to measure the degree of inconsistency between the true value of the sample and the predicted value of the model. The larger the sample bias, the lower the weight of the sample after the update. Feedback optimization: After executing one or more rounds of the iterative optimization training steps, feed back the sample bias predicted by the updated model to the sample weight initialization step to adaptively adjust the distribution reliability value of each training sample and execute the iterative optimization training step. End training: After each round of iterative optimization training, determine whether the model training meets the preset conditions. If the preset conditions are met, end the model training.
[0071] In summary, the present invention can be implemented by methods, apparatus, systems, electronic devices, or computer-readable media that execute computer programs. In practice, some or all of the functions of the present invention can be implemented using general-purpose data processing devices such as microprocessors or digital signal processors (DSPs).
[0072] The specific embodiments described above further illustrate the purpose, technical solution, and beneficial effects of the present invention. It should be understood that the present invention is not inherently related to any specific computer, virtual device, or electronic device, and various general-purpose devices can also implement the present invention. The above descriptions are merely specific embodiments of the present invention and are not intended to limit the present invention. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of the present invention should be included within the protection scope of the present invention.
Claims
1. A model training system based on weight initialization, characterized in that, The system includes: The sample weight initialization module is used to collect training sample sets with prior distribution offsets and obtain the distribution reliability value of each sample, and determine the initial weight of each sample based on the distribution reliability value; wherein: the distribution reliability value reflects the reliability of the sample coming from the overall distribution of the training sample set, and the higher the distribution reliability value of the sample, the higher the initial weight. The iterative optimization training module is used to perform at least one round of iterative optimization training on the model, starting from the initial training weights. In each round of iterative optimization training, the model parameters are updated using the current sample weights, and the weights of all samples are dynamically updated according to the sample bias predicted by the updated model. The sample bias is used to measure the degree of inconsistency between the true value of the sample and the predicted value of the model. The larger the sample bias, the lower the weight of the sample after the update. The feedback optimization module is used to feed back the sample bias predicted by the updated model to the sample weight initialization module after performing one or more rounds of iterative optimization training, adaptively adjust the distribution reliability value of each training sample, and input it into the iterative optimization training module. The End Training module is used to determine whether the model training meets the preset conditions after each round of iteration and optimization training. If the preset conditions are met, the model training ends.
2. The system according to claim 1, characterized in that, The feedback optimization module is used to adaptively adjust the distribution reliability value of each sample based on the sample bias predicted by the updated model. Alternatively, the feedback optimization module is used to determine a first distribution reliability value for each sample based on the sample bias predicted by the updated model, and to fuse the first distribution reliability value and the sub-distribution reliability value for each sample to obtain a distribution reliability value for each sample; wherein: the sub-distribution reliability value is obtained through at least one of the following methods: The reliability value of each sample's sub-distribution is determined based on the degree of consistency between the sample's label and that of its nearest neighbor samples; The reliability value of the sub-distribution for each sample is determined based on the prediction loss or confidence level of a standard model for the sample. The reliable value of the sub-distribution for each sample is determined based on the distribution density of the region where the sample is located in the feature space.
3. The system according to claim 1, characterized in that, The weight initialization module obtains the reliable distribution value of each sample through one or a combination of the following methods: The distribution reliability value of each sample is determined based on the degree of consistency between the sample and the labels of its nearest neighbor samples; The reliable distribution value for each sample is determined based on the prediction loss or confidence level of a standard model. The reliable distribution value of each sample is determined based on the distribution density of the region where the sample is located in the feature space.
4. The system according to any one of claims 1-3, characterized in that, The weight initialization module maps the reliable distribution value of each sample to the initial weight of each sample using a monotonic function.
5. The system according to claims 1-3, characterized in that, The iterative optimization module dynamically updates the weights of all samples using a robust weight function to reflect the sample bias predicted by the updated model.
6. A model training method based on weight initialization, characterized in that, The method includes: Sample weight initialization: Collect a training sample set with prior distribution offset and obtain the distribution reliability value of each sample. Determine the initial weight of each sample based on the distribution reliability value; wherein: the distribution reliability value reflects the reliability of the sample coming from the overall distribution of the training sample set, and the higher the distribution reliability value of the sample, the higher the initial weight. Iterative optimization training: Starting from the initial training weights, the model is subjected to at least one round of iterative optimization training, wherein: in each round of iterative optimization training, the model parameters are updated using the current sample weights, and the weights of all samples are dynamically updated according to the sample bias predicted by the updated model; the sample bias is used to measure the degree of inconsistency between the true value of the sample and the predicted value of the model, and the larger the sample bias, the lower the weight of the sample after the update. Feedback optimization: After performing one or more rounds of the iterative optimization training steps, the sample bias predicted by the updated model is fed back to the sample weight initialization step to adaptively adjust the distribution reliability value of each training sample and perform the iterative optimization training steps. End training: After each round of iterative optimization training, determine whether the model training meets the preset conditions. If the preset conditions are met, end the model training.
7. The method according to claim 6, characterized in that, The distribution reliability value of each sample is adaptively adjusted based on the sample bias predicted by the updated model. Alternatively, based on the sample bias predicted by the updated model, a first distribution reliability value is determined for each sample. The first distribution reliability value and the sub-distribution reliability value for each sample are then fused to obtain the distribution reliability value for each sample; wherein the sub-distribution reliability value is obtained through at least one of the following methods: The reliability value of each sample's sub-distribution is determined based on the degree of consistency between the sample's label and that of its nearest neighbor samples; The reliability value of the sub-distribution for each sample is determined based on the prediction loss or confidence level of a standard model for the sample. The reliable value of the sub-distribution for each sample is determined based on the distribution density of the region where the sample is located in the feature space.
8. The method according to claim 6, characterized in that, In the sample weight initialization step, the reliable distribution value of each sample is obtained through one or a combination of the following methods: The distribution reliability value of each sample is determined based on the degree of consistency between the sample and the labels of its nearest neighbor samples; The reliable distribution value for each sample is determined based on the prediction loss or confidence level of a standard model. The reliable distribution value of each sample is determined based on the distribution density of the region where the sample is located in the feature space.
9. The method according to any one of claims 6-8, characterized in that, The reliable distribution value of each sample is mapped to the initial weight of each sample using a monotonic function.
10. The method according to claims 6-8, characterized in that, The sample bias predicted by the updated model is dynamically updated using a robust weight function to update the weights of all samples.
11. An electronic device, comprising: processor; as well as A memory storing computer-executable instructions, which, when executed, cause the processor to perform the method according to any one of claims 6 to 10.
12. A computer program product, comprising a computer program, characterized in that, When the computer program is executed by a processor, it implements the method of any one of claims 6 to 10.
