A small sample data expansion method based on a bidirectional feedback mechanism
Patent Information
- Application Number
- CN202611407411.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-09-11
- Publication Date
- 2026-10-13
AI Technical Summary
[0004]本发明要解决的主要技术问题是:基于特征迁移学习的小样本数据扩充方法中,源域大规模文本与目标域小样本之间存在语义偏差,预训练模型学习到包含错误的特征规律,且单向扩充过程无法反馈校正,从样本粒度计算偏差不准确、粗粒度剔除又丢失有效信息,导致扩充后的数据存在语义偏移、质量不高
第一,针对源域大规模文本与目标域小样本之间语义偏差导致预训练模型学习错误特征规律的问题,本发明通过将特征按属性划分为互斥且完备的特征类,在特征类粒度上基于α散度计算特征尺度散度,实现疑似无关特征的细粒度区域定位,避免了从样本粒度整体计算偏差不准确的问题,有利于精准定位产生错误特征规律的无关特征所在区域。
Smart Images

Figure CN122903909A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the fields of data processing and machine learning technology, specifically to a method for augmenting small sample data based on a bidirectional feedback mechanism. Background Technology
[0002] In few-shot learning scenarios, due to the uneven distribution of data and insufficient feature coverage, the model cannot provide enough effective information to learn general rules related to the task. Traditional few-shot data augmentation methods generally suffer from weak generalization ability and are prone to overfitting. Meta-learning methods designed around few-shot learning, while endowing the model with the ability to quickly adapt to few-shot tasks through a multi-task training framework, have a generalization effect that is highly dependent on the distribution matching degree during the meta-training stage. In scenarios where source domain samples are scarce, the model is prone to capturing background noise in the training samples and misjudging false associations as core rules of the task, resulting in poor model performance. In few-shot scenarios, text data is the most common, and feature-based transfer learning methods are usually used to address the above shortcomings: the pre-trained model extracts the core semantic features of the source domain's few samples on large-scale text data through pre-training tasks such as masked language modeling. The core semantic features are input into the pre-trained model to generate several general feature rules. Then, each record in the few samples is expanded into multiple records according to these rules, finally obtaining the expanded large-sample data.
[0003] However, the semantic discrepancy between large-scale text data and small-sample semantics leads to biases in the core semantic features extracted from large-scale text data. The general feature patterns generated by the pre-trained model may contain some errors, resulting in a semantic shift between the final large-sample and small-sample data. Furthermore, feature transfer learning is a one-way expansion process; this bias cannot be fed back to the next round, leading to low-quality expanded data and impacting model performance on the target task. Adding a backfeedback mechanism to the pre-trained model to correct the semantic bias in the one-way expansion is problematic because the feature patterns only contain some errors. Calculating the data bias at the sample granularity is inaccurate and cannot accurately identify which irrelevant features can generate erroneous feature patterns. Conversely, using a coarse-grained feature classification strategy to locate irrelevant feature regions and directly remove suspected erroneous features results in the loss of effective information, further reducing model performance. Summary of the Invention
[0004] The main technical problem this invention aims to solve is that in small-sample data augmentation methods based on feature transfer learning, there is a semantic bias between the large-scale text in the source domain and the small samples in the target domain. The pre-trained model learns feature patterns containing errors, and the unidirectional augmentation process cannot provide feedback correction. Inaccurate bias calculations at the sample granularity and the loss of effective information through coarse-grained removal result in semantic shifts and low-quality augmented data. Secondary technical problems include: insufficient sample size in the target domain in small-sample scenarios leads to distortion of traditional divergence metrics; continuous and discrete features are difficult to process uniformly within the same framework; irrelevant features contain both complete noise and features retaining some effective information, and indiscriminately deleting all irrelevant features degrades model performance.
[0005] To achieve the above objectives, the present invention provides the following technical solution: a method for augmenting small sample data based on a bidirectional feedback mechanism, comprising the following steps: S1. Extract features from the source and target domain text data. Based on whether the feature values can be infinitely subdivided into continuous and discrete data features, the continuous features are normalized by Z-score, and the discrete features are encoded by binary or one-hot encoding. They are then divided into several mutually exclusive and complete feature classes according to the feature attributes. S2. Calculate the feature scale divergence of each feature class between the source domain and the target domain. The feature scale divergence is constructed based on α divergence, where α is a balance coefficient associated with the sample size of the target domain. Compare the feature scale divergence of each feature class with a dynamic threshold. Feature classes that are greater than the threshold are judged as suspected irrelevant feature regions. S3. For each candidate feature in the suspected irrelevant feature region, calculate the normalized contribution degree through a 5-fold cross-ablation experiment, calculate the feature directional β divergence, and construct a two-dimensional joint decision plane based on the contribution degree threshold and the divergence threshold. Features that satisfy both the contribution degree below the threshold and the feature directional divergence above the threshold are judged as strongly irrelevant features and removed, while the rest are judged as weakly irrelevant features. S4. Combine the weakly irrelevant features with the remaining features and input them into the pre-trained model to train and generate expanded samples. Feed the training results back to step S2 to update the dynamic threshold, and back to step S3 to update the contribution threshold and divergence threshold. Repeat steps S2 to S4 until the iteration termination condition is met, and output the expanded small sample dataset.
[0006] The working principle of the above technical solution is as follows: Addressing the semantic deviation problem between the source and target domains, instead of calculating the deviation at the overall sample granularity, features are first divided into mutually exclusive and complete feature classes based on their attributes. At the feature class granularity, feature scale divergence is calculated based on α-divergence to achieve region localization of potentially irrelevant features. α-divergence is adaptively adjusted through a balance coefficient associated with the sample size of the target domain. In small sample scenarios, it enhances the robustness to distribution fitting, while in scenarios with sufficient sample size, it degenerates into traditional JS divergence, thus solving the problem of distortion in traditional divergence measurement under small sample conditions. Based on region localization, candidate features are further quantified from two dimensions: task contribution and semantic deviation. A two-dimensional joint decision plane is constructed, dividing irrelevant features into strongly irrelevant and weakly irrelevant features and processing them differently—strongly irrelevant features are directly eliminated, while weakly irrelevant features are retained and their potential effective information is mined through weight adjustment, thus avoiding the loss of effective information caused by coarse-grained complete deletion. After the pre-trained model is trained, the results are fed back bidirectionally to the feature scale divergence calculation stage and the irrelevant feature classification stage, dynamically updating the threshold parameters. This forms a closed-loop iteration of bias calculation, feature selection, denoising evaluation, and feedback optimization, gradually eliminating semantic bias and achieving unbiased small-sample data augmentation. This technical solution combines fine-grained region localization with precise classification processing and bidirectional feedback dynamic correction, which can remove strong interfering features while retaining effective information. This helps reduce the semantic bias between the target domain and the source domain and improves the quality of the augmented small-sample data.
[0007] Based on the above technical solution, the balance coefficient α in step S2 adopts an adaptive adjustment strategy: when the target domain sample size is less than 100, α is 0.6 to 0.8; when the target domain sample size is sufficient, α is 0.5.
[0008] The underlying principle of this technique is that the balance coefficient α in α-divergence controls the degree of asymmetric weighting of the two probability distributions. When the sample size of the target domain is sparse, the estimation of the target domain probability distribution is unreliable. By biasing α to between 0.6 and 0.8, the adaptability of divergence calculation to small sample distributions can be enhanced, reducing divergence distortion caused by incomplete estimation of the target domain distribution and minimizing the risk of misclassifying effective features as irrelevant features. When the sample size of the target domain is sufficient, the probability distribution estimation tends to be accurate. Setting α to 0.5 degenerates the feature-scale divergence into the traditional JS divergence, maintaining the symmetry and stability of the distribution measurement. This adaptive strategy allows the feature-scale divergence to dynamically adjust the measurement method according to the data size of the target domain, which is beneficial for obtaining reliable semantic bias quantification results under different sample size conditions.
[0009] Based on the above technical solution, the dynamic threshold in step S2 is determined in the following way: 15% of the samples are randomly selected from the source domain data to construct a fixed validation set. The feature scale divergence score of each feature in the validation set is calculated and sorted in ascending order. The 90th, 92nd, 94th, 96th, 98th and 99th percentiles are selected to form a candidate threshold set. For each candidate threshold, feature masking simulation is performed on the validation set and the classification accuracy is calculated. The candidate threshold that makes the validation set accuracy the highest is selected as the dynamic threshold for the current iteration.
[0010] The underlying principle of this limitation is that a fixed threshold cannot adapt to changes in the feature distribution after each iteration due to the removal of irrelevant features and the retention of effective features, easily leading to over- or under-screening. A fixed validation set, constructed by randomly selecting 15% of samples from the source domain, ensures that the threshold evaluation benchmark remains consistent throughout the iteration process, avoiding additional variables introduced by validation set updates. The candidate threshold set selects multiple high percentiles of the feature scale divergence scores, covering different intensities from strict masking (removing only the most severely deviating features) to lenient masking (removing more potentially irrelevant features), ensuring the candidate set fully covers different feature masking strategies. Feature masking simulation is performed for each candidate threshold, i.e., the activation values of features with feature scale divergence higher than the threshold are set to zero, and the classification accuracy on the validation set is calculated. Using actual task performance as an objective basis for threshold selection, the threshold that achieves the highest accuracy is selected as the dynamic threshold for the current iteration. This ensures that the threshold always adapts to the current feature distribution state, facilitating an optimal balance between removing irrelevant features and retaining effective information.
[0011] Based on the above technical solution, the normalized task contribution in step S3 is calculated through a 5-fold cross-ablation experiment: Let the performance index of the original model on the validation set be Pbase, and the model performance after masking candidate features be P\fi. Then the normalized task contribution C(f) = (Pbase - P\fi) / Pbase, and its value range is [-1, 1]. Candidate features with a contribution greater than 0 are excluded from the irrelevant feature division range.
[0012] The underlying principle of this constraint is that the task contribution quantifies the actual direction and degree of each feature's impact on the model's predictive performance. By employing a 5-fold cross-ablation experiment—that is, by sequentially masking each candidate feature and then re-evaluating the model's performance—the magnitude differences in performance metrics and the randomness of a single evaluation in small-sample scenarios can be eliminated, making the contribution assessment more robust. Normalization constrains the contribution value within the [-1, 1] interval, with a clear physical meaning: a contribution value greater than 0 indicates that the feature has a positive contribution to the model, its interference is weak, and it is not an irrelevant feature; direct exclusion can correct initial screening errors in the preceding region localization stage. A contribution value not greater than 0 indicates that the feature has interference, and it is a potentially weakly or strongly irrelevant feature, requiring further differentiation in subsequent two-dimensional decision-making. This contribution calculation method objectively measures the usefulness of features from a task performance perspective, which is beneficial for accurately identifying features that negatively impact model prediction.
[0013] Based on the above technical solution, the feature directional divergence in step S3 is composed of a weighted sum of a probability distribution bias term and a semantic direction bias term: the probability distribution bias term is the average KL divergence between the probability distribution of the candidate feature in the K groups of prediction tasks and the probability distribution of the true label, where K is 5; the semantic direction bias term is the inverse cosine value of the cosine similarity between the vector representation of the candidate feature and the standard semantic vector, normalized by π. The vector representation of the candidate feature is encoded by a pre-trained language model, and the standard semantic vector is constructed based on well-annotated medical text features.
[0014] The underlying principle of this limitation is that relying solely on task contribution cannot fully characterize the semantic quality of features, as contribution reflects the feature's impact on final performance rather than directly measuring the feature's semantic deviation. Feature directional divergence collaboratively measures feature deviation from the model's predictions across two dimensions: probability distribution and semantic direction. The probability distribution deviation term, calculated using the average KL divergence under 5-fold cross-validation, quantifies the feature's deviation from the true semantics at the probability distribution level; a larger deviation indicates a stronger misleading effect of the feature on the model's predictions. The semantic direction deviation term, calculated using the inverse cosine normalized value of the cosine of the angle between the candidate feature vector and the standard semantic vector, measures the feature's directional deviation in the semantic vector space, reflecting the consistency between the feature's semantics and the standard semantics. The weighted sum of these two parts constitutes the feature directional divergence; a larger value indicates a higher degree of semantic deviation and a stronger misleading effect on the model. This dual-dimensional divergence measure comprehensively evaluates feature quality from both probability distribution and semantic direction perspectives, facilitating accurate quantification of the semantic deviation of candidate features.
[0015] Based on the above technical solution, the contribution threshold and divergence threshold are adaptively determined based on the statistical distribution of candidate features on the validation set: the contribution threshold τC = μC - 0.1·σC, where μC and σC are the mean and standard deviation of the contribution of candidate features with a contribution of not greater than 0, respectively; the divergence threshold τD = μD + k'·σD, where μD and σD are the mean and standard deviation of the feature direction divergence of candidate features, respectively, and k' is an adjustment coefficient dynamically adjusted according to the skewness of the feature direction divergence distribution, with a value range of 0.5 to 1.0.
[0016] The underlying principle of this limitation is that fixed thresholds cannot adapt to the feature distribution characteristics of different datasets. Adaptive thresholds based on statistical distribution can automatically determine the hierarchical boundaries according to the feature index distribution of the current data. The contribution threshold is the mean minus 0.1 times the standard deviation, used to define the boundary of features with significantly negative contributions. When the feature contribution is below this threshold, it indicates that it has a strong interference with model training. The scaling coefficient of 0.1 makes the threshold slightly lower than the mean, ensuring that only features with significant interference are included in the strongly irrelevant candidates. The divergence threshold is the mean plus an adjustment coefficient multiplied by the standard deviation. The adjustment coefficient is dynamically adjusted according to the skewness of the divergence distribution in the feature direction. When the distribution is relatively concentrated, the value is close to 0.5, and when the distribution is discrete, the value is close to 1.0, so that the threshold can adapt to distributions with different degrees of skewness and define the boundary of features with severe semantic bias. Based on the above two-dimensional thresholds, a two-dimensional joint decision plane is constructed. Only when a feature simultaneously meets the two conditions of significantly negative contribution and severe semantic bias is it judged as a strongly irrelevant feature; all others are judged as weakly irrelevant features. Two-dimensional joint decision-making can achieve complementarity between the two dimensions: if the judgment is based solely on negative contribution, features with slight semantic bias but weak interference may be misclassified as strongly irrelevant; if the judgment is based solely on severe semantic bias, redundant features that have no significant interference with the model may be misclassified as strongly irrelevant. Dual-condition joint decision-making helps ensure the accurate identification of strongly irrelevant features and avoids the accidental deletion of weakly irrelevant features that still have potential value.
[0017] Based on the above technical solution, in step S4, when the pre-trained model trains the weakly irrelevant features, the feature contribution score of each weakly irrelevant feature is calculated based on the multi-scale matching degree: the matching degree between the weakly irrelevant feature and the pre-constructed reference feature set is calculated at M scales respectively, where M is 3, corresponding to word-level, phrase-level and sentence-level scales respectively. The multi-scale matching degree is weighted, summed and normalized by combining the weight coefficients of attention terms and matching terms and feature adaptive weights to obtain the feature contribution score of each weakly irrelevant feature. The weight of the weakly irrelevant feature in the pre-trained model is adjusted according to the feature contribution score.
[0018] The underlying technical principle of this limitation is that while weakly irrelevant features may have slight semantic biases, they still retain some effective information relevant to the prediction task. Directly removing them would result in the loss of medical semantic information. The feature contribution score is designed for weakly irrelevant features to quantify their effective contribution to the disease prediction task, providing a quantitative basis for adaptive weight allocation. Multi-scale matching calculates the degree of matching between weakly irrelevant features and the reference feature set at three scales: word-level, phrase-level, and sentence-level. This comprehensively measures the consistency between features and task-related reference features from different semantic granularities, avoiding the one-sidedness of matching evaluation at a single scale. The weight coefficients of the attention term and the matching term are used to adjust the relative importance of the attention mechanism and direct matching in the score. The feature adaptive weight represents the importance of the feature itself. These three factors are combined to perform a weighted sum of the multi-scale matching scores, which is then normalized by the sum of the matching scores of all weakly irrelevant features, giving each weakly irrelevant feature a score reflecting its relatively effective contribution. The weights of weakly irrelevant features in the pre-trained model are adjusted based on the score. Weakly irrelevant features with high contribution have larger weights, while the weights of weakly irrelevant features with low contribution are reduced. This helps to retain potential effective information while suppressing interference, which is beneficial to improving feature utilization and model robustness.
[0019] Based on the above technical solution, the training of the pre-trained model in step S4 is achieved by minimizing the total loss function, which includes bidirectional cross-domain reconstruction loss and task loss: the bidirectional cross-domain reconstruction loss is the sum of the one-way reconstruction loss from the source domain to the target domain and the one-way reconstruction loss from the target domain to the source domain, and each one-way reconstruction loss is calculated based on the cosine distance between the mapped feature vector and the target feature vector; the task loss is the downstream few-sample classification task loss, and the bidirectional cross-domain reconstruction loss and the task loss in the total loss function are weighted by a balancing coefficient λ.
[0020] The underlying principle of this constraint is that the training objective of the pre-trained model is not only to complete the downstream classification task, but also to constrain the semantic consistency between the feature representations of the source and target domains. The bidirectional cross-domain reconstruction loss requires that the mapping function from the source domain to the target domain can generate outputs similar to those of the target domain from the source domain features, and vice versa. This bidirectional reconstruction constraint establishes a closed loop, forcing the features of the source and target domains to be mapped to a unified shared representation space, achieving effective alignment of cross-domain feature distributions. Using cosine distance instead of Euclidean distance to construct the reconstruction loss can adapt to the problems of sparse feature distribution and easily disturbed vector magnitudes in small-sample scenarios. It focuses only on the semantic angle while ignoring vector length differences, thus exhibiting stronger robustness. The task loss, as a strong supervisory signal, ensures that the learned representation is not only aligned but also discriminative for downstream tasks, preventing the trivial solution of representation collapse caused by simply minimizing the reconstruction loss. The balance coefficient λ is used to coordinate the weights of the reconstruction loss and the task loss, enabling the model to achieve a balance between inter-domain alignment and task discriminativeness. By optimizing the learning process by minimizing the total loss function, the feature representations of the source and target domains and the bidirectional mapping function can simultaneously satisfy alignment, semantic preservation, and generalization improvement, which is beneficial for providing reliable constraints for feature scale divergence quantification and irrelevant feature screening.
[0021] Based on the above technical solution, the iteration termination condition is: the feature scale divergence of all feature classes is lower than the dynamic threshold of the current round, and the performance of the model on the validation set tends to be stable. The performance tends to be stable, which means that the accuracy fluctuation of the validation set for three consecutive rounds does not exceed 1%.
[0022] The underlying principle of this limitation is as follows: the goal of the iterative process is to gradually eliminate semantic bias and stabilize model performance, requiring explicit termination conditions to avoid invalid iterations or premature termination. When the feature scale divergence of all feature classes is below the dynamic threshold, it indicates that there are no feature classes with significant semantic shifts under the current feature distribution, and potentially irrelevant feature regions have been eliminated. When the model's accuracy fluctuation on the validation set does not exceed 1% for three consecutive rounds, it indicates that the model performance has stabilized, and further iteration will not bring significant performance improvement. Iteration terminates only when both conditions are met simultaneously, ensuring that semantic bias is sufficiently eliminated while avoiding wasted computational resources from continuing iteration after performance has stabilized. The threshold parameter is locked after convergence and is no longer updated, which helps ensure the stability and reproducibility of the final augmentation result.
[0023] Compared with existing technologies, this invention provides a method for augmenting small sample data based on a bidirectional feedback mechanism, which has the following beneficial effects: First, to address the problem that semantic discrepancies between large-scale text in the source domain and small samples in the target domain lead to pre-trained models learning incorrect feature patterns, this invention divides features into mutually exclusive and complete feature classes according to their attributes. At the feature class granularity, feature scale divergence is calculated based on α divergence to achieve fine-grained region localization of suspected irrelevant features. This avoids the problem of inaccurate overall deviation calculation at the sample granularity and is conducive to accurately locating the regions where irrelevant features that generate incorrect feature patterns are located.
[0024] Second, to address the problem of distortion in traditional divergence measurement caused by insufficient sample size in the target domain in small sample scenarios, this invention adopts an α-adaptive balancing strategy related to the sample size of the target domain. When the sample size is sparse, it enhances the robustness of fitting the small sample distribution, and degenerates into traditional JS divergence when the sample size is sufficient. This is beneficial to obtain reliable semantic bias quantification results under different sample size conditions and reduce the risk of misclassifying effective features as irrelevant features.
[0025] Third, to address the problem of losing effective information caused by coarse-grained removal of suspected erroneous features, this invention constructs a two-dimensional joint decision plane by normalizing task contribution and feature directional divergence. Irrelevant features are divided into strongly irrelevant features and weakly irrelevant features and processed differently. Strongly irrelevant features are directly removed, while weakly irrelevant features are retained and their weights are dynamically adjusted through feature contribution scores. This is beneficial for retaining potential effective information in weakly irrelevant features while removing strongly interfering features, thereby improving feature utilization and model robustness.
[0026] Fourth, to address the problem that the one-way expansion process cannot provide feedback to correct semantic bias, this invention provides bidirectional feedback of the training results of the pre-trained model to the feature scale divergence calculation stage and the irrelevant feature classification stage, dynamically updating the dynamic threshold, contribution threshold and divergence threshold to form a closed-loop iteration, gradually eliminating semantic bias, which helps to reduce the semantic bias between the target domain and the source domain and improve the quality of the expanded small sample data.
[0027] Fifth, addressing the problem that continuous and discrete features are difficult to process uniformly within the same framework, this invention divides features into continuous and discrete types based on whether the feature values can be infinitely subdivided during the feature extraction stage and preprocesses them separately. α divergence supports the unified expression of continuous and discrete forms, which is beneficial for the stable processing of the two types of features within the same framework and improves the consistency of distribution measurement. Attached Figure Description
[0028] Figure 1 This is a flowchart illustrating the steps of a small sample data augmentation method based on a bidirectional feedback mechanism according to the present invention.
[0029] Figure 2 This is a system architecture diagram of a small sample data augmentation method based on a bidirectional feedback mechanism according to the present invention.
[0030] Figure 3 This is a process flow diagram of a small sample data augmentation method based on a bidirectional feedback mechanism according to the present invention. Detailed Implementation
[0031] This invention provides a technical solution, such as Figure 1 As shown, the small sample data augmentation method based on a bidirectional feedback mechanism described in this invention relies on the BAFLES model, which includes a feature extraction and classification module, a Finesse component, a Prelim component, a pre-trained model, and a bidirectional feedback module. The source and target domain datasets are input into the feature extraction and classification module for feature extraction and classification. The processed features are then sequentially processed by the Finesse component for locating suspected irrelevant feature regions, and by the Prelim component for hierarchical location and differentiation of irrelevant features. The processed features are then input into the pre-trained model for training and to generate augmented samples. The training results are fed back to the Finesse and Prelim components through the bidirectional feedback module to dynamically update the threshold parameters, ultimately outputting the augmented small sample dataset.
[0032] like Figure 2 As shown, the overall process of the method of the present invention includes steps S1 to S4.
[0033] In step S1, feature extraction and classification preprocessing are performed on the text data in the source domain dataset and the target domain dataset. The source domain dataset is a large-scale medical text database with sufficient sample size, while the target domain dataset is a small-sample medical text database with limited sample size. The feature extraction and classification module divides the extracted features into two categories: continuous data features and discrete data features, based on whether the feature values can be infinitely subdivided. For continuous data features, Z-score normalization is used for preprocessing to convert the value of each feature into a standard normal distribution form. The calculation formula is x'=(x-μ) / σ, where x' is the standard normal distribution form of the original feature x, x is the original feature value, μ is the mean of the feature in the source domain, and σ is the standard deviation of the feature in the source domain. Normalization eliminates the amplitude differences between different features, ensuring that all continuous features are in the same numerical range, thus ensuring the stability and accuracy of subsequent semantic bias calculations. For discrete data features, due to their limited value space and the lack of continuous comparability in numerical values, Z-score normalization is not performed. For binary discrete features such as gender and smoking history, their original 0 / 1 encoding form is directly retained. For multi-category discrete features such as disease classification and drug type, one-hot encoding is used to expand them into multi-dimensional binary vectors to eliminate possible ordinal biases between categories. After the above preprocessing, based on the core attributes of medical text features, the original feature set is divided into several mutually exclusive and complete feature classes, satisfying that the union of each feature class is all features and the intersection of any two feature classes is empty. For example, the encoded features are divided into symptom feature class, examination indicator feature class, medical history feature class, medication feature class, etc. Subsequently, semantic bias is calculated for each feature class to achieve distribution offset quantification at the single-class feature level, thereby locating which specific feature class has obvious semantic bias.
[0034] In step S2, the Finesse component takes the source domain dataset Ds, the target domain dataset Dt, the α divergence parameter α, the optimal dynamic threshold of the validation set, and the class set C (containing k classes such as C1, C2, etc.) as input. First, it encodes the source domain data Ds and the target domain data Dt respectively through the preset feature extraction module to obtain the corresponding latent feature matrices Hs and Ht. Then, it takes the mean of the feature dimension of Hs according to the class to obtain the source domain feature center μc divided by class. That is, for each class c in the class set C, it calculates the mean of the feature matrix of all samples with the label c in the source domain on the feature dimension, which is used as the source domain feature center of that class. Subsequently, an empty dictionary DFSD is initialized to store the semantic bias score of each target domain sample by category. It iterates through each category in the category set C, and then through each sample feature h of Ht under that category. Softmax is applied to the mean vector of the source domain category mean μc corresponding to category c and the target domain sample feature h to obtain probability distributions p and q. The mixture distribution m is calculated as the average of p and q. Based on α divergence, the divergence between p and m and the divergence between q and m are calculated and averaged to obtain the feature scale divergence FSD of the target domain sample. This is then added to the dictionary DFSD by category. After calculating the feature scale divergence of all samples, a dynamic threshold is used as the global criterion. The target domain samples under each category are iterated through, and samples whose feature scale divergence value does not exceed the dynamic threshold are added one by one to the clean data list Dclean. Finally, the clean dataset Dclean, after noise filtering, is output. Let the source domain dataset be Ds and the target domain dataset be Dt. For the k-th class of features, define the probability distribution of this class of features in the source domain as Pk, which is the frequency of each specific feature value in Ds, and the probability distribution of this class of features in the target domain as Qk. Construct a mixture distribution Mk = 0.5 × (Pk + Qk) of Pk and Qk. The feature scale divergence is constructed based on α divergence and is defined as the average of the α divergence between the source domain feature distribution and the mixture distribution and the target domain feature distribution and the mixture distribution. The mixed distribution satisfies: Meaning of each symbol: : No. The feature scale divergence of semantic features is used to quantify the distribution difference between the source domain and the target domain on this type of feature. : Balance coefficient related to the sample size of the target domain, with a value range of It can be adaptively adjusted according to the sample size; : No. The probability distribution of class features in the source domain dataset; : No. The probability distribution of class features in the target domain dataset; : No. The mixed average probability distribution of class features in the source and target domains; α-divergence operator, used to quantify the information difference between two probability distributions; : The standard symbol for divergence, read as "relative to", represents the relative difference between the left-hand and right-hand distributions.
[0035] α-divergence is used to measure the information difference of different probability distributions on a feature scale, and its applicability is subject to the following conditions: Its continuous form is: with respect to the integration variable First calculate the integrand. Integrate the product, take the natural logarithm of the integral, and finally divide by the coefficient. Its discrete form is: for the support set of discrete random variables Each value in First calculate Summing the results, taking the natural logarithm of the sum, and finally dividing by the coefficient. .
[0036] Formulaic expression of the continuous form of α-divergence: The formula for the discrete form of α divergence is as follows: To avoid computational anomalies caused by a probability of zero, a minimal constant is added to the probability distribution before calculation. .
[0037] α-divergence supports a unified expression for both continuous and discrete forms, and can handle continuous and discrete features respectively. The balance coefficient α adopts an adaptive adjustment strategy: when the target domain sample size is less than 100, α is set to 0.6 to 0.8 to enhance the algorithm's ability to fit and adapt to small sample feature distributions; when the target domain sample size is sufficient, α is set to 0.5 to maintain the stability and symmetry of JS divergence in distribution measurement, at which point the feature scale divergence degenerates into traditional JS divergence.
[0038] The dynamic threshold is determined using a fixed validation set strategy: before initial training, 15% of the samples are randomly selected from the source domain data to construct a validation set. This set remains fixed and unupdated throughout the iteration process, and is only used for dynamic threshold calculation. In each iteration, the feature scale divergence score of each feature representation in the validation set under the current task distribution is calculated first. A higher score indicates a greater deviation between the feature and the semantic distribution of the target task. Then, the feature scale divergence scores of all features are sorted in ascending order, and the 90th, 92nd, 94th, 96th, 98th, and 99th percentiles are selected to form a candidate threshold set. Higher percentiles correspond to a strict masking strategy that removes only a small number of features with the most severe deviations, while lower percentiles correspond to a more lenient masking strategy that removes more potentially irrelevant features. This ensures that the candidate set fully covers different feature masking intensities. For each candidate threshold, a full-process feature masking simulation is performed on the validation set: the activation values of features with feature scale divergence scores higher than the threshold are set to zero, while the remaining features remain unchanged, and the classification accuracy of the model on the validation set under this masking strategy is calculated. The candidate thresholds are iterated from low to high, and the threshold that maximizes the accuracy on the validation set is selected as the optimal dynamic threshold for the current iteration. Since the feature distribution changes after each training round due to the removal of irrelevant features and the retention of effective features, the threshold is dynamically updated based on the recalculated feature scale divergence distribution and accuracy evaluation results on a fixed validation set, ensuring that the threshold always adapts to the current feature distribution state.
[0039] After calculating the feature scale divergence for each feature class, the feature scale divergence value of each feature class is compared with the dynamic threshold of the current round to achieve preliminary screening: for feature classes with a feature scale divergence greater than the dynamic threshold, they are determined to have significant semantic shifts and are likely to contain irrelevant features, and are passed to the next round for fine-grained localization to accurately locate the specific location of irrelevant features; for feature classes with a feature scale divergence not greater than the dynamic threshold, the semantic distribution of the source domain and the target domain is determined to be relatively consistent, and no processing is performed temporarily, thereby locating irrelevant features at the region level and reducing the amount of subsequent computation. After the Finesse component completes the fine-grained feature semantic bias calculation and preliminary screening, the feature scale divergence values and screening results of all feature classes are passed to the Prelim component. The Prelim component sorts the feature scale divergence values in descending order and prioritizes the feature class with the most severe semantic shift as the main source of data noise.
[0040] like Figure 3As shown, in step S3, the Prelim component receives suspected irrelevant feature regions from the Finesse component and performs a two-dimensional quantitative evaluation on each candidate feature to achieve fine-grained hierarchical classification of irrelevant features. The first dimension is the normalized task contribution. A 5-fold cross-ablation experiment is used on the validation set to calculate the normalized task contribution of each candidate feature to eliminate the magnitude difference in performance metrics under small sample scenarios. First, 5-fold cross-validation is performed on the original model on the validation set to obtain the baseline performance Pbase; then, each feature f in the candidate feature set is traversed, and the model performance is re-evaluated through an ablation experiment, i.e., the feature is masked, to obtain the performance P\fi after masking the feature. The normalized contribution is then defined as C(f) = (Pbase - P\fi) / Pbase, and the value range of this metric is constrained to [-1, 1]. Features with C(f) ≤ 0 are selected from the candidate set to form the actual irrelevant feature set irr, which is used to correct the initial screening misjudgment of the Finesse component. A value greater than 0 for C(f) indicates that the feature has a positive contribution to the model, has weak interference, and belongs to weak irrelevant features or effective features, and is directly excluded from the scope of irrelevant feature classification; a value not greater than 0 for C(f) indicates that the feature has interference, and is a potential weakly irrelevant or strongly irrelevant feature, which will be further distinguished in the subsequent two-dimensional decision.
[0041] The second dimension is feature orientation divergence, which integrates probability distribution bias and semantic vector orientation bias, and embeds the feature association weight set {wi} output by the Finesse component to achieve a precise measurement of the degree of semantic deviation. The Prelim component takes the candidate irrelevant feature set output by the Finesse component, the model to be evaluated, the validation set, the feature association weight set {wi}, the feature vector set {vi}, the standard semantic vector vst, and the balance coefficient β as input. Feature orientation divergence is jointly constructed by the feature association weight wf and two bias terms, i.e. Candidate features The feature direction β divergence is used to comprehensively quantify the semantic deviation of features from both probability distribution and semantic direction dimensions.
[0042] Candidate features The feature association weight, output by the Finesse component, characterizes the strength of the association between the feature and the disease label.
[0043] The number of task groups to be predicted is set to 5, corresponding to 5-fold cross-validation groups.
[0044] Candidate features In the Probability distribution in group prediction tasks. Candidate features The probability distribution corresponding to the real labels.
[0045] The Kullback-Leibler (KL) divergence operator is used to quantify the degree of difference between two probability distributions. (Symbol: KL) This is the standard divergence operator, read as "relative to".
[0046] This is a balance coefficient related to the sample orientation, used to adjust the weight of the semantic orientation bias term in the overall divergence.
[0047] It is an inverse cosine function.
[0048] This is the cosine similarity function, used to calculate the cosine similarity between two vectors.
[0049] Candidate features The vector representation is obtained by encoding from a pre-trained language model.
[0050] These are standard semantic vectors, constructed based on well-annotated medical text features.
[0051] Pi is a constant used to normalize the arccosine value to π. Interval.
[0052] The feature orientation β divergence consists of two weighted bias terms based on the feature association weights: the first part is the probability distribution bias term, i.e., the bias towards the feature association weights. The prediction task calculates the KL divergence between the probability distribution of candidate features and the corresponding true label probability distribution, and then takes the average value to quantify the degree of deviation of the features from the true semantics at the probability distribution level. The second part is the semantic direction deviation term, which is calculated by first calculating the cosine similarity between the candidate feature vector and the standard semantic vector, taking the inverse cosine value, and then dividing by... Perform normalization, then multiply by the balance coefficient. This is used to quantify the degree of directional deviation of features in the semantic vector space. The two deviation terms are added together and then multiplied by the feature association weight. The final feature direction β divergence value is obtained. The larger the value, the higher the degree of deviation of the feature semantics and the stronger the misleading effect on the model.
[0053] After obtaining the normalized contribution and feature directional divergence for each candidate irrelevant feature, a two-dimensional adaptive threshold is constructed based on the statistical properties of the validation set features. For all features in the actual irrelevant feature set `irr`, the mean μC and standard deviation σC of the normalized contribution, and the mean μD and standard deviation σD of the feature directional divergence are calculated respectively. The mean is used to characterize the overall distribution level of the feature indicators, and the standard deviation is used to reflect the dispersion of the feature indicators. The combination of the two is used to avoid the bias caused by a single statistic, ensuring that the threshold can adapt to the feature distribution characteristics of the current dataset. Two core thresholds are set: the first is the lower bound threshold for contribution, τC = μC - 0.1 × σC, where the scaling factor of 0.1 is used to define the feature boundary where the contribution is significantly negative. When the feature contribution is lower than this threshold, it indicates that the feature has a strong interference with model training. The second is the upper bound threshold for feature directional divergence, τD = μD + k'·σD, where k' is an adjustment coefficient dynamically adjusted according to the skewness of the feature directional divergence distribution, with a value ranging from 0.5 to 1.0. If the semantic bias feature distribution is relatively concentrated, the value is close to 0.5; if the distribution is discrete, the value is close to 1.0. This threshold is used to define the feature boundary where the semantic bias is severe. When the feature directional divergence is higher than this threshold, it indicates that the semantics deviate far from the true target.
[0054] Based on the aforementioned dual-dimensional thresholds, a two-dimensional joint decision plane is constructed, and explicit feature classification rules are formulated: a feature is only classified as strongly irrelevant and included in the strongly irrelevant feature set Fstrong if it simultaneously satisfies two conditions: its contribution is below the contribution threshold τC and its directional divergence is above the divergence threshold τD. All other features in the actual irrelevant feature set Irr that do not belong to the strongly irrelevant feature set are classified as weakly irrelevant and included in the weakly irrelevant feature set Fweak. Finally, the strongly irrelevant feature set and the weakly irrelevant feature set are output, completing the fine-grained classification. Since a single-dimensional indicator cannot fully reflect the irrelevance of features, the two-dimensional joint decision-making can achieve complementarity: if only a negative contribution is used for judgment, features with slight semantic bias but weak interference may be misclassified as strongly irrelevant; if only a severe semantic bias is used for judgment, redundant features that have no significant interference to the model may be misclassified as strongly irrelevant. Strongly irrelevant features are those with severe semantic bias, lacking any effective information for the prediction task and directly misleading the model to learn incorrect patterns. They are often generated by data labeling errors, collection noise, or irrelevant interference factors, and have no potential value. These features are directly removed from the feature set. Weakly irrelevant features, on the other hand, have slight semantic bias but still retain some effective information relevant to the prediction task. They have a weak correlation with the target task, are not entirely noise, and possess some usable value. These features are retained and trained in the pre-trained model by iteratively adjusting their weights. While removing strongly irrelevant features, the Prelim component feeds back the weakly irrelevant features and their location information (including feature direction β divergence values and normalized contribution scores) to the BAFLES model. This allows the pre-trained model to adjust the contribution weights of the weakly irrelevant features, effectively reducing the loss of effective information in small sample scenarios.
[0055] In step S4, weakly irrelevant features are combined with the remaining features and input into the pre-trained model for training, generating augmented samples. The pre-trained model, using a Transformer architecture, trains the data to achieve unbiased small-sample data augmentation from the source domain to the target domain. The pre-trained model receives the localization of weakly irrelevant features from the Prelim component, assigns the same feature contribution to each weakly irrelevant feature in the first round, and trains it using the pre-trained model to obtain experimental results that retain the weakly irrelevant features. These results are then used as the baseline. To quantify the effective contribution of weakly irrelevant features in disease prediction tasks, a feature contribution scoring mechanism is designed. For any weakly irrelevant feature f, its contribution score is calculated based on a multi-scale matching function: the matching degree between the weakly irrelevant feature and the pre-constructed reference feature set is calculated at M scales, where M is 3, corresponding to the word level, phrase level, and sentence level, respectively. The multi-scale matching function combines the weight coefficients λ∈[0,1] of the attention term and the matching term, as well as the adaptive weight w(f) corresponding to the feature, where λ represents the weight coefficients of the attention term and the matching term, and w(f) represents the importance of the feature itself. After weighted summation of the matching degrees at each scale, the result is normalized by dividing by the sum of the matching degrees of all weakly irrelevant features with the reference feature set at multiple scales, thus obtaining the feature contribution score of each weakly irrelevant feature. The weights of the weakly irrelevant features in the pre-trained model are adjusted according to this score. Weakly irrelevant features with high contribution retain larger weights, while the weights of weakly irrelevant features with low contribution are attenuated, thereby suppressing interference while exploring the potential role of weakly irrelevant features.
[0056] The training of the pre-trained model is achieved by minimizing the total loss function, L= +λ×Ltask, where Let Ltask be the total bidirectional cross-domain reconstruction loss, λ be the loss from the downstream small-sample disease prediction task, and λ be a balancing coefficient used to coordinate the weights of the reconstruction loss and the task loss. The total bidirectional cross-domain reconstruction loss, based on the semantic alignment requirements of the source and target domain features, is further decomposed into the sum of the unidirectional reconstruction loss from the source domain to the target domain and the unidirectional reconstruction loss from the target domain to the source domain, i.e., the total bidirectional cross-domain reconstruction loss. One-way reconstruction loss from source domain to target domain: One-way reconstruction loss from target domain to source domain: in: The total loss for bidirectional cross-domain reconstruction is used to constrain the semantic consistency and inter-domain distribution alignment of the feature representations of the source and target domains.
[0057] The loss is the one-way reconstruction loss from the source domain to the target domain, which measures the semantic deviation after the source domain features are mapped to the target domain.
[0058] The loss is the one-way reconstruction loss from the target domain to the source domain, which measures the semantic deviation after the target domain features are mapped to the source domain.
[0059] This represents the total number of samples in the source domain.
[0060] This represents the total number of samples in the target domain.
[0061] For the first The feature vectors of the source domain samples.
[0062] For the first The feature vector of a target domain sample.
[0063] The feature mapping function from the source domain to the target domain. This is the set of learnable parameters corresponding to the mapping function.
[0064] The feature mapping function from the target domain to the source domain. This is the set of learnable parameters corresponding to the mapping function.
[0065] Let be the cosine similarity function between two feature vectors.
[0066] The cosine distance is used to measure the degree of difference between features in the semantic direction, focusing only on the semantic angle and ignoring the difference in vector length.
[0067] The total loss of bidirectional cross-domain reconstruction is the sum of the unidirectional reconstruction loss from the source domain to the target domain and the unidirectional reconstruction loss from the target domain to the source domain. Each unidirectional reconstruction loss is constructed using cosine distance: for all samples within the domain, the source features are first mapped to the target domain using the corresponding mapping function, the cosine similarity between the mapped feature vector and the target feature vector is calculated, and then the cosine distance is obtained by subtracting the cosine similarity from 1. Finally, the average of the cosine distances for all samples is taken to obtain the unidirectional reconstruction loss in that direction. Through the closed-loop constraint of bidirectional reconstruction, the features of the source and target domains are forced to be mapped to a unified shared representation space, achieving effective alignment of cross-domain feature distributions.
[0068] The reconstruction loss is constructed using cosine distance instead of Euclidean distance, which effectively adapts to the problems of sparse feature distribution and vector magnitude susceptibility to noise interference in small sample scenarios. It focuses only on semantic angles and ignores vector length differences, thus exhibiting stronger robustness. By calculating the average cosine distance between the bidirectional mapped features and the target features, semantic consistency and inter-domain distribution alignment during the cross-domain mapping process can be constrained, enabling the model to learn stable and universal feature representations even under small sample conditions. The task loss is calculated on the source domain feature set after small sample augmentation, ensuring that the learned representation is not only aligned but also discriminative for downstream tasks, preventing representation collapse caused by simply minimizing the reconstruction loss. The effectiveness of the above total loss function can be demonstrated from the following three aspects: First, minimizing the bidirectional cross-domain reconstruction loss. This leads to representation space alignment. The loss term requires a reconstructor from the source domain to the target domain. The ability to generate an output similar to the target domain feature representation Zt from the source domain feature representation Zs is similar to the requirement for a reconstructor from the target domain to the source domain. The ability to generate outputs similar to Zs from Zt establishes a closed loop through this bidirectional reconstruction constraint, i.e., Zs→ ≈Zt→ ≈Zs. If the feature distributions of the two domains differ significantly, the reconstructor cannot achieve bidirectional transformation with low error, therefore minimizing... The process essentially optimizes the feature extractor and reconstructor to reduce the distributional difference between Zs and Zt, i.e., to align the representation spaces. Second, minimizing the task loss (Ltask) ensures semantic discriminativity. The task loss, by enhancing task supervision on the data, ensures that the learned representation is not only aligned but also discriminative for downstream tasks. Without the task loss, simply minimizing the reconstruction loss might lead to trivial solutions that collapse the representation, such as mapping all features to the same constant point, where the reconstruction error is zero, but the representation is meaningless. The task loss, as a strong supervisory signal, prevents this collapse, forcing the representation to contain sufficient class semantic information to complete the classification task, thus ensuring semantic preservation. Third, joint optimization promotes generalization ability. Combining the bidirectional reconstruction loss and the task loss for joint training is key to the model's good performance in the target domain. By minimizing... This approach aligns features between the source and target domains. By minimizing the Ltask, the model is trained to accurately classify on labeled source domain data. Because the target data features are aligned, the model performs feature classification within the feature generator of the shared feature space. Therefore, this classifier can be directly applied to the target data, enabling the model to achieve powerful recognition capabilities even without having seen the target domain labels, thus improving generalization ability.
[0069] The Prelim component uses a set of threshold parameters for iteratively updating the weights of weakly irrelevant features. Following a fixed validation set strategy, these parameters are automatically optimized using grid search and the minimum loss criterion before each iteration, based on a 15% fixed validation set randomly selected from the source domain. This set of parameters comprises four values: the upper limit of divergence tolerance τmid for the medium contribution echelon and its retained weight wmid, and the upper limit of divergence tolerance τlow for the low contribution echelon and its retained weight wlow, always satisfying the logical constraints of τmid≥τlow and wmid≥wlow. At the start of each search, a complete forward and backward propagation is performed on the validation set based on the current model parameters to calculate the contribution of each feature to the model output. The mean value within the validation set is then normalized to a minimum value, ensuring that the contribution value of each feature falls within the [0,1] interval. Subsequently, the contribution distribution on the current validation set is statistically analyzed. The lower quartile is used as the boundary between the low and medium contribution echelons, and the upper quartile is used as the boundary between the medium and high contribution echelons, thus dividing the features into high, medium, and low contribution echelons. A search space is constructed for the candidate threshold set: For the tolerance upper limit candidate values, the distribution of the divergence values of all detectable features in the validation set is extracted, and the 60th, 70th, 75th, 80th, 85th, and 90th quantiles are used to form the candidate pool. Among the retained weight candidate values, the medium-contribution retained weights are selected in the range of 0.3 to 0.8 with a step size of 0.1, forming the candidate pool; the low-contribution retained weights are selected in the range of 0.1 to 0.5 with a step size of 0.1, forming the candidate pool. When generating candidate parameter schemes, both the medium and low tolerance upper limits are selected from the candidate pools, and all combinations satisfying τmid ≥ τlow are traversed. The retained weights are independently selected from their respective candidate pools. For each candidate scheme, simulated weighting is performed on the validation set: high-contribution features retain their original activation values; for medium-contribution features, if their divergence value is less than τmid, the activation value is multiplied by wmid, otherwise set to zero; for low-contribution features, if their divergence value is less than τlow, the activation value is multiplied by wlow, otherwise set to zero. After processing, the total loss of the model on the validation set is calculated. After all candidate solutions have been tested, the set of parameters that minimizes the total loss is selected as the formal threshold for this round. If multiple solutions have the same loss value, the one with the smaller upper limit of the medium contribution tolerance is selected first. If they are still the same, the one with the smaller upper limit of the low contribution tolerance is selected, so as to screen irrelevant features as strictly as possible.
[0070] After one round of formal training, the training results are fed back bidirectionally to the Finesse and Prelim components. The Finesse component recalculates the feature semantic bias based on the experimental results, i.e., recalculates the feature scale divergence of each feature class, and re-identifies and filters potentially irrelevant features based on the dynamic threshold learned from the validation set. The Prelim component dynamically optimizes the feature removal threshold and weight decay coefficient by comparing the deviation between the actual output and the expected target, combined with the real-time performance of downstream tasks, and adaptively adjusts the suppression strength of different features to avoid the accidental deletion of potentially effective information. If the model performance after the current adjustment still does not reach the optimal expectation, the proportion of effective feature weights is adaptively reduced according to the magnitude of the performance deviation to prevent effective features from excessively dominating the overall feature distribution, thereby alleviating the problems of model overfitting and feature bias, and enabling the model to learn more general feature representations. Simultaneously, the model's loss on the fixed validation set is re-evaluated and compared with the loss at the end of the previous round. If the loss in this round increases significantly compared to the previous round and exceeds the preset tolerance range, it indicates that the feature distribution has shifted significantly after training, and the search space of the current threshold parameter may be too loose. It needs to be narrowed and adjusted in the next search round: shift the entire candidate tolerance upper percentile set to the left by 10%, for example, from [60,70,75,80,85,90] to [50,60,65,70,75,80]. Simultaneously, reduce the upper limits of the search intervals for medium contribution retention weights and low contribution retention weights by 0.1. If the loss change is within the tolerance range or decreases, maintain the original search interval. This dynamic optimization process proceeds synchronously with each iteration until the difference in loss between two adjacent validation sets converges below the preset threshold, at which point the threshold parameter is locked and no longer updated.
[0071] The iteration termination condition is as follows: the feature scale divergence of all feature classes is lower than the dynamic threshold of the current round, and the model's performance on the validation set tends to stabilize. Stable performance means that the accuracy fluctuation on the validation set does not exceed 1% for three consecutive rounds. After each round of sample filtering, the model re-extracts the updated feature set and recalculates the semantic bias of each feature class using the Finesse component. The feature bias distribution and dynamic threshold are dynamically updated, forming a closed-loop iterative process of bias calculation, feature selection, denoising evaluation, and feedback optimization. This iterative process continues until the termination condition is met, at which point irrelevant feature identification and filtering are considered complete, and the expanded small sample dataset is output.
[0072] In a specific implementation scenario, the source domain dataset is a medical text database of common diseases with 1000 samples, and the target domain dataset is a small sample medical text database of rare diseases with 50 samples. The encoded medical texts have a feature dimension of 512, which is divided into four feature classes based on the medical text feature attributes: symptom features, examination indicator features, medical history features, and medication features. The pre-trained language model uses the BERT model with a feature vector dimension of 768. The standard semantic vector is constructed based on 1000 fully annotated medical text features, covering 10 categories of common disease-related features. The model training adopts a dynamic learning rate strategy, with a batch size of 32, weight decay set to 0.01 for high-dimensional feature scenarios and 0.001 for small sample scenarios, a maximum text sequence length limited to 384, a maximum training epoch of 100 epochs with an early stopping mechanism, a 5-epoch learning rate warm-up in the initial training phase, a Dropout probability of 0.2, and a label smoothing coefficient of 0.1. The parameters mentioned above are specific values taken in the embodiments and do not constitute a limitation on the scope of protection of the present invention.
Claims
1. A method for augmenting small sample data based on a two-way feedback mechanism, characterized in that, Includes the following steps: S1. Extract features from the source and target domain text data. Based on whether the feature values can be infinitely subdivided into continuous and discrete data features, the continuous features are normalized by Z-score, and the discrete features are encoded by binary or one-hot encoding. They are then divided into several mutually exclusive and complete feature classes according to the feature attributes. S2. Calculate the feature scale divergence of each feature class between the source domain and the target domain. The feature scale divergence is constructed based on α divergence, where α is a balance coefficient associated with the sample size of the target domain. Compare the feature scale divergence of each feature class with a dynamic threshold. Feature classes that are greater than the threshold are judged as suspected irrelevant feature regions. S3. For each candidate feature in the suspected irrelevant feature region, calculate its normalized contribution and feature direction β divergence through a 5-fold cross-ablation experiment. Construct a two-dimensional joint decision plane based on the contribution threshold and divergence threshold. Features that satisfy both the contribution below the threshold and the feature direction divergence above the threshold are judged as strongly irrelevant features and removed. The rest are judged as weakly irrelevant features. S4. Combine the weakly irrelevant features with the remaining features and input them into the pre-trained model to train and generate expanded samples. Feed the training results back to step S2 to update the dynamic threshold, and back to step S3 to update the contribution threshold and divergence threshold. Repeat steps S2 to S4 until the iteration termination condition is met, and output the expanded small sample dataset.
2. The method for augmenting small sample data based on a bidirectional feedback mechanism according to claim 1, characterized in that, In step S2, the balance coefficient α adopts an adaptive adjustment strategy: when the number of samples in the target domain is less than 100, α is 0.6 to 0.8; when the number of samples in the target domain is sufficient, α is 0.
5.
3. The method for augmenting small sample data based on a bidirectional feedback mechanism according to claim 1, characterized in that, The dynamic threshold in step S2 is determined as follows: 15% of the samples are randomly selected from the source domain data to construct a fixed validation set. The feature scale divergence scores of each feature in the validation set are calculated and sorted in ascending order. The 90th, 92nd, 94th, 96th, 98th, and 99th percentiles are selected to form a candidate threshold set. For each candidate threshold, feature masking simulation is performed on the validation set and the classification accuracy is calculated. The candidate threshold that makes the validation set accuracy the highest is selected as the dynamic threshold for the current iteration.
4. The method for augmenting small sample data based on a bidirectional feedback mechanism according to claim 1, characterized in that, In step S3, the normalized task contribution is calculated through a 5-fold cross-ablation experiment: Let the performance index of the original model on the validation set be Pbase, and the model performance after masking candidate features be P\fi. Then the normalized task contribution C(f) = (Pbase - P\fi) / Pbase, and its value range is [-1, 1]. Candidate features with a contribution greater than 0 are excluded from the irrelevant feature partitioning range.
5. The method for augmenting small sample data based on a bidirectional feedback mechanism according to claim 1, characterized in that, In step S3, the feature directional divergence is composed of a weighted sum of a probability distribution bias term and a semantic direction bias term: the probability distribution bias term is the average KL divergence between the probability distribution of the candidate feature in the K prediction tasks and the probability distribution of the true label, where K is 5; the semantic direction bias term is the inverse cosine value of the cosine similarity between the vector representation of the candidate feature and the standard semantic vector, normalized by π. The vector representation of the candidate feature is encoded by a pre-trained language model, and the standard semantic vector is constructed based on well-annotated medical text features.
6. The method for augmenting small sample data based on a bidirectional feedback mechanism according to claim 4 or 5, characterized in that, The contribution threshold and divergence threshold are adaptively determined based on the statistical distribution of candidate features on the validation set: the contribution threshold τC = μC - 0.1·σC, where μC and σC are the mean and standard deviation of the contribution of candidate features with a contribution of not greater than 0, respectively; the divergence threshold τD = μD + k'·σD, where μD and σD are the mean and standard deviation of the feature directional divergence of candidate features, respectively, and k' is an adjustment coefficient dynamically adjusted according to the skewness of the feature directional divergence distribution, with a value ranging from 0.5 to 1.
0.
7. The method for augmenting small sample data based on a bidirectional feedback mechanism according to claim 1, characterized in that, In step S4, when the pre-trained model trains the weakly irrelevant features, the feature contribution score of each weakly irrelevant feature is calculated based on the multi-scale matching degree: the matching degree between the weakly irrelevant feature and the pre-constructed reference feature set is calculated at M scales respectively, where M is 3, corresponding to word-level, phrase-level and sentence-level scales respectively. The multi-scale matching degree is weighted, summed and normalized by combining the weight coefficients of attention terms and matching terms and feature adaptive weights to obtain the feature contribution score of each weakly irrelevant feature. The weight of the weakly irrelevant feature in the pre-trained model is adjusted according to the feature contribution score.
8. The method for augmenting small sample data based on a bidirectional feedback mechanism according to claim 1, characterized in that, In step S4, the training of the pre-trained model is achieved by minimizing the total loss function, which includes bidirectional cross-domain reconstruction loss and task loss: the bidirectional cross-domain reconstruction loss is the sum of the one-way reconstruction loss from the source domain to the target domain and the one-way reconstruction loss from the target domain to the source domain, and each one-way reconstruction loss is calculated based on the cosine distance between the mapped feature vector and the target feature vector; the task loss is the downstream few-sample classification task loss, and the bidirectional cross-domain reconstruction loss and the task loss in the total loss function are weighted by a balancing coefficient λ.
9. The method for augmenting small sample data based on a bidirectional feedback mechanism according to claim 1, characterized in that, The iteration termination condition is: the feature scale divergence of all feature classes is lower than the dynamic threshold of the current round, and the performance of the model on the validation set tends to be stable. The performance tends to be stable means that the accuracy fluctuation of the validation set does not exceed 1% for three consecutive rounds.
10. A computer-readable storage medium having a computer program stored thereon, characterized in that, When the computer program is executed by the processor, it implements the small sample data augmentation method based on the bidirectional feedback mechanism as described in any one of claims 1 to 9.