This is achieved using a PyTorch implementation of SimCLR based on https://github.com/facebookresearch/moco, adapted so that the encoder consists of ResNet-18 followed by a representation network. Also, the QSSL method reference to QSSL
- Fingerprint Preprocessing
- dataset from Sokoto Coventry Fingerprint Dataset(kaggle)
- Training Architecture(adapted from QSSL)
- Fingerprint Enhancement(Gabor Filter): Python implementation reference to author Utkarsh-Deshmukh Fingerprint-Enhancement-Python
- NOTE must clone the Fingerprint-Enhancement-Python first
- Fingerprint Canny Edge Detection
python train_simclr.py --gpu 0 --lr 1e-3 -b 256 -d data/ -w 8
Optional arguments:
--gpu gpu_id
--lr learning rate
-b batch_size
-d data_dir
-w width of representation network
NOTE You must clone quantum-neural-network and add it to your sys/python path first.
python train_simclr.py -q --q_backend qasm_simulator --q_ansatz sim_circ_14_half -w 8 --classes 5 --save-batches --epochs 2
Optional arguments:
-q Flag to use a quantum representation network
--q_backend Qiskit backend to use (can include real quantum devices)
--q_ansatz Variational ansatz for quantum neural network.
-w Width of representation network, in this case the number of qubits.
--classes Use the first N classes of the dataset
--save-batches Save the model after each batch (rather than epoch by default)
--epochs Number of epochs to train for (quantum training takes a long time)
The so called "ring" and "all-to-all" ansatzes used in the paper correspond to --q_anzatz sim_circ_14_half
and abbas
in these options respectively.
python linear_probe_simclr.py --pretrained model/selfsup/path_to_checkpoint_0000.path.tar -q --q_backend qasm_simulator --q_ansatz sim_circ_14_half -w 8 --classes 5
Optional arguments:
--pretrained path_to_self_sup_model
Jaderberg, B., Anderson, L.W., Xie, W., Albanie, S., Kiffner, M. and Jaksch, D., 2021. Quantum Self-Supervised Learning. arXiv preprint arXiv:2103.14653.