micbia / SegU-Net

Segmentation 2D Convolutional U-Network for Identification of HI regions during Reionization in 21-cm 3D Tomography Observations

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

SegU-Net

Segmentation 2D Convolutional U-Network for Identification of HI regions during the Cosmic Epoch of Reionization in 21-cm 3D Tomography Observations

Seg U-Net Training Utilization:
to train the network on data at you disposal you can change the directory path variable PATH in the initial condition files net.ini, as well as other hypeparameters. The actual data should be stored at this location in a sub-directory called data/.
Then run the following command:

 ▶  python segUnet.py config/net.ini

If you want to resume a training change the parameters BEST_EPOCH and RESUME_EPOCH in the same initial condition file, the first indicates the epoch of the best saved model, the second is the restarting epoch. These quantities should be both zero if you are starting a new training. You also must provide the output directory RESUME_PATH of the interrupted training (genertaed by the code). Our code save the entire network (weights and layers) so that, in case of resumed trainig the model is already compiled (keras: load_model).

Also, the number of down- and up-sampling levels are automatically scales depending on the images size (between 64 and 128 per side, 4 levels. Above equal 128, 5 levels).


Seg U-Net Predicts 21cm:
to do some predictions with your best trained network, use:

 ▶  python pred_segUnet.py config/pred.ini

in the initial condition file pred.ini, change:

  • PATH_OUT is the directory of the best performing model.
  • PATH_PREDIC is the path of the data to predict (same structure as in net.ini file).
  • AUGMENT is the number of times you want to increase your data set (random flip of 90, 180, 270 or 360 along the x, y or z-axis).

About

Segmentation 2D Convolutional U-Network for Identification of HI regions during Reionization in 21-cm 3D Tomography Observations

License:MIT License


Languages

Language:Jupyter Notebook 96.8%Language:Python 3.2%Language:Shell 0.1%