FingerFlow is an end-to-end deep learning Python framework for fingerprint minutiae manipulation built on top of Keras - TensorFlow high-level API.
In current stable version 3.0.1 following modules are provided:
- extractor - module responsible for extraction and classification of minutiae points from fingerprints. It is also capable of detecting fingerprint core points.
- matcher - module responsible for matching extracted minutiae feature vectors.
FingerFlow supports GPU acceleration on CUDA®-enabled graphic cards.
- Python 3.7 or newer
- CUDA - for TensorFlow GPU acceleration (if missing, CPU will be used for computation)
Use the package manager pip to install FingerFlow. We reccomend to use it in pip or anaconda enviroment.
Installation in anaconda enviroment:
pip install fingerflow
Module responsible for extraction and classification of fingerprint minutiae points and also for detecting fingerprint core point. Minutiae extraction part is built using MinutiaeNet neural network architecture. Core detection part is built using YOLOv4 object detection neural network architecture.
Extractor contains 3 modules:
- MinutiaeNet - module responsible for extracting minutiae points from fingerprint image. Using MinutiaeNet neural network architecture.
- ClassifyNet - module responsible for classifying extraced minutiae points. Architecture based on FineNet module of MinutiaeNet.
- CoreNet - module responsible for detecting fingerprint core point. YOLOv4 neural network architecture is used.
- CoarseNet: Googledrive || Dropbox
- FineNet: Googledrive || Dropbox
- ClassifyNet: Googledrive
- CoreNet: Googledrive
Class which provides all functionality for extraction of minutiae points
fingerflow.extractor.Extractor()
Arguments
coarse_net_path
- used for setting path to pretrained model of submodule CoarseNetfine_net_path
- used for setting path to pretrained model of submodule FineNetclassify_net_path
- used for setting path to pretrained model of submodule ClassifyNetcore_net_path
- used for setting path to pretrained model of submodule CoreNet
Methods
extract_minutiae(image_data)
- used for extracting minutiae points and detecting of fingerprint core from input image data. Method accepts input data in form of 3D matrix (e.g. output of OpenCV imread function). Method returns object with extracted and detected data in following shape:- minutiae - Pandas DataFrame of extracted and classified minutiae points in following form:
- x - x coordinate of minutiae point
- y - y coordinate of minutiae point
- angle - direction of minutiae point rotation
- score - minutiae point extraction confidence
- class - type of minutiae point. In FingerFlow 1.0.0 we support following minutiae classes:
- ending
- bifurcation
- fragment
- enclosure
- crossbar
- other
- core - Pandas DataFrame of deteted fingerprint cores in following form:
- x1 - left coordinate of bounding box
- y1 - top coordinate of bounding box
- x2 - right coordinate of bounding box
- y2 - bottom coordinate of bounding box
- score - core detection confidence
- w - width of bounding box
- h - height of bounding box
Usage
import cv2
import numpy as np
from fingerflow.extractor import Extractor
extractor = Extractor("coarse_net", "fine_net", "classify_net", "core_net")
image = cv2.imread("some_image")
extracted_minutiae = extractor.extract_minutiae(image)
Module responsible for matching extracted feature vectors. It is using custom Siamese neural network architecture.
Input size (number of minutiae in feature vector) for matching is not fixed and is determined by precision
constructor argument. Used weights need to be in the correct shape - network needs to be trained with the same precision as passed in the argument.
But in general, the more minutiae points the higher precision. Our custom model is trained on 10, 14, 20, 24, 30 minutie points per input.
Matcher contains 1 module:
- VerifyNet - module responsible for matching feature vectors. Custom Siamese neural network architecture is used.
- VerifyNet 10: Googledrive
- VerifyNet 14: Googledrive
- VerifyNet 20: Googledrive
- VerifyNet 24: Googledrive
- VerifyNet 30: Googledrive
Class which provides all functionality for matching feature vectors
fingerflow.matcher.Matcher()
Arguments
precision
- input size (number of minutiae in feature vector)verify_net_path
- used for setting path to pretrained model of submodule VerifyNet
Methods`
verify(anchor, sample)
- used for matching feature vectors. Method accepts input data in form of NumPy N-dimensional array, which should be in following shape: (confidence, columns). Its columns should contain the same data asExtractor minutiae output
with one additional column that represents minutia distance to fingerprint core. Method returns float matching confidence in range 0-1.verify_batch(pairs)
- performs pairwise verification in provided list of pairs. Returns list of float matching confidences.plot_model(file_path)
- plot model structure into image file.file_path
should represent path to desired file.
Usage
from fingerflow.matcher import Matcher
matcher = Matcher(30, "verify_net")
prediction = matcher.verify(anchor_feature_vector, sample_feature_vector)
Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.