Classify IVF images in real time.

To run the STORK framework please see the Flowchart.pdf and follow these steps:
Install the TensorFlow. Follow the instruction from here: https://www.tensorflow.org/install/
Pre-trained Models of CNN architectures should be downloaded from the "Pre-trained Models" part of https://github.com/wenwei202/terngrad/tree/master/slim#pre-trained-models and be located in your machine (e.g. GitHub_STORK/scripts/slim/run/checkpoint). The files for pre-trained models are available under the column named "Checkpoint".
Divide the images with the original size into two or more classes based on the aim of classification (e.g., discrimination of good-quality and poor-quality embryos). 85% of images in each class will be selected as Train set (train and validation) and 15% for Test set.
_NUM_CLASSES should be set in embryo.py (located in src/stork_src/slim/datasets/embryo.py).
Run the convert.py (located in src/stork_src/convert.py the "STORK/scripts" directory) to allocate the suitable percentage of images to train and validation sets.convert.py needs three arguments including:
Example Command
python convert.py ../Images/train process/ 0
Keep the percentage of validation images as 0 because we set 15% for validation inside the code
It will save converted .tf records in the "process" directory.
The Inception-V1 architecture should be run on the Train set images from the [src/stork_src/scripts/slim] (src/stork_src/scripts/slim) directory.
load_inception_v1.sh located in "run/" directory src/stork_src/scripts/slim/run and edit PRETRAINED_CHECKPOINT_DIR, TRAIN_DIR, and DATASET_DIR addresses../run/load_inception_v1.sh
chmod 777 load_inception_v1.sh
Each script in slim dataset should be run separately based on the selected architecture. The slim folder contains some sub-folders.
You can set up the parameters of each architectures in “run” sub-folder. For example you can set the architecture in a way to run from scratch or trained for the last or all layer. Also you can set the batch size or the number of maximum steps.
see the result folder at src/stork_src/scripts/result as the result of running the above script.
Note that the flag for --clone_on_cpu is set to "True". If you are going to use GPUs you should change this flag to "False".
predict.py loads a trained model on provided images. This script requires 5 arguments:python predict.py v1 ../result/ ../../Images/test output.txt 2
v1 = inception-v1, ../Images/test = the address of test set images, out.txt = the output result file, 2 = number of classes
You can see output.txt in src/stork_src/scripts/slim, for example.
output.txt file should be in the same folder that you are running acc.py. Then run the following code:$ python acc.py
process and result folders from ML training (Not included in this repository).DOCKER_CONTAINER_NAME=stork \
STORK_PORT=3000 \
OUTPUT_DIR=/stork/data/output/
UPLOAD_DIR=/stork/data/uploads/
PROCESS_DIR=/stork/data/process/
RESULT_DIR=/stork/data/result/
STORK_TAG=latest
docker run -d --name ${DOCKER_CONTAINER_NAME} \
--restart on-failure:5 \
-p ${STORK_PORT}:80 \
-v ${OUTPUT_DIR}:/output \
-v ${UPLOAD_DIR}:/uploads \
-v ${PROCESS_DIR}:/stork/src/stork_src/process:ro \
-v ${RESULT_DIR}:/stork/src/stork_src/result:ro \
--env USERS_DICT="{ 'username1': 'password', 'username2': 'password', 'username3': 'password' }" \
eipm/stork:${STORK_TAG}
Where:
Content type
Image
Digest
sha256:b75fec3e2…
Size
694.8 MB
Last updated
almost 3 years ago
docker pull eipm/stork