Metadata-Version: 2.4
Name: sigverse
Version: 0.1.0
Summary: A professional signature verification and embedding library using a Siamese EfficientNet-B0 model.
Author-email: Shyamal Parikh <parikhshyamal1993@gmail.com>
Project-URL: Homepage, https://github.com/parikhshyamal1993/SigVerse
Project-URL: Bug Tracker, https://github.com/parikhshyamal1993/SigVerse/issues
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.9
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: License :: OSI Approved :: MIT License
Classifier: Operating System :: OS Independent
Classifier: Topic :: Scientific/Engineering :: Image Recognition
Classifier: Topic :: Software Development :: Libraries :: Python Modules
Requires-Python: >=3.9
Description-Content-Type: text/markdown
Requires-Dist: numpy
Requires-Dist: opencv-python
Requires-Dist: onnxruntime

# 🖋️ SigVerse: Enterprise-Grade Signature Intelligence

**SigVerse** is a high-performance, developer-centric Python SDK for offline signature verification and forensic embedding generation. Built on modern deep learning architectures, it provides the "First Line of Defense" for document-heavy industries like FinTech, LegalTech, and Insurance.

SigVerse doesn't just "match" images; it understands the latent spatial features of a signature to distinguish between genuine handwriting and sophisticated forgeries.

---

## 🚀 Key Features

*   **Siamese Deep Learning Architecture**: Trained on the GPDS-150 and custom datasets to learn the underlying physics of handwriting.
*   **EfficientNet-B0 Backbone**: Optimized for the perfect balance between high-precision feature extraction and low-latency inference.
*   **Forensic Vector Embeddings**: Generate 256-dimensional "signature fingerprints" for storage, fast search, and clustering.
*   **Production-Ready with ONNX**: Decoupled from heavy deep learning frameworks; runs at blazing speeds on CPU or GPU via ONNXRuntime.
*   **Zero-Config Integration**: Pre-packaged model weights included. Install and verify in seconds.

---

## 🏗️ The Engineering Behind SigVerse

### Why EfficientNet-B0?
In a production KYC pipeline, latency is the ultimate bottleneck. We selected **EfficientNet-B0** because it utilizes **Compound Scaling**—balancing depth, width, and resolution. This allows SigVerse to capture fine-grained pen-stroke details without the computational overhead of heavy Vision Transformers (ViTs).

### The Siamese Advantage
Unlike standard classification models, SigVerse uses a **Siamese Network**. During training, the model learns to minimize the distance between genuine signature pairs (Anchors and Positives) while maximizing the distance from forgeries (Negatives) using **Triplet Margin Loss**.

**Result**: A model that understands *identity* rather than just *appearance*.

---

## 🛠️ Installation & Setup

SigVerse is designed to be a standard Python package.

### 1. Install via Pip
```bash
# From PyPI (Coming Soon)
pip install sigverse

# Or directly from the repository for development
pip install git+https://github.com/parikhshyamal1993/SigVerse.git
```

### 2. Standard Dependencies
*   Python 3.9+
*   OpenCV
*   NumPy
*   ONNXRuntime

---

## 💻 Quick Start

### Verification: Is it a Match?
Verify if two signatures belong to the same individual with a single call.

```python
from sigverse import SignatureVerifier

# Initialize verifier
verifier = SignatureVerifier()

# Verify two images (supports file paths or OpenCV arrays)
result = verifier.verify("anchor_genuine.png", "target_sample.jpg")

print(f"Matched: {result['matched']}")
print(f"Similarity Score: {result['match_percentage']}")
print(f"L2 Distance: {result['distance']}")
```

### Embeddings: Generate Signature Fingerprints
Convert signatures into numerical vectors for database storage or similarity search.

```python
from sigverse import SignatureEmbedder

embedder = SignatureEmbedder()
vector = embedder.embed("signature_sample.png")

# 'vector' is a 256-d normalized numpy array
print(vector.shape) # (256,)
```

---

## 📈 Performance & Calibration
Our latest test suite (running on 1487+ unique users) shows consistent accuracy across various handwriting styles.

| Scenario | Expected | Accuracy |
| :--- | :--- | :--- |
| Genuine vs. Genuine | Match | **~92%** |
| Genuine vs. Forged | No Match | **~88%** |
| Different User | No Match | **~99%** |

*Note: You can calibrate the `threshold` (default=1.0) in the `verify()` method to tune for False Acceptance Rate (FAR) vs False Rejection Rate (FRR) based on your use case.*

---

## 🔮 Future Roadmap (The KYC Hub)

SigVerse is Component #1 of the **KYC Intelligence Hub**. Upcoming enhancements include:
1.  **PAD (Presentation Attack Detection)**: Detecting screen spoofing (taking photos of signatures on a monitor).
2.  **Moiré Pattern Detection**: Identifying digital interference in fraudulent captures.
3.  **Signature Extraction**: Auto-detecting and cropping signatures from complex multi-page documents (ID cards, bank statements).

---

## 📄 License
This project is licensed under the MIT License.

---

**Built by [Shyamal Parikh](https://github.com/parikhshyamal1993)**
*Transforming Document AI for the Real World.*
