{"id":38494988,"url":"https://github.com/jjshay/handwriting-analysis","last_synced_at":"2026-01-17T05:49:51.885Z","repository":{"id":332013161,"uuid":"1130646912","full_name":"jjshay/handwriting-analysis","owner":"jjshay","description":"Forensic signature and handwriting analysis with statistical comparison","archived":false,"fork":false,"pushed_at":"2026-01-12T05:25:41.000Z","size":111,"stargazers_count":0,"open_issues_count":4,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2026-01-12T06:00:00.281Z","etag":null,"topics":["ai","analysis","authentication","computer-vision","forensics","handwriting","machine-learning","opencv","python","signature-verification","statistics"],"latest_commit_sha":null,"homepage":null,"language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/jjshay.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":"SECURITY.md","support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2026-01-08T20:01:14.000Z","updated_at":"2026-01-12T05:50:38.000Z","dependencies_parsed_at":null,"dependency_job_id":"8f19f368-81a3-4efc-8efe-4d0453158588","html_url":"https://github.com/jjshay/handwriting-analysis","commit_stats":null,"previous_names":["jjshay/handwriting-analysis"],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/jjshay/handwriting-analysis","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jjshay%2Fhandwriting-analysis","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jjshay%2Fhandwriting-analysis/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jjshay%2Fhandwriting-analysis/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jjshay%2Fhandwriting-analysis/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/jjshay","download_url":"https://codeload.github.com/jjshay/handwriting-analysis/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jjshay%2Fhandwriting-analysis/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28501328,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-17T04:31:57.058Z","status":"ssl_error","status_checked_at":"2026-01-17T04:31:45.816Z","response_time":85,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"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":["ai","analysis","authentication","computer-vision","forensics","handwriting","machine-learning","opencv","python","signature-verification","statistics"],"created_at":"2026-01-17T05:49:51.818Z","updated_at":"2026-01-17T05:49:51.875Z","avatar_url":"https://github.com/jjshay.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Handwriting Analysis System\n\n![CI](https://github.com/jjshay/handwriting-analysis/workflows/CI/badge.svg)\n![CodeQL](https://github.com/jjshay/handwriting-analysis/workflows/CodeQL/badge.svg)\n[![codecov](https://codecov.io/gh/jjshay/handwriting-analysis/branch/main/graph/badge.svg)](https://codecov.io/gh/jjshay/handwriting-analysis)\n![Release](https://img.shields.io/github/v/release/jjshay/handwriting-analysis)\n![Python](https://img.shields.io/badge/python-3.9+-blue.svg)\n![License](https://img.shields.io/badge/license-MIT-green.svg)\n![OpenCV](https://img.shields.io/badge/OpenCV-enabled-brightgreen.svg)\n![AI Optional](https://img.shields.io/badge/AI-optional-lightgrey.svg)\n\n**Forensic-grade signature and handwriting analysis - statistical comparison for authentication.**\n\n[![Demo](https://asciinema.org/a/bWZcm0S3ayeCsVy4.svg)](https://asciinema.org/a/bWZcm0S3ayeCsVy4)\n\n[![Watch Demo](https://img.shields.io/badge/▶%20Watch%20Demo-Click%20to%20Play-red?style=for-the-badge\u0026logo=asciinema)](https://asciinema.org/a/bWZcm0S3ayeCsVy4)\n\n---\n\n## What Does This Do?\n\nAnalyze signatures and handwriting for authenticity:\n\n1. **Extract features** from signature images (slant, pressure, proportions)\n2. **Build baseline** from known authentic samples\n3. **Compare questioned documents** against the baseline\n4. **Generate reports** with statistical confidence scores\n\n**Use cases:**\n- Art authentication (artist signatures)\n- Document verification\n- Forensic analysis\n- Research and education\n\n---\n\n## Quick Start\n\n```bash\n# Clone the repo\ngit clone https://github.com/jjshay/handwriting-analysis.git\ncd handwriting-analysis\n\n# Install dependencies\npip install -r requirements.txt\n\n# Run the interactive demo\npython demo.py\n\n# Or run the visual showcase\npython showcase.py\n\n# Analyze with sample signatures\npython forensic_handwriting_analyzer.py \\\n  --baseline examples/sample_baseline_data.json \\\n  --questioned examples/signature_questioned.png\n```\n\n### Sample Files\n- `examples/signature_authentic_01.png` - Sample authentic signatures\n- `examples/signature_questioned.png` - Questioned signature to analyze\n- `examples/sample_baseline_data.json` - Pre-computed baseline stats\n- `sample_output/forensic_report.txt` - Example analysis report\n\n---\n\n## Architecture\n\n```mermaid\nflowchart TB\n    subgraph Baseline[\"Baseline Creation\"]\n        A[Authentic Samples] --\u003e B[Image Preprocessing]\n        B --\u003e C[Feature Extractor]\n        C --\u003e D[Statistical Analyzer]\n        D --\u003e E[Baseline Model]\n    end\n\n    subgraph Analysis[\"Document Analysis\"]\n        F[Questioned Document] --\u003e G[Image Preprocessing]\n        G --\u003e H[Feature Extractor]\n    end\n\n    subgraph Comparison[\"Statistical Comparison\"]\n        E --\u003e I[Feature Comparison]\n        H --\u003e I\n        I --\u003e J[Z-Score Calculator]\n        J --\u003e K[Mahalanobis Distance]\n        K --\u003e L[Probability Engine]\n    end\n\n    subgraph Optional[\"Optional: AI Review\"]\n        H --\u003e M1[Claude]\n        H --\u003e M2[GPT-4]\n        H --\u003e M3[Gemini]\n        H --\u003e M4[Grok]\n        M1 \u0026 M2 \u0026 M3 \u0026 M4 --\u003e N[AI Consensus]\n    end\n\n    subgraph Output\n        L --\u003e O[Confidence Score]\n        N --\u003e O\n        O --\u003e P[Forensic Report]\n    end\n\n    style A fill:#e1f5fe\n    style F fill:#fff9c4\n    style P fill:#c8e6c9\n```\n\n## How It Works\n\n```\nKnown Authentic Samples (70+)\n            │\n            ▼\n┌─────────────────────────────────────────┐\n│       FEATURE EXTRACTION                 │\n│  - Slant angle (60-90°)                  │\n│  - Height ratios                         │\n│  - Stroke characteristics                │\n│  - Pressure patterns                     │\n│  - Connected vs lifted strokes           │\n└─────────────────────────────────────────┘\n            │\n            ▼\n┌─────────────────────────────────────────┐\n│       STATISTICAL BASELINE              │\n│  Mean ± Standard Deviation for each     │\n│  feature across all authentic samples   │\n└─────────────────────────────────────────┘\n            │\n            ▼\n  Questioned Document\n            │\n            ▼\n┌─────────────────────────────────────────┐\n│       STATISTICAL COMPARISON            │\n│  - Z-scores for each feature            │\n│  - Mahalanobis distance                 │\n│  - Probability calculations             │\n└─────────────────────────────────────────┘\n            │\n            ▼\n  Authentication Report\n  (Confidence: 94.7%)\n```\n\n---\n\n## Features Extracted\n\n| Feature | Description | Typical Range |\n|---------|-------------|---------------|\n| Slant Angle | Degrees from horizontal | 60-90° |\n| Height Ratio | Full height / x-height | 2.0-3.5 |\n| Aspect Ratio | Width / Height of bounding box | 1.5-4.0 |\n| Stroke Width | Average pen stroke thickness | 2-8 px |\n| Pressure Variance | Variation in stroke darkness | 0.1-0.4 |\n| Connectedness | % of connected strokes | 40-80% |\n| Loop Ratio | Loops per letter | 0.2-0.6 |\n\n---\n\n## Output Report\n\n```\nFORENSIC HANDWRITING ANALYSIS REPORT\n=====================================\nDocument ID: QD-2024-001\nAnalysis Date: January 8, 2024\n\nFEATURE COMPARISON:\n  Slant Angle:      73.2° (Baseline: 71.5° ± 4.2°)  → WITHIN RANGE\n  Height Ratio:     2.8   (Baseline: 2.6 ± 0.3)    → WITHIN RANGE\n  Stroke Width:     4.1px (Baseline: 3.8 ± 0.8)    → WITHIN RANGE\n  Pressure Var:     0.28  (Baseline: 0.25 ± 0.08)  → WITHIN RANGE\n\nSTATISTICAL ANALYSIS:\n  Combined Z-Score: 0.82\n  Mahalanobis Distance: 1.24\n\nCONCLUSION:\n  Confidence: 94.7%\n  Opinion: The questioned signature is CONSISTENT with\n           the known authentic baseline samples.\n```\n\n---\n\n## Multi-AI Review (Optional)\n\nFor additional verification, the system can use multiple AI models:\n\n| AI Model | Role |\n|----------|------|\n| Claude | Detailed stroke analysis |\n| GPT-4 | Pattern recognition |\n| Gemini | Visual comparison |\n| Grok | Anomaly detection |\n\nEach AI provides independent analysis, then results are combined for consensus.\n\n---\n\n## Setup\n\n### Basic (Statistical Only)\n```bash\npip install -r requirements.txt\npython demo.py\n```\n\n### Full AI Mode\n```bash\ncp .env.example .env\nnano .env\n# Add API keys\npython llm_handwriting_reviewer.py\n```\n\n---\n\n## Files\n\n| File | Purpose |\n|------|---------|\n| `forensic_handwriting_analyzer.py` | Main statistical analyzer |\n| `signature_analyzer.py` | Signature-specific analysis |\n| `statistical_signature_generator.py` | Generate test signatures |\n| `llm_handwriting_reviewer.py` | Multi-AI review system |\n| `demo.py` | Demo without dependencies |\n\n---\n\n## Important Notes\n\n- This is a research/educational tool\n- Not a replacement for professional forensic examination\n- Statistical analysis provides probability, not certainty\n- Always consult qualified experts for legal matters\n\n---\n\n## License\n\nMIT - For research and educational use\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjjshay%2Fhandwriting-analysis","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjjshay%2Fhandwriting-analysis","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjjshay%2Fhandwriting-analysis/lists"}