# RAIN

 This repo is the official implementation of "Application of Deep Learning for the Precise Detection of Recurrence in Nasopharyngeal Carcinoma: A Multicenter Observational Study". 

# System Requirements

## Hardware Requirements

The “RAIN” package requires a standard computer with enough RAM to run the program. If the computer has a Nvidia graphics card that supports CUDA, this will help speed up the execution of the program.

We have tested the program based on the computer with the following specs:

RAM: 32GB

CPU: IntelXeon@Gold 6240Processor 24.75M Cache,2.60 GHz

Graphics card: NVIDIA V100

## Software Requirements

### OS Requirements

The package is tested on **centos** **7.6** operating systems.

### Python Dependencies

The IDE is PyCharm. The installation instructions on the official website are as follows (https://www.jetbrains.com/pycharm/download/other.html):

Take version 2018.1.4 as an example:

1. Run the PyCharm-2018.1.4.exe file that starts the Installation Wizard
2. Follow all steps suggested by the wizard. Please pay special attention to the corresponding installation options

This package depends on the Python scientific stack, and the versions used for testing are:

```
Python 3.6.10
pytorch 1.4.0
numpy 1.19.1
matplotlib 3.2.1
torchvision 0.11.2
SimpleITK   1.2.4   
pandas 1.0.3
```

# Installation Guide

Python is necessary, which can be downloaded from the official website: [Welcome to Python.org](https://www.python.org/).

PyTorch can also be downloaded from the official website: [PyTorch](https://pytorch.org/). Please confirm its version to make sure it can work with the CUDA you used.

Other packages can be installed from PyPi:

```
pip install pandas
pip install numpy
pip install torchvision
...
```

 It takes about 10 minutes to install these packages on the above computer. 

# DEMO

**Demo_data** contains numpy data collected from complete remission of nasopharyngeal carcinoma MRI.

In demo data, data from recurrence scan were labelled as "1", while data from non-recurrence scan  were labelled as "0".

## How to use the package

1. Divide the data into training, validation, and test sets (such as : "train.csv", "test.csv").
2. Run the file "train.py" to get the trained model.
3. Run the file "test.py" to get the accuracy.

## 

## License

 This project is covered under the **MIT License**. 

