{"id":26160862,"url":"https://github.com/morellodev/image-signature-classifier","last_synced_at":"2026-04-18T23:05:10.356Z","repository":{"id":281001539,"uuid":"941922109","full_name":"morellodev/image-signature-classifier","owner":"morellodev","description":"A deep learning-based model that detects whether an image contains a valid handwritten signature or not. Built with MobileNetV2 + Transfer Learning.","archived":false,"fork":false,"pushed_at":"2025-03-03T09:27:28.000Z","size":5,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-03-06T13:28:30.430Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/morellodev.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2025-03-03T09:26:54.000Z","updated_at":"2025-03-03T09:27:31.000Z","dependencies_parsed_at":"2025-03-06T13:38:37.567Z","dependency_job_id":null,"html_url":"https://github.com/morellodev/image-signature-classifier","commit_stats":null,"previous_names":["morellodev/image-signature-classifier"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/morellodev%2Fimage-signature-classifier","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/morellodev%2Fimage-signature-classifier/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/morellodev%2Fimage-signature-classifier/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/morellodev%2Fimage-signature-classifier/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/morellodev","download_url":"https://codeload.github.com/morellodev/image-signature-classifier/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243031515,"owners_count":20224784,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2025-03-11T12:21:56.416Z","updated_at":"2025-12-24T23:03:45.027Z","avatar_url":"https://github.com/morellodev.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# ✍️ Signature Classification Model\n\n## 🚀 Overview\n\nThis project is a **signature classification model** that determines whether an image contains a **valid handwritten signature** or not. The model is based on **deep learning** and includes a **FastAPI server** for easy deployment and real-time classification.\n\n## 📌 Features\n\n- ✅ Detects whether an image contains a valid signature.\n- ✅ Uses **MobileNetV2 + Transfer Learning** for efficient classification.\n- ✅ Includes a **FastAPI server** for easy testing and deployment.\n- ✅ Supports **image uploads via API**.\n- ✅ Can be deployed locally or to **Docker, Render, or AWS**.\n\n---\n\n## 🛠 Installation\n\n### 1️⃣ **Clone the repository**\n\n```bash\ngit clone https://github.com/your-username/signature-classifier.git\ncd signature-classifier\n```\n\n### 2️⃣ Create a virtual environment (optional but recommended)\n\n```bash\npython -m venv venv-name\nsource venv-name/bin/activate  # On macOS/Linux\nvenv-name\\Scripts\\activate     # On Windows\n```\n\n### 3️⃣ Install dependencies\n\n```bash\npip install -r requirements.txt\n```\n\n### 4️⃣ Download the Dataset\n\nDownload the **signature dataset** from the [CEDAR Signature Dataset](https://paperswithcode.com/dataset/cedar-signature) page.\n\nExtract the dataset into the `dataset/` folder with the following structure:\n\n```raw\n📂 dataset/\n├── 📂 train/                # Training data (80% of the dataset)\n│   ├── 📂 valid_signature/  # Contains genuine signatures\n│   ├── 📂 invalid_signature/  # Contains forged or non-signature images\n│\n├── 📂 val/                  # Validation data (10% of the dataset)\n│   ├── 📂 valid_signature/\n│   ├── 📂 invalid_signature/\n│\n├── 📂 test/                 # Test data (10% of the dataset)\n│   ├── 📂 valid_signature/\n│   ├── 📂 invalid_signature/\n```\n\n## ▶️ Running the API Locally\n\nOnce dependencies are installed, you can **start the API** using FastAPI and Uvicorn.\n\n```bash\nuvicorn app:app --host 0.0.0.0 --port 8000 --reload\n```\n\nYour API will be accessible at [http://127.0.0.1:8000](http://127.0.0.1:8000).\n\n## 🔍 How to Use the API\n\n### 1️⃣ Upload an Image for Classification\n\nExample using **cURL**:\n\n```bash\ncurl -X 'POST' 'http://127.0.0.1:8000/predict/' \\\n  -H 'accept: application/json' \\\n  -H 'Content-Type: multipart/form-data' \\\n  -F 'file=@dataset/test/valid_signature/sample.png'\n```\n\n### 2️⃣ Expected API Response\n\n```json\n{\n  \"filename\": \"sample.png\",\n  \"prediction\": \"Valid Signature ✅\",\n  \"confidence\": \"98.32%\"\n}\n```\n\n## 🛠 Model Training\n\nThe model is trained using **MobileNetV2 + Transfer Learning**. The training script (`train.py`) does the following:\n\n1. **Loads the dataset** of valid and invalid signatures.\n2. **Uses MobileNetV2** as a feature extractor.\n3. **Trains with frozen layers**, then fine-tunes the last layers.\n4. **Saves the trained model** (`signature_classifier_finetuned.keras`).\n\nTo train the model, run:\n\n```bash\npython train.py\n```\n\n## 📄 Project Structure\n\n```raw\n📂 signature-classifier/\n├── 📂 dataset/          # Training data (valid \u0026 invalid signatures)\n├── 📜 app.py            # FastAPI server\n├── 📜 train.py          # Model training script\n├── 📜 classify.py       # Local testing script\n├── 📜 requirements.txt  # Dependencies\n├── 📜 README.md         # Project documentation\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmorellodev%2Fimage-signature-classifier","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmorellodev%2Fimage-signature-classifier","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmorellodev%2Fimage-signature-classifier/lists"}