Skip to content

Commit 1a61cf6

Browse files
authored
Merge pull request #2 from nccaiteam/master
readme
2 parents 29b9ef4 + df5044b commit 1a61cf6

File tree

2 files changed

+64
-37
lines changed

2 files changed

+64
-37
lines changed

README.md

Lines changed: 1 addition & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -1,29 +1,13 @@
11

2-
# mmg-nia Repository for NIA project
3-
42
## How to use it
53
1. `$ git clone https://github.com/lunit-io/mmg-nia`
64
2. `$ pip install -r requirements.txt`
75
3. `$ cd data_preprocessing` and do data-preprocessing [here](https://github.com/lunit-io/mmg-model-nia/tree/master/data_preprocessing)
86
4. To train and test 5-fold cross validation, use `$ sh test.sh $GPU_ID $PICKLE_PATH $DATA_ROOT` \
97
e.g. `$ sh test.sh 0 data_preprocessing/db/shuffled_db.pkl /data/mmg/mg_nia`
8+
- If you want to use many GPUs, input multiple numbers: `sh test.sh 0,1,2,3, ...`
109
5. `$ cat resnet34-5fold-result`
1110
```
12-
compressed
13-
threshold : 0.1
14-
calculated accuracy is 0.8150886790885683
15-
calculated specificity is 0.8227048930437848
16-
calculated sensitivity is 0.7889675985264972
17-
threshold : 0.15
18-
calculated accuracy is 0.8451890694648247
19-
calculated specificity is 0.878533964063642
20-
calculated sensitivity is 0.7308764166673534
21-
threshold : 0.2
22-
calculated accuracy is 0.8608703452476536
23-
calculated specificity is 0.9128091136592129
24-
calculated sensitivity is 0.6827785378337696
25-
calculated auc is 0.8896701982655968
26-
uncompressed
2711
threshold : 0.1
2812
calculated accuracy is 0.8144577092389047
2913
calculated specificity is 0.8112627121478205
@@ -40,21 +24,6 @@ uncompressed
4024
```
4125
6. `$ cat densenet121-5fold-result`
4226
```
43-
compressed
44-
threshold : 0.1
45-
calculated accuracy is 0.8405651319250256
46-
calculated specificity is 0.8526687249469763
47-
calculated sensitivity is 0.7984347172444817
48-
threshold : 0.15
49-
calculated accuracy is 0.8595072953293281
50-
calculated specificity is 0.888602910574434
51-
calculated sensitivity is 0.7593899157536472
52-
threshold : 0.2
53-
calculated accuracy is 0.8708727262659541
54-
calculated specificity is 0.9096908783863396
55-
calculated sensitivity is 0.7374108776754932
56-
calculated auc is 0.9031778432556026
57-
uncompressed
5827
threshold : 0.1
5928
calculated accuracy is 0.8379339405852875
6029
calculated specificity is 0.8391845548624011

data_preprocessing/README.md

Lines changed: 63 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,77 @@
11
# Prepare dataset
22

3-
## Download dataset
3+
## Library installation: GDCM
4+
```
5+
apt-get update
6+
7+
apt-get install -y --no-install-recommends curl build-essential cmake swig
8+
9+
curl -L -O https://sourceforge.net/projects/gdcm/files/gdcm%202.x/GDCM%202.8.9/gdcm-2.8.9.tar.gz
10+
11+
tar -xzf gdcm-2.8.9.tar.gz
12+
13+
mv gdcm-2.8.9 gdcm-src
14+
15+
mkdir gdcm-build
16+
17+
cd gdcm-build
18+
19+
cmake -DGDCM_WRAP_PYTHON=ON \
20+
-DGDCM_BUILD_SHARED_LIBS=ON \
21+
-DCMAKE_INSTALL_PREFIX=/usr/local \
22+
../gdcm-src
23+
24+
make -j$(nproc) && make install && \
25+
26+
cd /usr/local/lib && cp _gdcmswig.so gdcmswig.py gdcm.py $(python -c "from distutils.sysconfig import get_python_lib; print(get_python_lib())")
27+
28+
cd -
29+
30+
rm -rf gdcm-src gdcm-build gdcm-2.8.9.tar.gz
31+
```
32+
33+
## Dataset
434

535
We assume the data is downloaded in $DATA_ROOT
636

7-
Rearrange data by moving Compressed & Uncompressed data by following command,
37+
Store data in $DATA_ROOT/dcm by following command,
838

939
```
1040
cd $DATA_ROOT
1141
mkdir dcm
12-
mv Uncompressed/ dcm/.
13-
mv Compressed/ dcm/.
1442
```
1543

16-
## Data preprocess
44+
Data structure
45+
46+
```
47+
$DATA_ROOT
48+
└── dcm
49+
├── 1
50+
│ ├── LCC.dcm
51+
│ ├── LMLO.dcm
52+
│ ├── RCC.dcm
53+
│ └── RMLO.dcm
54+
├── 2
55+
│ ├── LCC.dcm
56+
│ ├── LMLO.dcm
57+
│ ├── RCC.dcm
58+
│ └── RMLO.dcm
59+
...
60+
61+
$DATA_ROOT
62+
└── annotation_result_1st
63+
├── Various time stamps…(e.g., 20191015082002_KST)
64+
├── \_\_results
65+
│ ├── dst_json
66+
│ | ├── Various time stamps...
67+
│ | ├── 20190930172251_KST
68+
│ │ | ├── Success
69+
│ │ │ | ├── Type_id.json (e.g. Cancer_00367.json)
70+
...
71+
```
72+
73+
74+
## Data preprocessing
1775
To train our model, we have to first convert dicom files to image files.
1876
Then, the information about the data(such as the path to image file or annotations) is gathered.
1977

0 commit comments

Comments
 (0)