batmanlab / Mammo-CLIP

Official Pytorch implementation of MICCAI 2024 paper (early accept, top 11%) Mammo-CLIP: A Vision Language Foundation Model to Enhance Data Efficiency and Robustness in Mammography
https://shantanu-ai.github.io/projects/MICCAI-2024-Mammo-CLIP/
Creative Commons Attribution 4.0 International
38 stars 11 forks source link

Request for Report Example or Explanation on Report Construction for Mammo-CLIP #18

Closed GuilhermeJC13 closed 1 month ago

GuilhermeJC13 commented 1 month ago

Hello,

I’m currently testing Mammo-CLIP using a different dataset and would like to align my reports with those used during the model’s training phase. Specifically, I would appreciate if you could provide an example of a report that was directly used in the training step. It doesn’t have to be a real one; I’m mainly looking to understand the format and structure to better adapt my own reports for compatibility.

I came across the file upmc_dicom_consolidated_final_folds_BIRADS_num_1_report.csv, which contains valuable information. However, I’m unsure how all this data is consolidated into the final report format. Do you simply merge the FINDINGS and IMPRESSION sections, or do you also incorporate details such as laterality and breast density?

A detailed explanation or an example report would be incredibly helpful for me to adapt my reports accurately. Thank you for your assistance!

Best regards, Guilherme Jácome

shantanu-ai commented 1 month ago

So, in our dataset, all the reports are formatted as this in a txt file:

[History]
.........

[Findings]
...........

[Impression]
.........

Using a simple regex we extract the impression and findings and create this csv file upmc_dicom_consolidated_final_folds_BIRADS_num_1_report.csv. So, if you have a report, just extract the impression and findings section and create the above csv file.

We had a metadata.csv file which contains the paths of the images, BIRADS, age, and patient id. For each of the image, we extracted the view (CC/MLO) and laterality (left/right) from the dicom header. Using all the information including the impression and findings, we create upmc_dicom_consolidated_final_folds_BIRADS_num_1_report.csv file.

GuilhermeJC13 commented 1 month ago

Thank you for your response!

To clarify, which specific columns are used as the report during the training process? For example, do you only use the IMPRESSIONS column, or do you merge multiple columns into a single string for the model input? It would be helpful to understand the exact structure or combination of columns that Mammo-CLIP utilizes so that I can format my dataset accordingly.

shantanu-ai commented 1 month ago

We use impression and findings both. Go through the augmentation section 2.2 in the paper to understand. If we have impression and findings both, we use one as original text, another as augmented one. If we have either the impression or findings, we use it as original text. We translate the text to Italian and then translate back to english and use this as augmented text. So, the 1st step is to extract findings and impression from report to create upmc_dicom_consolidated_final_folds_BIRADS_num_1_report.csv file.

After that, you have to run the following (we listed this in details in readme.md) which will give u the actual csv file with text augmentation, needed by Mammo-CLIP:

 ./src/codebase/augment_text.py \
  --dataset-path="/restricted/projectnb/batmanlab/shawn24/PhD/Mammo-CLIP/src/codebase/data_csv" \
  --csv-path="upmc_dicom_consolidated_final_folds_BIRADS_num_1_report.csv" \
  --dataset="upmc"