Update README.md
Browse files
README.md
CHANGED
@@ -1,83 +1,142 @@
|
|
1 |
-
|
|
|
|
|
|
|
|
|
2 |
|
3 |
-
|
4 |
|
5 |
-
|
6 |
|
7 |
-
|
8 |
|
9 |
-
|
10 |
-
|
11 |
-
|
12 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
13 |
|
14 |
## Performance Comparison of ResNet Models
|
15 |
|
16 |
-
This table compares the performance of ResNet models pretrained on 2D RadImageNet using regular and Two2Three convolution techniques across various metrics
|
17 |
|
18 |
-
| Model
|
19 |
-
|
20 |
-
| ResNet10t
|
21 |
-
| ResNet18
|
22 |
-
| ResNet50
|
23 |
|
|
|
24 |
|
|
|
25 |
|
26 |
-
|
27 |
|
28 |
-
To
|
29 |
|
30 |
-
|
|
|
|
|
|
|
31 |
|
32 |
-
|
33 |
-
git lfs install
|
34 |
-
```
|
35 |
|
36 |
-
|
37 |
|
38 |
-
|
39 |
-
|
40 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
41 |
|
42 |
-
|
43 |
|
44 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
45 |
|
46 |
-
|
47 |
|
48 |
-
|
49 |
-
import timm
|
50 |
-
model = timm.create_model('resnet10t', num_classes=165)
|
51 |
-
```
|
52 |
|
53 |
-
|
54 |
|
55 |
-
|
56 |
|
57 |
-
|
|
|
|
|
58 |
|
59 |
-
|
60 |
|
61 |
-
|
62 |
|
63 |
-
```
|
64 |
-
|
65 |
-
title={Policy Gradient-Driven Noise Mask},
|
66 |
-
author={Yavuz, Mehmet Can and Yang, Yang},
|
67 |
-
booktitle={International Conference on Pattern Recognition},
|
68 |
-
pages={414--431},
|
69 |
-
year={2025},
|
70 |
-
organization={Springer}
|
71 |
-
}
|
72 |
```
|
73 |
|
74 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
75 |
|
76 |
-
|
77 |
|
78 |
-
|
79 |
|
80 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
81 |
|
82 |
---
|
83 |
license: cc-by-2.0
|
|
|
1 |
+
---
|
2 |
+
language: en
|
3 |
+
---
|
4 |
+
|
5 |
+
# Refined RadImageNet - Conversion Tools
|
6 |
|
7 |
+
The RadImageNet dataset is available upon request at [https://www.radimagenet.com/](https://www.radimagenet.com/).
|
8 |
|
9 |
+
This repository provides tools to process the RadImageNet dataset, converting it into a refined and stratified organization suitable for various medical imaging applications.
|
10 |
|
11 |
+
For detailed information, refer to our preprint paper: [Policy Gradient-Driven Noise Mask](https://arxiv.org/abs/2406.14568).
|
12 |
|
13 |
+
If you use this code in your research, please cite our paper:
|
14 |
+
|
15 |
+
```bibtex
|
16 |
+
@article{yavuz2024policy,
|
17 |
+
title={Policy Gradient-Driven Noise Mask},
|
18 |
+
author={Yavuz, Mehmet Can and Yang, Yang},
|
19 |
+
year={2024},
|
20 |
+
eprint={2406.14568},
|
21 |
+
archivePrefix={arXiv},
|
22 |
+
primaryClass={eess.IV}
|
23 |
+
}
|
24 |
+
```
|
25 |
|
26 |
## Performance Comparison of ResNet Models
|
27 |
|
28 |
+
This table compares the performance of ResNet models pretrained on 2D RadImageNet using regular and Two2Three convolution techniques across various metrics:
|
29 |
|
30 |
+
| Model | Precision (macro) | Recall (macro) | F1 Score (macro) | Balanced Accuracy | Average Accuracy |
|
31 |
+
|-----------|-------------------|----------------|------------------|-------------------|------------------|
|
32 |
+
| ResNet10t | 0.4720 | 0.3848 | 0.3998 | 0.3848 | 0.7981 |
|
33 |
+
| ResNet18 | 0.5150 | 0.4383 | 0.4545 | 0.4383 | 0.8177 |
|
34 |
+
| ResNet50 | 0.5563 | 0.4934 | 0.5097 | 0.4934 | 0.8352 |
|
35 |
|
36 |
+
We recommend adapting the code for benchmarking other models, which can be found here: [https://github.com/pytorch/vision/tree/main/references/classification](https://github.com/pytorch/vision/tree/main/references/classification).
|
37 |
|
38 |
+
## ResNet Models and Weights
|
39 |
|
40 |
+
The model weights are shared through [https://huggingface.co/convergedmachine/RadImagenet](https://huggingface.co/convergedmachine/RadImagenet).
|
41 |
|
42 |
+
To create a model using the `timm` library:
|
43 |
|
44 |
+
```python
|
45 |
+
import timm
|
46 |
+
model = timm.create_model('resnet10t', num_classes=165)
|
47 |
+
```
|
48 |
|
49 |
+
Replace `'resnet10t'` with `'resnet18'` or `'resnet50'` as needed.
|
|
|
|
|
50 |
|
51 |
+
## Folder Structure
|
52 |
|
53 |
+
```
|
54 |
+
correction_masks/
|
55 |
+
data/
|
56 |
+
weights/
|
57 |
+
output/
|
58 |
+
source/
|
59 |
+
correction_masks.tar.gz
|
60 |
+
radimagenet.tar.gz
|
61 |
+
RadiologyAI_test.csv
|
62 |
+
RadiologyAI_train.csv
|
63 |
+
RadiologyAI_val.csv
|
64 |
+
process.py
|
65 |
+
measure_acc_metrics.py
|
66 |
+
```
|
67 |
|
68 |
+
### Files & Directories
|
69 |
|
70 |
+
- **correction_masks/**: Contains correction masks for the images.
|
71 |
+
- **data/**: Contains the extracted radiology images.
|
72 |
+
- **weights/**: Directory for model weights.
|
73 |
+
- **output/**: Directory for output files.
|
74 |
+
- **source/**: Contains source files and datasets.
|
75 |
+
- **correction_masks.tar.gz**: Compressed file containing correction masks.
|
76 |
+
- **radimagenet.tar.gz**: Compressed RadImageNet dataset.
|
77 |
+
- **RadiologyAI_test.csv**: CSV file for the test dataset.
|
78 |
+
- **RadiologyAI_train.csv**: CSV file for the training dataset.
|
79 |
+
- **RadiologyAI_val.csv**: CSV file for the validation dataset.
|
80 |
+
- **process.py**: Main script to process and organize the RadImageNet files.
|
81 |
+
- **measure_acc_metrics.py**: Script to measure accuracy metrics.
|
82 |
|
83 |
+
## Download Processing Files
|
84 |
|
85 |
+
This repository contains files from the Hugging Face repository `convergedmachine/Refined-RadImagenet`. Follow the instructions below to clone the repository using Git.
|
|
|
|
|
|
|
86 |
|
87 |
+
### Prerequisites
|
88 |
|
89 |
+
Ensure that Git LFS (Large File Storage) is installed:
|
90 |
|
91 |
+
```bash
|
92 |
+
git lfs install
|
93 |
+
```
|
94 |
|
95 |
+
### Cloning the Repository
|
96 |
|
97 |
+
To clone the entire repository to your local machine:
|
98 |
|
99 |
+
```bash
|
100 |
+
git clone https://huggingface.co/convergedmachine/Refined-RadImagenet source/
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
101 |
```
|
102 |
|
103 |
+
This command clones all files from the repository into a directory named `source`.
|
104 |
+
|
105 |
+
### Notes
|
106 |
+
|
107 |
+
- Ensure you have sufficient storage space for large files.
|
108 |
+
- For more information about this dataset, visit the [Hugging Face page](https://huggingface.co/convergedmachine/Refined-RadImagenet).
|
109 |
+
|
110 |
+
Feel free to contribute or raise issues if you encounter any problems.
|
111 |
+
|
112 |
+
## Usage
|
113 |
+
|
114 |
+
1. **Extract the Dataset**:
|
115 |
+
|
116 |
+
```bash
|
117 |
+
python process.py
|
118 |
+
```
|
119 |
+
|
120 |
+
Ensure the dataset tar file is located in the `source/` directory. The script will automatically extract it to the `data/` directory.
|
121 |
|
122 |
+
2. **Process the Images**:
|
123 |
|
124 |
+
The script will read the CSV files, refine the images, and organize them accordingly.
|
125 |
|
126 |
+
## Dependencies
|
127 |
+
|
128 |
+
- Python 3.9+
|
129 |
+
- pandas
|
130 |
+
- OpenCV
|
131 |
+
- tarfile
|
132 |
+
- tqdm
|
133 |
+
- numpy
|
134 |
+
|
135 |
+
Install the required packages using pip:
|
136 |
+
|
137 |
+
```bash
|
138 |
+
pip install pandas opencv-python tarfile tqdm numpy
|
139 |
+
```
|
140 |
|
141 |
---
|
142 |
license: cc-by-2.0
|