feature representation
0
stars
614
commits
Jupyter Notebook
primary language
Jul 14, 2024
updated
Generated by GPT-4
A feature representation task.
currently using the Classification task as a utility task, aiming to build a general disease detecter via chest x-ray.
This project tries to explore the data cooperation between multimodal data -- text and image, and then improve AI downstream tasks.
Leveraging multimodal data, the Visual Language Model(VLM) demonstrated impressive capability of bridging the knowledge in multi-modalities. VLMs like CLIP, Flamingo, and DALL-E, which are trained based on the tremendous amount of data and computational resources show good performance in many different downstream tasks due to the good generalizability. However, like a double-edged sword, the generalizability of pre-trained VLMs limits their performance in the customized setting. In this project, I try to leverage the prior knowledge in pre-trained VLMs and customize the embedding generation in my general classification task. Using the simple contrastive learning method proposed in the report, a robust generalist classifier is available with the deficiency of training data which is a ubiquitous context in the biomedical setting.
A feature representation task.
currently using the Classification task as a utility task, aiming to build a general disease detecter via chest x-ray.
This project tries to explore the data cooperation between multimodal data -- text and image, and then improve AI downstream tasks.
To alleviate the workload of radiologists, researchers develop algorithms that can automatically classify X-ray images into different classes (corresponding to the existence of different diseases discovered in X-ray images).
even though, the current SOTA specialist model (customized model for one certain disease) gets very good performance, a generalist model (capable of handling multiple diseases simultaneously) is still weak.
In this context, what I want to do is establish an algorithm which capable of detecting multiple diseases from X-ray images.
To solve this problem, I need to interface 2 main challenges

Using contrastive learning to align the diseases' representation between textual and visual branches, leveraging the power of LLMs to guide the feature extraction in the visual branch.
In reality, the diseases diagnosed from X-ray images are supposed to be correlated with each other to some extent. Therefore, the orthogonalizing may not make sense.
To inject the prior knowledge of this correlation, I use the graph to represent the hierarchical relation between my 14 labels, and I hope this prior knowledge can guide the model learning.
Hierarchical relation tree of 14 labels
AUC comparison among 14 labels(config: grpah+Orth+Contrastive)
Using the same model and training configuration in the visual branch, comparing the performance concerning the AUC metric between the setting of the visual-only version and the visual-plus-textual version. Shown as a graph, I highlight the difference in performance between these two settings. Using green values to indicate the improvement and red values to indicate degradation if the difference is larger than 0.5%.
From the figure, most of them are the same, and in some certain diseases like pleural other get improvement.
[1] Towards long-tailed, multi-label disease classification from chest X-ray: Overview of the CXR-LT challenge
[2] Explainer: From X-Ray Observations to Explainable Zero-Shot Diagnosis
[3] CheXclusion: Fairness gaps in deep chest X-ray classifiers
[4] A Simple General Approach to Balance Task Difficulty in Multi-Task Learning
[5] Multi-Task Learning Using Uncertainty to Weigh Losses
for Scene Geometry and Semantics
[6] Attentional Mixtures of Soft Prompt Tuning
for Parameter-efficient Multi-task Knowledge Sharing
[7] A Pilot Study of Query-Free Adversarial Attack against Stable Diffusion
2023-11-8:
2023-11-10
2023-11-11
2023-11-18:
Memo:
CheXpert is an open-source rule based tool that is built on NegBio. It proceeds in three stages: (1) extraction, (2) classification, and (3) aggregation. In the extraction stage, all mentions of a label are identified, including alternate spellings, synonyms, and abbreviations (e.g. for pneumothorax, the words "pneumothoraces" and "ptx" would also be captured) [8]. Mentions are then classified as positive, uncertain, or negative using local context. Finally, aggregation is necessary as there may be multiple mentions of a label. Priority is given to positive mentions, followed by uncertain mentions, and lastly negative mentions. If a positive mention exists, then the label is positive. Conversely, if a negative and uncertain mention exist, the label is uncertain. These stages are used to define all labels except "No Finding", which is only positive if all other labels except "Support Devices" are negative or unmentioned. More detail is provided in the CheXpert article [8]. The output of CheXpert was saved to a CSV file with one row per study and one column per finding.
Structured labels
The mimic-cxr-2.0.0-chexpert.csv.gz and mimic-cxr-2.0.0-negbio.csv.gz files are compressed comma delimited value files. A total of 227,827 studies are assigned a label by CheXpert and NegBio. Eight studies could not be labeled due to a lack of a findings or impression section. The first three columns are:
subject_id - An integer unique for an individual patient
study_id - An integer unique for an individual study (i.e. an individual radiology report with one or more images associated with it)
The remaining columns are labels as presented in the CheXpert article [8]:
Atelectasis
Cardiomegaly
Consolidation
Edema
Enlarged Cardiomediastinum
Fracture
Lung Lesion
Lung Opacity
Pleural Effusion
Pneumonia
Pneumothorax
Pleural Other
Support Devices
No Finding
Note that "No Finding" is the absence of any of the 13 descriptive labels and a check that the text does not mention a specified set of other common findings beyond those covered by the descriptive labels. Thus, it is possible for a study in the CheXpert set to have no labels assigned. For example, study 57,321,224 has the following findings/impression text: "Hyperinflation. No evidence of acute disease.". this would be assigned a label of "No Finding", but the use of "hyperinflation" suppresses the labeling of no finding. For details see the CheXpert article [8], and the list of phrases are publicly available in their code repository (phrases/mention/no_finding.txt). There are 2,414 studies which do not have a label assigned by CheXpert. Conversely, all studies present in the provided files have been assigned a label by NegBio.
Each label column contains one of four values: 1.0, -1.0, 0.0, or missing. These labels have the following interpretation:
1.0 - The label was positively mentioned in the associated study, and is present in one or more of the corresponding images
e.g. "A large pleural effusion"
0.0 - The label was negatively mentioned in the associated study, and therefore should not be present in any of the corresponding images
e.g. "No pneumothorax."
-1.0 - The label was either: (1) mentioned with uncertainty in the report, and therefore may or may not be present to some degree in the corresponding image, or (2) mentioned with ambiguous language in the report and it is unclear if the pathology exists or not
Explicit uncertainty: "The cardiac size cannot be evaluated."
Ambiguous language: "The cardiac contours are stable."
Missing (empty element) - No mention of the label was made in the report
for `Support Devices`, this column get 4 kind of values(1, 0, -1, missing), most of them are missing and 1, missing>1>0>>-1
in the previous experiment, using the disease name as text prompts, we hoped these textual embeddings could facilitate the performance of classification tasks in the visual branch.
Indeed, adding auxiliary losses can improve the overall performance.
In my ideal case, visual embeddings should be aligned with textual embeddings. However, the unreduced contrastive loss (1.7) between embeddings with 512 dimensions.
Therefore, regardless of the general disease concepts, I try to induce the diagnostic information (Positive/Negative Fracture).
To simplify the experiment, I initially assumed all of the corresponding textual embeddings should be orthogonal with each other.
Eg: Positive Fracture Ortho Negative Edma
614 commits
Jupyter Notebook
99.5%
feature representation
0
stars
614
commits
Jupyter Notebook
primary language
Jul 14, 2024
updated
Generated by GPT-4
A feature representation task.
currently using the Classification task as a utility task, aiming to build a general disease detecter via chest x-ray.
This project tries to explore the data cooperation between multimodal data -- text and image, and then improve AI downstream tasks.
Leveraging multimodal data, the Visual Language Model(VLM) demonstrated impressive capability of bridging the knowledge in multi-modalities. VLMs like CLIP, Flamingo, and DALL-E, which are trained based on the tremendous amount of data and computational resources show good performance in many different downstream tasks due to the good generalizability. However, like a double-edged sword, the generalizability of pre-trained VLMs limits their performance in the customized setting. In this project, I try to leverage the prior knowledge in pre-trained VLMs and customize the embedding generation in my general classification task. Using the simple contrastive learning method proposed in the report, a robust generalist classifier is available with the deficiency of training data which is a ubiquitous context in the biomedical setting.
A feature representation task.
currently using the Classification task as a utility task, aiming to build a general disease detecter via chest x-ray.
This project tries to explore the data cooperation between multimodal data -- text and image, and then improve AI downstream tasks.
To alleviate the workload of radiologists, researchers develop algorithms that can automatically classify X-ray images into different classes (corresponding to the existence of different diseases discovered in X-ray images).
even though, the current SOTA specialist model (customized model for one certain disease) gets very good performance, a generalist model (capable of handling multiple diseases simultaneously) is still weak.
In this context, what I want to do is establish an algorithm which capable of detecting multiple diseases from X-ray images.
To solve this problem, I need to interface 2 main challenges

Using contrastive learning to align the diseases' representation between textual and visual branches, leveraging the power of LLMs to guide the feature extraction in the visual branch.
In reality, the diseases diagnosed from X-ray images are supposed to be correlated with each other to some extent. Therefore, the orthogonalizing may not make sense.
To inject the prior knowledge of this correlation, I use the graph to represent the hierarchical relation between my 14 labels, and I hope this prior knowledge can guide the model learning.
Hierarchical relation tree of 14 labels
AUC comparison among 14 labels(config: grpah+Orth+Contrastive)
Using the same model and training configuration in the visual branch, comparing the performance concerning the AUC metric between the setting of the visual-only version and the visual-plus-textual version. Shown as a graph, I highlight the difference in performance between these two settings. Using green values to indicate the improvement and red values to indicate degradation if the difference is larger than 0.5%.
From the figure, most of them are the same, and in some certain diseases like pleural other get improvement.
[1] Towards long-tailed, multi-label disease classification from chest X-ray: Overview of the CXR-LT challenge
[2] Explainer: From X-Ray Observations to Explainable Zero-Shot Diagnosis
[3] CheXclusion: Fairness gaps in deep chest X-ray classifiers
[4] A Simple General Approach to Balance Task Difficulty in Multi-Task Learning
[5] Multi-Task Learning Using Uncertainty to Weigh Losses
for Scene Geometry and Semantics
[6] Attentional Mixtures of Soft Prompt Tuning
for Parameter-efficient Multi-task Knowledge Sharing
[7] A Pilot Study of Query-Free Adversarial Attack against Stable Diffusion
2023-11-8:
2023-11-10
2023-11-11
2023-11-18:
Memo:
CheXpert is an open-source rule based tool that is built on NegBio. It proceeds in three stages: (1) extraction, (2) classification, and (3) aggregation. In the extraction stage, all mentions of a label are identified, including alternate spellings, synonyms, and abbreviations (e.g. for pneumothorax, the words "pneumothoraces" and "ptx" would also be captured) [8]. Mentions are then classified as positive, uncertain, or negative using local context. Finally, aggregation is necessary as there may be multiple mentions of a label. Priority is given to positive mentions, followed by uncertain mentions, and lastly negative mentions. If a positive mention exists, then the label is positive. Conversely, if a negative and uncertain mention exist, the label is uncertain. These stages are used to define all labels except "No Finding", which is only positive if all other labels except "Support Devices" are negative or unmentioned. More detail is provided in the CheXpert article [8]. The output of CheXpert was saved to a CSV file with one row per study and one column per finding.
Structured labels
The mimic-cxr-2.0.0-chexpert.csv.gz and mimic-cxr-2.0.0-negbio.csv.gz files are compressed comma delimited value files. A total of 227,827 studies are assigned a label by CheXpert and NegBio. Eight studies could not be labeled due to a lack of a findings or impression section. The first three columns are:
subject_id - An integer unique for an individual patient
study_id - An integer unique for an individual study (i.e. an individual radiology report with one or more images associated with it)
The remaining columns are labels as presented in the CheXpert article [8]:
Atelectasis
Cardiomegaly
Consolidation
Edema
Enlarged Cardiomediastinum
Fracture
Lung Lesion
Lung Opacity
Pleural Effusion
Pneumonia
Pneumothorax
Pleural Other
Support Devices
No Finding
Note that "No Finding" is the absence of any of the 13 descriptive labels and a check that the text does not mention a specified set of other common findings beyond those covered by the descriptive labels. Thus, it is possible for a study in the CheXpert set to have no labels assigned. For example, study 57,321,224 has the following findings/impression text: "Hyperinflation. No evidence of acute disease.". this would be assigned a label of "No Finding", but the use of "hyperinflation" suppresses the labeling of no finding. For details see the CheXpert article [8], and the list of phrases are publicly available in their code repository (phrases/mention/no_finding.txt). There are 2,414 studies which do not have a label assigned by CheXpert. Conversely, all studies present in the provided files have been assigned a label by NegBio.
Each label column contains one of four values: 1.0, -1.0, 0.0, or missing. These labels have the following interpretation:
1.0 - The label was positively mentioned in the associated study, and is present in one or more of the corresponding images
e.g. "A large pleural effusion"
0.0 - The label was negatively mentioned in the associated study, and therefore should not be present in any of the corresponding images
e.g. "No pneumothorax."
-1.0 - The label was either: (1) mentioned with uncertainty in the report, and therefore may or may not be present to some degree in the corresponding image, or (2) mentioned with ambiguous language in the report and it is unclear if the pathology exists or not
Explicit uncertainty: "The cardiac size cannot be evaluated."
Ambiguous language: "The cardiac contours are stable."
Missing (empty element) - No mention of the label was made in the report
for `Support Devices`, this column get 4 kind of values(1, 0, -1, missing), most of them are missing and 1, missing>1>0>>-1
in the previous experiment, using the disease name as text prompts, we hoped these textual embeddings could facilitate the performance of classification tasks in the visual branch.
Indeed, adding auxiliary losses can improve the overall performance.
In my ideal case, visual embeddings should be aligned with textual embeddings. However, the unreduced contrastive loss (1.7) between embeddings with 512 dimensions.
Therefore, regardless of the general disease concepts, I try to induce the diagnostic information (Positive/Negative Fracture).
To simplify the experiment, I initially assumed all of the corresponding textual embeddings should be orthogonal with each other.
Eg: Positive Fracture Ortho Negative Edma
614 commits
Jupyter Notebook
99.5%