Skip to content
Semi-supervised implementation of a DNN for mass prediction from sparsely labeled images
Python
Branch: master
Clone or download
Hamdan
Hamdan updates
Latest commit 0f3fc2a Aug 20, 2019
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
.idea minor_change Aug 20, 2019
Gradcam_visualization Update cam_functions.py Aug 20, 2019
Live_cam_visualization Update cam_functions.py Aug 20, 2019
checkpoints updated_for_mac Jun 7, 2019
data_files
dataset dataset_added May 27, 2019
models Update RES_16E.py May 29, 2019
tensorboard minor_change Aug 20, 2019
utils live_cam_added Aug 18, 2019
.gitignore Initial commit Mar 27, 2019
LICENSE
README.md Update README.md Aug 18, 2019
__init__.py retry_deployables May 27, 2019
estimate.py Update estimate.py Jun 2, 2019
example_live_cam.gif gif_added Aug 18, 2019
mass_flow.py updates Aug 20, 2019

README.md

Mass Estimation from Images with Sparse ground Truth using DNN

Implementation

The code provided herein is implemented in TF1.12 and compatible with Eager mode. To run the code, simply run the estimate.py with specifying the following arguments directly in terminal.

Requirements

1- Numpy 2- tqdm 3- termcolor 4- matplotlib 5-pickle

Args

  • '-n', '--network_size', default=None, type=int, help= '(9: RES9E, 16:RES16E) -- default set to: RES9ER'
  • '-b', '--batch_size',default=8, type=int,help='(between 1<=b<=215 (smallest log size=215). depends on GPU/CPU ram capacity -- default set to: 8 '
  • '-t', '--train_mode', default=0, type=int, help='0: No training, 1: continue with existing checkpoint, 2: train from scratch) -- set to default: 0 '
  • '-e', '--training_epochs', default=10, type=int, help='-- default set to 10'
  • '-v', '--visualize', default=1, type=int, help='(0, No visualization, 1: validate and visualize log signal) -- defualt set to: 1 '
  • '-l', '--logs', default=2, type=int, help='(Logs to visualize--> 0: train logs, 1: validate logs, 2: test logs) -- defualt set to: 2 '

Example use

This runs in training mode with existing checkpoints then visualize the predicted signal of the test log/s

  • python3 estimate.py -t 1

Note:

  • Test accuracy of test log using RES9_ER should give an accuracy of 99.45% and if trained with option 1 for 1 epoch (i.e. python3 estimate.py -t 1 -e 1), accuracy can top 99.67%. This attached code is tested with TF1.12 and compabatible with linux and windows machines. Also, make sure to include/install all TF dependencies as per used in the code.
  • When training, checkpoints for certain accuracies are automatically saved in generated_checkpoints folder inside the main checkpoints folder

Aditional Note

  • Gradcam code is provided seperately in the Gradcam_visualization folder, navigate to the Readme file in that folder for instructions on usage.

  • Live Gradcam - a fun feature to lively visualize predictions is available in Live_cam_visualization folder.

  • Paper

Live CAM Example

Author

Muhammad K.A. Hamdan

You can’t perform that action at this time.