Medical bill image text detection method based on feature enhancement and multi-scale feature fusion
By adopting feature enhancement and multi-scale feature fusion methods in medical bill image detection, combining visual language pre-training model and efficient segmentation module, the detection problem of low resolution and high noise in medical bill image is solved, and a higher Accuracy and speed provide new ideas for text detection in complex scenarios.
Patent Information
- Application Number
- CN202411083092.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-08-08
- Publication Date
- 2024-11-01
AI Technical Summary
The existing text detection methods are difficult to achieve high accuracy and efficient detection in low resolution and high noise environments in medical bill images, and cannot meet the characteristics of medical bill text, resulting in insufficient recognition accuracy and speed.
Using a method based on feature enhancement and multi-scale feature fusion, combining efficient segmentation modules and learnable post-processing modules, the visual language pre-trained model ResNet50 is introduced for transfer learning, and feature enhancement and fusion is performed through EFEM and MSFM modules to generate probability maps and Threshold graph, loss calculation and model evaluation are performed, and text detection results are finally generated through the label generation algorithm.
It significantly improves the speed and accuracy of text detection of medical bills image, improves accuracy and recall, and provides new ideas for text detection in complex medical scenarios. Compared with the DBNet++ method, it shows 6.8% accuracy in medical insurance bills image detection. The rate increase and the recall rate of 7.7% increased, and the reasoning speed increased by about 43%.
Smart Images

Figure CN118887685A_ABST
Abstract
Description
Technical Field
[0001] The present invention belongs to the technical field of computer vision, and in particular relates to a medical bill image text detection method based on feature enhancement and multi-scale feature fusion. Background Art
[0002] Text is the core medium for human information transmission, communication of ideas and perception of the objective world, and is also an indispensable tool for the inheritance of civilization. The text in the image contains rich and accurate high-level semantic information, which is the key to interpreting the connotation of the image. Image-based text detection and recognition technology plays an important role in the field of computer vision and is widely used in automatic or assisted driving, multi-language real-time translation, medical auxiliary diagnosis, and visual information retrieval, creating huge economic benefits for society.
[0003] In the actual process of medical insurance claims and medical expense reimbursement, users need to upload a large amount of picture information as evidence. This picture information includes relevant picture information such as ID card photos, hospitalization reports, diagnosis reports, outpatient invoices, drug purchase invoices, drug lists, and discharge summaries. This information can help the insurance company's claims personnel and the medical insurance agency's auditors verify the authenticity of the application. However, the traditional claims method requires auditors to manually check the relevant bills and complete the claims manually. The manual verification process is not only inefficient, but also prone to errors, especially when dealing with a large number of bills. In addition, since the format and content of bills may vary from medical institution to medical institution, this also increases the difficulty of the underwriter's work.
[0004] In recent years, significant progress has been made in the field of text detection, and segmentation-based text detection methods have been widely used in the field of text detection. However, when it comes to text detection tasks in medical bill images involving dense text, extreme aspect ratios, and multi-directional text, current detection methods still cannot achieve satisfactory performance. In reality, natural scene text detection and text recognition algorithms are generally applied to bill recognition tasks. Model fine-tuning is performed with the help of bill data. Although certain effects can be achieved on bill data, there is no targeted research and analysis of the characteristics of bill text and algorithm improvement. It is impossible to solve the problems and difficulties in bill recognition tasks and it is difficult to meet the needs of actual applications. In addition, the text targets on bill images are significantly different from natural scene text targets and ordinary document text targets. The text in bills is smaller in scale, more dense in text, more noisy, and requires higher recognition accuracy. Therefore, it is of great significance to study the characteristics of medical bill text, analyze the problems and shortcomings of natural scene text detection methods in bill detection tasks, and design a bill text detection algorithm framework with high accuracy and high robustness based on this, and build a complete bill detection and recognition model based on deep learning. Summary of the invention
[0005] In view of the problems existing in the prior art, the present invention provides a text detection method based on feature enhancement and multi-scale feature fusion. The method integrates an efficient segmentation module and a learnable post-processing module, and enhances the performance of the detection method by introducing a visual language pre-training model oCLIP. The method can effectively improve the speed and accuracy of text detection in medical bill images with low resolution and high noise, and also provides new ideas for the subsequent research on text detection algorithms and engineering applications in more complex medical scenarios.
[0006] In order to achieve the above-mentioned invention object, the technical solution adopted by the present invention is: A method for detecting text in medical bill images based on feature enhancement and multi-scale feature fusion, comprising the following steps: S1: Build a medical bill image dataset and perform preprocessing operations; S2: Introduce the visual language pre-training model for transfer learning of the ResNet50 network; S3: Multi-level feature extraction based on the ResNet50 network after weight migration; S4: Efficient feature enhancement processing based on EFEM module; S5: Multi-scale feature fusion processing based on MSFM module; S6: After obtaining the final fused feature map F, the feature map is further used to generate the probability map P and the threshold map T, and on this basis, the approximate binary map is obtained through differentiable binarization. ; S7: Based on the approximate binary image Calculate the total loss, precision, recall, and F-measure of the model to evaluate the model; S8: Generate text detection results through label generation algorithm.
[0007] As a preferred method, in step S1, since the medical bill data used are all real bills collected in reality and contain a lot of privacy information, it is necessary to first desensitize the bill images; secondly, in order to ensure the consistency and effectiveness of model training, the resolution of all images is uniformly adjusted to 100 by image scaling technology. This step aims to eliminate the bias that may be introduced due to differences in image size, thereby improving the learning efficiency and generalization ability of the model.
[0008] Preferably, in step S2, the introduced visual language pre-training model adopts ResNet50 as the backbone network of its image decoder, and pre-trains the visual language pre-training model using the SynthText dataset and the ICDAR2019-LSVT dataset, so that the visual language pre-training model acquires rich visual and semantic representation capabilities; then, the obtained pre-training weights are used to perform transfer learning on the weight parameters of the ResNet50 network, that is, the weights trained by the pre-training model are transferred to the detection network.
[0009] Preferably, in step S3, in order to fully capture the multi-level features in the medical bill image, the ResNet50 network after weight migration is used to extract features of the medical bill image to obtain a multi-level feature map C, which includes four feature maps of different sizes, namely 1 / 4, 1 / 8, 1 / 16, and 1 / 32 of the original image. These feature maps gradually encode the texture, shape, and semantic information of the image from low level to high level.
[0010] Preferably, step S4 specifically includes the following steps: (1) In order to effectively integrate the multi-level feature maps C output by the ResNet50 network, we first adopt a channel adjustment strategy to uniformly adjust the number of channels of these feature maps C to 256; specifically, for feature maps with less than 256 channels, we use The convolutional layer performs channel expansion, and for feature maps with more than 256 channels, The convolutional layer performs channel reduction; this step ensures that all feature maps have the same channel dimension before being input into the efficient feature enhancement module (EFEM), which facilitates subsequent feature fusion and enhancement processing; (2) The adjusted feature map is input into the efficient feature enhancement module EFEM for enhancement processing. The text area in the feature map is made more prominent by increasing the weight. The enhanced feature map is denoted as feature map D.
[0011] As a preferred method, the efficient feature enhancement module EFEM is a cascaded U-shaped module, which includes three sub-modules: an upscale enhancement module, a pyramid attention segmentation module (PSA), and a downscale enhancement module; the input feature map is first subjected to an upscale enhancement operation to obtain an enhanced feature map, and then the feature map is sent to the PSA module; in this module, the feature map undergoes multiple steps of fine processing, including the combination of feature maps, the calculation of channel attention, and the refinement of feature maps; finally, the feature map is further enhanced in the downscale enhancement stage.
[0012] Preferably, step S5 specifically includes the following steps: (1) In order to make full use of the rich information in the multi-level feature maps extracted by the ResNet50 network, the original multi-level feature map C is first added to its corresponding feature map D after being enhanced by the EFEM module, and the result is recorded as feature map E. This addition operation aims to combine the detailed information of the original feature map with the enhanced features extracted by the EFEM module, and to combine local details with global context to generate an intermediate feature map that contains both rich details and high-level semantic information, thereby capturing fine information and overall scene understanding. (2) The added feature map E is taken as input and sent to the Multi-Scale Feature Fusion Module (MSFM) for multi-scale feature fusion. This module further extracts feature representations with strong discriminability and robustness through cross-scale feature interaction and fusion, and generates a comprehensive final feature map through upsampling and splicing operations, which is recorded as feature map F. This feature map not only integrates multi-level feature information from different depths, but also enhances the feature representation capability through the multi-scale feature fusion mechanism.
[0013] The above operations can effectively integrate multi-scale features and enhance the model's ability to perceive text targets and bill image scenes.
[0014] Preferably, in step S6, the approximate binary image is calculated The formula is as follows: in, is the magnification factor, which is 50. is the adaptive threshold map learned from the network, is the generated probability map, It is an approximate binary image The midpoint is The approximate binarization value of It is an approximate binary image An element in represents an approximate binary image The approximate binary value at the coordinate point (i, j); is the adaptive threshold map The midpoint is The adaptive threshold The coordinate point in the probability map is The probability value of .
[0015] Preferably, in step S7, the total loss of the training model is obtained by the weighted sum of three loss values: probability map loss, approximate binary map loss and threshold map loss. The calculation formula is as follows: In the above formula, Refers to the total loss of the text detection model, is the loss coefficient of the approximate binary image, which takes the value of 1. is the threshold map loss coefficient, which takes a value of 10; and They are probability map loss and approximate binary map loss, and their calculation formulas are as follows: in, Refers to a sampling set with a positive-negative sample ratio of 1:3; It means that for the probability map The predicted probability value of the pixel position, is with The corresponding label value; is the threshold map loss, which is calculated by With the real threshold map The specific calculation formula is as follows: in, represents the label of the threshold map, represents the predicted value of the threshold map during training, Represents the set of pixels in the dilated area around the text area.
[0016] Preferably, in step S7, the calculation of precision (Precision), recall (Recall), and F-measure (F-measure) is performed using the following specific formulas: in, Refers to the number of positive samples that are correctly identified. It refers to the number of labeled positive samples that are misidentified, and FN refers to the number of labeled negative samples that are misidentified.
[0017] Compared with the prior art, the beneficial effects of the present invention are: In view of the low resolution and high noise problems of medical bill images compared with natural scene text images and ordinary document text images, as well as the limitations of existing natural scene text detection methods in bill detection tasks, the present invention proposes a medical bill text detection method based on feature enhancement and multi-scale feature fusion. The method integrates an efficient segmentation module and a learnable post-processing module, and enhances the performance of the detection method by introducing a visual language pre-training model. Through the innovative combination and improvement of the algorithm, the speed and accuracy problems of medical bill text detection in complex scenarios are effectively solved, providing new ideas for the subsequent research on text detection algorithms and engineering applications in more complex medical scenarios. BRIEF DESCRIPTION OF THE DRAWINGS
[0018] Figure 1 It is the overall framework diagram of the model of the present invention; Figure 2 This is a structural diagram of the efficient feature enhancement module EFEM in the present invention; Figure 3 This is the structural diagram of the multi-scale feature fusion module MSFM in the present invention. DETAILED DESCRIPTION
[0019] The technical scheme of the present invention is further specifically described below through examples, which are provided for the purpose of explaining the present invention, not for limiting the present invention. Based on the examples in this application, all other examples obtained by ordinary technicians in this field without creative work are within the scope of protection of this application.
[0020] Reference Figure 1 , a medical bill image text detection method based on feature enhancement and multi-scale feature fusion, specifically comprising the following steps: S1: Build a medical bill image dataset and perform preprocessing operations; Since the medical bill data used are all real bills collected in reality and contain a lot of private information, it is necessary to first desensitize the bill images. Secondly, in order to ensure the consistency and effectiveness of model training, the resolution of all images is uniformly adjusted to 1000 by image scaling technology. This step aims to eliminate the bias that may be introduced due to differences in image size, thereby improving the learning efficiency and generalization ability of the model.
[0021] S2: Introduce the visual language pre-training model for transfer learning of the ResNet50 network; The introduced visual language pre-training model uses ResNet50 as the backbone network of its image decoder, and uses the SynthText dataset and ICDAR2019-LSVT dataset for pre-training on the visual language training model, so that the visual language pre-training model obtains rich visual and semantic representation capabilities; then the obtained pre-training weights are used to perform transfer learning on the weight parameters of the ResNet50 network, that is, the weights trained by the pre-training model are transferred to the detection network.
[0022] S3: Multi-level feature extraction based on the ResNet50 network after weight migration; In order to fully capture the multi-level features in the medical bill image, the ResNet50 network after weight migration is used to extract the features of the medical bill image to obtain a multi-level feature map C, which includes four feature maps of different sizes, namely 1 / 4, 1 / 8, 1 / 16, and 1 / 32 of the original image. These feature maps gradually encode the texture, shape, and semantic information of the image from low to high levels.
[0023] S4: Efficient feature enhancement processing based on EFEM module, which is further divided into the following steps: Figure 2 As shown: (1) In order to effectively integrate the multi-level feature maps C output by the ResNet50 network, a channel adjustment strategy is first adopted to uniformly adjust the number of channels of these feature maps C to 256. Specifically, for feature maps with less than 256 channels, use The convolutional layer performs channel expansion, and for feature maps with more than 256 channels, The convolutional layer performs channel reduction. This step ensures that all feature maps have the same channel dimension before being input into the efficient feature enhancement module (EFEM), which facilitates subsequent feature fusion and enhancement processing;
[0024] (2) The adjusted feature map is input into the efficient feature enhancement module EFEM for enhancement processing. By increasing the weight, the text area in the feature map is displayed more prominently. The enhanced feature map is recorded as feature map D. The efficient feature enhancement module EFEM is a cascaded U-shaped module, which contains three submodules: upscale enhancement module, pyramid attention segmentation module (PSA), and downscale enhancement module. The input feature map first undergoes an upscale enhancement operation to obtain the enhanced feature map, and then the feature map is sent to the PSA module. In this module, the feature map undergoes multiple steps of fine processing, including feature map combination, channel attention calculation, and feature map refinement. Finally, the feature map is further enhanced in the downscale enhancement stage.
[0025] S5: Multi-scale feature fusion processing based on MSFM module, this step is further divided into the following steps: Figure 3 As shown: (1) In order to make full use of the rich information in the multi-level feature map extracted by the ResNet50 network, the original multi-level feature map C is first added to its corresponding feature map D after being enhanced by the EFEM module, and the result is recorded as feature map E. This addition operation aims to combine the detail information of the original feature map with the enhanced features extracted by the EFEM module, and to combine local details with global context to generate an intermediate feature map that contains both rich details and high-level semantic information, thereby capturing fine information and overall scene understanding.
[0026] (2) The added feature map E is used as input to the Multi-Scale Feature Fusion Module (MSFM) for multi-scale feature fusion. This module further extracts feature representations with strong discriminability and robustness through cross-scale feature interaction and fusion, and generates a comprehensive final feature map through upsampling and splicing operations, which is recorded as feature map F. This feature map not only integrates multi-level feature information from different depths, but also enhances the feature representation capability through the multi-scale feature fusion mechanism.
[0027] S6: After obtaining the final fused feature map F, the feature map is further used to generate the probability map P and the threshold map T, and on this basis, the approximate binary map is obtained through differentiable binarization. . Calculate the approximate binary image The formula is as follows:
[0028] in, is the magnification factor, which is 50. is the adaptive threshold map learned from the network, is the generated probability map, It is an approximate binary image The midpoint is The approximate binarization value of is the adaptive threshold map The midpoint is The adaptive threshold The coordinate point in the probability map is The probability value of .
[0029] S7: Based on the approximate binarization image Calculate the total loss, precision, recall, and F-measure of the model to evaluate the model; The total loss of the training model is obtained by the weighted sum of the three loss values of probability map loss, approximate binary map loss, and threshold map loss. The calculation formula is as follows: In the above formula, Refers to the total loss of the text detection model, is the loss coefficient of the approximate binary image, which takes the value of 1. is the threshold map loss coefficient, which takes a value of 10; and They are probability map loss and approximate binary map loss, and their calculation formulas are as follows: in, Refers to a sampling set with a positive-negative sample ratio of 1:3; It means that for the probability map The predicted probability value of the pixel position, is with The corresponding label value; is the threshold map loss, which is calculated by With the real threshold map The specific calculation formula is as follows: in, represents the label of the threshold map, represents the predicted value of the threshold map during training, Represents the set of pixels in the dilated area around the text area.
[0030] The calculation formulas for precision, recall, and F-measure are as follows: in, Refers to the number of positive samples that are correctly identified. It refers to the number of labeled positive samples that are misidentified, and FN refers to the number of labeled negative samples that are misidentified.
[0031] S8: Generate text detection results through label generation algorithm.
[0032] The present invention is specifically applied to the text detection of medical insurance receipt images, and compared with the existing text detection algorithm DBNet++, reflecting the advantages of the present invention in detection accuracy and speed. First, the network in the present invention is pre-trained on the SynthText dataset and the ICDAR2019-LSVT dataset, and then a fine-tuning process of 1200 epochs is performed on the constructed real medical receipt dataset, where the number of samples in each batch is set to 16. In the selection of the optimizer, the Stochastic Gradient Descent (SGD) algorithm with momentum is adopted, the momentum is set to 0.9, and the weight decay is 0.0001. The initial learning rate is set to 0.007, and the Poly strategy is used to decay the learning rate. The experimental results show that compared with the text detection algorithm DBNet++, the method proposed in the present invention improves the accuracy by 6.8%, the recall by 7.7%, and the inference speed by about 43%.
[0033] The present invention aims to solve the problem that medical bill images are full of various noises (such as stains, scratches, handwriting, and seal images, etc.), which makes traditional text detection methods ineffective. A text detection method based on efficient feature enhancement and multi-scale feature fusion is proposed. The method combines an efficient segmentation module and a learnable post-processing module, and enhances the performance of the detection method by introducing a visual language pre-training model. Through the innovative combination and improvement of the algorithm, the present invention effectively solves the problem of medical bill text detection in complex scenarios, and has greatly improved accuracy and speed compared with existing text detection methods.
[0034] Finally, it should be noted that the above are only some specific embodiments of the present invention. Obviously, the present invention is not limited to the above embodiments, and there are many variations. All variations that can be directly derived or associated with the content disclosed by ordinary technicians in this field should be considered as the protection scope of the present invention.
Claims
1. A method for text detection in medical bill images based on feature enhancement and multi-scale feature fusion. Features The architecture of the medical bill image text detection algorithm based on feature enhancement and multi-scale feature fusion is constructed, which specifically includes the following steps: S1: Build a medical bill image dataset and perform preprocessing operations; S2: Introduce the visual language pre-training model for transfer learning of the ResNet50 network; S3: Multi-level feature extraction based on the ResNet50 network after weight migration; S4: Feature enhancement processing based on EFEM module; S5: Multi-scale feature fusion processing based on MSFM module; S6: After obtaining the final fused feature map F, the feature map F is further used to generate the probability map P and the threshold map T, and on this basis, the approximate binary map is obtained through differentiable binarization. ; S7: Based on the approximate binary image Calculate the total loss, precision, recall, and F-measure of the model to evaluate the model; S8: Generate text detection results through label generation algorithm.
2. According to claim 1, the medical bill image text detection method based on feature enhancement and multi-scale feature fusion, Features In step S1, the preprocessing includes: first desensitizing the bill image; then adjusting the resolution of all images to uniform Pixel.
3. According to claim 1, the medical bill image text detection method based on feature enhancement and multi-scale feature fusion, Features: In step S2, the introduced visual language pre-training model uses ResNet50 as the backbone network of its image decoder, and pre-trains the visual language pre-training model using the SynthText dataset and the ICDAR2019-LSVT dataset, so that the visual language pre-training model obtains rich visual and semantic representation capabilities; then, the obtained pre-training weights are used to perform transfer learning on the weight parameters of the ResNet50 network, that is, the weights trained by the pre-training model are transferred to the detection network.
4. According to claim 3, the method for detecting text in medical bill images based on feature enhancement and multi-scale feature fusion, Features: In step S3, in order to fully capture the multi-level features in the medical bill image, the ResNet50 network after weight transfer in step S2 is used to extract features of the medical bill image to obtain a multi-level feature map C, which includes four feature maps of different sizes, namely 1 / 4, 1 / 8, 1 / 16, and 1 / 32 of the original image. These feature maps gradually encode the texture, shape, and semantic information of the image from low to high levels.
5. According to claim 4, the method for detecting text in medical bill images based on feature enhancement and multi-scale feature fusion, Features Step S4 specifically includes the following steps: (1) Adopt the channel adjustment strategy to uniformly adjust the number of channels of feature map C to 256; specifically, for feature maps with less than 256 channels, use The convolutional layer performs channel expansion, and for feature maps with more than 256 channels, The convolutional layer performs channel compression; (2) The adjusted feature map is input into the efficient feature enhancement module EFEM for enhancement processing. The text area in the feature map is made more prominent by increasing the weight. The enhanced feature map is denoted as feature map D.
6. The method for detecting text in medical bill images based on feature enhancement and multi-scale feature fusion according to claim 5, Features: The efficient feature enhancement module EFEM is a cascaded U-shaped module, which consists of three submodules: an upscale enhancement module, a pyramid attention segmentation module, and a downscale enhancement module. The input feature map C is first subjected to an upscale enhancement operation to obtain an enhanced feature map, which is then fed into the pyramid attention segmentation module. In this module, the feature map undergoes multiple steps of refinement, including the combination of feature maps, the calculation of channel attention, and the refinement of feature maps; finally, the feature map is further enhanced in the downscale enhancement stage.
7. The method for detecting text in medical bill images based on feature enhancement and multi-scale feature fusion according to claim 5, Features Step S5 specifically includes the following steps: (1) Add the original multi-level feature map C and their corresponding feature maps D after feature enhancement by the EFEM module, and the result is recorded as feature map E; (2) The added feature map E is taken as input and sent to the multi-scale feature fusion module MSFM for multi-scale feature fusion. The multi-scale feature fusion module further extracts feature representations with strong discriminability and robustness through cross-scale feature interaction and fusion, and generates a comprehensive final feature map through upsampling and splicing operations, which is recorded as feature map F. Feature map F not only integrates multi-level feature information from different depths, but also enhances the feature representation capability through the multi-scale feature fusion mechanism.
8. The medical bill image text detection method based on feature enhancement and multi-scale feature fusion according to claim 1, Features In step S6, the approximate binary image is calculated The formula is as follows: in, is the magnification factor, which is 50. is the adaptive threshold map learned from the network, is the generated probability map, It is an approximate binary image The midpoint is The approximate binarization value of is the adaptive threshold map The midpoint is The adaptive threshold The coordinate point in the probability map is The probability value of .
9. The medical bill image text detection method based on feature enhancement and multi-scale feature fusion according to claim 1, Features In step S7, the total loss of the training model is obtained by the weighted sum of the three loss values of probability map loss, approximate binary map loss and threshold map loss. The calculation formula is as follows: In the above formula, Refers to the total loss of the text detection model, is the loss coefficient of the approximate binary image, which takes the value of 1. is the threshold map loss coefficient, which takes a value of 10; and They are probability map loss and approximate binary map loss, and their calculation formulas are as follows: in, Refers to a sampling set with a positive and negative sample ratio of 1:
3. It means that for the probability map The predicted probability value of the pixel position, is with The corresponding label value; is the threshold map loss, which is calculated by With the real threshold map The specific calculation formula is as follows: in, represents the label of the threshold map, represents the predicted value of the threshold map during training, Represents the set of pixels in the dilated area around the text area.
10. The medical bill image text detection method based on feature enhancement and multi-scale feature fusion according to claim 1, Features In step S7, the calculation formulas of precision, recall, and F-measure are as follows: in, Refers to the number of positive samples that are correctly identified. It refers to the number of labeled positive samples that are misidentified, and FN refers to the number of labeled negative samples that are misidentified.
Citation Information
Cited By
Identification and correction method and system based on bill orientation
CN119091451A
Method and system for identifying and correcting bill orientation
CN119091451B
Text information-based ship open set target detection method and system
CN119272069A
Low-light food package image enhancement and identification method, system and terminal
CN119784655A
Subway tunnel structure disease type prediction method and system
CN119863456A
