A chest x-ray multi-label computer-aided classification method
By using a deep learning-based multi-label classification model and training the decoding network with a transformer decoder and an asymmetric loss function, the efficiency and accuracy issues of classifying massive amounts of chest X-ray images were solved, achieving automated and efficient disease prediction and reducing the workload of doctors.
Patent Information
- Application Number
- CN202211473779.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-11-22
- Publication Date
- 2025-11-04
- Estimated Expiration
- 2042-11-22
AI Technical Summary
Existing technologies are insufficient for doctors to efficiently and comprehensively classify massive amounts of chest X-ray images using multiple labels, leading to increased risk of missed diagnoses and increased stress on doctors.
A deep learning-based multi-label classification model is adopted, which utilizes a transformer decoder and an asymmetric loss function, combined with cosine similarity loss to train the decoding network. Image features are extracted alternately through a CvT backbone network and a transformer, and disease prediction is performed using label embedding and attention mechanisms.
It enables accurate and comprehensive automated classification of chest X-rays, reducing doctors' workload, improving classification accuracy and efficiency, and lowering the risk of missed diagnoses.
Smart Images

Figure CN115861198B_ABST
Abstract
Description
Technical Field
[0001] This invention belongs to the field of image processing, and in particular relates to a multi-label computer-aided classification method for chest X-ray images. Background Technology
[0002] Using computer-aided classification to alleviate the workload of doctors is an important research direction. With the increasing prevalence and volume of chest X-rays, ensuring comprehensive classification of each patient's chest X-ray under limited doctor workload requires the use of deep learning-based multi-label classification models to initially screen massive amounts of data. This allows for efficient and comprehensive classification of a patient's chest X-ray, effectively reducing doctor workload and the risk of missed diagnoses. In clinical practice, chest X-ray reports are often formatted and can be broken down into multiple disease classification questions of interest to doctors. Therefore, modeling these as multi-label problems can provide auxiliary classification. The significance of this lies in the existence of prior knowledge indicating potential relationships between multiple classification tasks, allowing for the comprehensive consideration of these relationships and the integration of image information to arrive at the final prediction result.
[0003] Therefore, the ability to accurately and comprehensively classify chest X-rays by combining label information is key to improving the level of computer-aided classification. Summary of the Invention
[0004] The purpose of this invention is to provide a multi-label computer-aided classification method for chest X-ray images to solve the problems existing in the prior art.
[0005] To achieve the above objectives, the present invention provides a multi-label computer-aided classification method for chest X-ray images, comprising:
[0006] Acquire historical image features and corresponding tags for medical images, including chest X-rays;
[0007] A decoding network is constructed, wherein the decoding network includes several decoders, the decoders adopt the transformer decoder, and the decoding network is trained and updated based on several labels and historical image features through asymmetric loss and cosine similarity loss to obtain a trained decoding network.
[0008] Image features are acquired, and the trained decoding network is used to identify these features to obtain the decoder output.
[0009] The decoder output is classified to obtain the classification result.
[0010] Optionally, image features of X-ray films can be extracted by alternating between convolutional layers and transformers based on a CvT backbone network.
[0011] Optionally, the construction of the decoding network includes:
[0012] Different tag embeddings are obtained based on each tag;
[0013] The tag embedding is used as the query vector for the transformer decoder;
[0014] Based on the attention mechanism in the transformer decoder, the query vector is used to obtain the different positions of different labels in the chest X-ray image.
[0015] Optionally, the decoding network training includes:
[0016] By varying the γ value, the sensitivity of the loss to positive and negative samples is changed. Based on the confidence level of each label, the loss value is calculated using the following formula:
[0017]
[0018] Where K is the total number of tags, y k This refers to the binary ground truth value of the k-th label in the image. The total loss is calculated by averaging the losses across all samples in the batch, and optimization is performed using stochastic gradient descent. k γ is the confidence score of the k-th label output by the model, γ+ is the decay rate of positive samples, and γ- is the decay rate of negative samples.
[0019] Optionally, the loss update process includes:
[0020] The number of times each pair of tags appears together is counted to obtain a co-occurrence matrix. The co-occurrence matrix is then divided by the product of the number of times each tag appears on its own to obtain the value of the co-occurrence matrix.
[0021] The similarity between each pair of the embedded tags is represented by cosine similarity.
[0022] The cosine similarity is calculated using a loss function to approximate the value of the co-occurrence matrix.
[0023] Optionally, classifying the decoder output includes processing it with a linear layer and mapping it to confidence using a sigmoid function, thereby completing the classification task.
[0024] The technical effects of this invention are as follows:
[0025] This application can be performed on provided chest X-rays, which greatly helps reduce the workload of doctors and improve accuracy and comprehensiveness. The method is simple to operate, accurate and reliable, and automated detection saves time and costs, providing excellent assistance to the medical process as a computer-aided procedure.
[0026] This application enables the classification of chest X-rays for 15 diseases, including atelectasis, cardiomegaly, pulmonary effusion, pulmonary infiltration, pulmonary mass, pulmonary nodule, pneumonia, pneumothorax, pulmonary consolidation, hernia, pulmonary fibrosis, emphysema, pulmonary edema, and pleural thickening. The model process is simple, the comparison accuracy is reliable, and computer-aided detection can save time and costs, greatly reduce the workload of doctors, and improve accuracy. Attached Figure Description
[0027] The accompanying drawings, which form part of this application, are used to provide a further understanding of this application. The illustrative embodiments and descriptions of this application are used to explain this application and do not constitute an undue limitation of this application. In the drawings:
[0028] Figure 1 This is a structural diagram of a computer-aided system based on deep learning in an embodiment of the present invention. Detailed Implementation
[0029] It should be noted that, unless otherwise specified, the embodiments and features described in this application can be combined with each other. This application will now be described in detail with reference to the accompanying drawings and embodiments.
[0030] It should be noted that the steps shown in the flowchart in the accompanying drawings can be executed in a computer system such as a set of computer-executable instructions, and although a logical order is shown in the flowchart, in some cases the steps shown or described may be executed in a different order than that shown here.
[0031] Example 1
[0032] like Figure 1 As shown, this embodiment provides a multi-label computer-aided classification method for chest X-ray images, specifically including the following steps:
[0033] Step 1: Use a backbone network to extract model features.
[0034] For a given image Features were extracted from the backbone network. Where H0×W0 represents the size of the input image, and H×W×d0 is the size of the feature, the specific size of which is determined by the network structure of the backbone network. Here, a CvT network is used as the feature extraction tool, utilizing local and global information of the image through alternating convolutional layers and transformers. Then, a linear projection is used to transform the feature dimensions to F∈R. HW×d This will help with transformer operations.
[0035] Step 2: Generate different attention to different locations in the image for different labels.
[0036] Attention is a fundamental component of the transformer decoder, represented as attn(Q,V), where Q and V are the inputs to the module, and the module contains a learnable parameter T∈R. 3×d×d It is a learnable transformation matrix responsible for transforming dimensions to T = [T1; T2; T3], where d′ is the dimension size used by each head in multi-head attention when calculating attention. The parameter M represents the number of self-attention heads, ensuring that the number of feature channels remains consistent before and after multi-head attention calculation.
[0037] The derivation process is as follows:
[0038] [X Q ;X K ;X V ]=[T1(Q+P Q T2(V+P) V );T3V]
[0039] P Q and P V These are the location embeddings for labels and images, respectively.
[0040] The obtained X K X Q Used to calculate attention weights
[0041]
[0042] N V N is the number of image features output by the backbone network. V =HW, then multiply the weights by V to get the expression for attention:
[0043]
[0044] Self-attention is a special case of multi-head attention structures where M=1, and its formula can be expressed as follows:
[0045] Q′ l=[attn(Q l-1 Q l-1 )]
[0046]
[0047] Q l-1 It is the query vector output by the previous layer, where the attention module contains learnable variables. These are learnable weights.
[0048] The basic structure of multi-head attention consists of an attention layer and a normalization layer. Taking the l-th layer as an example, the learnable parameters of the attention layer are T. l The input is Q. l V l The learnable parameter of the normalized layer is β. l The calculation formula is as follows:
[0049]
[0050] Each attention module has independent learnable parameters T∈R. 3×d×d After all heads have completed their attention, the results are spliced together to obtain the final result.
[0051]
[0052] Step 3: Input the features obtained by embedding different labels into the classifier to complete the prediction of different diseases.
[0053] Different features are classified using a linear layer, and the classification is mapped to confidence scores using a sigmoid function, thus completing the classification task.
[0054] Step 4: Train the model on a large dataset using the new loss function so that it can predict a variety of diseases end-to-end from chest X-rays.
[0055] The model is trained on a large dataset, and its parameters are updated using asymmetric loss and cosine similarity loss. Specifically, asymmetric loss is introduced to address the imbalance problem, and different γ values are used to change the sensitivity of the loss to positive and negative samples. The loss calculation formula for each class probability obtained from the passed model is as follows:
[0056]
[0057] Where K is the total number of tags, y k This refers to the binary ground truth value of the k-th label in the image. The total loss is calculated by averaging the losses across all samples in the batch, and optimization is performed using stochastic gradient descent. kγ is the confidence score of the k-th label output by the model, γ+ is the decay rate of positive samples, and γ- is the decay rate of negative samples.
[0058] Furthermore, a novel loss function guides the learning of label embeddings, leveraging statistical confidence from the training set. Specifically, a co-occurrence matrix, a k×k symmetric matrix, is first calculated to count the number of times each label co-occurs pairwise. To eliminate the influence of the label's own occurrence distribution, this count is divided by the product of the occurrence counts of the two labels themselves, yielding the values of the entire matrix. Cosine similarity is introduced to represent the pairwise similarity between label embeddings, and a loss function is used to make it as close as possible to the values of the co-occurrence matrix.
[0059] The chest X-ray 14 training set was used to train the model. It contains 112,120 chest X-ray images, each with detailed annotations. This allows the model to achieve high classification performance.
[0060] This application has the following beneficial effects:
[0061] The computer-aided multi-label method for chest X-rays provided in this embodiment can obtain comprehensive, accurate, and reliable information from X-ray images. This embodiment also automates medical image classification, reducing doctors' workload and significantly alleviating the burden on hospitals.
[0062] The above description is merely a preferred embodiment of this application, but the scope of protection of this application is not limited thereto. Any variations or substitutions that can be easily conceived by those skilled in the art within the technical scope disclosed in this application should be included within the scope of protection of this application. Therefore, the scope of protection of this application should be determined by the scope of the claims.
Claims
1. A computer-aided classification method for multi-label chest X-rays, characterized in that, Includes the following steps: Acquire historical image features and corresponding tags for medical images, including chest X-rays; A decoding network is constructed, wherein the decoding network includes several decoders, the decoders adopt the transformer decoder, and the decoding network is trained and updated based on several labels and historical image features through asymmetric loss and cosine similarity loss to obtain a trained decoding network. The construction of the decoding network includes: obtaining different label embeddings based on each label; using the label embeddings as query vectors for the transformer decoder; and using the query vectors to obtain the different positions of different labels in the chest X-ray image based on the attention mechanism in the transformer decoder. Decoding network training includes: By varying the γ value, the sensitivity of the loss to positive and negative samples is changed. Based on the confidence level of each label, the loss value is calculated using the following formula: Where K is the total number of tags. This refers to the binary ground truth value of the k-th label in the image. The total loss is calculated by averaging the losses across all samples in the batch, and optimization is performed using stochastic gradient descent. L represents the loss value. It is the confidence score of the model outputting the k-th label. It is the decay rate of the positive sample. It is the decay rate of negative samples; Image features are acquired, and the trained decoding network is used to identify these features to obtain the decoder output. The decoder output is classified to obtain the classification result.
2. The computer-aided classification method for multi-label chest X-rays according to claim 1, characterized in that, Image features of X-ray films are extracted by alternating convolutional layers and transformers based on a CvT backbone network.
3. The computer-aided classification method for multi-label chest X-rays according to claim 1, characterized in that, The loss update process includes: The number of times each pair of tags appears together is counted to obtain a co-occurrence matrix. The co-occurrence matrix is then divided by the product of the number of times each tag appears on its own to obtain the value of the co-occurrence matrix. The similarity between each pair of the embedded tags is represented by cosine similarity. The cosine similarity is calculated using a loss function to approximate the value of the co-occurrence matrix.
4. The computer-aided classification method for multi-label chest X-rays according to claim 1, characterized in that, The classification of the decoder output includes processing with a linear layer and mapping the result to confidence using a sigmoid function, thereby completing the classification task.
Citation Information
Patent Citations
Chest radiography multi-label classification method based on self-correcting label generation network
CN111275118A
Character recognition method and device based on progressive coding and electronic equipment
CN112712079A