An Expert-in-the-Loop OCR and Annotation Platform for IVF Clinical Data Digitization
Developed in collaboration with Ashoka University and Kutum Labs
The IVF Clinical Document Digitization Platform is a comprehensive web-based solution designed to transform unstructured IVF (In Vitro Fertilization) medical records into structured, machine-readable datasets. This platform bridges the gap between traditional paper-based clinical documentation and modern AI-driven healthcare systems.
IVF clinics generate vast amounts of clinical data in PDF and image formats, including:
This data remains locked in unstructured formats, making it:
Our platform provides an expert-in-the-loop system that:
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ Frontend (React) โ
โ โโโโโโโโโโโโโโโโโโ โโโโโโโโโโโโโโโโ โโโโโโโโโโโโโโโโโโโ โ
โ โ File Upload โ โ PDF Viewer โ โ Annotation Panelโ โ
โ โโโโโโโโโโฌโโโโโโโโ โโโโโโโโฌโโโโโโโโ โโโโโโโโโโฌโโโโโโโโโ โ
โ โ โ โ โ
โ โโโโโโโโโโโโโโโโโโโโผโโโโโโโโโโโโโโโโโโโโโ โ
โ โ โ
โ โโโโโโโโโโโผโโโโโโโโโโโ โ
โ โ BoundingOverlay โ โ
โ โ Component โ โ
โ โโโโโโโโโโโโโโโโโโโโโโ โ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโฌโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ HTTP/JSON
โ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโผโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ Backend (Flask) โ
โ โโโโโโโโโโโโโโโโโโ โโโโโโโโโโโโโโโโ โโโโโโโโโโโโโโโโโโโ โ
โ โ OCR Inference โ โ Annotation โ โ Data Storage โ โ
โ โ (Tesseract) โ โ Endpoint โ โ (JSON/YAML) โ โ
โ โโโโโโโโโโโโโโโโโโ โโโโโโโโโโโโโโโโ โโโโโโโโโโโโโโโโโโโ โ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
App.jsx (Main Application)
โโโ Header.jsx (Banner with logos and title)
โโโ StatusBar.jsx (Status messages)
โโโ FileUploadButton (Custom file input)
โโโ Document Viewer
โ โโโ React-PDF (PDF rendering)
โ โโโ Image Preview (Image rendering)
โ โโโ BoundingOverlay.jsx (Interactive boxes)
โโโ OCR Text Panel
โ โโโ ClickableText.jsx (Selectable text)
โโโ Annotation Panel
โโโ Selected Text Display
โโโ Clinical Field Dropdown
โโโ Annotation List
โโโ Bounding Box Editor
| Technology | Version | Purpose |
|---|---|---|
| React | 18.x | Component-based UI framework |
| Vite | Latest | Fast build tool and dev server |
| react-pdf | Latest | PDF rendering and page management |
| pdfjs-dist | Latest | PDF.js worker for text extraction |
| Axios | Latest | HTTP client for API communication |
| CSS3 | - | Custom styling with gradients and animations |
| Technology | Version | Purpose |
|---|---|---|
| Flask | Latest | Lightweight Python web framework |
| Flask-CORS | Latest | Cross-Origin Resource Sharing support |
| Tesseract OCR | 4.x+ | Industry-standard OCR engine |
| pytesseract | Latest | Python wrapper for Tesseract |
| Pillow | Latest | Image processing library |
| pdf2image | Latest | PDF to image conversion |
| LinkML | Latest | Schema validation for annotations |
# System Requirements
- Node.js 16+ and npm
- Python 3.8+
- Tesseract OCR 4.0+
- Poppler (for PDF processing)
git clone https://github.com/anuragmoyde/AIIMS-IVF-Capstone.git
cd AIIMS-IVF-Capstone
macOS:
brew install tesseract
brew install poppler
Ubuntu/Debian:
sudo apt-get update
sudo apt-get install tesseract-ocr
sudo apt-get install poppler-utils
Windows:
cd app/backend
# Create virtual environment
python -m venv .venv
# Activate virtual environment
# macOS/Linux:
source .venv/bin/activate
# Windows:
.venv\Scripts\activate
# Install Python dependencies
pip install -r requirements.txt
cd app/frontend
# Install Node dependencies
npm install
Place logo files in app/frontend/src/assets/:
ashoka logo.jpg (Ashoka University logo)kutum-labs-logo.png (Kutum Labs logo)Terminal 1 - Backend Server:
cd app/backend
source .venv/bin/activate # Activate virtual environment
python main.py
# Server runs on http://localhost:5050
Terminal 2 - Frontend Development Server:
cd app/frontend
npm run dev
# Application opens at http://localhost:5173 (or specified port)
Key Functions:
handleFileChange(): Processes uploaded filesrunOCR(): Sends files to backend for OCR processinghandleUpdateBox(): Updates bounding box propertieshandleDeleteBox(): Removes bounding boxesaddAnnotationFromSelection(): Creates structured annotationssaveAnnotationsToBackend(): Exports data to Flask APIFeatures:
/inference): Processes uploaded files with Tesseract/save_annotation): Saves structured annotationsAPI Endpoints:
POST /inference
Request: multipart/form-data with "image" field
Response: {
"pages": [
{
"page": 1,
"text": "extracted text...",
"words": [
{
"text": "Patient",
"bbox_rel": {"x": 0.1, "y": 0.2, "w": 0.15, "h": 0.03},
"class": null,
"source": "ocr"
}
]
}
]
}
POST /save_annotation
Request: {
"file_id": "filename.pdf",
"annotations": [
{
"text": "John Doe",
"class": "Patient Name",
"page": 1,
"bbox_rel": {"x": 0.25, "y": 0.2, "w": 0.2, "h": 0.03},
"source": "pdf"
}
]
}
Response: {"status": "success"}
interface Annotation {
text: string; // Extracted or edited text
class: string | null; // IVF clinical field type
page: number; // Source page number
bbox_rel: BBox; // Relative bounding box coordinates
source: "ocr" | "pdf" | "human"; // Origin of annotation
}
interface BBox {
x: number; // Left position (0-1)
y: number; // Top position (0-1)
w: number; // Width (0-1)
h: number; // Height (0-1)
}
โ CRITICAL LIMITATION: The platform currently does not support handwritten clinical documents.
Technical Reason: Tesseract OCR, while excellent for printed text, has limited accuracy with handwritten content, especially:
Workaround: For handwritten documents, consider:
We welcome contributions from the community! Here's how you can help:
git checkout -b feature/AmazingFeature)git commit -m 'Add AmazingFeature')git push origin feature/AmazingFeature)This project is developed for research purposes in collaboration with:
Note: License details to be determined based on institutional requirements.
Please report bugs and feature requests via GitHub Issues.
For additional documentation, see the /docs folder (to be added).
Made with โค๏ธ for advancing IVF research and reproductive healthcare
An Expert-in-the-Loop OCR and Annotation Platform for IVF Clinical Data Digitization
Developed in collaboration with Ashoka University and Kutum Labs
The IVF Clinical Document Digitization Platform is a comprehensive web-based solution designed to transform unstructured IVF (In Vitro Fertilization) medical records into structured, machine-readable datasets. This platform bridges the gap between traditional paper-based clinical documentation and modern AI-driven healthcare systems.
IVF clinics generate vast amounts of clinical data in PDF and image formats, including:
This data remains locked in unstructured formats, making it:
Our platform provides an expert-in-the-loop system that:
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ Frontend (React) โ
โ โโโโโโโโโโโโโโโโโโ โโโโโโโโโโโโโโโโ โโโโโโโโโโโโโโโโโโโ โ
โ โ File Upload โ โ PDF Viewer โ โ Annotation Panelโ โ
โ โโโโโโโโโโฌโโโโโโโโ โโโโโโโโฌโโโโโโโโ โโโโโโโโโโฌโโโโโโโโโ โ
โ โ โ โ โ
โ โโโโโโโโโโโโโโโโโโโโผโโโโโโโโโโโโโโโโโโโโโ โ
โ โ โ
โ โโโโโโโโโโโผโโโโโโโโโโโ โ
โ โ BoundingOverlay โ โ
โ โ Component โ โ
โ โโโโโโโโโโโโโโโโโโโโโโ โ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโฌโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ HTTP/JSON
โ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโผโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ Backend (Flask) โ
โ โโโโโโโโโโโโโโโโโโ โโโโโโโโโโโโโโโโ โโโโโโโโโโโโโโโโโโโ โ
โ โ OCR Inference โ โ Annotation โ โ Data Storage โ โ
โ โ (Tesseract) โ โ Endpoint โ โ (JSON/YAML) โ โ
โ โโโโโโโโโโโโโโโโโโ โโโโโโโโโโโโโโโโ โโโโโโโโโโโโโโโโโโโ โ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
App.jsx (Main Application)
โโโ Header.jsx (Banner with logos and title)
โโโ StatusBar.jsx (Status messages)
โโโ FileUploadButton (Custom file input)
โโโ Document Viewer
โ โโโ React-PDF (PDF rendering)
โ โโโ Image Preview (Image rendering)
โ โโโ BoundingOverlay.jsx (Interactive boxes)
โโโ OCR Text Panel
โ โโโ ClickableText.jsx (Selectable text)
โโโ Annotation Panel
โโโ Selected Text Display
โโโ Clinical Field Dropdown
โโโ Annotation List
โโโ Bounding Box Editor
| Technology | Version | Purpose |
|---|---|---|
| React | 18.x | Component-based UI framework |
| Vite | Latest | Fast build tool and dev server |
| react-pdf | Latest | PDF rendering and page management |
| pdfjs-dist | Latest | PDF.js worker for text extraction |
| Axios | Latest | HTTP client for API communication |
| CSS3 | - | Custom styling with gradients and animations |
| Technology | Version | Purpose |
|---|---|---|
| Flask | Latest | Lightweight Python web framework |
| Flask-CORS | Latest | Cross-Origin Resource Sharing support |
| Tesseract OCR | 4.x+ | Industry-standard OCR engine |
| pytesseract | Latest | Python wrapper for Tesseract |
| Pillow | Latest | Image processing library |
| pdf2image | Latest | PDF to image conversion |
| LinkML | Latest | Schema validation for annotations |
# System Requirements
- Node.js 16+ and npm
- Python 3.8+
- Tesseract OCR 4.0+
- Poppler (for PDF processing)
git clone https://github.com/anuragmoyde/AIIMS-IVF-Capstone.git
cd AIIMS-IVF-Capstone
macOS:
brew install tesseract
brew install poppler
Ubuntu/Debian:
sudo apt-get update
sudo apt-get install tesseract-ocr
sudo apt-get install poppler-utils
Windows:
cd app/backend
# Create virtual environment
python -m venv .venv
# Activate virtual environment
# macOS/Linux:
source .venv/bin/activate
# Windows:
.venv\Scripts\activate
# Install Python dependencies
pip install -r requirements.txt
cd app/frontend
# Install Node dependencies
npm install
Place logo files in app/frontend/src/assets/:
ashoka logo.jpg (Ashoka University logo)kutum-labs-logo.png (Kutum Labs logo)Terminal 1 - Backend Server:
cd app/backend
source .venv/bin/activate # Activate virtual environment
python main.py
# Server runs on http://localhost:5050
Terminal 2 - Frontend Development Server:
cd app/frontend
npm run dev
# Application opens at http://localhost:5173 (or specified port)
Key Functions:
handleFileChange(): Processes uploaded filesrunOCR(): Sends files to backend for OCR processinghandleUpdateBox(): Updates bounding box propertieshandleDeleteBox(): Removes bounding boxesaddAnnotationFromSelection(): Creates structured annotationssaveAnnotationsToBackend(): Exports data to Flask APIFeatures:
/inference): Processes uploaded files with Tesseract/save_annotation): Saves structured annotationsAPI Endpoints:
POST /inference
Request: multipart/form-data with "image" field
Response: {
"pages": [
{
"page": 1,
"text": "extracted text...",
"words": [
{
"text": "Patient",
"bbox_rel": {"x": 0.1, "y": 0.2, "w": 0.15, "h": 0.03},
"class": null,
"source": "ocr"
}
]
}
]
}
POST /save_annotation
Request: {
"file_id": "filename.pdf",
"annotations": [
{
"text": "John Doe",
"class": "Patient Name",
"page": 1,
"bbox_rel": {"x": 0.25, "y": 0.2, "w": 0.2, "h": 0.03},
"source": "pdf"
}
]
}
Response: {"status": "success"}
interface Annotation {
text: string; // Extracted or edited text
class: string | null; // IVF clinical field type
page: number; // Source page number
bbox_rel: BBox; // Relative bounding box coordinates
source: "ocr" | "pdf" | "human"; // Origin of annotation
}
interface BBox {
x: number; // Left position (0-1)
y: number; // Top position (0-1)
w: number; // Width (0-1)
h: number; // Height (0-1)
}
โ CRITICAL LIMITATION: The platform currently does not support handwritten clinical documents.
Technical Reason: Tesseract OCR, while excellent for printed text, has limited accuracy with handwritten content, especially:
Workaround: For handwritten documents, consider:
We welcome contributions from the community! Here's how you can help:
git checkout -b feature/AmazingFeature)git commit -m 'Add AmazingFeature')git push origin feature/AmazingFeature)This project is developed for research purposes in collaboration with:
Note: License details to be determined based on institutional requirements.
Please report bugs and feature requests via GitHub Issues.
For additional documentation, see the /docs folder (to be added).
Made with โค๏ธ for advancing IVF research and reproductive healthcare