A knowledge-integrated deep learning framework for cellular image analysis in microbiology: specialized for parasite classification, detection, and out-of-focus reconstruction
This repository includes Python codes and datasets used in our paper. A detailed description of how to use this repository is provided in our paper, for review purposes, the preview version of this paper is not available right now. These codes are based on the previous publications of our group, including three different tasks: classification (DCTL), detection (GFS-ExtremeNet), and reconstruction (COMI). All the codes have been refactored and abundant code comments for better readability, it is recommended to use this repository instead of the original one. The corresponding datasets for these codes are available at https://www.scidb.cn/anonymous/bWUyMm15.
To run the codes, install the Anaconda and create the virtual environment using the following command, if you are using a GPU then use the command 1 to create a GPU-compatible virtual environment, otherwise, use command 2:
- conda create -n microscopy_image_analysis cudatoolkit=10.0.130 cudnn=7.6.5 python=3.7.16
- conda create -n microscopy_image_analysis python=3.7.16
After installing the needed virtual environment, the next step is to set up the package dependencies. Simply open the command prompt under the previously installed virtual environment and use the "pip install packagename==version" to install the needed package. For example, if you want to install pandas with a version of 1.3.5, you should use this command: "pip install pandas==1.3.5". For pytorch and torchvision, it is recommended to use the command provided by the official website. The following are the needed packages:
- Python 3.7.16 or below
- tensorflow 1.15.0
- pytorch 1.2.0
- torchvision 0.4.0
- keras 2.2.4
- keras-contrib 2.0.8
- h5py 2.10.0
- protobuf 3.19.0
- scikit-learn 1.0.2
- opencv-python 4.6.0.66
- pycocotools 2.0.5
- tqdm 4.64.1
- pandas 1.3.5
- numpy 1.21.5
- matplotlib 3.5.3
To run this repository, it is important to keep an identical file structure for each template as follows, the pretrained models used in COMI are available at (https://drive.google.com/drive/folders/13R9fZ45IyPdJrq-ATHatPc_j_977qsT3?usp=sharing):
DCTL GFS-ExtremeNet COMI
├─checkpoints ├─checkpoints ├─dataset
├─dataset ├─config │ └─BPAEC
│ ├─X ├─dataset │ ├─actin
│ └─Y │ ├─Babesia │ ├─mitochondria
├─evaluate │ ├─Toxoplasma │ └─nucleus
│ └─plot_til │ └─Trypanosoma ├─pretrained
├─lib ├─db ├─results
├─models ├─external └─utils
└─results ├─models train.py
├─auc_roc │ └─py_utils test.py
└─tsne ├─nnet
train.py ├─results
test.py ├─sample
├─testing
├─tools
└─utils
config.py
train.py
test.py
When running these codes, open the Spyder IDE (use Spyder 5.3.3 for best compatibility) under the installed virtual environment and switch the file directory to the needed one. Open the "train.py" file and click the run button. If all the settings are correct, the IPython console will keep scrolling up with the training information. The trained model weights will be saved under the "models" folder. To test the trained model, open the "test.py" and configure the settings.
If you have any problems in running this repository, do not hesitate to contact us with this email fengruijuan558@gmail.com.