This project is a deep learning application that predicts gender from fingerprint images.
It uses a Convolutional Neural Network (CNN) trained on the SOCOFing dataset and provides a Streamlit web interface for uploading and classifying fingerprints in real time.
- Introduction
- Dataset
- Installation
- Usage
- Features
- Project Structure
- Dependencies
- Configuration
- Examples
- Troubleshooting
- Contributors
- License
This project uses the SOCOFing dataset, which contains 6,000 fingerprint images (real and synthetically altered).
-
Download the dataset from Kaggle:
👉 SOCOFing Dataset on Kaggle -
Extract the dataset into your project folder so the structure looks like this:
SOCOFing/ ├── Real/ └── Altered/ ├── Altered-Easy/ ├── Altered-Medium/ └── Altered-Hard/
-
Install the Kaggle API:
pip install kaggle
-
Create a Kaggle API token:
- Go to your Kaggle Account Settings
- Click Create New API Token
- This downloads a file named
kaggle.json
-
Place
kaggle.jsonin:- Linux/Mac:
~/.kaggle/kaggle.json - Windows:
C:\Users\<YourUsername>\.kaggle\kaggle.json
- Linux/Mac:
-
Download and unzip the dataset automatically:
kaggle datasets download -d ruizgara/socofing unzip socofing.zip -d .
Now your dataset is ready in the SOCOFing/ folder.
-
Clone this repository:
git clone https://github.com/AryanGupta5084/DL.git cd DL -
Install dependencies:
pip install -r requirements.txt
-
Ensure you have the SOCOFing dataset placed in the correct folder structure (see above).
Run the training script to build and save the CNN model (trained_model.h5):
python train.pyOnce the model is trained, launch the Streamlit app:
streamlit run app.py- Upload a fingerprint image (
.jpg,.jpeg,.png) - The app will classify it as Male or Female
- CNN-based gender classification from fingerprints
- Training on multiple difficulty levels of the SOCOFing dataset
- Real-time predictions via a Streamlit web interface
- Automatic preprocessing (grayscale conversion, resizing, normalization)
- Model saved in
trained_model.h5for reuse
DL/
├── app.py # Streamlit web app for predictions
├── train.py # CNN training script
├── requirements.txt # Dependencies
├── trained_model.h5 # Saved model (created after training)
└── SOCOFing/ # Dataset (not included in repo)
Main dependencies (from requirements.txt):
- numpy
- pandas
- matplotlib, seaborn
- scikit-learn
- tensorflow, keras
- opencv-python
- streamlit
- Pillow
Install all with:
pip install -r requirements.txt- Image size: 96×96 pixels
- Batch size: 128
- Epochs: 30 (with early stopping)
- Optimizer: Adam (learning rate = 0.001)
- Loss function: Categorical Crossentropy
- Error: trained_model.h5 not found → Run
python train.pybefore launching the app. - Dataset missing → Ensure the SOCOFing dataset is properly downloaded and structured.
- OpenCV errors → Check that fingerprint images are valid grayscale images.
- Aryan Gupta — Developer & Maintainer
