--- language: th tags: - yolov8 - object-detection - fintech - ocr-pre-processing - pytorch - banking license: mit --- # 💳 Th-Slip-OCR-K: Precision Financial Detection ![Static Badge](https://img.shields.io/badge/Architecture-YOLOv8_Nano-blue?style=flat-square) ![Static Badge](https://img.shields.io/badge/Classes-6_Zones-orange?style=flat-square) ![Static Badge](https://img.shields.io/badge/Precision-99.8%25-green?style=flat-square) ![Static Badge](https://img.shields.io/badge/Device-Apple_M4_Silicon-grey?style=flat-square) **A lightweight, high-velocity object detection model engineered to extract full telemetry from Kasikorn Bank (K-Bank) transaction slips.** --- ## ⚡ Overview **Th-Slip-OCR-K** is a specialized computer vision model designed as a pre-processing engine for OCR pipelines. It isolates specific regions of interest within financial documents, eliminating noise and enabling higher accuracy for text extraction systems. **🚀 V2 Update:** Enhanced detection capabilities to cover sender/receiver names and masked account numbers. * **Architecture:** Ultralytics YOLOv8 Nano (v8.3.0) * **Training Hardware:** Apple M4 Silicon (Metal Performance Shaders) * **Optimization:** Low-latency inference, suitable for edge devices and mobile deployment. ## 🎯 Detection Classes (Updated) The model is now trained to identify **6 critical zones** with high confidence: | Label | Description | Context | | :--- | :--- | :--- | | **`amount`** | Numeric transaction value | Net transfer amount (e.g., 100.00) | | **`accnum`** | Account Number | Supports masked formats (e.g., `xxx-2-x8574-x`) | | **`date`** | Timestamp | Date and Time of transaction | | **`pp1`** | Sender Name | Name of the person initiating the transfer | | **`pp2`** | Receiver Name | Name of the beneficiary | | **`transaction`** | Transaction Type | Operation status (e.g., Transfer Success) | ## 💻 Usage (Python) Seamlessly integrate into your workflow using the `ultralytics` library. ```python from ultralytics import YOLO # 1. Load the model directly from Hugging Face Hub model = YOLO("https://huggingface.co/Pondet/Th-Slip-OCR-K/resolve/main/best.pt") # 2. Run Inference results = model("path/to/your/slip.jpg") # 3. Display Results results[0].show() ``` ## 📊 Performance Metrics Evaluated on the latest K-Bank validation set (103 samples): * **mAP50:** 0.995 (99.5%) * **Precision:** 0.998 (High fidelity) * **Recall:** 1.0 (Zero miss rate) ## ⚠️ Scope & Limitations * **Domain Specific:** Optimized exclusively for Kasikorn Bank (Green Theme) slip layouts. * **Privacy Aware:** The model detects masked account numbers (x) accurately but cannot reveal hidden digits without external database verification. * **Educational Purpose:** Developed as a Proof-of-Concept for automated household accounting. --- Maintained by **Pondet**