<jupyter_start><jupyter_text>Training CoarseNetCode for FineNet in paper "Robust Minutiae Extractor: Integrating Deep Networks and Fingerprint Domain Knowledge" at ICB 2018: https://arxiv.org/pdf/1712.09401.pdfIf you use whole or partial function in this code, please cite paper:    @inproceedings{Nguyen_MinutiaeNet,	author    = {<NAME> and <NAME> and <NAME>},	title     = {Robust Minutiae Extractor: Integrating Deep Networks and Fingerprint Domain Knowledge},	booktitle = {The 11th International Conference on Biometrics, 2018},	year      = {2018},	} To run this script, you need to prepare dataset as follows:`path/to/dataset/`:```Shell - img_files/*.bmp - mnt_files/*.mnt - seg_files/*.jpg```See example at `Dataset/CoarseNet_train/` (these images are example from NIST SD27)  CoarseNet can run with any image sizeSee [CoarseNet_train.py](https://github.com/luannd/MinutiaeNet/blob/master/CoarseNet/CoarseNet_train.py) if running from command line.Log files, tensorboard, minutiae models can be seen from `output_CoarseNet` folder<jupyter_code>from __future__ import absolute_import
from __future__ import division

import sys, os
sys.path.append(os.path.realpath('../CoarseNet'))

os.environ['KERAS_BACKEND'] = 'tensorflow'

from datetime import datetime
from MinutiaeNet_utils import *

from keras import backend as K
from keras.optimizers import SGD, Adam

from CoarseNet_utils import *
from CoarseNet_model import *

lr = 0.005

os.environ["CUDA_VISIBLE_DEVICES"] = '0'

config = K.tf.ConfigProto(gpu_options=K.tf.GPUOptions(allow_growth=True))
sess = K.tf.Session(config=config)
K.set_session(sess)

batch_size = 2
use_multiprocessing = False
input_size = 400

# Can use multiple folders for training
train_set = ['../Dataset/CoarseNet_train/',]
validate_set = ['../path/to/your/data/',]

pretrain_dir = '../Models/CoarseNet.h5'
output_dir = '../output_CoarseNet/'+datetime.now().strftime('%Y%m%d-%H%M%S')
FineNet_dir = '../Models/FineNet.h5'



output_dir = '../output_CoarseNet/trainResults/' + datetime.now().strftime('%Y%m%d-%H%M%S')
logging = init_log(output_dir)
logging.info("Learning rate = %s", lr)
logging.info("Pretrain dir = %s", pretrain_dir)

train(input_shape=(input_size, input_size), train_set=train_set, output_dir=output_dir,
      pretrain_dir=pretrain_dir, batch_size=batch_size, test_set=validate_set,
      learning_config=Adam(lr=float(lr), beta_1=0.9, beta_2=0.999, epsilon=1e-08, clipnorm=0.9),
      logging=logging)
pip list<jupyter_output>Package                 Version             
----------------------- --------------------
apturl                  0.5.2               
attrs                   19.3.0              
backcall                0.2.0               
bcrypt                  3.1.7               
beautifulsoup4          4.9.1               
bleach                  3.1.5               
blinker                 1.4                 
Brlapi                  0.7.0               
bs4                     0.0.1               
certifi                 2019.11.28          
chardet                 3.0.4               
Click                   7.0                 
colorama                0.4.3               
command-not-found       0.3                 
cryptography            2.8                 
cupshelpers             1.0                 
dbus-python             1.2.16              
decorator               4.4.2               
defer                   1.0.6               
defusedxml              0.6.0               
distro    [...]
StarcoderdataJupyterStructuredCleanDedup