Image classification device and method

The recursive double-layer neural network is used to process medical prescription images in specific fields, generate pseudo labels and perform cross-entropy loss calculations, which solves the problem of high recognition error rate in existing OCR technology in specific fields and achieves more efficient image classification and processing. .

CN113903027BActive Publication Date: 2024-10-29GUANGZHOU TIANCHEN HEALTH TECH CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202111248897.6
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-10-26
Publication Date
2024-10-29
Estimated Expiration
2041-10-26

AI Technical Summary

Technical Problem

Existing OCR text recognition technology has a high error rate in specific fields, such as medical prescription image processing, and cannot be automated, resulting in low processing efficiency and requiring a lot of manual review and correction.

Method used

A recursive two-layer neural network is used to generate pseudo labels and calculate cross-entropy loss through the image preprocessing module, the first and second neural network modules, the feature fusion module and the classifier to improve the model's generalization ability and accuracy.

Benefits of technology

It improves the accuracy of image recognition and processing, reduces manpower investment, improves efficiency and saves costs.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN113903027B_ABST
    Figure CN113903027B_ABST
Patent Text Reader

Abstract

The present invention discloses an image classification device and method, wherein an image classification device includes an image preprocessing module, a first neural network module, a second neural network module, a feature fusion module, a classifier, and an overall loss function module, wherein: the image preprocessing module is used to enhance the unlabeled image of the input image to obtain the first enhanced image and the second enhanced image; the first neural network module and the second neural network module are used to extract the feature information of the input image to obtain a feature set; the feature fusion module is used to obtain the feature loss score; the classifier is used to obtain the target classification of the image; the overall loss function module is used to calculate the loss of the device and update the neural network module. The model and method described in the present invention can significantly improve the classification accuracy in the image classification process.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of image processing, and in particular to a picture classification device and method. Background Art

[0002] In the traditional process of image processing in specific fields, due to the professionalism and particularity of the text on the image, a lot of manual review and processing is often required, which is difficult to automate. Therefore, the processing process of these images is not only inefficient, but also prone to errors. Now there are some OCR text recognition technology that automatically recognizes paper images as structured electronic images, which has significantly improved the efficiency of image processing. However, it is found in actual practice that general OCR text recognition technology cannot adapt to text recognition in specific fields, and the error rate is very high. For example, in the medical field, in the process of processing prescription images, since the prescription contains a large number of special terms in the medical field, there are many recognition errors after OCR technology processing, and a lot of review and correction work is still required in the later stage. At present, this part of the review and correction work can only be done manually, and machine automation cannot be realized, resulting in the overall work efficiency is still low. How to solve the efficiency and accuracy of automatic classification of images in such specific fields is a technical problem that needs to be solved in this field. Summary of the invention

[0003] In order to solve the above defects in the prior art, the present invention provides a picture classification device and a picture classification method.

[0004] In order to achieve the above objectives, the present invention proposes an image classification device, including an image preprocessing module, a first neural network module, a second neural network module, a feature fusion module, a classifier, and an overall loss function module, wherein:

[0005] The image preprocessing module is used to enhance the unlabeled image of the input image to obtain a first enhanced image and a second enhanced image;

[0006] The first neural network module extracts features of the first enhanced image and features of the labeled image of the input image to obtain a first feature set, and generates a first pseudo label according to the first enhanced image, wherein the first feature set includes a first labeled feature vector and a first unlabeled feature vector; as a preferred embodiment, the pseudo labels are all predicted by using a softmax classifier;

[0007] The second neural network module is used to extract features of the second enhanced image and features of the labeled image of the input image to obtain a second feature set, and generate a second pseudo label according to the second enhanced image, wherein the second feature set includes a second labeled feature vector and a second unlabeled feature vector; as a preferred embodiment, the pseudo labels are predicted by using a softmax classifier;

[0008] The feature fusion module fuses the first unlabeled feature vector and the second pseudo label, and fuses the first pseudo label and the second unlabeled feature vector to obtain a feature loss score;

[0009] The classifier is used to obtain the target classification of the image according to the feature loss score;

[0010] The overall loss function module is used to calculate the loss of the device and update the first neural network module.

[0011] Furthermore, the first neural network module includes:

[0012] A first feature extraction module: used to extract features of the first enhanced image and features of the labeled image of the input image to obtain a first feature set;

[0013] A first classifier module: used to calculate a cross entropy loss value according to a feature vector of the labeled image and generate a first pseudo label;

[0014] A second classifier module: used to calculate a cross entropy loss value according to a feature vector of the labeled image, and generate a first pseudo label according to the first enhanced image;

[0015] The first loss function module is used to perform weighted summation of the loss values ​​output by the first classifier module and the second classifier module to obtain the overall loss value of the first neural network module.

[0016] Furthermore, the second neural network comprises:

[0017] A second feature extraction module: used to extract features of the second enhanced image and features of the labeled image of the input image to obtain a second feature set;

[0018] A third classifier module: used to calculate a cross entropy loss value according to the feature vector of the labeled image, and generate a second pseudo label according to the second enhanced image;

[0019] A fourth classifier module: used for calculating a loss value according to features of the second enhanced image;

[0020] The second loss function module is used to perform weighted summation of the loss values ​​output by the third classifier module and the fourth classifier module to obtain the overall loss value of the second neural network module.

[0021] Furthermore, the second neural network also includes an updating module, which updates the second feature extraction module according to the overall loss of the second neural network module.

[0022] Furthermore, the device includes at least one first neural network.

[0023] Furthermore, the device comprises at least one second neural network.

[0024] Furthermore, the overall loss function module also includes updating parameters of the second neural network module.

[0025] The present invention also discloses a picture classification method, which is applied to a picture classification device, comprising:

[0026] Read in an input image, wherein the input image includes a labeled image and an unlabeled image;

[0027] Performing enhancement processing on the unlabeled image to obtain a first enhanced image and a second enhanced image;

[0028] Inputting the first enhanced image and the labeled image into a first neural network module to obtain a first feature set and a first pseudo label;

[0029] Inputting the second enhanced image and the labeled image into a second neural network module to obtain a second feature set and a second pseudo label;

[0030] The first feature set, the second feature set, the first pseudo-label and the second pseudo-label are input into a feature fusion module to obtain a feature loss value; specifically, the feature fusion module fuses the first unlabeled feature vector and the second pseudo-label, and fuses the first pseudo-label and the second unlabeled feature vector.

[0031] Input the feature loss value into the classifier to obtain the target classification of the image;

[0032] Calculating the loss of the image classification device using the overall loss function module and updating the first neural network module;

[0033] The picture classification device is any one of the picture classification devices described above.

[0034] Furthermore, after calculating the loss of the device using the overall loss function module, the method also includes: updating the second neural network module.

[0035] The present invention also discloses an electronic device, comprising: a processor, a storage medium and a bus, wherein the storage medium stores machine-readable instructions executable by the processor. When the electronic device is running, the processor communicates with the storage medium through the bus, and the processor executes the machine-readable instructions to execute the prescription identification method.

[0036] The present invention also discloses a storage medium, on which a computer program is stored. When the computer program is run by a processor, the prescription recognition method is executed.

[0037] In actual applications, the modules described in the method and system disclosed in the present invention can be deployed in multiple modules on one target server, or each module can be independently deployed on different target servers. In particular, in order to provide more powerful computing processing capabilities, the modules can also be deployed on cluster target servers as needed.

[0038] It can be seen that the image classification device of the present invention adopts a recursive two-layer neural network to enhance the generalization ability of the image classification device, and adopts different enhancement methods for the same unlabeled image, so that the obtained feature distribution is close, which can solve the problem that the existing OCR text recognition technology cannot effectively classify images, improves the accuracy in the image recognition and processing process, reduces manpower input, improves efficiency and saves costs.

[0039] In order to have a clearer and more comprehensive understanding of the present invention, the specific implementation methods of the present invention are described in detail below in conjunction with the accompanying drawings. BRIEF DESCRIPTION OF THE DRAWINGS

[0040] In order to more clearly illustrate the technical solutions in the embodiments of the present application, the following briefly introduces the drawings required for use in the description of the embodiments. Obviously, the drawings described below are only some embodiments of the present application, and those skilled in the art can obtain other drawings based on these drawings without creative work.

[0041] Figure 1 A schematic diagram of the structure of an image classification device according to an embodiment of the present application.

[0042] Figure 2 A schematic diagram of a specific implementation structure of a first neural network according to an embodiment of the present application.

[0043] Figure 3 A schematic diagram of a specific implementation structure of a second neural network according to an embodiment of the present application.

[0044] Figure 4 Another structural schematic diagram of an image classification device according to an embodiment of the present application.

[0045] Among them: image preprocessing module 1, first neural network module 2, second neural network module 3, feature fusion module 4, classifier 5, overall loss function module 6. DETAILED DESCRIPTION

[0046] See also Figure 1 , Figure 1A structural schematic diagram of a picture classification device is shown.

[0047] The present application discloses an image classification device, which reads input images, including labeled images and unlabeled images. First, different enhancement processes are performed on the unlabeled images in the input images to obtain two groups of enhanced input images. Then, the two enhanced input images are analyzed independently by a first neural network module and a second neural network module to obtain two groups of feature sets and pseudo labels respectively. Then, the output is subjected to cross-feature fusion processing to obtain a loss function score. Then, a classifier is used to obtain a target classification of the image. Finally, the overall loss function module is used to calculate the loss of the device, and the first neural network module is updated according to the loss. As a preferred embodiment, the first neural network and the second neural network can be updated simultaneously, which has the advantage of further improving the accuracy.

[0048] As an implementation mode, the image classification device of the embodiment of the present application includes an image preprocessing module, a first neural network module, a second neural network module, a feature fusion module, a classifier, and an overall loss function module, wherein:

[0049] The image preprocessing module is used to enhance the unlabeled image of the input image to obtain a first enhanced image and a second enhanced image;

[0050] The first neural network module is used to extract features of the first enhanced image and features of the labeled image of the input image to obtain a first feature set, and generate a first pseudo label according to the first enhanced image, wherein the first feature set includes a first labeled feature vector and a first unlabeled feature vector;

[0051] The second neural network module is used to extract features of the second enhanced image and features of the labeled image of the input image to obtain a second feature set, and generate a second pseudo label according to the second enhanced image, wherein the second feature set includes a second labeled feature vector and a second unlabeled feature vector;

[0052] The feature fusion module fuses the first unlabeled feature vector and the second pseudo label, and fuses the first pseudo label and the second unlabeled feature vector to obtain a feature loss score;

[0053] The classifier is used to obtain the target classification of the image according to the feature loss score;

[0054] The overall loss function module is used to calculate the loss of the device and update the first neural network module.

[0055] In this embodiment, the image preprocessing module uses two different enhancement methods for the unlabeled images, with the purpose of enhancing the generalization ability of the network. As an example, the first enhancement method can be splicing, horizontal flipping, image contrast enhancement, etc., and the second enhancement method is random cropping, scaling, zero padding, color jitter, adding noise, etc. Using different enhancement methods for the same unlabeled image, the resulting feature distribution is closer, thereby enhancing the model's anti-noise ability.

[0056] As an implementation method, the above pseudo labels are all predicted using a softmax classifier.

[0057] As an implementation method, the overall loss function module also includes updating the parameters of the second neural network module. For details, please refer to Figure 4 Another structural schematic diagram is shown.

[0058] See also Figure 2 , Figure 2 A schematic diagram of a specific implementation structure of a first neural network is shown.

[0059] As an implementation method, the first neural network module includes a first feature extraction module, a first classifier module, a second classifier module, and a first loss function module, wherein:

[0060] A first feature extraction module: used to extract features of the first enhanced image and features of the labeled image of the input image to obtain a first feature set;

[0061] The first classifier module is used to calculate the cross entropy loss value according to the feature vector of the labeled image, and generate a first pseudo label according to the first enhanced image; in a specific implementation, the first classifier module calculates the cross entropy loss according to the feature vector of the input labeled image, and then uses the softmax function to generate the first pseudo label of the unlabeled image.

[0062] The second classifier module is used to calculate the loss according to the characteristics of the first enhanced image. In a specific implementation, the second classifier module multiplies the first pseudo label of the first type of enhanced data by the characteristics of the second type of enhanced data to obtain the loss.

[0063] The first loss function module is used to perform weighted summation of the loss values ​​output by the first classifier module and the second classifier module to obtain the overall loss value of the first neural network module.

[0064] See also Figure 3 , Figure 3 A schematic diagram of a specific implementation structure of a second neural network is shown.

[0065] As an implementation mode, the second neural network in the embodiment of the present application includes a second feature extraction module, a third classifier module, a fourth classifier module, and a second loss function module, wherein:

[0066] A second feature extraction module: used to extract features of the second enhanced image and features of the labeled image of the input image to obtain a second feature set;

[0067] The third classifier module is used to calculate the cross entropy loss value according to the feature vector of the labeled image, and generate a second pseudo label according to the second enhanced image. In a specific application, the feature set obtained by the first neural network can be used to generate a second pseudo label for the unlabeled image using a softmax function.

[0068] The fourth classifier module is used to calculate the loss value according to the features of the second enhanced image.

[0069] The second loss function module is used to perform weighted summation of the loss values ​​output by the third classifier module and the fourth classifier module to obtain the overall loss value of the second neural network module.

[0070] As a preferred implementation, the second neural network described in the embodiment of the present application also includes an update module, which updates the second feature extraction module according to the overall loss of the second neural network module.

[0071] When processing a large amount of data, in order to improve the efficiency and accuracy of the processing, as a preferred embodiment, the device includes at least one first neural network. Similarly, as a preferred embodiment, the device includes at least one second neural network.

[0072] As a preferred implementation, the feature fusion module in the embodiment of the present application is implemented using a CNN convolutional neural network, which is used to fuse the input features to obtain richer features.

[0073] See also Figure 4 , Figure 4 A schematic diagram of a specific implementation structure of a picture classification device is shown.

[0074] As an implementation method, the image classification device in the embodiment of the present application includes an image preprocessing module, a first neural network module, a second neural network module, a feature fusion module, a classifier, and an overall loss function module, wherein:

[0075] The image preprocessing module is used to enhance the unlabeled image of the input image to obtain a first enhanced image and a second enhanced image;

[0076] The first neural network module is used to extract features of the first enhanced image and features of the labeled image of the input image to obtain a first feature set, and generate a first pseudo label according to the first enhanced image, wherein the first feature set includes a first labeled feature vector and a first unlabeled feature vector;

[0077] The second neural network module is used to extract features of the second enhanced image and features of the labeled image of the input image to obtain a second feature set, and generate a second pseudo label according to the second enhanced image, wherein the second feature set includes a second labeled feature vector and a second unlabeled feature vector;

[0078] The feature fusion module fuses the first unlabeled feature vector and the second pseudo label, and fuses the first pseudo label and the second unlabeled feature vector to obtain a feature loss score;

[0079] The classifier is used to obtain the target classification of the image according to the feature loss score; when the device is used in different industries, the target classification is different. As an example, in the medical prescription image recognition application, the prescription image is a target classification.

[0080] The overall loss function module is used to calculate the loss of the device and update the first neural network module.

[0081] In this embodiment, the first neural network module includes a first feature extraction module, a first classifier module, a second classifier module, and a first loss function module. Figure 2 Schematic diagram of the structure of the first neural network shown.

[0082] In this embodiment, the second neural network module includes a second feature extraction module, a fourth classifier module, a third classifier module, a second loss function module, and an update module. For details, please refer to Figure 3 Schematic diagram of the structure of the second neural network shown.

[0083] Based on the recognition and error correction device of the above embodiment, the present application also discloses a prescription recognition method, which is applied to the image classification device, and the steps include:

[0084] Read in an input image, wherein the input image includes a labeled image and an unlabeled image;

[0085] Performing enhancement processing on the unlabeled image to obtain a first enhanced image and a second enhanced image;

[0086] Inputting the first enhanced image and the labeled image into a first neural network module to obtain a first feature set and a first pseudo label;

[0087] Inputting the second enhanced image and the labeled image into a second neural network module to obtain a second feature set and a second pseudo label;

[0088] Inputting the first feature set, the second feature set, the first pseudo label and the second pseudo label into a feature fusion module to obtain a feature loss value;

[0089] Input the feature loss value into the classifier to obtain the target classification of the image;

[0090] Calculating the loss of the image classification device using the overall loss function module and updating the first neural network module;

[0091] Among them, the picture classification device is the picture classification device of any one of the above embodiments.

[0092] As an implementation mode, after calculating the loss of the device using the overall loss function module, the method further includes: updating the second neural network module.

[0093] The present application also provides an electronic device, including: a processor, a storage medium and a bus, wherein the storage medium stores machine-readable instructions executable by the processor, and when the electronic device is running, the processor communicates with the storage medium through the bus, and the processor executes the machine-readable instructions to perform the method described in the above embodiment.

[0094] The present application also provides a storage medium, on which a computer program is stored. When the computer program is executed by a processor, the method described in the above embodiment is executed.

[0095] It should be noted that, a person skilled in the art can understand that all or part of the steps in each method of the above embodiments can be completed by instructing related hardware through a computer program, and the computer program can be stored in a computer-readable storage medium, and the storage medium can include but is not limited to: read-only memory (ROM), random access memory (RAM), disk or optical disk, etc.

[0096] The above description of the disclosed embodiments enables one skilled in the art to implement or use the present invention. Many modifications to these embodiments will be apparent to one skilled in the art, and the general principles defined herein may be implemented in other embodiments without departing from the spirit or scope of the present invention. Therefore, the present invention will not be limited to the embodiments shown herein, but rather to the widest scope consistent with the principles and novel features disclosed herein.

Claims

1. A picture classification device, characterized in that: It includes an image preprocessing module, a first neural network module, a second neural network module, a feature fusion module, a classifier, and an overall loss function module, wherein: The image preprocessing module is used to enhance the unlabeled image of the input image to obtain a first enhanced image and a second enhanced image; The first neural network module is used to extract features of the first enhanced image and features of the labeled image of the input image to obtain a first feature set, and generate a first pseudo label according to the first enhanced image, wherein the first feature set includes a first labeled feature vector and a first unlabeled feature vector; The second neural network module is used to extract features of the second enhanced image and features of the labeled image of the input image to obtain a second feature set, and generate a second pseudo label according to the second enhanced image, wherein the second feature set includes a second labeled feature vector and a second unlabeled feature vector; The feature fusion module fuses the first unlabeled feature vector and the second pseudo label, and fuses the first pseudo label and the second unlabeled feature vector to obtain a feature loss score; The classifier is used to obtain the target classification of the image according to the feature loss score; The overall loss function module is used to calculate the loss of the device and update the first neural network module.

2. The image classification device according to claim 1, characterized in that: The first neural network module comprises: A first feature extraction module: used to extract features of the first enhanced image and features of the labeled image of the input image to obtain a first feature set; A first classifier module: used to calculate a cross entropy loss value according to a feature vector of the labeled image, and generate a first pseudo label according to the first enhanced image; A second classifier module: used to calculate the loss according to the features of the first enhanced image; The first loss function module is used to perform weighted summation of the loss values ​​output by the first classifier module and the second classifier module to obtain the overall loss value of the first neural network module.

3. The image classification device according to claim 1, characterized in that: The second neural network comprises: A second feature extraction module: used to extract features of the second enhanced image and features of the labeled image of the input image to obtain a second feature set; A third classifier module: used to calculate a cross entropy loss value according to the feature vector of the labeled image, and generate a second pseudo label according to the second enhanced image; A fourth classifier module: used for calculating a loss value according to features of the second enhanced image; The second loss function module is used to perform weighted summation of the loss values ​​output by the third classifier module and the fourth classifier module to obtain the overall loss value of the second neural network module.

4. The image classification device according to claim 3, characterized in that: The second neural network also includes an updating module, which updates the second feature extraction module according to the overall loss of the second neural network module.

5. The image classification device according to claim 1, characterized in that: The apparatus comprises at least one first neural network.

6. The image classification device according to claim 1 or 5, characterized in that: The apparatus comprises at least one second neural network.

7. The image classification device according to claim 1, characterized in that: The overall loss function module also includes updating the second neural network module.

8. A method for classifying pictures, applied to a picture classification device, comprising the steps of: Read in an input image, wherein the input image includes a labeled image and an unlabeled image; Performing enhancement processing on the unlabeled image to obtain a first enhanced image and a second enhanced image; Inputting the first enhanced image and the labeled image into a first neural network module to obtain a first feature set and a first pseudo label; Inputting the second enhanced image and the labeled image into a second neural network module to obtain a second feature set and a second pseudo label; Inputting the first feature set, the second feature set, the first pseudo label and the second pseudo label into a feature fusion module to obtain a feature loss value; Input the feature loss value into the classifier to obtain the target classification of the image; Calculating the loss of the image classification device using the overall loss function module and updating the first neural network module; Its characteristic is that the picture classification device is the picture classification device described in any one of claims 1-7.

9. The image classification method according to claim 8, characterized in that: After the loss of the device is calculated using the overall loss function module, the method also includes: updating the second neural network module.

10. An electronic device, comprising: A processor, a storage medium and a bus, wherein the storage medium stores machine-readable instructions executable by the processor, and when the electronic device is running, the processor communicates with the storage medium via the bus, and the processor executes the machine-readable instructions to perform the method as claimed in claim 8 or 9.

11. A storage medium, characterized in that: The storage medium stores a computer program, and the computer program executes the method according to claim 8 or 9 when executed by a processor.

Citation Information

Patent Citations

  • Image classification method and system based on self-supervised learning

    CN110909820A

  • Semi-supervised pedestrian re-identification method based on deep multi-model cooperation

    CN112115780A