Technology

Built to read the paper chart without overloading the phone.

NeoScan separates fast on-device document work from server-side computer vision, WHO analytics, secure records, and audit logging.

Architecture

From mobile capture to structured record.

Each layer has a focused job. The diagram presents the specified design, not a claim that production infrastructure is already deployed.

01 · Mobile

React Native + Expo

Profiles, camera flow, verification, trends, consent, and referral UI.

02 · On device

Google ML Kit

Document edges, auto-crop, perspective correction, and squared JPEG output.

03 · Processing

OpenCV

Orientation, contrast, shadow handling, and HSV pen-mark separation.

04 · Vision

YOLOv11

Chart axes, curves, plot points, and handwriting-noise detection.

05 · API

FastAPI

Authentication, inference orchestration, analytics, flags, and reports.

06 · Analytics

WHO LMS

Sex-specific, day-precise reference lookup and Z-score calculation.

07 · Data

PostgreSQL

WHO tables, patient records, scans, flags, referrals, and audit trails.

08 · Return

Digital growth view

Verified trends, review flags, offline sync state, and consented sharing.

Why this split

Fast document correction near the camera. Consistent inference in the cloud.

The SRS keeps Google ML Kit work on-device and moves YOLOv11 to FastAPI to reduce heat, memory pressure, and hardware-driven accuracy variation.

  1. Under 1.5 seconds

    Target for local edge detection and rectification after capture.

  2. Under 3 seconds

    Target for upload, inference, WHO calculation, flag evaluation, and response over standard 4G.

  3. Under 250 MB RAM

    Specified ceiling for normal mobile-client operation.

These are design targets from the June 2026 draft SRS, not measured results.

Technical stack

Chosen for the chart, the workflow, and the team.

MobileReact Native + Expo

One iOS and Android codebase, with Expo-managed integration and SVG chart rendering.

Document scanGoogle ML Kit

On-device corner detection, auto-crop, perspective correction, and document-squared image output.

Image processingOpenCV 4.x

Adaptive thresholding, orientation normalization, and HSV masks that separate pen marks from printed curves.

DetectionYOLOv11 / PyTorch

Custom model training for the Kenya MOH chart format and multi-class element detection.

BackendFastAPI + Uvicorn

Python API gateway, authentication, inference, WHO analytics, anomaly rules, logging, and report generation.

DataPostgreSQL 15+

Relational storage for reference tables, growth records, consent, referrals, immunization requirements, and immutable audit events.

Computer vision pipeline

Designed around the printed geometry of one chart family.

The model is constrained to the Kenya MOH Road-to-Health chart format. A different print layout requires coordinate recalibration and potentially new model training.

  1. Normalize

    Read EXIF and structural anchors, then rotate upright.

  2. Flatten

    Correct skew, crop the chart, and mitigate lighting artifacts.

  3. Separate

    Mask blue or black pen marks before object detection.

  4. Detect

    Find axes, percentile curves, plot points, and text noise.

  5. Map

    Translate local pixel positions into age and measurement values.

Model input · illustrative
age-axis · measurement-axis · curves · plot-points · text-noise
Tightly coupled: The SRS states that OpenCV color separation and YOLO detection must both run because the model cannot reliably distinguish handwriting from printed curves on its own.
Offline queue

Encrypted SQLite holds scans and metadata temporarily.

CaptureAES-256 local storeNetwork monitorFastAPI sync

Synchronization architecture

Chronology survives connectivity gaps.

When several scans are queued, the backend is specified to process them in time order and preserve the original capture time for flags and audit history.

Images are resized to a maximum width of 1920 pixels and targeted at 80–85% JPEG quality to protect grid-line detail on limited bandwidth.

Security architecture

Protection across device, network, API, and database.

Layered controls

The SRS defines these as architecture requirements under Kenya’s data protection framework.

Local storageAES-256 encrypted SQLite; Keychain or Keystore for tokens.
TransportHTTPS over TLS 1.3 on port 443.
API accessShort-lived JWTs with rotating refresh tokens.
DatabaseAES-256 at rest, RBAC boundaries, and immutable logs.

Evidence behind the architecture

See how the model and extraction targets are meant to be tested.

Research and validation