This project implements a signature forgery detection system using Convolutional Neural Networks (CNNs) and Support Vector Machines (SVMs). The pipeline involves:
- Loading genuine and forged signature images
- Applying Neural Style Transfer (NST) to generate synthetic forgeries
- Extracting features using MobileNetV2 (a pre-trained CNN model)
- Training an SVM classifier on the extracted features
- Evaluating the model for accuracy and performance
- Python
- TensorFlow/Keras (for MobileNetV2 and Neural Style Transfer)
- OpenCV (for image processing)
- Scikit-learn (for SVM training & evaluation)
- NumPy (for numerical operations)
- Genuine Signatures: Located in
dataset/signatures/full_org - Forged Signatures: Located in
dataset/signatures/full_forg - Style Images for NST: Located in
dataset/archive (1)/artbench-10-python
The script loads genuine and forged signatures from the specified dataset directories using OpenCV.
load_images(folder, label)NST is applied to genuine signatures using style images to generate synthetic forgeries.
apply_nst(content_img, style_img)The MobileNetV2 model extracts deep features from the signature images.
base_model = MobileNetV2(weights='imagenet', include_top=False, input_shape=(128, 128, 3))
feature_extractor = Model(inputs=base_model.input, outputs=base_model.output)An SVM classifier is trained on the extracted features.
clf = SVC(kernel='linear')
clf.fit(X_train, y_train)The trained model is evaluated using accuracy score and a classification report.
accuracy_score(y_test, y_pred)- Achieved Accuracy: ✅
{accuracy:.4f}(as printed in the output) - Classification Report: Printed in the console
- Clone the repository:
git clone https://github.com/ryanfer123/signature-forgery-detection.git cd signature-forgery-detection - Install dependencies:
pip install tensorflow opencv-python numpy scikit-learn
- Run the script:
python signature_detection.py
- Modify dataset paths in the script if needed.
- NST (Bonus Task) is still under development.
🔗 GitHub Repository: ryanfer123/CSI-ML