Update README.md
Browse files
README.md
CHANGED
|
@@ -2,4 +2,32 @@
|
|
| 2 |
license: mit
|
| 3 |
---
|
| 4 |
|
| 5 |
-
# source code of CPICANN
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 2 |
license: mit
|
| 3 |
---
|
| 4 |
|
| 5 |
+
# source code of CPICANN
|
| 6 |
+
|
| 7 |
+
## Instructions for replication
|
| 8 |
+
|
| 9 |
+
This directory contains all the source code needed to reproduce this work.
|
| 10 |
+
|
| 11 |
+
### Data preparation
|
| 12 |
+
|
| 13 |
+
To directly run the train and validation script in this directory, data preparation needs to be done. The [OneDrive link](https://hkustgz-my.sharepoint.com/:f:/g/personal/bcao686_connect_hkust-gz_edu_cn/EhdJLtou8I1MoUJCu-KCoboBfi-wOp00WAlQCrONxjoYgg?e=rltgFE) contains all the training and synthetic testing data used in this work, stored in data.zip. This link also contains the pretrained model for single-phase and di-phase identification.
|
| 14 |
+
|
| 15 |
+
File single-phase_checkpoint_0200.pth and file bi-phase_checkpoint_2000.pth from the link above is the pretrained model, place them under directory "pretrained".
|
| 16 |
+
|
| 17 |
+
File data.zip contains the data and the annotaion file. Place directory "train" and "val" from data.zip under directory "data", place the annotation files anno_train.csv and anno_val.csv under directory "annotation".
|
| 18 |
+
|
| 19 |
+
### Model Trianing
|
| 20 |
+
|
| 21 |
+
#### Single-phase
|
| 22 |
+
|
| 23 |
+
Run ```python train_single-phase.py``` to train the single-phase identification model from scratch. To train the model on your data, addtional parameters need to be set: ```python train_single-phase.py --data_dir_train=[your training data] --data_dir_val=[your validation data] --anno_train=[your anno file for training data] --anno_val=[your anno file for validation data]```.
|
| 24 |
+
|
| 25 |
+
#### Bi-phase
|
| 26 |
+
|
| 27 |
+
Run ```python train_bi-phase.py``` to train the bi-phase identification model. The bi-phase identification model is trained based on single-phase model, you can change the default setting by set the parameter ```load_path=[your pretrained single-phase model]```.
|
| 28 |
+
|
| 29 |
+
### Model validation
|
| 30 |
+
|
| 31 |
+
Run ```python train_single-phase.py``` and ```python val_bi-phase.py``` to run the validation code at default setting.
|
| 32 |
+
|
| 33 |
+
If you wish to validate the model on your data, plase format your data using data_format.py
|