AI-Powered Gesture Recognition for Frictionless Handwritten Note-Taking
OnePen is the first handwriting note-taking app that lets users format and edit notes without ever lifting their hand or touching a toolbar.
By recognizing handwritten gestures in real time, it reduces hand movement and context switchingβhelping users write up to 30% faster and stay in flow.
I designed and deployed a fully in-browser ML system that recognizes gestures like underline, box, delete, and brackets using a hybrid vision + geometry model, achieving 99.89% accuracy with ~20 ms latency on-device.
π NOT A DEMO Β· NOT A PROTOTYPE
β OnePen is a published app, used by real users, that measurably improves how people write.
π Winner β βMost Novel Use of AIβ, HackUMASS XII
TensorFlow / Keras Β· TensorFlow.js Β· Python Β· MLflow Β· Canvas API Β· PWA
Handwritten note-taking is full of interruptions.
Changing colors, highlighting, erasing, or switching pens forces you to lift your hand, reach for a toolbar, then return to the page.
These tiny actions add upβquietly breaking your flow and focus.
OnePen removes that friction.
Itβs a handwriting-first note-taking web app powered by AI gesture recognition, allowing you to write, format, and organize naturallyβwithout ever touching a toolbar.
One pen. Zero interruptions.
π₯ Watch Demo β
Quick Draw β Instantly styles strokes (fully customizable):
| Gesture | Action |
|---|---|
| Box | Groups and styles enclosed content |
| Wavy box | Groups content with alternative styling |
| Strike-through | Deletes crossed strokes |
| Box / Curly / Circle brackets | Styles child content within bracket height |
Draw + Hold β Opens a radial tool dial
6 gestures Γ 8 tools = 48 quick-access tools
Draw any gesture (except delete), hold briefly, and select a toolβwithout lifting your pen.

OnePen uses a hybrid dual-input model that fuses visual and geometric stroke features:
βββββββββββββββββββ βββββββββββββββββββ
β 96Γ96 Image β β 12D Geometric β
β (stroke) β β Features β
ββββββββββ¬βββββββββ ββββββββββ¬βββββββββ
β β
βΌ βΌ
βββββββββββββββββββ βββββββββββββββββββ
β MobileNetV3 β β Dense 128β64 β
β + SE Attention β β + LayerNorm β
ββββββββββ¬βββββββββ ββββββββββ¬βββββββββ
β β
ββββββββββββ¬βββββββββββββ
βΌ
βββββββββββββββββ
β Concat β
β 384 β 192 β
β + Dropout β
βββββββββ¬ββββββββ
βΌ
βββββββββββββββββ
β 8 Classes β
β (softmax) β
βββββββββββββββββ
Why hybrid?
Image-only models struggled with visually similar gestures (box vs bracket, underline vs delete).
Adding geometric features improved accuracy by ~5β8%.
| # | Feature | Why It Helps |
|---|---|---|
| 1 | Closure ratio | Boxes form closed loops |
| 2 | Compactness | Underlines are elongated |
| 3 | Spread ratio | Underlines have low spread |
| 4 | Aspect ratio | Distinguishes wide vs tall |
| 5 | Edge fraction | Boxes cluster on edges |
| 6 | Point count | Deletes use more points |
| 7 | Height diff | Underlines stay below threshold |
| 8 | Horizontal variance | Underlines vary in X |
| 9 | Total path length | Wavy strokes are longer |
| 10 | Perimeter ratio | Size-invariant metric |
| 11 | Spine verticality | Deletes are diagonal |
| 12 | Vertical variance | Underlines have low Y variance |
| Model | Accuracy | Size | Inference |
|---|---|---|---|
| MobileNetV3-Large | 99.88% | 5 MB | 30 ms |
| MobileNetV3-Small (Chosen) | 99.89% | 2.5 MB | 20 ms |
| EfficientNetV2-B0 | β | 7 MB | 60 ms |
Chosen for near-perfect accuracy with ultra-fast browser inference.

Runs entirely in-browser. Optional Flask backend for math solving.
git clone https://github.com/yourusername/OnePen.git
cd OnePen
python -m venv .venv
source .venv/bin/activate # Windows: .venv\Scripts\activate
pip install -r requirements.txt
cd app
python -m http.server 8000
### Train Your Own Model
```bash
make dataset # Preprocess collected data
make train # Train hybrid CNN (~200 epochs)
make export # Export to TensorFlow.js
OnePen/
βββ app/ # Progressive Web App
β βββ index.html # Main interface
β βββ draw.js # Canvas engine (zoom, pan, stylus)
β βββ predict.js # TensorFlow.js inference
β βββ sw.js # Service worker (offline)
β βββ manifest.json # PWA manifest
β
βββ src/modifiers/ # ML Library
β βββ models/
β β βββ architecture.py # Hybrid CNN definition
β βββ features/
β β βββ geometric.py # 12D feature extraction
β βββ data/
β βββ loader.py # Dataset loading
β βββ augmenter.py # Data augmentation
β
βββ scripts/ # CLI Tools
β βββ train.py # Training script
β βββ export.py # TF.js export
β
βββ config/config.yaml # Hyperparameters
βββ mlruns/ # MLflow experiments
| Layer | Technologies |
|---|---|
| Frontend | Canvas API, TensorFlow.js, IndexedDB, Service Workers |
| ML | TensorFlow/Keras, MobileNetV3, Squeeze-and-Excitation |
| Backend | Flask, Pix2Text (math), Google Drive API |
| DevOps | MLflow, pytest, ruff, mypy |
MIT
Andy Huynh β GitHub