Online large pathological model fine tuning method and system based on active-passive feedback combination

By combining doctor feedback and medical record reports with a dynamic optimization scheme, the issues of decreased diagnostic performance and privacy compliance of pathology AI models in new scenarios have been resolved, enabling continuous autonomous evolution and improved accuracy of the models.

CN121366738APending Publication Date: 2026-01-20GUANGZHOU FANGXIN MEDICAL TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202511510750.8
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-10-22
Publication Date
2026-01-20

AI Technical Summary

Technical Problem

When existing pathology AI models are deployed in new hospitals or new scenarios, their diagnostic performance deteriorates due to differences in data distribution. They cannot be continuously optimized in compliance with privacy regulations, doctor feedback is not systematically utilized, and traditional fine-tuning methods lead to the loss of historical knowledge, especially resulting in a decline in the ability to identify rare cases.

Method used

By receiving doctor feedback tags through an interactive interface and combining them with semantic analysis of medical record reports, difficult cases are dynamically identified and classified. The Patch feature extractor is frozen, and only the multi-instance learning head network is fine-tuned. Historical data playback and regularization constraints are introduced to ensure a significant improvement in model performance.

Benefits of technology

It significantly improves the accuracy and generalization ability of AI diagnostic models in complex cases, reduces the misdiagnosis rate, and provides reliable support for clinical decision-making.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121366738A_ABST
    Figure CN121366738A_ABST
Patent Text Reader

Abstract

The invention relates to an active-passive feedback combination-based large pathological model online fine tuning method and system, and the method comprises the steps: marking an active feedback mark as a difficult case when the active feedback mark is abnormal or the semantic similarity is lower than a threshold value, dividing the difficult case into multiple levels: medium, high and extremely high according to the Euclidean distance, sampling the difficult case data according to the difficulty weight in an equal ratio during the idle period of the system, and carrying out the sampling of the difficult case data; the method comprises the following steps of: selecting a model, mixing easy example data in a preset proportion, freezing the weight of a Patch feature extractor of the model, only finely tuning a multi-instance learning MIL head network, introducing historical data playback and regularization constraints, and superposing a LoRA module on the MIL head, so that parameter updating is satisfied, performance improvement of the model on a test set after fine tuning needs to reach statistical significant difference, and the weight is updated and the data is filed.
Need to check novelty before this filing date? Find Prior Art

Description

[0001] TECHNICAL FIELD The present application relates to the field of information technology, in particular to a pathological large model online fine-tuning method and system based on active-passive feedback combination. BACKGROUND

[0002] In the clinical deployment of pathological artificial intelligence models, the existing technology faces the following key bottlenecks: when deploying pathological AI models in new hospitals or new scenarios, due to data distribution differences (regional pathological characteristics, instrument differences), the diagnostic performance will decrease significantly, and local data fine-tuning is needed to maintain accuracy; due to patient privacy protection regulations (HIPAA, GDPR) and data security requirements, hospitals cannot provide original pathological data to model providers, and traditional fine-tuning schemes based on original data cannot be implemented. There are two defects in the existing system: the false positives / false negatives / category errors marked by doctors through the interactive interface are not systematically used for model iteration; there is a lack of automatic analysis mechanism for the semantic difference between the medical record reports written by doctors and the AI prediction results, and a large amount of implicit error correction information is not mined. Traditional fine-tuning methods overfit new data, resulting in loss of historical knowledge, especially the recognition ability of rare cases; There is currently no privacy-compliant continuous optimization scheme, and there is an urgent need for a mechanism that dynamically integrates doctor's double-path feedback (active marking + medical record semantic analysis) to realize model self-evolution without obtaining original data.

[0003] SUMMARY In order to solve the problems existing in the prior art, the present application aims to provide a pathological large model online fine-tuning method and system based on active-passive feedback combination.

[0004] The pathological large model online fine-tuning method based on active-passive feedback combination described in the present application comprises the following steps: S101, receiving active feedback marks of AI prediction results from doctors through an interactive interface, the marks including false positives, false negatives, subtype errors or category errors, synchronously analyzing medical record reports written by doctors, and performing: extracting pathological academic term entities in the reports, comparing with AI result keywords, generating semantic vectors of medical record reports and AI results through a pre-trained embedding model, and calculating cosine similarity; S102, when the active feedback marks are abnormal or the semantic similarity is lower than a threshold, marking as difficult examples, and dividing the difficult examples into multiple levels: medium, high, and very high according to Euclidean distance; S103, during the idle period of the system, sampling difficult example data in equal proportion according to difficulty weight, and mixing easy example data in a preset proportion; S104, based on the easy example data, freezing the Patch feature extractor weight of the model, and only fine-tuning the multi-instance learning (MIL) head network; S105, introduce historical data playback and regularization constraints, and superimpose LoRA module on MIL head, whose parameter update meets; S106, the performance improvement of the model after parameter fine-tuning on the test set needs to reach a statistically significant difference (p<0.05), and the weights are updated and the data is archived.

[0005] Further, in the S101 step, the interactive interface receives the active feedback label of the doctor on the AI prediction result, the label includes false positive, false negative, subtype error or category error, synchronously analyzes the medical record report written by the doctor, and performs: extracting pathological academic term entities in the report, comparing with AI result keywords, generating semantic vectors of medical record report and AI result through pre-trained embedding model, calculating cosine similarity, including: Obtain the feedback label (false positive / false negative, etc.) of the doctor and the pathological term entity (extracted by NER algorithm) in the medical record report, generate a label data set and a term entity list double-source input; Match the term entity and the AI prediction result keyword through the keyword comparison algorithm, if they are inconsistent, trigger semantic analysis, use the pre-trained embedding model to generate the semantic vector of the medical record report and the AI prediction, and calculate the cosine similarity When the similarity is lower than the threshold, mark the semantic deviation; Associate the deviation record with the feedback label data set, classify the label type using the SVM algorithm, dynamically update the AI training data set according to the classification result, and generate an optimized data set.

[0006] Further, in the S102 step, when the active feedback label is abnormal or the semantic similarity is lower than the threshold, mark it as a difficult example, and divide the difficult examples into multiple levels according to the Euclidean distance: medium, high, and extremely high, including: Select difficult examples marked as high or extremely high from the difficult example level data set, generate a high-priority subset as the processing core, and use the K-means algorithm to cluster the subset If there are isolated points, isolate abnormal data to generate a purified subset through an anomaly detection algorithm; Extract feature vectors from the purified subset, generate semantic vector sets through a pre-trained embedding model, and calculate the cosine similarity with the preset template If the similarity is lower than the threshold, trigger principal component analysis PCA dimension reduction to generate a feature set; Update the preset center point according to the dimension-reduced feature set, output the optimized center point set to complete the closed-loop upgrade.

[0007] Further, in the S103 step, during the idle period of the system, sample difficult example data in proportion to the difficulty weight, and mix easy example data in a preset proportion, including: During the idle period of the system, use a hierarchical sampling algorithm based on the difficulty weight (w_i) , obtain a difficult example and the like sampling data set; Analyze the category proportion of the sampling data set, and if the proportion is lower than a preset threshold, supplement sampling from easy example data, mix difficult or easy example data in proportion, and generate a balanced mixed data set; Extract statistical features of the mixed data set, reduce dimensions by principal component analysis to select a key feature set, group data by K-means clustering, calculate the data amount distribution of each category after clustering, verify the balance of the distribution by mean comparison, and output the optimization result.

[0008] Further, in the S104 step, the Patch feature extractor weight of the model is frozen based on easy example data, and only the multi-instance learning (MIL) head network is fine-tuned, including: Batch normalization is performed on the head network parameter input, and a standardized data distribution is output; Based on the normalized data, a statistical vector is calculated, principal component features are extracted by PCA dimension reduction, if the variance contribution rate is insufficient, features are supplemented by random sampling from the original data, an extended feature set is generated, data is grouped by K-means clustering, and the balance is judged by calculating the mean square error between clusters, if the distribution is not balanced, an balanced data set is generated by weighted sampling; Linear discriminant analysis is performed on the balanced data set, and the final classification result is output to complete the verification closed loop.

[0009] Further, in the S105 step, the history data playback and regularization constraint are introduced, and the LoRA module is superimposed on the MIL head, and the parameter update satisfies, including: A training set is obtained by history data playback, and a shard data set is generated by data sharding; PCA dimension reduction is performed on the shard data to extract principal components, if the variance contribution rate is insufficient, features are supplemented by random sampling from the history data, and an extended feature set is constructed; Based on the extended feature set, the low-rank module parameters are optimized by regularization constraint, the parameters are updated by gradient descent to generate an updated parameter set, the weighted representation of the extended features is calculated, linear discriminant analysis is used for classification, and the final result is output to complete the closed loop.

[0010] Further, in the S106 step, the performance of the model after parameter fine-tuning on the test set needs to reach a statistically significant difference (p<0.05), the weight is updated and the data is archived, including: The mean value of the test set performance and the mean value of the benchmark model performance are calculated respectively, a comparison benchmark is established, the difference significance is calculated by two-sample t-test, if the p value is less than the threshold, the weight increment is calculated; The model is updated by the weight increment, the test data is archived and stored in the database.

[0011] The application discloses a pathological large model online fine-tuning system based on active-passive feedback combination, which comprises a feedback processing module, a difficult case management module, a data scheduling module, a model fine-tuning module, an optimization constraint module and a weight updating module. The feedback processing module is used for receiving active feedback marks of doctors on AI prediction results through an interactive interface, synchronously analyzing medical record reports, extracting pathological academic term entities and comparing the pathological academic term entities with AI result keywords, generating semantic vectors by using a pre-training embedding model and calculating cosine similarity. The difficult case management module is used for marking as a difficult case when the active feedback marks are abnormal or the semantic similarity is lower than a threshold value; the difficult cases are classified into medium, high and extremely high levels according to Euclidean distances, a high-priority subset is generated, and a center point set is optimized by using a clustering algorithm. The data scheduling module is used for sampling difficult case data in an equal ratio according to difficulty weights and mixing easy case data in a preset proportion during an idle period of the system; and key features are screened by using principal component analysis. The model fine-tuning module is used for freezing Patch feature extractor weights and fine-tuning only a multi-instance learning (MIL) head network; batch normalization is performed on input data, and classification results are verified by using linear discriminant analysis. The optimization constraint module is used for introducing a historical data playback mechanism to generate a fragmented data set and adding a LoRA module to the MIL head; low-rank parameters are optimized by using regularization constraint, and parameters are updated by using gradient descent. The weight updating module is used for verifying whether performance improvement of the fine-tuned model on a test set reaches a statistical significant difference (p<0.05); if the condition is met, the model is updated by calculating weight increments, and test data is archived to a database.

[0012] The pathological large model online fine-tuning method and system based on active-passive feedback combination has the advantages that in view of the problems that a traditional AI diagnosis model has low prediction accuracy in complex cases and difficult case data is difficult to be effectively utilized, a dynamic optimization scheme is provided by fusing doctor active feedback and medical record report semantic analysis; the doctor active feedback on AI prediction results, such as false positives and false negatives, is collected through an interactive interface, medical record reports are synchronously analyzed, pathological term entities are extracted and compared with AI results, semantic similarity is calculated by using a pre-training embedding model, difficult cases are accurately identified, difficult cases are classified according to Euclidean distances, easy case data is mixed by sampling difficult case data in an equal ratio according to difficulty weights during an idle period, a Patch feature extractor is frozen, only a multi-instance learning head network is fine-tuned, a LoRA module is added, historical data playback and regularization constraint are introduced, and it is ensured that the performance of the fine-tuned model is significantly improved (p<0.05). By means of semantic analysis and difficult case dynamic optimization, the AI diagnosis model can be improved in accuracy and generalization ability in complex cases, and the misdiagnosis rate can be reduced, so that more reliable support can be provided for clinical decision-making. BRIEF DESCRIPTION OF DRAWINGS

[0013] Figure 1 This application describes a method for online fine-tuning of a large pathological model based on a combination of active and passive feedback. Figure 1 ; Figure 2 This application describes a method for online fine-tuning of a large pathological model based on a combination of active and passive feedback. Figure 2 . Detailed Implementation

[0014] like Figures 1-2 As shown, the online fine-tuning method for a large pathological model based on a combination of active and passive feedback, as described in this application, includes: like Figures 1-2 As shown in S101, the active feedback tags from doctors on AI prediction results are received through the interactive interface. The tags include false positives, false negatives, subtype errors, or category errors. The medical record report written by the doctor is parsed simultaneously, and the following steps are performed: extracting pathological terminology entities from the report, comparing them with keywords in the AI ​​results, generating semantic vectors of the medical record report and the AI ​​results through a pre-trained embedding model, and calculating the cosine similarity.

[0015] Further, in step S101, the feedback tags submitted by the doctor through the interactive interface are obtained, the tags include false positives, false negatives, subtype errors or category errors, and a tag dataset is obtained. Pathological terminology entities are extracted from the medical record report, and a terminology entity list is generated using a named entity recognition algorithm in natural language processing. The keyword comparison algorithm is used to match the list of term entities with the keywords in the AI ​​prediction results, judge the matching consistency, and obtain the matching results. If the matching results are inconsistent, a pre-trained embedding model is used to generate semantic vectors for the medical record report and the AI ​​prediction results. Cosine similarity is then calculated to obtain a similarity score, where the cosine similarity formula is: , where A and B are the semantic vectors of the medical record report and the AI ​​prediction result, respectively, and ||A|| and ||B|| are the vector magnitudes; The similarity score is compared with a preset threshold. If the similarity score is lower than the preset threshold, it is marked as a semantic deviation and a deviation record is generated. By analyzing the association between deviation records and feedback label datasets, the support vector machine algorithm is used to classify the label types and obtain the classification results. The training dataset of the AI ​​prediction model is updated based on the classification results to generate an optimized dataset.

[0016] Specifically, in step S101, the system receives the doctor's feedback label for the AI prediction result through the interactive interface, for example, labeling a prediction as false positive (predicted as cancer but actually benign), false negative (predicted as benign but actually cancer), subtype error (predicted as lung adenocarcinoma but actually squamous carcinoma), or category error (predicted as malignant but actually inflammation). Assuming the doctor labels a case predicted by AI as "lung adenocarcinoma" as false positive, and the actual case is "inflammation", the system records the label and stores it as structured data in JSON format: {"case_id": "12345", "prediction": "lung_adenocarcinoma", "label": "false_positive", "actual": "inflammation"}; Subsequently, the system parses the medical record report written by the doctor, the report content is "patient's lung CT shows nodules, clear boundary, no obvious invasion, pathological biopsy shows inflammation cell infiltration, no cancer cell", through natural language processing (NLP) tools such as BERT-based Chinese pre-training model, extract pathological academic term entities such as "nodule", "inflammatory cells", "no cancer cells", these entities are compared with AI result keywords "lung adenocarcinoma" "malignant", it is found that "inflammatory cells" and "malignant" have semantic conflict, the matching degree is 0.1 (based on word vector cosine similarity, range 0-1); Then, the system uses a pre-trained embedding model (RoBERTa Chinese version) to convert the medical record report and the AI prediction result into semantic vectors. The medical record report vector is based on the average embedding after full-text segmentation, and the AI result vector is based on the "lung adenocarcinoma" keyword embedding. The cosine similarity of the two vectors is calculated, and the formula is The result is 0.35, indicating that the semantic difference is large. According to the similarity lower than the threshold value 0.5, combined with the false positive label, the system triggers the model updating mechanism, adjusts the AI classifier weight, and reduces the malignant prediction tendency of "nodule" feature; All steps are automatically executed, and data is stored in a cloud database. The update log is recorded as "case_12345_updated_2025-07-29". Through continuous feedback and semantic analysis, the system optimizes the prediction accuracy, and the logic chain forms a closed loop from labeling to model adjustment.

[0017] As shown in Figures 1-2 S102, when the active feedback label is abnormal, or the semantic similarity is lower than the threshold value, it is labeled as a difficult example. According to the Euclidean distance, the difficult examples are divided into multiple levels: medium, high, and extremely high.

[0018] Further, in step S102, according to the difficult example level data set, the difficult example data marked as high or extremely high is obtained, and a high priority subset is generated; The high priority subset is grouped by a clustering algorithm, and a K-means algorithm is used, and the formula is: , wherein Ci is the i th clustering cluster, ci is the center point of the i th cluster, J is the objective function, and x is the data point vector, and a clustering grouping result is obtained; If there are isolated points in the clustering grouping result, an anomaly detection algorithm is used to isolate abnormal data, and an isolated data subset is generated; For the isolated data subset, its feature vector is extracted, a pre-trained embedding model is used to generate a semantic vector, and a semantic vector set is obtained; The cosine similarity between the semantic vector set and the preset template is calculated, and the formula is: , wherein A is the semantic vector set, B is the preset template vector, ||A|| and ||B|| are the vector lengths, and a similarity score set is obtained; If the similarity score is lower than the preset threshold, a principal component analysis algorithm is used to reduce the dimension of the semantic vector set, and a reduced feature set is generated; According to the reduced feature set, the preset center is updated, and an optimized center point set is generated.

[0019] Specifically, in step S102, for example, the system receives the feedback label of the doctor to the AI prediction result, for example, a case is predicted as "squamous cell carcinoma", and the doctor marks it as false negative, and the actual is "interstitial lung disease", the system automatically stores the label as JSON format: {“case_id”:“67890”,“prediction”:“squamous_cell_carcinoma”,“label”:“false_negative”,“actual”:“interstitial_lung_disease”}; Subsequently, the system parses the medical record report, the content is "patient chest CT shows diffuse ground glass shadow in both lungs, with fibrosis cord, no typical mass, pathology suggests interstitial hyperplasia", uses a Chinese pre-training model (ERNIE) to extract entities such as "ground glass shadow", "fibrosis", and "interstitial hyperplasia", and compares them with the AI prediction keywords "squamous cell carcinoma" and "malignant", and finds semantic conflicts, and the word vector matching degree is 0.15; The system further divides the report into words, generates a semantic vector based on ERNIE, and generates a vector based on "squamous cell carcinoma" for the AI prediction result, calculates the Euclidean distance, and the formula is , wherein d is the Euclidean distance between semantic vectors, xi is the i-th dimensional component of the medical record report vector, yi is the i-th dimensional component of the AI prediction vector, n is the vector dimension, the result is 2.8, higher than the threshold value 2.0, marked as a difficult case, the difficult case classification adopts the Euclidean distance interval: medium (1.5-2.5), high (2.5-3.5), and very high (>3.5), and the case is classified as high difficulty; According to the difficult case level, the system automatically adjusts the feature weight, reduces the weight coefficient of the "ground glass shadow" related to malignancy from 0.7 to 0.4, updates the classifier parameters, and stores the data to the cloud, and the log record is "case_67890_updated_2025-07-29"; To form a closed loop, the system adds the difficult case to the priority training set, sets the batch ratio of the next training to 30%, ensures that the model is optimized for high-difficulty cases, and all processes are automatically executed, relying on cloud computing and database support.

[0020] As shown in Figures 1-2 S103, during the system idle period, the difficult case data is sampled according to the difficulty weight ratio, and the easy case data of the preset proportion is mixed.

[0021] Further, in step S103, during the system idle period, the data based on the difficulty weight ratio is obtained from the difficult case data, and a stratified sampling algorithm is used, and the formula is: wherein w_i is the difficulty weight, d_i is the data point, and S is the sampling result, and the sampling data set is obtained; According to the sampling data set, the data distribution characteristics are obtained, the statistical analysis is used to calculate the category proportion, and the distribution characteristic set is obtained; If the category proportion in the distribution characteristic set is lower than the preset threshold, the data is obtained from the easy case data by supplementing sampling, and the supplement data set is obtained; The sampling data set and the supplement data set are mixed according to the preset proportion, and the formula is: wherein a is the mixing ratio, S_d is the sampling data set, S_e is the supplement data set, and M is the mixing result, and the mixed data set is obtained; According to the mixed data set, the statistical feature vector thereof is extracted, a principal component analysis algorithm is used for feature screening, and the formula is: wherein X is the mixed data set, U is the feature vector matrix, F is the screened feature set, and the screened feature set is obtained; According to the screened feature set, a clustering algorithm is used to group the data, and the formula is: wherein x_i is the data point, c_j is the clustering center, and J is the objective function, and the grouped data set is obtained; According to the grouped data set, the data amount distribution of each category is calculated, the mean value comparison is used to determine the distribution balance, and the balanced distribution result is obtained.

[0022] Specifically, in step S103, during the system idle period, for example, from 2:00 to 4:00 every morning, the system automatically triggers the data sampling task to extract difficult and easy case data from the database for mixed processing; The system first queries the cloud database to filter case data marked as difficult examples. Assuming that there are 10,000 difficult example records stored, the difficulty weights are divided into low (0.1-0.5), medium (0.5-0.8), and high (0.8-1.0), accounting for 40%, 40%, and 20%, respectively. Through a weighted random sampling algorithm, the system extracts data according to the weight proportion. For example, the probability of extracting high-difficulty cases (weight 0.8-1.0) is 20%. Each time 1,000 difficult examples are sampled, 200 high-difficulty, 400 medium-difficulty, and 400 low-difficulty cases are obtained. The sampling algorithm uses the roulette wheel method to generate a random number r (between 0 and 1). If r falls within the 0-0.2 interval, a high-difficulty case is selected. Similarly, the sampling conforms to the weight distribution. Next, the system randomly selects 2,000 easy examples from the easy example library (assuming 50,000). Easy examples are defined as cases with a semantic matching degree higher than 0.9. The mixing ratio is set to difficult examples:easy examples = 1:2, i.e., 1,000 difficult examples and 2,000 easy examples form a training batch. The system uses a Chinese pre-trained model (RoBERTa) to extract features from the mixed data, tokenizes the medical record text, and generates 512-dimensional semantic vectors. The cosine similarity is used to calculate the semantic correlation between samples. If the average cosine similarity between a difficult example vector and an easy example vector is less than 0.3, it is marked as an isolated sample and is preferentially added to the next training. Isolated samples are further grouped by K-means clustering (K=5). The centroid of each group is calculated, and samples with a Euclidean distance greater than 1.5 from the centroid are retained, accounting for about 10%, or 300 samples. These samples are stored in the priority training set. After data processing, the system generates a log file "sample_2025-07-29_mixed" to record the sampling details, and uploads the mixed data set to the cloud HDFS for subsequent model training. The entire process is automatically executed through a distributed computing framework (Spark), relying on database and cloud storage support to ensure efficient completion.

[0023] As shown in Figures 1-2 S104, based on easy example data, the Patch feature extractor weight of the frozen model is only fine-tuned for the multi-instance learning MIL head network.

[0024] Further, in step S104, batch normalization method is used to process input data for optimized head network parameters, with the formula: where x_i is the input data, μ is the mean, σ is the standard deviation, γ and β are learnable parameters, and the normalized data distribution is obtained. Based on the normalized data distribution, the statistical vector of the data features is calculated, and the principal component analysis algorithm is used to reduce the dimensionality of the features. The formula is: Z=XW, where X is the normalized data matrix, W is the principal component vector matrix, and Z is the dimensionality-reduced feature set, thus obtaining the dimensionality-reduced feature set. If the variance contribution rate of the dimensionality-reduced feature set is lower than the preset threshold, supplementary features are obtained from the original data through random sampling. The formula is: F_s=S(X_r), where X_r is the original data, S is the random sampling function, and F_s is the supplementary feature set, thus obtaining the extended feature set. For the extended feature set, the K-means clustering algorithm is used to group the data, and the formula is: Where z_i are feature points, c_j are cluster centers, and J is the objective function, the grouped data clusters are obtained; Based on the grouped data clusters, calculate the mean of the characteristic distribution of each cluster, and use analysis of variance to determine the distribution balance. The formula is: Where V is the inter-cluster variance, mi is the mean of the characteristic distribution of the i-th cluster, m is the overall mean of all clusters, and n is the number of clusters, thus obtaining the balance judgment result; If the balance assessment result shows uneven distribution, the data clusters are adjusted by weighted sampling, using the following formula: Where w_i is the cluster weight, d_i is the data point, and D_w is the resampled dataset, thus obtaining the balanced dataset; For a balanced dataset, its high-dimensional feature vectors are extracted, and a linear discriminant analysis algorithm is used for classification, as shown in the formula: , where X_e is the balanced dataset, W is the discriminant vector matrix, and Y is the classification result, to obtain the final classification result.

[0025] Specifically, in step S104, for example, the system initiates the model freezing and fine-tuning process. First, it loads the pre-trained Patch feature extractor, assuming it is based on the Chinese BERT model, containing 12 Transformer layers, 110 million parameters, and outputting a 768-dimensional feature vector. The system automatically freezes all weights of the BERT model through a configuration script. Specifically, it sets require_grad=0, locking approximately 100 million parameters and retaining only the trainable parameters of the Multi-Instance Learning (MIL) head network. The MIL head contains 2 fully connected layers with approximately 5 million parameters. The system obtains a medical record dataset from a cloud database, containing 5,000 records. Each record consists of multiple text fragments, with an average of 5 fragments per medical record. In the data preprocessing stage, the system performs word segmentation on each text segment, generates an input sequence with a maximum length of 128 using the BERT tokenizer, and fills it to a uniform length. In the feature extraction stage, the frozen BERT model generates a 768-dimensional vector for each segment. The system aggregates multiple segment vectors from the same medical record using the attention mechanism of the MIL head network. The attention weights are calculated using the softmax function, and the sum of the weights is 1. The system sets the learning rate to 0.001, uses the Adam optimizer to fine-tune the MIL head, the training batch size is 32, and iterates for 10 epochs. In each iteration, the system calculates the cross-entropy loss. Assuming the initial loss is 2.5, after 10 epochs, the loss decreases to 0.8. During the fine-tuning process, the system monitors the attention weight distribution of the MIL head. If the attention weight of a medical record segment is less than 0.1, it is marked as a low-contribution segment and recorded in the log file "mil_tune_2025-07-29.log". After training is complete, the system saves the optimized MIL head parameters to the HDFS path / hdfs / model / mil_head_2025-07-29. The frozen BERT weights remain unchanged. The entire process is executed on a distributed GPU cluster through the PyTorch framework, automatically completing data loading, model training, and parameter storage to ensure efficiency and reproducibility.

[0026] As shown in Figures 1-2 S105, historical data playback and regularization constraints are introduced, and the LoRA module is added to the MIL head, and the parameter update satisfies

[0027] Further, in step S105, the training data set is obtained by historical data playback, and the data slicing method is used for processing, and the formula is: D_s=P(X_h), wherein X_h is historical data, P is a slicing function, and D_s is a sliced data set, and a sliced data set is obtained; For the sliced data set, the initial feature vector is extracted, and the principal component analysis algorithm is used for dimension reduction, and the formula is: Z_d=D_sW_d, wherein D_s is the sliced data set, W_d is the principal component vector matrix, and Z_d is the reduced feature set, and the reduced feature set is obtained; If the variance contribution rate of the reduced feature set is lower than the preset threshold, the supplementary features are obtained from the historical data by random sampling, and the formula is: F_c=S(X_h), wherein X_h is the historical data, S is the random sampling function, and F_c is the supplementary feature set, and the expanded feature set is obtained; According to the expanded feature set, the low-rank adaptive module parameters are optimized by regularization constraints, and the formula is: wherein L_m is the module loss function, λ is the regularization coefficient, ||W_p||_2 is the parameter norm, L_p is the regularization loss function, and the optimized parameter set is obtained; The gradient descent method is used to update the low-rank adaptive module parameters for the optimized parameter set, and the formula is: Where θ_n is the current parameter, θ_(n-1) is the parameter at the last time, η is the learning rate, L_p is the regularization loss gradient, and the updated parameter set is obtained; According to the updated parameter set, the weighted feature representation of the extended feature set is calculated, and the formula is: F_w=Z_eW_n, where Z_e is the extended feature set, W_n is the updated parameter matrix, and F_w is the weighted feature representation, and the weighted feature representation is obtained; Through the weighted feature representation, the linear discriminant analysis algorithm is used for classification, and the formula is: Where F_w is the weighted feature representation, W_c is the discriminant vector matrix, and Y_c is the classification result, and the final classification result is obtained.

[0028] Specifically, in step S105, the system starts the medical text analysis process, loads the pre-trained Chinese RoBERTa model as the feature extractor, the model contains 24 layers of Transformer, the parameter amount is about 300 million, and the output is 1024-dimensional feature vector. The system automatically introduces the LoRA module for the RoBERTa model through script configuration, the LoRA module adds a low-rank decomposition matrix to each Transformer layer, the rank is set to 8, the new parameter amount is about 2 million, only the LoRA parameters and the MIL head parameters are updated, and the RoBERTa main weight is kept frozen; The medical consultation record data set is obtained from the cloud database, which contains 8000 records, each record contains an average of 6 text segments. In the data preprocessing stage, the system uses the RoBERTa tokenizer to tokenize the text segments, generates input sequences with a maximum length of 256, fills them to a uniform length, and introduces a historical data replay mechanism to load 1000 historical consultation records from the HDFS path / hdfs / data / replay_2025-07-29 as auxiliary data to enhance the model's generalization ability. In the feature extraction stage, the frozen RoBERTa model generates a 1024-dimensional vector for each segment, and the MIL head network aggregates the segment vectors through a double-layer attention mechanism. The first layer calculates the intra-segment weight, and the second layer aggregates the cross-segment weight. Both are normalized by the softmax function. The system adds an L2 regularization constraint to the MIL head with a regularization coefficient of 0.01 to prevent overfitting. During training, the system sets the learning rate to 0.0005, uses the AdamW optimizer, the batch size is 16, and iterates 12 epochs. Each iteration, the system calculates the cross-entropy loss with regularization, the initial loss is 3.0, and after 12 epochs, it decreases to 0.9. During the training process, the system analyzes the low-rank matrix norm of the LoRA module. If the norm of a certain layer is lower than 0.05, it is recorded in the log file "lora_analysis_2025-07-29.log" to monitor parameter updates. Historical data playback dynamically adjusts the sampling ratio of playback data by comparing the loss distribution of new and old data. The initial ratio is 0.2, and it gradually increases to 0.4. After training is completed, the system saves the optimized LoRA module and MIL header parameters to the HDFS path / hdfs / model / lora_mil_2025-07-29. The entire process is implemented on a distributed GPU cluster using PyTorch, automatically completing data loading, model training, and parameter storage.

[0029] As shown in Figures 1-2 S106, the performance of the model after parameter fine-tuning on the test set needs to reach a statistically significant difference (p<0.05) to update the weights and archive the data.

[0030] Further, in step S106, the performance indicators of the test set are obtained, and the mean value of the test set performance is obtained using the mean calculation method. Through the baseline model, the same mean calculation method is used to obtain the mean value of the baseline model performance. The difference between the mean value of the test set performance and the mean value of the baseline model performance is calculated using the t-test method, and the formula is: where S_d is the standard deviation, and the t-test statistic is calculated. If the p-value of the t-test statistic is less than the preset threshold, the weight increment is calculated, and the formula is: ΔW = ηG_w, where η is the learning rate, G_w is the gradient matrix, and the weight increment is obtained. The model weight is updated through the weight increment, and the formula is: W_u = W_c + ΔW, where W_c is the current weight matrix, and the updated weight matrix is obtained. The test data is processed using the archive function, and the formula is: D_a = F_a(D_t), where D_t is the test data, F_a is the archive function, and the archived data set is obtained. Through the preset database interface, the archived data set is stored in the database, and the formula is: D_s = I_d(D_a), where I_d is the database storage interface, D_a is the archived data set, and the storage confirmation is obtained.

[0031] Specifically, in step S106, the system starts the medical text classification process, loads the pre-trained Chinese BERT model as the feature extractor, the model contains 12 layers of Transformer, the parameter amount is about 110 million, and the output is a 768-dimensional feature vector. The system introduces an adapter module for the BERT model through an automated script, adds two fully connected layers to each Transformer layer, sets the hidden layer dimension to 64, and adds about 1.5 million new parameters. Only the adapter and classification head parameters are updated, and the BERT main body weight is kept frozen. The system obtains a medical diagnosis report dataset from a cloud database, which contains 10,000 records, each record containing an average of 4 text segments. In the data preprocessing stage, the system uses the BERT tokenizer to tokenize the text and generate input sequences with a maximum length of 128, which are then padded to a uniform length. The data augmentation mechanism is introduced by loading 2,000 synthetic diagnosis records from the HDFS path / hdfs / data / augment_2025-07-29 to enhance the robustness of the model. In the feature extraction stage, the frozen BERT model generates a 768-dimensional vector for each segment, and the classification head aggregates the segment vectors through a single attention mechanism. The softmax function is used to normalize the weights, and a Dropout layer is added with a dropout rate of 0.1 to prevent overfitting. During training, the system sets the learning rate to 0.001, uses the Adam optimizer, and sets the batch size to 32 and iterates for 10 epochs. In each iteration, the system calculates the cross-entropy loss, which is initially 2.5 and decreases to 0.7 after 10 epochs. During training, the system monitors the weight changes of the adapter module. If the L1 norm of a layer's weight is less than 0.03, it is recorded in the log file "adapter_monitor_2025-07-29.log". In the test phase, the system evaluates the model on the 2,000 test sets and calculates the F1 score, which is initially 0.82 and improves to 0.87 after fine-tuning. The system analyzes the performance improvement through t-test, and the p-value is 0.03, which meets the significance requirement of p<0.05, triggering weight update. The optimized adapter and classification head parameters are automatically saved to the HDFS path / hdfs / model / adapter_2025-07-29, and the data is archived to / hdfs / data / archive_2025-07-29. The entire process is implemented on a distributed CPU cluster through TensorFlow, automatically completing data processing, model training, and result storage.

[0032] The pathological large model online fine-tuning system based on active-passive feedback combination includes a feedback processing module, a difficult example management module, a data scheduling module, a model fine-tuning module, an optimization constraint module, and a weight updating module. a feedback processing module configured to receive active feedback labels of the doctor on the AI prediction result through the interactive interface, synchronously analyze the medical record report, extract pathological academic term entities and compare them with AI result keywords, generate semantic vectors by using a pre-trained embedding model and calculate cosine similarity; a difficult case management module configured to mark as a difficult case when the active feedback label is abnormal or the semantic similarity is lower than a threshold value; classify the difficult case into medium, high and extremely high according to Euclidean distance, generate a high priority subset and optimize a center point set by using a clustering algorithm; a data scheduling module configured to sample difficult case data in equal proportion according to difficulty weight during a system idle period, mix easy case data in a preset proportion, and screen key features by using principal component analysis; a model fine-tuning module configured to freeze the Patch feature extractor weight and fine-tune only the multi-instance learning (MIL) head network; perform batch normalization on the input data and verify the classification result by using linear discriminant analysis; an optimization constraint module configured to introduce a historical data playback mechanism to generate a fragmented data set and add a LoRA module to the MIL head; optimize low-rank parameters by using regularization constraint and update the parameters by using gradient descent; a weight updating module configured to verify whether the performance improvement of the fine-tuned model on the test set reaches a statistically significant difference p<0.05; if the condition is met, calculate the weight increment to update the model and archive the test data to the database.

[0033] The above only describes the preferred embodiments of one or more embodiments of the present specification, and does not limit one or more embodiments of the present specification. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of one or more embodiments of the present specification shall be included in the protection scope of one or more embodiments of the present specification.

Claims

1. A pathological large model online fine-tuning method based on active-passive feedback combination, characterized in that, The method comprises the following steps: Receiving active feedback marks of doctors on AI prediction results through an interactive interface, the active feedback marks including false positives, false negatives, subtype errors or category errors, synchronously analyzing medical record reports written by doctors, extracting pathological academic term entities by using a named entity recognition algorithm, generating semantic vectors of the medical record reports and the AI prediction results by using a pre-trained embedding model, and calculating cosine similarity between the two; When the active feedback marks are abnormal or the cosine similarity is lower than a preset threshold, marking as difficult examples, calculating Euclidean distances between semantic vectors of the medical record reports and semantic vectors of the AI prediction results, and classifying the difficult examples into three levels of medium, high and extremely high according to distance intervals; Layered sampling is performed according to difficulty levels and weights to obtain a difficult example dataset, category distribution of the dataset is analyzed, easy examples are supplemented when a category proportion is lower than a threshold, and a balanced training set is generated by mixing the difficult examples and the easy examples at a preset ratio; Freezing Patch feature extractor weights of a pathological large model, and only fine-tuning a multi-instance learning head network: performing batch normalization processing on input data, and extracting features by principal component analysis dimension reduction; Stacking a low-rank adaptation module on the multi-instance learning head, and updating parameters of the low-rank adaptation module by gradient descent; When a p value is less than 0.05, calculating a weight increment to update model parameters, and archiving test data to a database.

2. The online fine-tuning method of pathological large models based on active-passive feedback combination according to claim 1, characterized in that, The active feedback marks are stored as structured data in a JSON format, the cosine similarity is calculated by using a ratio of a vector dot product to a modulus product, and semantic analysis is triggered when term entities and AI prediction keywords do not match. 3.The pathological large model online fine-tuning method based on active-passive feedback combination of claim 1, wherein, The preset mixing ratio is difficult examples:easy examples = 1:2, key feature sets are screened by using principal component analysis, and data distribution balance is verified by K-means clustering.

4. The online fine-tuning method of pathological large models based on active-passive feedback combination according to claim 1, characterized in that, The rank of the low-rank adaptation module is set to 8.

5. The online fine-tuning method of pathological large models based on active-passive feedback combination according to claim 1, characterized in that, The batch normalization processing adjusts data distribution by using learnable parameters γ and β.

6. The online fine-tuning method of pathological large models based on active-passive feedback combination according to claim 5, characterized in that, When a variance contribution rate after principal component analysis dimension reduction is lower than a threshold, original data is randomly sampled to supplement features to generate an extended feature set.

7. A system for implementing the method of any of claims 1-6, characterized by The method comprises the following steps: The feedback processing module, the difficult example management module, the data scheduling module, the model fine-tuning module, the optimization constraint module and the weight updating module.