CN113177479B - Image classification method, device, electronic equipment and storage medium - Google Patents

Image classification method, device, electronic equipment and storage medium Download PDF

Info

Publication number
CN113177479B
CN113177479B CN202110475943.XA CN202110475943A CN113177479B CN 113177479 B CN113177479 B CN 113177479B CN 202110475943 A CN202110475943 A CN 202110475943A CN 113177479 B CN113177479 B CN 113177479B
Authority
CN
China
Prior art keywords
image
initial
category
determining
classification
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN202110475943.XA
Other languages
Chinese (zh)
Other versions
CN113177479A (en
Inventor
尹芳
马晶
马杰
张晓璐
肖劲
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Lianren Healthcare Big Data Technology Co Ltd
Original Assignee
Lianren Healthcare Big Data Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Lianren Healthcare Big Data Technology Co Ltd filed Critical Lianren Healthcare Big Data Technology Co Ltd
Priority to CN202110475943.XA priority Critical patent/CN113177479B/en
Publication of CN113177479A publication Critical patent/CN113177479A/en
Application granted granted Critical
Publication of CN113177479B publication Critical patent/CN113177479B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F18/00Pattern recognition
    • G06F18/20Analysing
    • G06F18/21Design or setup of recognition systems or techniques; Extraction of features in feature space; Blind source separation
    • G06F18/214Generating training patterns; Bootstrap methods, e.g. bagging or boosting
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/30Information retrieval; Database structures therefor; File system structures therefor of unstructured textual data
    • G06F16/35Clustering; Classification
    • G06F16/353Clustering; Classification into predefined classes
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F40/00Handling natural language data
    • G06F40/20Natural language analysis
    • G06F40/279Recognition of textual entities
    • G06F40/289Phrasal analysis, e.g. finite state techniques or chunking
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06NCOMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
    • G06N3/00Computing arrangements based on biological models
    • G06N3/02Neural networks
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06VIMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
    • G06V30/00Character recognition; Recognising digital ink; Document-oriented image-based pattern recognition
    • G06V30/40Document-oriented image-based pattern recognition
    • G06V30/41Analysis of document content
    • G06V30/413Classification of content, e.g. text, photographs or tables

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Data Mining & Analysis (AREA)
  • Artificial Intelligence (AREA)
  • General Engineering & Computer Science (AREA)
  • Computer Vision & Pattern Recognition (AREA)
  • General Health & Medical Sciences (AREA)
  • Health & Medical Sciences (AREA)
  • Evolutionary Computation (AREA)
  • Computational Linguistics (AREA)
  • Life Sciences & Earth Sciences (AREA)
  • Computing Systems (AREA)
  • Software Systems (AREA)
  • Bioinformatics & Cheminformatics (AREA)
  • Bioinformatics & Computational Biology (AREA)
  • Databases & Information Systems (AREA)
  • Biophysics (AREA)
  • Biomedical Technology (AREA)
  • Molecular Biology (AREA)
  • Evolutionary Biology (AREA)
  • Mathematical Physics (AREA)
  • Audiology, Speech & Language Pathology (AREA)
  • Multimedia (AREA)
  • Image Analysis (AREA)
  • Medical Treatment And Welfare Office Work (AREA)

Abstract

The embodiment of the invention discloses an image classification method, an image classification device, electronic equipment and a storage medium, wherein the method comprises the following steps: acquiring an initial image to be classified; classifying the initial image, and determining the image classification probability of the initial image corresponding to each image category; extracting text information in the initial image based on a text extraction technology, processing the text information based on a pre-established natural language processing model, and determining text classification probability of the text information corresponding to each image category; and determining a target image category of the initial image based on the image classification probability and the text classification probability. By the technical scheme provided by the embodiment of the invention, the technical effects of comprehensively considering the image information and the text information and improving the medical image classification accuracy are realized.

Description

Image classification method, device, electronic equipment and storage medium
Technical Field
The embodiment of the invention relates to an artificial intelligence technology, in particular to an image classification method, an image classification device, electronic equipment and a storage medium.
Background
At present, the application of the image recognition technology is wider, and the problem of recognizing the image category can be better solved. However, medical images have a large difference from common images, and the difficulty in image recognition of medical images, medical image images or medical instrument images, and even medical scene images is large.
Thus, relying on only a single image recognition may miss some of the content in the medical image, i.e. may ignore many of the content in the image that contains medical elements, resulting in the problem of inaccurate identification of medical image categories.
Disclosure of Invention
The embodiment of the invention provides an image classification method, an image classification device, electronic equipment and a storage medium, so as to achieve the technical effect of improving the medical image classification accuracy.
In a first aspect, an embodiment of the present invention provides an image classification method, including:
Acquiring an initial image to be classified;
classifying the initial image, and determining the image classification probability of the initial image corresponding to each image category;
Extracting text information in the initial image based on a text extraction technology, processing the text information based on a pre-established natural language processing model, and determining text classification probability of the text information corresponding to each image category;
And determining a target image category of the initial image based on the image classification probability and the text classification probability.
In a second aspect, an embodiment of the present invention further provides an image classification apparatus, including:
The initial image acquisition module is used for acquiring initial images to be classified;
the image classification probability determining module is used for classifying the initial image and determining the image classification probability of the initial image corresponding to each image category;
the text classification probability determining module is used for extracting text information in the initial image based on a text extraction technology, processing the text information based on a pre-established natural language processing model and determining text classification probability of the text information corresponding to each image category;
and the target image category determining module is used for determining the target image category of the initial image based on the image classification probability and the text classification probability.
In a third aspect, an embodiment of the present invention further provides an electronic device, including:
one or more processors;
Storage means for storing one or more programs,
The one or more programs, when executed by the one or more processors, cause the one or more processors to implement the image classification method according to any of the embodiments of the present invention.
In a fourth aspect, embodiments of the present invention further provide a computer-readable storage medium having stored thereon a computer program which, when executed by a processor, implements an image classification method according to any of the embodiments of the present invention.
According to the technical scheme, the initial image to be classified is obtained, the image classification probability of the initial image corresponding to each image category is determined, the image is classified according to the image characteristics of the initial image, text information in the initial image is extracted based on a text extraction technology, the text information is processed based on a pre-established natural language processing model, the text classification probability of the text information corresponding to each image category is determined, the classification is performed according to the text characteristics of the initial image, the target image category of the initial image is determined based on the image classification probability and the text classification probability, the problem that part of content and medical elements in a medical image are omitted by means of single image identification is solved, the technical effects of comprehensively considering the image information and the text information and improving the medical image classification accuracy are achieved.
Drawings
In order to more clearly illustrate the technical solution of the exemplary embodiments of the present invention, a brief description is given below of the drawings required for describing the embodiments. It is obvious that the drawings presented are only drawings of some of the embodiments of the invention to be described, and not all the drawings, and that other drawings can be made according to these drawings without inventive effort for a person skilled in the art.
Fig. 1 is a flowchart of an image classification method according to an embodiment of the invention;
fig. 2 is a flow chart of an image classification method according to a second embodiment of the invention;
fig. 3 is a flow chart of an image classification method according to a third embodiment of the present invention;
fig. 4 is a flowchart of an image classification method according to a fourth embodiment of the present invention;
Fig. 5 is a flowchart of an image classification method according to a fifth embodiment of the present invention;
fig. 6 is a schematic structural diagram of an image classification device according to a sixth embodiment of the present invention;
fig. 7 is a schematic structural diagram of an electronic device according to a seventh embodiment of the present invention.
Detailed Description
The invention is described in further detail below with reference to the drawings and examples. It is to be understood that the specific embodiments described herein are merely illustrative of the invention and are not limiting thereof. It should be further noted that, for convenience of description, only some, but not all of the structures related to the present invention are shown in the drawings.
Example 1
Fig. 1 is a schematic flow chart of an image classification method according to an embodiment of the present invention, where the method may be applied to the case of classifying and identifying medical images, and the method may be performed by an image classification device, where the device may be implemented in software and/or hardware, and the hardware may be an electronic device, optionally, an electronic device may be a mobile terminal, a PC or the like.
As shown in fig. 1, the method of this embodiment specifically includes the following steps:
S110, acquiring an initial image to be classified.
The initial image may be any image, may be a medical image, may be a non-medical image, or may be an image frame in a video.
Specifically, an initial image to be classified is acquired, so that subsequent classification processing is performed on the initial image. For example: taking the image stored in the image library as an initial image, cutting out the image frame in the video as the initial image, and the like.
S120, classifying the initial image, and determining the image classification probability of the initial image corresponding to each image category.
Wherein the image category may be a medical related category, such as: medical instruments, medical images, medical scenes, and the like. The image category may also be a finer image category, such as: specific medical instrument types, human body parts corresponding to medical images, specific medical scene types, and the like. The medical instrument image can be an image of a medical instrument such as a scalpel, a hemostatic clamp, a nuclear magnetic resonance instrument and the like. The medical image may be a medical image of a human body part taken by a medical imaging instrument, for example: brain images, lung images, etc. The medical scene may be an operating room scene, a medical room scene or a ward scene, etc. The image classification probability may be a probability corresponding to each image category obtained by classifying the initial image, for example, the image classification probability: category a:10%, category B:0, category C:30%, category D:60% and the like. It should be noted that the above examples of the image classification probability are only for explanation, and are not limiting.
Specifically, the initial image can be classified by the image classification recognition technology, and the image classification probability of the initial image corresponding to each image category is determined according to the classification result.
The image classification and recognition technology may be image classification technology based on color features, image classification technology based on textures, image classification technology based on shapes, image classification technology based on spatial relationships, etc. The image classification recognition technique may also be a technique based on a machine learning model, a deep learning model, for example: convolutional neural network (Convolutional Neural Networks, CNN), K-Nearest Neighbor (KNN), support vector machine (Support Vector Machine, SVM), BP (Back Propagation) neural network, and the like.
S130, extracting text information in an initial image based on a text extraction technology, processing the text information based on a pre-established natural language processing model, and determining text classification probability of the text information corresponding to each image category.
The text information may be information of a text composition in the initial image. The text classification probability may be a probability corresponding to each image category determined based on the processing of the text information.
Specifically, text information in the initial image can be extracted based on text extraction technology, such as: OCR (Optical Character Recognition ) technology. The information composed of the text information may be used as the text information. The text information is input into a natural language processing model, and word segmentation, labeling, classification and other processing can be performed on the text information so as to obtain probabilities corresponding to the text information and corresponding to the image categories.
And S140, determining the target image category of the initial image based on the image classification probability and the text classification probability.
The target image category may be an image category determined by combining an image classification probability and a text classification probability.
Specifically, the image classification probability and the text classification probability may be processed, for example, weighted summation processing, processing by a mathematical function, or processing by a neural network model, or the like. Further, the image category corresponding to the largest probability value among the classification probabilities obtained after the processing may be set as the target image category.
According to the technical scheme, the initial image to be classified is obtained, the image classification probability of the initial image corresponding to each image category is determined, the image is classified according to the image characteristics of the initial image, text information in the initial image is extracted based on a text extraction technology, the text information is processed based on a pre-established natural language processing model, the text classification probability of the text information corresponding to each image category is determined, the classification is performed according to the text characteristics of the initial image, the target image category of the initial image is determined based on the image classification probability and the text classification probability, the problem that part of content and medical elements in a medical image are omitted by means of single image identification is solved, the technical effects of comprehensively considering the image information and the text information and improving the medical image classification accuracy are achieved.
Example two
Fig. 2 is a flow chart of an image classification method according to a second embodiment of the present invention, and the determination method for the image classification probability according to the present embodiment can be referred to the technical solution of the present embodiment based on the foregoing embodiments. Wherein, the explanation of the same or corresponding terms as the above embodiments is not repeated herein.
As shown in fig. 2, the method of this embodiment specifically includes the following steps:
s210, acquiring an initial image to be classified.
S220, coarse classification is carried out on the initial image based on the deep learning model, and a first category of the initial image is determined.
The deep learning model can be a model for image classification, which is trained based on a deep learning algorithm. The first category may be a preliminary classified image category, the first category including medical images or non-medical images.
Specifically, the initial image may be coarsely classified based on a pre-trained deep learning model to determine whether the initial image is a medical image or a non-medical image in preparation for subsequent image classification. If the first category of the initial image is a medical image, the next step of image classification and identification can be carried out; if the first category of the initial image is a non-medical image, it may be determined that no further processing of the initial image is required.
Alternatively, the first category of the initial image may be determined based on the steps of:
Step one, obtaining a coarse classification model generated based on a deep learning model.
Wherein the coarse classification model is trained based on medical images and non-medical images.
Specifically, the deep learning model may be a CNN model, RNN (Recurrent Neural Network ) model, LSTM (Long Short-Term Memory) model, or the like. A coarse classification model generated based on the deep learning model is acquired for coarse classification of the initial image.
It should be noted that the coarse classification model may be trained in advance, so that the coarse classification model can more accurately distinguish medical images from non-medical images.
Inputting the initial image into the coarse classification model, and determining the medical image probability and the non-medical image probability corresponding to the initial image.
Specifically, the initial image is input into the coarse classification model, and the probability that the initial image is a medical image and the probability that the initial image is a non-medical image can be obtained. For example: the initial image has a probability of 80% of the medical image and a probability of 20% of the non-medical image.
And step three, when the medical image probability is greater than or equal to the non-medical image probability, determining that the first category of the initial image is the medical image, otherwise, determining that the first category of the initial image is the non-medical image.
Specifically, the medical image probability and the non-medical image probability are compared to determine a first category of the initial image. If the medical image probability is greater than or equal to the non-medical image probability, determining that the first category of the initial image is a medical image; if the medical image probability is less than the non-medical image probability, it is determined that the first category of the initial image is a non-medical image.
And S230, if the first category is a medical image, classifying the initial image based on the deep learning model, and determining the first image classification probability of the initial image corresponding to each image category.
The first image classification probability may be a probability that the initial image corresponds to each image class, which is determined by fine classification, that is, a probability that the initial image belongs to each medical image class.
Specifically, if the first category of the initial image is a medical image, the initial image is further classified to determine a specific medical image category. The initial image may be finely classified based on a pre-trained deep learning model, and a first image classification probability corresponding to each image class of the initial image may be determined, i.e., a probability of each medical image class corresponding to the initial image may be determined.
Alternatively, the first image classification probability for the initial image corresponding to each image category may be determined based on the steps of:
Step one, acquiring a fine classification model generated based on a deep learning model.
The fine classification model is trained based on the sample medical images and image categories corresponding to the respective sample medical images.
Specifically, a fine classification model generated based on the deep learning model is acquired for fine classification of the initial image.
It should be noted that the fine classification model may be trained in advance, so that the fine classification model and the coarse classification model can more accurately distinguish the image types of the medical images.
Inputting the initial image into the fine classification model, and determining a first image classification probability of the initial image corresponding to each image category.
Specifically, the initial image is input into the fine classification model, and the probability that the initial image is of each medical image class can be obtained. For example: the initial image has a 10% probability of belonging to medical image class a, a 20% probability of belonging to medical image class B, a 30% probability of belonging to medical image class C, a 5% probability of belonging to medical image class D, and a 35% probability of belonging to medical image class E.
It should be noted that, the advantages of using the coarse classification model and then using the fine classification model to process the initial image are that: the method can carry out secondary verification on the initial image, avoid the influence and interference of the non-medical image, and improve the accuracy of medical image classification.
S240, extracting text information in the initial image based on a text extraction technology, processing the text information based on a pre-established natural language processing model, and determining text classification probability of the text information corresponding to each image category.
S250, determining the target image category of the initial image based on the first image classification probability and the text classification probability.
Specifically, the first image classification probability and the text classification probability may be processed, for example, weighted summation processing, processing by a mathematical function, or processing by a neural network model, or the like. Further, the image category corresponding to the largest probability value among the classification probabilities obtained after the processing may be set as the target image category.
According to the technical scheme, the initial image to be classified is obtained, coarse classification is carried out on the initial image based on the deep learning model, the first category of the initial image is determined, if the first category is the medical image, fine classification is carried out on the initial image based on the deep learning model, the first image classification probability corresponding to each image category of the initial image is determined, the image characteristics of the initial image are determined to classify, further, text information in the initial image is extracted based on a text extraction technology, the text information is processed based on a pre-established natural language processing model, the text classification probability corresponding to each image category is determined, classification is carried out according to the text characteristics of the initial image, and the target image category of the initial image is determined based on the first image classification probability and the text classification probability, so that the problem of identifying partial content and medical elements in the medical image by means of single image is solved, the technical effects of comprehensively considering the image information and the text information, and improving the medical image classification accuracy are achieved.
Example III
Fig. 3 is a flow chart of an image classification method according to a third embodiment of the present invention, and the determination method for the image classification probability according to the present embodiment can be referred to the technical solution of the present embodiment based on the foregoing embodiments. Wherein, the explanation of the same or corresponding terms as the above embodiments is not repeated herein.
As shown in fig. 3, the method of this embodiment specifically includes the following steps:
S310, acquiring an initial image to be classified.
S320, extracting features based on the initial image, determining initial features, and determining second image classification probabilities of the initial image corresponding to each image category based on the initial features and a pre-constructed image feature library.
The feature extraction may be color features, texture features, shape features, etc., and may also be statistical features, such as mean, variance, etc. The initial feature may be a feature obtained by extracting a feature from the initial image, and is used to describe the initial image. The image feature library may include feature libraries for each type of image, such as: feature collection library of image class a, feature collection library of image class B, etc. The second image classification probability may be a probability corresponding to each image category obtained by performing special matching between the initial feature of the initial image and the feature set library of each image category.
Specifically, feature extraction is performed on the initial image to obtain initial features for describing the initial image, feature matching is performed on the initial features and feature sets corresponding to image categories in an image feature library, and the matching degree of the initial features and the feature sets of the image categories is determined, so that the second image classification probability corresponding to the initial image and the image categories can be determined.
In order to ensure accuracy of feature matching, the feature extraction method for determining the initial feature from the initial image is the same as the feature extraction method for each feature in the image feature library.
Alternatively, the second image classification probability for the initial image corresponding to each image category may be determined based on the steps of:
Step one, determining feature distances between initial features and features of each image feature library based on the initial features and pre-constructed image feature libraries corresponding to each image category.
The feature distance may be a distance between an initial feature and a feature of each image feature library, and may be understood as a distance between the initial feature and each feature in the image feature library.
Specifically, according to a distance calculation mode between two points, calculating the distance between the initial feature and each feature in the image feature library to determine the feature matched with the initial feature.
And step two, determining second image classification probability corresponding to the initial image and each image category based on each image category and the feature distance corresponding to each image category.
Specifically, the feature distances are sorted, and the features with the smallest feature distance and the preset number of features with the highest matching degree with the initial features are selected. And counting the image categories corresponding to the selected preset number of features, and determining the second image classification probability corresponding to the initial image and each image category.
For example, the preset number is 10, and among 10 features with the smallest feature distance, there are 3 belonging to the image category a,5 belonging to the image category B, and 2 belonging to the image category E, which are not belonging to the image categories C and D. The second image classification probability may be determined as: image category a:30%, image category B:50%, image category C:0, image category D:0, image category E:20%.
S330, extracting text information in the initial image based on a text extraction technology, processing the text information based on a pre-established natural language processing model, and determining text classification probability of the text information corresponding to each image category.
S340, determining the target image category of the initial image based on the second image classification probability and the text classification probability.
In particular, the second image classification probability and the text classification probability may be processed, for example, weighted summation processing, processing by a mathematical function, or processing by a neural network model, etc. Further, the image category corresponding to the largest probability value among the classification probabilities obtained after the processing may be set as the target image category.
According to the technical scheme, the initial image to be classified is obtained, feature extraction is carried out based on the initial image, initial features are determined, the second image classification probability of the initial image corresponding to each image category is determined based on the initial features and a pre-built image feature library, so that the image features of the initial image are determined to classify, further, text information in the initial image is extracted based on a text extraction technology, text information is processed based on a pre-built natural language processing model, text classification probability of the text information corresponding to each image category is determined, classification is carried out according to the text features of the initial image, and the target image category of the initial image is determined based on the second image classification probability and the text classification probability, so that the problem of missing part of content and medical elements in a medical image by means of single image recognition is solved, the technical effects of comprehensively considering the image information and the text information and improving the medical image classification accuracy are achieved.
Example IV
Fig. 4 is a flow chart of an image classification method according to a fourth embodiment of the present invention, and the determination method for text classification probability according to the present embodiment can be referred to the technical solution of the present embodiment based on the foregoing embodiments. Wherein, the explanation of the same or corresponding terms as the above embodiments is not repeated herein.
As shown in fig. 4, the method of this embodiment specifically includes the following steps:
s410, acquiring an initial image to be classified.
S420, performing coarse classification on the initial image based on the deep learning model, and determining a first category of the initial image.
And S430, if the first category is a medical image, classifying the initial image based on the deep learning model, and determining the first image classification probability of the initial image corresponding to each image category.
S440, extracting features based on the initial image, determining initial features, and determining second image classification probabilities of the initial image corresponding to each image category based on the initial features and a pre-constructed image feature library.
S450, extracting text information in the initial image based on a text extraction technology.
S460, acquiring a pre-constructed medical knowledge graph.
The medical knowledge graph is constructed according to a natural language processing method and a medical word library constructed in advance. The medical term library may include a term library constructed based on a priori medical knowledge.
Specifically, a medical knowledge graph constructed according to a natural language processing method and a pre-constructed medical word library is acquired for text classification of text information in an initial image.
S470, extracting at least one entity information in the text information.
The entity information may be node information in a medical knowledge graph.
Specifically, the text information can be processed through a natural language processing model, and at least one entity information in the text information is determined. The natural language processing model may be a model which is obtained by training in advance and used for identifying entity information. The text information can also be subjected to word segmentation processing to obtain at least one word to be matched, each word to be matched is matched with each entity word in the pre-constructed entity word list, and at least one entity information in the text information is determined. The determination method of the other entity information may be also used, and is not particularly limited in this embodiment.
S480, determining the text classification probability of the text information corresponding to each image category according to the medical knowledge graph and each entity information.
Specifically, the extracted entity information is input into a medical knowledge graph, the category corresponding to the entity information can be determined according to the entities in the medical knowledge graph and the relation between the entities, and the text classification probability corresponding to the text information and the image category can be statistically determined.
S490, determining a target image category of the initial image based on the first image classification probability, the second image classification probability and the text classification probability.
In particular, the first image classification probability, the second image classification probability, and the text classification probability may be processed, for example, weighted summation processing, processing by a mathematical function, or processing by a neural network model, or the like. Further, the image category corresponding to the largest probability value among the classification probabilities obtained after the processing may be set as the target image category.
Illustratively, for the first image classification probability, the second image classification probability and the text classification probability are respectively set to 2:1:1, carrying out weighted summation processing on the first image classification probability, the second image classification probability and the text classification probability according to the weight, and determining the image category corresponding to the maximum probability value. For example: the first image classification probability corresponding to the image category A is 25%,30%,40% and the first image classification probability corresponding to the image category B is 20%,0 and 20% respectively, the first image classification probability corresponding to the image category C is 40%,30%,20% respectively, the first image classification probability corresponding to the image category D is 10%,30% and 10% respectively, the first image classification probability corresponding to the image category E is 5%,10% and 10% respectively, and the second image classification probability and the text classification probability are 10% respectively according to the weight ratio 2:1:1 can determine that the weighted probability values of the image categories a, B, C, D and E are 120%,60%,130%,60% and 30%, respectively, and further can determine that the image category C corresponding to the maximum probability of 130% is the target image category.
It should be noted that, the execution sequence of the three parts S420-S430, S440 and S450 may be adjusted, and the execution sequence of the three parts is not limited in this embodiment.
According to the technical scheme, the initial image to be classified is obtained, coarse classification is carried out on the initial image based on the deep learning model, the first class of the initial image is determined, if the first class is the medical image, fine classification is carried out on the initial image based on the deep learning model, the first image classification probability corresponding to each image class of the initial image is determined, feature extraction is carried out on the initial image, initial characteristics are determined, the second image classification probability corresponding to each image class of the initial image is determined based on the initial characteristics and a pre-built image feature library, the image characteristics of the initial image are determined, classification is carried out on the image characteristics of the initial image, text information in the initial image is extracted based on a text extraction technology, text classification probability corresponding to each image class is determined, classification is carried out according to the text characteristics of the initial image, and the target image class of the initial image is determined based on the first image classification probability, the second image classification probability and the text classification probability.
Example five
As an alternative implementation of the above embodiments, fig. 5 is a schematic flow chart of an image classification method provided in the fifth embodiment of the present invention. Wherein, the explanation of the same or corresponding terms as the above embodiments is not repeated herein.
As shown in fig. 5, the method of this embodiment specifically includes the following steps:
1. A picture or video frame (initial image) is acquired.
2. Taking the subdivision category of the medical image as a category, and establishing a corresponding feature library for the medical images of different categories according to each subdivision category by utilizing the trained feature extraction model; extracting features of a picture or a video frame to be detected to obtain initial features, comparing the initial features with features in a feature library, and adopting a nearest neighbor mode, if the nearest distance is smaller than a preset threshold value, successfully matching, wherein the image category and the similarity corresponding to the features at the moment are output results (second image classification probability). And expanding a feature library corresponding to the correct image category according to the picture or the video frame and the corresponding correct image category.
3. The image or the video frame is classified at one stage based on the deep learning model, so that the class (first class) of the image can be roughly obtained; if an image is determined to be a medical image, a secondary classification is performed to determine the medical image type (first image classification probability) of the image.
4. Aiming at characters appearing in the image, adopting an OCR detection and recognition technology to obtain character information (text information); the text information is processed, the word patterns and the related words related to the medicine in the text information are detected by utilizing an NLP (Natural Language Processing ) technology, and matching scoring is carried out on the detected sentences, so that an output result (text classification probability) is obtained.
5. And (3) carrying out recognition decision on the three output results, distributing weights (for example, 1:2:1) for the three output results, and multiplying the weight coefficient by the output result of each image category to obtain a final recognition result (target image category).
It should be noted that, the output result may be limited according to a specific service scenario (for example, the threshold of the output result may be set higher, for example, 0.9, and if high recall is pursued, the threshold of the output result may be set lower, for example, 0.5), so as to obtain an identification effect meeting the requirement.
According to the technical scheme, the image or video frame is acquired, the depth characteristic extraction is carried out on the image or video frame, the characteristic library is expanded to obtain the second image classification probability, the first image classification probability is obtained by carrying out the first-stage classification and the second-stage classification on the image or video frame, the character information of the image or video frame is detected by using the OCR technology and the NLP technology to obtain the character classification probability, and then the final recognition result is determined by the recognition decision, so that the problem that part of content and medical elements in a medical image are omitted by means of single image recognition is solved, the technical effects of comprehensively considering the image information and the character information and improving the medical image classification accuracy are achieved.
Example six
Fig. 6 is a schematic structural diagram of an image classification device according to a sixth embodiment of the present invention, where the device includes: an initial image acquisition module 610, an image classification probability determination module 620, a text classification probability determination module 630, and a target image category determination module 640.
The initial image obtaining module 610 is configured to obtain an initial image to be classified; an image classification probability determining module 620, configured to classify the initial image, and determine an image classification probability corresponding to each image class of the initial image; the text classification probability determining module 630 is configured to extract text information in the initial image based on a text extraction technology, process the text information based on a pre-established natural language processing model, and determine a text classification probability of the text information corresponding to each image category; a target image category determination module 640 for determining a target image category of the initial image based on the image classification probability and the text classification probability.
Optionally, the image classification probability determining module 620 is further configured to perform coarse classification on the initial image based on a deep learning model, and determine a first class of the initial image; wherein the first category includes medical images or non-medical images; if the first category is a medical image, the initial image is finely classified based on a deep learning model, and a first image classification probability corresponding to the initial image and each image category is determined; accordingly, the target image category determining module 640 is further configured to determine a target image category of the initial image based on the first image classification probability and the text classification probability.
Optionally, the apparatus further includes: the second image classification probability determining module is used for extracting features based on the initial image, determining initial features, and determining second image classification probabilities corresponding to the initial image and each image category based on the initial features and a pre-constructed image feature library; correspondingly, the target image category determining module 640 is further configured to determine a target image category of the initial image based on the second image classification probability and the text classification probability; or determining a target image category of the initial image based on the first image classification probability, the second image classification probability and the text classification probability.
Optionally, the second image classification probability determining module is further configured to determine feature distances between the initial features and features of each image feature library based on the initial features and a pre-constructed image feature library corresponding to each image class; and determining a second image classification probability corresponding to each image category of the initial image based on each image category and the characteristic distance corresponding to each image category.
Optionally, the image classification probability determining module 620 is further configured to obtain a coarse classification model generated based on the deep learning model; wherein the coarse classification model is trained based on medical images and non-medical images; inputting the initial image into the coarse classification model, and determining medical image probability and non-medical image probability corresponding to the initial image; and when the medical image probability is greater than or equal to the non-medical image probability, determining that the first category of the initial image is a medical image, otherwise, determining that the first category of the initial image is a non-medical image.
Optionally, the image classification probability determining module 620 is further configured to obtain a fine classification model generated based on the deep learning model; the fine classification model is trained based on sample medical images and image categories corresponding to the sample medical images; and inputting the initial image into the fine classification model, and determining a first image classification probability of the initial image corresponding to each image class.
Optionally, the text classification probability determining module 630 is further configured to obtain a pre-constructed medical knowledge graph; the medical knowledge graph is constructed according to a natural language processing method and a medical word library constructed in advance; extracting at least one entity information in the text information; and determining the text classification probability of the text information corresponding to each image category according to each entity information of the medical knowledge graph.
According to the technical scheme, the initial image to be classified is obtained, the image classification probability of the initial image corresponding to each image category is determined, the image is classified according to the image characteristics of the initial image, text information in the initial image is extracted based on a text extraction technology, the text information is processed based on a pre-established natural language processing model, the text classification probability of the text information corresponding to each image category is determined, the classification is performed according to the text characteristics of the initial image, the target image category of the initial image is determined based on the image classification probability and the text classification probability, the problem that part of content and medical elements in a medical image are omitted by means of single image identification is solved, the technical effects of comprehensively considering the image information and the text information and improving the medical image classification accuracy are achieved.
The image classification device provided by the embodiment of the invention can execute the image classification method provided by any embodiment of the invention, and has the corresponding functional modules and beneficial effects of the execution method.
It should be noted that each unit and module included in the above apparatus are only divided according to the functional logic, but not limited to the above division, so long as the corresponding functions can be implemented; in addition, the specific names of the functional units are also only for distinguishing from each other, and are not used to limit the protection scope of the embodiments of the present invention.
Example seven
Fig. 7 is a schematic structural diagram of an electronic device according to a seventh embodiment of the present invention. Fig. 7 shows a block diagram of an exemplary electronic device 70 suitable for use in implementing the embodiments of the invention. The electronic device 70 shown in fig. 7 is merely an example and should not be construed as limiting the functionality and scope of use of embodiments of the present invention.
As shown in fig. 7, the electronic device 70 is embodied in the form of a general purpose computing device. Components of the electronic device 70 may include, but are not limited to: one or more processors or processing units 701, a system memory 702, and a bus 703 that connects the various system components (including the system memory 702 and the processing units 701).
Bus 703 represents one or more of several types of bus structures, including a memory bus or memory controller, a peripheral bus, an accelerated graphics port, a processor, or a local bus using any of a variety of bus architectures. By way of example, and not limitation, such architectures include Industry Standard Architecture (ISA) bus, micro channel architecture (MAC) bus, enhanced ISA bus, video Electronics Standards Association (VESA) local bus, and Peripheral Component Interconnect (PCI) bus.
Electronic device 70 typically includes a variety of computer system readable media. Such media can be any available media that is accessible by electronic device 70 and includes both volatile and non-volatile media, removable and non-removable media.
The system memory 702 may include computer system readable media in the form of volatile memory, such as Random Access Memory (RAM) 704 and/or cache memory 705. Electronic device 70 may further include other removable/non-removable, volatile/nonvolatile computer system storage media. By way of example only, storage system 706 may be used to read from and write to non-removable, nonvolatile magnetic media (not shown in FIG. 7, commonly referred to as a "hard drive"). Although not shown in fig. 7, a magnetic disk drive for reading from and writing to a removable non-volatile magnetic disk (e.g., a "floppy disk"), and an optical disk drive for reading from or writing to a removable non-volatile optical disk (e.g., a CD-ROM, DVD-ROM, or other optical media) may be provided. In such cases, each drive may be coupled to bus 703 through one or more data medium interfaces. The system memory 702 may include at least one program product having a set (e.g., at least one) of program modules configured to carry out the functions of the embodiments of the invention.
A program/utility 708 having a set (at least one) of program modules 707 may be stored in, for example, system memory 702, such program modules 707 including, but not limited to, an operating system, one or more application programs, other program modules, and program data, each or some combination of which may include an implementation of a network environment. Program modules 707 generally perform the functions and/or methods of the embodiments described herein.
The electronic device 70 may also communicate with one or more external devices 709 (e.g., keyboard, pointing device, display 710, etc.), one or more devices that enable a user to interact with the electronic device 70, and/or any devices (e.g., network card, modem, etc.) that enable the electronic device 70 to communicate with one or more other computing devices. Such communication may occur through an input/output (I/O) interface 711. Also, the electronic device 70 may communicate with one or more networks such as a Local Area Network (LAN), a Wide Area Network (WAN) and/or a public network, such as the Internet, through a network adapter 712. As shown, network adapter 712 communicates with other modules of electronic device 70 over bus 703. It should be appreciated that although not shown in fig. 7, other hardware and/or software modules may be used in connection with electronic device 70, including, but not limited to: microcode, device drivers, redundant processing units, external disk drive arrays, RAID systems, tape drives, data backup storage systems, and the like.
The processing unit 701 executes various functional applications and data processing by running a program stored in the system memory 702, for example, implementing the image classification method provided by the embodiment of the present invention.
Example eight
An eighth embodiment of the present invention also provides a storage medium containing computer-executable instructions, which when executed by a computer processor, are for performing a method of image classification, the method comprising:
Acquiring an initial image to be classified;
classifying the initial image, and determining the image classification probability of the initial image corresponding to each image category;
Extracting text information in the initial image based on a text extraction technology, processing the text information based on a pre-established natural language processing model, and determining text classification probability of the text information corresponding to each image category;
And determining a target image category of the initial image based on the image classification probability and the text classification probability.
The computer storage media of embodiments of the invention may take the form of any combination of one or more computer-readable media. The computer readable medium may be a computer readable signal medium or a computer readable storage medium. The computer readable storage medium can be, for example, but not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or a combination of any of the foregoing. More specific examples (a non-exhaustive list) of the computer-readable storage medium would include the following: an electrical connection having one or more wires, a portable computer diskette, a hard disk, a Random Access Memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing. In this document, a computer readable storage medium may be any tangible medium that can contain, or store a program for use by or in connection with an instruction execution system, apparatus, or device.
The computer readable signal medium may include a propagated data signal with computer readable program code embodied therein, either in baseband or as part of a carrier wave. Such a propagated data signal may take any of a variety of forms, including, but not limited to, electro-magnetic, optical, or any suitable combination of the foregoing. A computer readable signal medium may also be any computer readable medium that is not a computer readable storage medium and that can communicate, propagate, or transport a program for use by or in connection with an instruction execution system, apparatus, or device.
Program code embodied on a computer readable medium may be transmitted using any appropriate medium, including but not limited to wireless, wireline, optical fiber cable, RF, etc., or any suitable combination of the foregoing.
Computer program code for carrying out operations for embodiments of the present invention may be written in one or more programming languages, including an object oriented programming language such as Java, smalltalk, C ++ and conventional procedural programming languages, such as the "C" programming language or similar programming languages. The program code may execute entirely on the user's computer, partly on the user's computer, as a stand-alone software package, partly on the user's computer and partly on a remote computer or entirely on the remote computer or server. In the case of a remote computer, the remote computer may be connected to the user's computer through any kind of network, including a Local Area Network (LAN) or a Wide Area Network (WAN), or may be connected to an external computer (for example, through the Internet using an Internet service provider).
Note that the above is only a preferred embodiment of the present invention and the technical principle applied. It will be understood by those skilled in the art that the present invention is not limited to the particular embodiments described herein, but is capable of various obvious changes, rearrangements and substitutions as will now become apparent to those skilled in the art without departing from the scope of the invention. Therefore, while the invention has been described in connection with the above embodiments, the invention is not limited to the embodiments, but may be embodied in many other equivalent forms without departing from the spirit or scope of the invention, which is set forth in the following claims.

Claims (8)

1. An image classification method, comprising:
Acquiring an initial image to be classified;
classifying the initial image, and determining the image classification probability of the initial image corresponding to each image category;
Extracting text information in the initial image based on a text extraction technology, processing the text information based on a pre-established natural language processing model, and determining text classification probability of the text information corresponding to each image category;
Determining a target image category of the initial image based on the image classification probability and the text classification probability;
the classifying the initial image to determine the image classification probability of the initial image corresponding to each image category comprises the following steps:
Coarse classifying the initial image based on a deep learning model, and determining a first category of the initial image; wherein the first category includes medical images or non-medical images;
If the first category is a medical image, the initial image is finely classified based on a deep learning model, and a first image classification probability corresponding to the initial image and each image category is determined;
The determining the target image category of the initial image based on the image classification probability and the text classification probability comprises:
Determining a target image category of the initial image based on the first image classification probability and the text classification probability;
The method further comprises the steps of:
extracting features based on the initial image, determining initial features, and determining second image classification probabilities of the initial image corresponding to each image category based on the initial features and a pre-constructed image feature library;
The determining the target image category of the initial image based on the image classification probability and the text classification probability comprises:
determining a target image category of the initial image based on the second image classification probability and the text classification probability; or alternatively
The second image classification probability and the text classification probability determine a target image category of the initial image based on the first image classification probability.
2. The method of claim 1, wherein the determining a second image classification probability for the initial image corresponding to each image category based on the initial features and a pre-constructed image feature library comprises:
determining feature distances between the initial features and features of each image feature library based on the initial features and pre-constructed image feature libraries corresponding to each image category;
And determining a second image classification probability corresponding to each image category of the initial image based on each image category and the characteristic distance corresponding to each image category.
3. The method of claim 1, wherein the coarse classification of the initial image based on the deep learning model, determining the first class of the initial image, comprises:
Acquiring a coarse classification model generated based on a deep learning model; wherein the coarse classification model is trained based on medical images and non-medical images;
inputting the initial image into the coarse classification model, and determining medical image probability and non-medical image probability corresponding to the initial image;
And when the medical image probability is greater than or equal to the non-medical image probability, determining that the first category of the initial image is a medical image, otherwise, determining that the first category of the initial image is a non-medical image.
4. The method of claim 1, wherein the sub-classifying the initial image based on the deep learning model, determining a first image classification probability for the initial image corresponding to each image class, comprises:
Acquiring a fine classification model generated based on a deep learning model; the fine classification model is trained based on sample medical images and image categories corresponding to the sample medical images;
And inputting the initial image into the fine classification model, and determining a first image classification probability of the initial image corresponding to each image class.
5. The method of claim 1, wherein the processing the text information based on a pre-established natural language processing model to determine a text classification probability for the text information corresponding to the image categories comprises:
Acquiring a pre-constructed medical knowledge graph; the medical knowledge graph is constructed according to a natural language processing method and a medical word library constructed in advance;
extracting at least one entity information in the text information;
and determining the text classification probability of the text information corresponding to each image category according to the medical knowledge graph and each entity information.
6. An image classification apparatus, comprising:
The initial image acquisition module is used for acquiring initial images to be classified;
the image classification probability determining module is used for classifying the initial image and determining the image classification probability of the initial image corresponding to each image category;
the text classification probability determining module is used for extracting text information in the initial image based on a text extraction technology, processing the text information based on a pre-established natural language processing model and determining text classification probability of the text information corresponding to each image category;
a target image category determining module, configured to determine a target image category of the initial image based on the image classification probability and the text classification probability;
The image classification probability determining module is further configured to:
Coarse classifying the initial image based on a deep learning model, and determining a first category of the initial image; wherein the first category includes medical images or non-medical images;
If the first category is a medical image, the initial image is finely classified based on a deep learning model, and a first image classification probability corresponding to the initial image and each image category is determined;
the target image category determining module is further configured to:
Determining a target image category of the initial image based on the first image classification probability and the text classification probability;
The apparatus further comprises:
The second image classification probability determining module is used for extracting features based on the initial image, determining initial features, and determining second image classification probabilities corresponding to the initial image and each image category based on the initial features and a pre-constructed image feature library;
the target image category determining module is further configured to:
determining a target image category of the initial image based on the second image classification probability and the text classification probability; or alternatively
The second image classification probability and the text classification probability determine a target image category of the initial image based on the first image classification probability.
7. An electronic device, the electronic device comprising:
one or more processors;
Storage means for storing one or more programs,
The one or more programs, when executed by the one or more processors, cause the one or more processors to implement the image classification method of any of claims 1-5.
8. A computer-readable storage medium, on which a computer program is stored, characterized in that the program, when being executed by a processor, implements the image classification method according to any one of claims 1-5.
CN202110475943.XA 2021-04-29 2021-04-29 Image classification method, device, electronic equipment and storage medium Active CN113177479B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202110475943.XA CN113177479B (en) 2021-04-29 2021-04-29 Image classification method, device, electronic equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202110475943.XA CN113177479B (en) 2021-04-29 2021-04-29 Image classification method, device, electronic equipment and storage medium

Publications (2)

Publication Number Publication Date
CN113177479A CN113177479A (en) 2021-07-27
CN113177479B true CN113177479B (en) 2024-05-03

Family

ID=76925405

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202110475943.XA Active CN113177479B (en) 2021-04-29 2021-04-29 Image classification method, device, electronic equipment and storage medium

Country Status (1)

Country Link
CN (1) CN113177479B (en)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114255219B (en) * 2021-12-21 2022-08-16 数坤(北京)网络科技股份有限公司 Symptom identification method and device, electronic equipment and storage medium

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2012173886A2 (en) * 2011-06-15 2012-12-20 Ceresis, Llc Method for parsing, searching and formatting of text input for visual mapping of knowledge information
CN109214386A (en) * 2018-09-14 2019-01-15 北京京东金融科技控股有限公司 Method and apparatus for generating image recognition model
KR102079970B1 (en) * 2019-04-30 2020-04-07 (주)에스투더블유랩 Method, apparatus and computer program for providing cyber security using a knowledge graph
CN111310793A (en) * 2020-01-17 2020-06-19 南方科技大学 Medical image classification method and device, mobile terminal and medium
CN112528658A (en) * 2020-12-24 2021-03-19 北京百度网讯科技有限公司 Hierarchical classification method and device, electronic equipment and storage medium
CN112712879A (en) * 2021-01-18 2021-04-27 腾讯科技(深圳)有限公司 Information extraction method, device, equipment and storage medium for medical image report

Family Cites Families (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US11222052B2 (en) * 2011-02-22 2022-01-11 Refinitiv Us Organization Llc Machine learning-based relationship association and related discovery and
US10303999B2 (en) * 2011-02-22 2019-05-28 Refinitiv Us Organization Llc Machine learning-based relationship association and related discovery and search engines
US9037529B2 (en) * 2011-06-15 2015-05-19 Ceresis, Llc Method for generating visual mapping of knowledge information from parsing of text inputs for subjects and predicates
US9704102B2 (en) * 2013-03-15 2017-07-11 William Marsh Rice University Sparse factor analysis for analysis of user content preferences

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2012173886A2 (en) * 2011-06-15 2012-12-20 Ceresis, Llc Method for parsing, searching and formatting of text input for visual mapping of knowledge information
CN109214386A (en) * 2018-09-14 2019-01-15 北京京东金融科技控股有限公司 Method and apparatus for generating image recognition model
KR102079970B1 (en) * 2019-04-30 2020-04-07 (주)에스투더블유랩 Method, apparatus and computer program for providing cyber security using a knowledge graph
CN111310793A (en) * 2020-01-17 2020-06-19 南方科技大学 Medical image classification method and device, mobile terminal and medium
CN112528658A (en) * 2020-12-24 2021-03-19 北京百度网讯科技有限公司 Hierarchical classification method and device, electronic equipment and storage medium
CN112712879A (en) * 2021-01-18 2021-04-27 腾讯科技(深圳)有限公司 Information extraction method, device, equipment and storage medium for medical image report

Non-Patent Citations (2)

* Cited by examiner, † Cited by third party
Title
医学知识图谱构建技术与研究进展;袁凯琦;邓扬;陈道源;张冰;雷凯;;计算机应用研究(07);全文 *
基于知识图谱的东方音乐可视化教育研究与应用;赵维平;孙宁;杨晓春;郑国真;;计算机工程与科学(S1);全文 *

Also Published As

Publication number Publication date
CN113177479A (en) 2021-07-27

Similar Documents

Publication Publication Date Title
CN109117777B (en) Method and device for generating information
CN109858555B (en) Image-based data processing method, device, equipment and readable storage medium
CN110020592B (en) Object detection model training method, device, computer equipment and storage medium
US20210240682A1 (en) Automatic entity resolution with rules detection and generation system
CN110472675B (en) Image classification method, image classification device, storage medium and electronic equipment
CN109583332B (en) Face recognition method, face recognition system, medium, and electronic device
CN106951484B (en) Picture retrieval method and device, computer equipment and computer readable medium
CN108733778B (en) Industry type identification method and device of object
CN110232340B (en) Method and device for establishing video classification model and video classification
CN113033438B (en) Data feature learning method for modal imperfect alignment
US10423817B2 (en) Latent fingerprint ridge flow map improvement
CN113094478B (en) Expression reply method, device, equipment and storage medium
CN111325156A (en) Face recognition method, device, equipment and storage medium
CN114898266B (en) Training method, image processing device, electronic equipment and storage medium
CN113177479B (en) Image classification method, device, electronic equipment and storage medium
CN113096687B (en) Audio and video processing method and device, computer equipment and storage medium
CN112613293A (en) Abstract generation method and device, electronic equipment and storage medium
CN117011581A (en) Image recognition method, medium, device and computing equipment
CN113627186B (en) Entity relation detection method based on artificial intelligence and related equipment
CN110059180B (en) Article author identity recognition and evaluation model training method and device and storage medium
CN110442714B (en) POI name normative evaluation method, device, equipment and storage medium
CN108882033B (en) Character recognition method, device, equipment and medium based on video voice
CN113836297A (en) Training method and device for text emotion analysis model
CN112380169A (en) Storage device, data processing method, device, apparatus, medium, and system
CN114078271A (en) Threshold determination method, target person identification method, device, equipment and medium

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant