A noise-robust active learning method for medical document OCR recognition
By employing minimum confidence screening and dynamic noise label correction loss function in medical document OCR recognition, the problem of noise label interference is solved, the recognition performance and robustness of the model are improved, and low-cost document recognition results are achieved.
Patent Information
- Application Number
- CN202310533619.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-05-12
- Publication Date
- 2025-12-09
- Estimated Expiration
- 2043-05-12
AI Technical Summary
Existing technologies suffer from noise and label interference in medical document OCR recognition, resulting in poor model training performance and high costs in obtaining labeled data, making it difficult to effectively improve model performance.
A sample selection method based on minimum confidence is used to select samples with high uncertainty for manual labeling. A dynamic noise label correction loss function is designed to dynamically adjust the confidence level of the model during iterative training. The noise label is corrected by minimizing the entropy term to improve the robustness of the model.
With low-cost human interaction, noise labels are effectively corrected, improving the recognition performance of the medical document OCR recognition model and achieving better document recognition results.
Smart Images

Figure CN116563867B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application belongs to the field of artificial intelligence and text recognition technology, in particular relates to a noise robust active learning method for medical document OCR recognition. BACKGROUND
[0002] The medical record materials currently used in hospitals are still mainly paper-based, which contain patient information, diagnosis information, medication information, and cost information, etc. In the medical and insurance industries, these information has high commercial and scientific research value. However, due to the barrier of medical professional knowledge, it is difficult to extract these data, and currently it still relies on manual input. With the development of deep learning, OCR models based on deep neural networks have been widely popularized in various fields due to their high prediction accuracy. Although using deep OCR models can effectively improve work efficiency compared to traditional manual input methods, training an OCR model with excellent performance often relies on a large amount of labeled data. However, obtaining labeled data is not easy, especially for very scarce medical documents, and it is even more difficult to obtain complete and error-free string labels for all text images.
[0003] Existing methods mainly use active learning to alleviate the problems of insufficient data quantity and low utilization efficiency. In each iteration of the training process, active learning actively selects or generates the most valuable samples through certain query strategies and returns them to human annotation. Then, the updated model parameters are returned to the training set to update the model parameters to achieve the expected performance of the model with as few labeled samples as possible. However, in actual applications, the initial labeled data set provided by the community often contains many noisy labels. In addition, due to the uneven level of annotators, individual bias and misleading behavior, etc., errors often occur during manual annotation. For OCR recognition models, the CTC loss or standard cross-entropy loss used for model training usually assumes that the given labels are completely correct. If noisy or incorrect labels or one-hot encoding of labels are directly used as training supervision information, it will mislead the model training and hinder the improvement of model performance. Since the cost of querying the true label from human experts is very high, a low-cost method is needed to accurately relabel as many incorrect label samples as possible without human interaction to alleviate the impact of noisy labels on active learning performance. SUMMARY
[0004] In view of this, it is necessary to propose a noise-robust active learning method for the problem of active learning interference by noise text in the scene of medical document OCR recognition. In the active learning sample screening stage, the algorithm first uses a screening method based on minimum confidence, obtains a sequence of overall confidence as an indicator by multiplication, and screens a batch of highly uncertain valuable samples. Then, in the iterative training stage, the method designs a dynamic noise label correction loss function, introduces a regularization term on the basis of the original recognition loss to encourage the sample prediction probability distribution to change in the direction of low entropy, obtains a confident prediction for correcting the noise label, and the regularization process is controlled by a dynamic regulation function. In the early stage, a higher weight is allocated to the recognition loss item using the real label, and in the later stage, the weight is more allocated to the entropy minimization item, encouraging to trust the low-entropy prediction probability distribution, so as to achieve the purpose of dynamically correcting the noise label.
[0005] The application discloses a noise-robust active learning method for medical document OCR recognition, and specifically comprises the following steps:
[0006] Step 1, constructing a medical document OCR recognition model based on deep learning, training a medical document OCR recognition model θ0 based on the initial annotation data set provided by the community;
[0007] Step 2, using the initial model obtained by training to predict each sample in the unannotated sample pool, calculating the confidence of the sample, and sorting the confidence scores in descending order to select the top a% of samples with the minimum confidence;
[0008] Step 3, the selected samples are labeled by artificial labeling;
[0009] Step 4, adding the labeled samples to the annotation data set, and removing this part of data from the unannotated sample pool;
[0010] Step 5, using the updated annotation data set to iteratively train the model, and using a dynamic noise label correction loss function in the training process to guide the implicit correction of the probability distribution of the noise label, and using the corrected probability distribution as a training supervision signal;
[0011] Step 6, iteratively training the model θ n ;
[0012] Step 7, repeating steps 2-6 N times until the model reaches the predetermined accuracy or the annotation cost reaches the upper limit, stopping active learning, and outputting the final model θ N .
[0013] Specifically, the process of predicting each sample in the unannotated sample pool and calculating the confidence of the sample in step 2 comprises the following steps:
[0014] Given an input medical document image X, it is input into the OCR recognition model of the general encoder-decoder framework. The input is first encoded into a feature representation containing context information by the encoder. Then, the decoder converts the feature representation into a probability matrix where each column vector p t represents the probability distribution in the extended total K character space, and T is the maximum decoding step. For different decoder-based OCR models, different decoding mechanisms will result in different sequence confidence calculation methods.
[0015] Optionally, for the model based on the attention mechanism, it outputs the prediction and the corresponding confidence prediction
[0016]
[0017]
[0018] The decoding process is terminated when the output terminal symbol EOS symbol is terminated, and the final predicted string sequence ( is obtained. Its sequence confidence calculation formula is:
[0019]
[0020] For the CTC model, it uses the same strategy as the attention mechanism decoder, that is, it outputs the maximum probability prediction at each time to output the most likely path π. The final prediction sequence can be obtained by the mapping function B:
[0021]
[0022] The corresponding sequence confidence calculation is:
[0023]
[0024] where p t (π t | X) represents the prediction probability of path π at the t-th time step.
[0025] The minimum confidence-based sampling strategy considers that the smaller the confidence, the higher the value of the sample. Therefore, after obtaining the text and the corresponding confidence prediction, the samples are sorted from low to high according to the sequence confidence, and the top a% of the samples are selected and given to the annotator for sorting.
[0026] Specifically, the dynamic noise label correction loss function calculation process described in step 5 specifically includes the following steps:
[0027] θ0 is learned by initial labeled data, and certain category distribution knowledge is learned. The prediction result generated by the model on this basis can be used as a reference for determining whether the label is noisy and correcting the noisy label.
[0028] When correcting, it is considered that the corrected label should have high certainty to be trusted by the model as a training supervision signal; and the degree of trust of the model for the predicted information should change over time, and the early model should trust the artificial label more, and to the late training period, the model has learned more complex knowledge, at this time the prediction of the model can be used to correct the wrong artificial annotation. Therefore, the method combines the entropy minimization principle, and designs a noise label correction loss function which changes with the training period and the prediction probability distribution for model training. The overall loss is defined as follows:
[0029]
[0030] wherein, Loss reg represents the loss function of the recognition model for improving the recognition accuracy. For the model based on the attention mechanism, Loss reg is the corresponding cross-entropy loss; for the CTM model, Loss reg represents the CTC loss.
[0031] is an entropy regularization term, which encourages the model to output a low-entropy deterministic prediction. The entropy regularization term is defined as follows:
[0032]
[0033] wherein, Ent(·) represents the entropy value of the prediction at each time. The regularization term is inserted into the empirical loss of the general recognition model, which can improve the condition that the model is completely guided by the label. If the prediction is consistent with the label, the model is encouraged to output a low-entropy deterministic prediction; if the prediction is inconsistent with the label, the trust in the label is reduced to avoid the model fitting to the noise completely, and the robustness of the model to the noise is enhanced.
[0034] is a dynamic regulation function which changes with the training period and the prediction probability distribution. The dynamic regulation function is defined as follows:
[0035]
[0036] wherein, g(n,m) is a dynamic time factor which changes with the training period m and the iteration number n, is a dynamic entropy factor which changes with the probability distribution of a single sample .
[0037] For the dynamic time factor g(n, m), it is independent of the probability distribution of each sample, only related to the training time, and therefore global, which can be defined as:
[0038]
[0039] where M represents the total number of training periods in each iteration, μ is the critical training period that distinguishes the time period before and after model training, and λ is a hyperparameter that controls the growth rate of the dynamic time factor. As the number of active learning iterations n and the training period m increase, the model's trust in prediction also gradually increases.
[0040] For the dynamic entropy factor It depends on the prediction probability distribution of the sample, which can be defined as:
[0041]
[0042] where represents the total sequence prediction step, and u represents a uniform probability distribution. When the model is more certain about the prediction, the entropy value of the prediction is lower, and the value of the dynamic entropy factor is higher, and the model's trust in prediction also gradually increases.
[0043] Compared with the prior art, the present application has the following advantages:
[0044] In the process of training the OCR model in an active learning manner, the present application designs a dynamic regulation function, which allocates a higher weight to the recognition loss term using real labels in the early stage, and then allocates more weight to the entropy minimization term in the later stage, encouraging trust in low-entropy prediction probability distribution, to achieve the purpose of dynamically correcting noisy labels. The active learning algorithm using dynamic noisy label correction enables the OCR recognition model to implicitly correct the noisy labels of artificial errors in the active learning process, achieving better medical document recognition performance. BRIEF DESCRIPTION OF DRAWINGS
[0045] Figure 1 The flowchart of the method of the present application is shown;
[0046] Figure 2 The medical document OCR recognition flowchart in the method of the present application is shown. DETAILED DESCRIPTION
[0047] In order to make the purposes, technical solutions and advantages of the embodiments of the present application clearer, the technical solutions in the embodiments of the present application will be described clearly and completely below with reference to the drawings in the embodiments of the present application. Obviously, the described embodiments are some but not all of the embodiments of the present application. Based on the embodiments in the present application, all other embodiments obtained by a person of ordinary skill in the art without creative work fall within the protection scope of the present application.
[0048] For the sake of citation and clarity, the technical terms, abbreviations or acronyms used below are explained as follows:
[0049] CTC: Connectionist Temporal Classification
[0050] Figure 1 A flowchart of the embodiments of the present application is shown. The noise-robust active learning method for medical document OCR recognition comprises the following steps:
[0051] Specifically, the embodiments of the present application are implemented by the following steps.
[0052] A medical document OCR recognition model based on deep learning is constructed, and the medical document OCR recognition model θ0 is trained based on the initial annotation data set provided by the community;
[0053] Each sample in the unlabeled sample pool is predicted using the trained initial model, and the confidence of the sample is calculated. According to the confidence score, the top a% of samples with the smallest confidence, i.e. the highest value, are selected in descending order;
[0054] The selected samples are labeled by humans;
[0055] The labeled samples are added to the labeled data set, and this part of data is removed from the unlabeled sample pool;
[0056] The updated labeled data set is used to iteratively train the model, and the dynamic control function at each time is calculated during the training process to guide the implicit correction of the probability distribution of the noise label, and the corrected probability distribution is used as the training supervision signal;
[0057] The updated labeled data set is used to iteratively train the model θ n .
[0058] Steps 2-6 are repeated N times until the model reaches the predetermined accuracy or the annotation cost reaches the upper limit, the active learning is stopped, and the final model θ N .
[0059] Specifically, the embodiment adopts the following steps to implement the inventive method.
[0060] Step 1, obtain documents in the medical field as a medical field dataset, including but not limited to pictures of documents such as discharge summaries, outpatient invoices, drug purchase invoices, and hospitalization invoices. Randomly select 10% of the data to label the text in the images as an initial labeling dataset, and train to obtain an initial model θ0 on this basis. The remaining samples are used as data in the unlabeled sample pool for subsequent active learning screening and iterative training.
[0061] Step 2, load the initial model θ0 obtained in step 1, predict each sample in the unlabeled sample pool, and calculate the confidence of the sample. According to the confidence score , perform descending order sorting, and select the top 1% of samples with the smallest confidence, i.e., the highest value;
[0062] In step 2, for the confidence calculation of the predicted sample, for different decoder models, different calculation methods are used according to their decoding principles. As shown in the accompanying Figure 2 , first, input the medical document image X into the OCR recognition model of the general encoder-decoder framework. The input is first encoded into a feature representation containing context information by the encoder. Then, the decoder converts the feature representation into a probability matrix where each column vector p t represents a probability distribution in the extended total K character space, and T is the maximum decoding step. For different decoder-based OCR models, different decoding mechanisms (i.e., attention-based decoding mechanism and CTC-based decoding mechanism) will result in different sequence confidence calculation methods.
[0063] Optionally, for models based on the attention mechanism, it outputs the prediction and the corresponding confidence prediction at each decoding time during inference.
[0064]
[0065]
[0066] The decoding process terminates when the output terminates the EOS symbol, and the final predicted string sequence ( is obtained, which is the length of the predicted text). The sequence confidence calculation formula is:
[0067]
[0068] For the CTC model, it uses the same strategy as the attention mechanism decoder, that is, output the most likely path π by outputting the maximum probability prediction at each time step. The final prediction sequence can be obtained by the mapping function B:
[0069]
[0070] CTC defines a mapping function B, which removes duplicate labels and removes "blank" symbols from π. It should be noted that under this mechanism, multiple paths may be mapped to the same text sequence, for example: B(c-aa---t) = B(cca--ttt) = cat. Among them, the two paths "c-aa---t" and "cca--ttt" are both mapped to the same text "cat". Therefore, The conditional probability of can be calculated as the sum of the probabilities of all possible paths mapped to
[0071]
[0072] Where p t (π t | X) represents the prediction probability of path π at the t-th time step.
[0073] The sample screening strategy uses a minimum confidence-based sampling strategy, which believes that the smaller the confidence, the higher the sample value. Therefore, after obtaining the text and corresponding confidence prediction in each iteration, the samples are sorted from low to high according to the sequence confidence, and the top 1% of samples are selected and given to the annotator for sorting.
[0074] Step 3, give the screened samples to manually annotate the text in the medical document image;
[0075] Step 4, add the annotated samples to the annotated data set, expand and update the initial annotated data set, and use it to continue iterative training of the OCR model. At the same time, remove this part of data from the unannotated sample pool and no longer participate in subsequent active learning screening and iterative training;
[0076] Step 5, use the updated annotated data set to iteratively train the model, and use a dynamic correction loss function in the training process to guide the implicit correction of the probability distribution of the noise label, and use the corrected probability distribution as the training supervision signal;
[0077] In step 5, the dynamic correction loss function is defined as follows:
[0078]
[0079] Where Loss reg This represents the loss function used by the recognition model to improve recognition accuracy. For attention-based models, Loss... reg This corresponds to the cross-entropy loss; for the CTC model, Loss reg This indicates CTC loss.
[0080] It is an entropy regularization term that encourages the model to output low-entropy deterministic predictions. The specific definition of the entropy regularization term is as follows:
[0081]
[0082] Here, Ent(·) represents the entropy value of the prediction at each time step. This regularization term is inserted into the empirical loss of a general recognition model, which can improve the situation where the model is completely guided by the label. If the prediction matches the label, the model is encouraged to output a low-entropy definite prediction; if the prediction does not match the label, the model is prevented from completely fitting to noise by reducing the trust in the label, thus enhancing the model's robustness to noise.
[0083] This is a dynamic adjustment function that varies with the training period and the predicted probability distribution. The specific definition of the dynamic adjustment function is as follows:
[0084]
[0085] Where g(n,m) is a dynamic time factor that varies with the training period m and the number of iterations n. It is with a single sample The dynamic entropy factor of probability distribution change.
[0086] The dynamic time factor g(n,m) is independent of the probability distribution of each sample and is only related to the training time; therefore, it is global and can be specifically defined as follows:
[0087]
[0088] Where M represents the total number of training cycles in each iteration, μ is the critical training cycle that distinguishes the time stages before and after model training, and λ is a hyperparameter that controls the growth rate of the dynamic time factor. As the number of active learning iterations n and the training cycles m increase, the model's confidence in predictions gradually increases.
[0089] For dynamic entropy factor It depends on the predicted probability distribution of the samples, which can be specifically defined as:
[0090]
[0091] in, denotes the total sequence prediction step, u denotes a uniform probability distribution. When the model is more certain about the prediction, the entropy value of the prediction is lower, and the value of the dynamic entropy factor is higher, and the model's trust in the prediction gradually increases.
[0092] By analyzing the influence of the weight regulation function on the loss calculation, it can be seen that in the early learning stage, i.e., the current training number m < μM, the value range of the dynamic time factor is: At this time, the model has not seen enough data in the early stage, and the reliability of the learned knowledge is low, and false confident predictions are prone to occur. In this case, the algorithm increases the weight of the loss function using the label as supervision through the dynamic time factor, so that the model trusts the label more. To the late training stage, i.e., the current training iteration number m ≥ μM, the value range of the dynamic time factor is: At this time, the entropy factor gradually plays a leading role. If the model is not confident about the prediction, the entropy value of the probability distribution is greater, and the value of the entropy factor is smaller, and at this time the label is still the dominant supervision information guiding the model training; on the contrary, if the model is confident enough about the prediction, it believes that the model has learned enough knowledge to make correct predictions, and at this time the value of the entropy factor increases, and the model trusts the prediction more.
[0093] Step 6, using the augmented labeled data set to iteratively train the model θ n ;
[0094] Step 7, judge whether the model reaches the predetermined accuracy or the labeling cost reaches the upper limit, if yes, output the final model θ N , otherwise continue to repeat steps 2-6 repeatedly N times until the interactive learning stopping condition is met.
[0095] Those skilled in the art can realize that the units and algorithm steps of each example described in combination with the embodiments disclosed herein can be realized in electronic hardware or a combination of computer software and electronic hardware. Whether the functions are realized in hardware or software depends on the specific application and design constraints of the technical solution. Professionals can use different methods to implement the described functions for each specific application, but such implementation should not be considered beyond the scope of the present application.
[0096] The technical features of the above embodiments can be combined in any way. In order to make the description concise, not all possible combinations of technical features in the above embodiments are described, but as long as the combinations of technical features do not exist Contradictions, it should be considered within the scope of the present disclosure.
[0097] Those skilled in the art will appreciate that embodiments of the present application can be readily used as a method, a system or a computer program product. Accordingly, the present application can take the form of an entirely hardware embodiment, an entirely software embodiment or an embodiment combining software and hardware aspects. Furthermore, the present application can take the form of a computer program product on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROMs, optical storage devices, etc.) embodying computer-readable program code.
[0098] The above description is only the preferred embodiment of the present application, it should be pointed out that, for those skilled in the art, without departing from the principles of the present application, can make a number of improvements and refinements, these improvements and refinements should also be considered as the protection scope of the present application.
Claims
1. A noise-robust active learning method for medical document OCR recognition, characterized in that, The method comprises the following steps: Step 1, constructing a deep learning-based medical document OCR recognition model, training a medical document OCR recognition model θ0 based on an initial labeled data set; Step 2, using the trained recognition model to predict each sample in the unlabeled sample pool, and calculating the confidence of the sample, sorting the confidence scores in descending order, and selecting the top a% of samples with the smallest confidence; Step 3, the selected samples are marked by artificial; Step 4, add the labeled sample to the labeled data set, and remove the labeled sample data from the unlabeled sample pool; Step 5, iteratively train the recognition model using the updated labeled data set, and use the dynamic noise label correction loss function in the training process to guide the implicit correction of the probability distribution of the noise label, and use the corrected probability distribution as the training supervision signal; Step 6, iteratively train the recognition model θ n ; Step 7, repeat steps 2-step 6 for N times until the identification model reaches a predetermined accuracy or the labeling cost reaches an upper limit, stop active learning, and output the final identification model θ N .
2. The noise-robust active learning method for medical document OCR recognition according to claim 1, characterized in that, The process of calculating the confidence of the sample comprises the following steps: Given an input medical document image X, it is input into an OCR recognition model of a general encoder-decoder framework, the encoder encodes the input into a feature representation containing context information first, and then the decoder converts the feature representation into a probability matrix where each column vector p t represents a probability distribution in an extended total of K character space, and T is the maximum decoding step. If the recognition model is an attention mechanism-based recognition model, output the prediction of each decoding moment in the inference process and the corresponding confidence prediction The decoding process terminates upon outputting a terminal symbol EOS symbol, thereby obtaining a final predicted text string sequence For the length of the predicted text, the confidence score of the overall sequence is calculated as follows: If the recognition model is a CTC recognition model, the maximum probability prediction at each time is output to output the most likely path π, and the final prediction sequence is obtained through a mapping function B: The confidence of the corresponding sequence is calculated as: where p t (π t |X) denotes the prediction probability of path p at the t-th time step.
3. The noise-robust active learning method for medical document OCR recognition according to claim 2, characterized in that, The calculation process of the dynamic noise label correction loss function comprises the following steps: The recognition model θ0 is learned through initial labeled data, and certain category distribution knowledge is learned, and a prediction result is generated As a reference for judging whether the label is noisy and correcting the noisy label, a noise label correction loss function that changes with the training period and the prediction probability distribution is designed based on the cross entropy minimization principle for the recognition model training. The overall loss is defined as follows: wherein Loss reg represents a loss function used by the recognition model to improve recognition accuracy, for a recognition model based on an attention mechanism, Loss reg is a corresponding cross-entropy loss; for a CTC recognition model, Loss reg represents a CTC loss, is an entropy regularization term that encourages the model to output a low-entropy deterministic prediction, is a dynamic regulation function that changes with the training cycle m, the iteration number n and the prediction sample probability distribution.
4. The noise-robust active learning method for medical document OCR recognition according to claim 3, characterized in that, The dynamic regulation function calculation contains a dynamic entropy factor and a dynamic time factor calculation, which is defined as follows: where g(n,m) is a dynamic time factor that varies with training cycle m and iteration number n, is a dynamic entropy factor that varies with the probability distribution of individual samples of the probability distribution. For the dynamic time factor g(n,m), it is independent of the probability distribution of each sample, and only related to the training time, so it is global, and is defined as: Where M represents the total number of training periods in each iteration, μ is the critical training period for distinguishing the time stage before and after the model training, and λ is the hyperparameter for controlling the growth rate of the dynamic time factor. With the increase of the number of active learning iterations n and the training period m, the model's trust in prediction also gradually increases; For dynamic entropy factors The sample-dependent prediction probability distribution is defined as: where, represents the total sequence prediction step, u represents a uniform probability distribution, Ent(·) represents the entropy value of each time prediction, when the model is more certain about the prediction, the entropy value of the prediction is lower, the value of the dynamic entropy factor is higher, and the model's trust in the prediction gradually increases.
Citation Information
Patent Citations
OCR-based case text recognition method and electronic equipment
CN112861842A
Training data processing method and device and storage medium
CN114332984A