Automated extraction of structured information from semi-structured documents using OCR, layout detection, and rule-based post-processing.
This project converts scanned documents into machine-readable structured data, enabling automation of document processing workflows.
Many business processes rely on documents such as:
- vehicle registration documents
- invoices
- insurance forms
- certificates
- identification records
These documents contain valuable information but exist only as images or PDFs.
This project builds a Document AI pipeline that extracts key fields from such documents and converts them into structured output.
Example extracted fields include:
- License plate number
- Owner name
- Address
- Vehicle type
- Vehicle model
- VIN number
- Birth date
- Insurance company
- Color
- Registration number
Below is an example of the system extracting structured fields from a vehicle registration document.
The pipeline identifies relevant regions, extracts text, and maps the information into structured fields.
The system follows a multi-stage document intelligence workflow:
1️⃣ Input Document
- Scanned document or image
2️⃣ Preprocessing
- Image cleanup
- Noise reduction
- resizing / normalization
- preparing document for OCR
3️⃣ OCR Extraction
- text detection
- text recognition
4️⃣ Field Detection
- identifying key-value regions
- mapping extracted text to structured fields
5️⃣ Post Processing
- text normalization
- rule-based validation
- formatting corrections
6️⃣ Structured Output
Example output:
{
"license_plate": "XX 000 000",
"owner_name": "Max Mustermann",
"address": "Musterstrasse 123, 9999 Beispielstadt",
"vehicle_type": "Musterfahrzeug",
"vehicle_model": "Sample Car 1.0",
"vin": "VIN-DEMO-PLACEHOLDER",
"birth_date": "1990-01-01",
"insurance": "Demo Versicherung Muster AG",
"vehicle_color": "Musterblau"
}Python OpenCV – image preprocessing OCR – text recognition (Tesseract / EasyOCR / PaddleOCR) NumPy / Pandas – data processing Custom extraction logic – field detection & validation
document-ai-extraction/
│
├── data/
│ ├── sample_documents
│
├── notebooks/
│ └── docAI.ipynb
│
├── src/
│ ├── preprocessing.py
│ ├── ocr_pipeline.py
│ ├── extraction_logic.py
│
├── assets/
│ └── doc_ai_example.png
│
├── requirements.txt
└── README.md
Clone repository
git clone https://github.com/MuntahaShams/document-ai-extraction.git
cd document-ai-extractionInstall dependencies
pip install -r requirements.txtRun the notebook:
docAI.ipynb
Or run extraction on a document:
python extract.py --input sample_document.pngSome challenges addressed in this project:
- noisy scans
- inconsistent document layouts
- OCR recognition errors
- multilingual fields
- varying formats across documents
Future enhancements include:
- layout-aware models (LayoutLM / Donut)
- key-value detection models
- table extraction
- confidence scoring
- human-in-the-loop validation UI
- API deployment
Muntaha Shams AI Engineer – LLMs | NLP | Computer Vision | Document AI
GitHub https://github.com/MuntahaShams
Portfolio https://muntahashams.github.io/portfolio/projects
