Skip to content

Jarraya, I., Hamdani, T.M., Chabchoub, H. et al. TinySiamese network for biometric analysis. Int. J. Mach. Learn. & Cyber. 16, 7897–7911 (2025). https://doi.org/10.1007/s13042-025-02694-x

Notifications You must be signed in to change notification settings

Islem-Jarraya/TinySiamese-network

Repository files navigation

TinySiamese network

The TinySiamese neural network took on a new look and a new way of working which was different from the standard Siamese network. The difference first appeared in the input processing of the network. Instead of having images as input, the input was the output feature vector of a pre-trained CNN model. In other words, all input images would be transformed into feature vectors using a feature extractor (such as a pre-trained CNN model). Then, the Tiny-Siamese encoded the features in a small set of layers and finally calculated the distance between two encoded feature vectors and generated similarity score. Using this score, the model was trained from scratch with the Adam optimization algorithm and binary cross-entropy loss function.

Tiny-Siamese2

Figure 1: The TinySiamese Network [1].

Instalation

Requires python 3

Code structure

Step 1:

Run the "FeatureVectorsTrain.py" file to create the CSV files of features (csv_train.csv), labels (csv_trainLabels.csv), and paths (csv_trainPaths.csv).

Step 2:

Run the "FeatureVectorsTest.py" file to create the CSV files of features (csv_test.csv), labels (csv_testLabels.csv), and paths (csv_testPaths.csv). These two files use a pre-trained model (VGG16) on fingerprint classification for feature extraction. The pre-trained model should be saved in the "model" folder.

Step 3:

After completing Step 1 and Step 2, the CSV files will be created. We can then start the execution of the training code in the "TinySiameseTrain.py" file. Running this file will produce the trained TinySiamese model in the "model" folder.

Step 4:

The file "TinySiameseTest.py" contains the testing code for accuracy calculation.

Example - Fingerprint classification(FVC)

FVC2002[3] and FVC2004[2] datasets include noisy images acquired by different live scan devices. The fingerprints of each dataset were categorized into four types: arch, right loop, left loop and whorl. The four sets of FVC2004 were merged into a single set of four classes to form a multi-sensor fingerprint dataset. The same procedure was used for FVC2002 using only three sets (DB1, DB2 and DB4). This example does not include all the data but only some images.

References:

[1] Jarraya, I., Hamdani, T.M., Chabchoub, H. et al. TinySiamese network for biometric analysis. Int. J. Mach. Learn. & Cyber. 16, 7897–7911 (2025).

[2] MAIO, Dario, MALTONI, Davide, CAPPELLI, Raffaele, et al. FVC2004: Third fingerprint verification competition. In : International conference on biometric authentication. Berlin, Heidelberg : Springer Berlin Heidelberg, 2004. p. 1-7.

[3] MAIO, Dario, MALTONI, Davide, CAPPELLI, Raffaele, et al. FVC2000: Fingerprint verification competition. IEEE transactions on pattern analysis and machine intelligence, 2002, vol. 24, no 3, p. 402-412.

About

Jarraya, I., Hamdani, T.M., Chabchoub, H. et al. TinySiamese network for biometric analysis. Int. J. Mach. Learn. & Cyber. 16, 7897–7911 (2025). https://doi.org/10.1007/s13042-025-02694-x

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages