Skip to main content
privacut-ai · architecture
PrivaCut AI: Privacy-Preserving On-Device Biometric Processing Engine — Architecture and Implementation Showcase

01 · Executive Overview

PrivaCut AI is a privacy-first mobile engineering solution built to process sensitive biometric identity photos entirely within client-side sandboxes. By shifting computer vision segmentation workloads from centralized GPU cloud clusters onto on-device WebGL and WebAssembly runtimes, the system eliminates recurring cloud compute costs while ensuring Typed request/response contracts data sovereignty for end-users.

02 · The Problem & Engineering Constraints

Conventional biometric photo utilities rely on server-side processing pipelines where raw portrait imagery is transmitted over REST endpoints to cloud GPU instances. This architecture introduces severe data privacy liabilities (GDPR and biometric regulation exposure), recurring infrastructure compute costs per transformation, and latency bottlenecks when users operate on bandwidth-constrained mobile networks.

03 · Measurable Engineering Impact

No server-side image processing

Server Compute Latency

Local On-Device Compute

Typed request/response contracts

Data Sovereignty

Biometric Data Stays On Device

Hardware-accelerated rendering

Viewfinder Frame Rate

Smooth Overlay on Mid-Tier Hardware

04 · Technical Solution & Strategy

Architected an offline-first computer vision pipeline using localized WebGL and WebAssembly segmentation models running within a Capacitor native bridge. Designed reactive Angular Signals state graphs that coordinate camera viewfinder streams, contour detection, automated aspect ratio calibration, and multi-country print formatting directly on the user mobile silicon.

Edge Computer Vision Pipeline

Local WebGL/WebAssembly segmentation network executing client-side contour extraction without server roundtrips.

Angular Signals State Flow

Fine-grained reactive state graph synchronizing real-time camera feedback loops with smooth UI performance.

Zero Cloud Compute Overhead

Shifting transformation logic to client silicon eliminates recurring server GPU operational costs entirely.

05 · Role & Core Contributions

Engineered the client-side architecture using Angular 19+ (Zoneless, Signals) and Ionic/Capacitor native runtime.

Implemented WebGL canvas compositing pipelines for real-time background subtraction and sub-pixel edge smoothing.

Built a lightweight PHP 8.4 REST service for dynamic specification schemas and regulatory dimension profile delivery.

Configured automated Android build pipelines and Google Play Console release workflows.

06 · System Architecture & Subsystems

The system is decoupled into an on-device edge processing client and a lightweight metadata microservice. The client executes WebAssembly/WebGL models in a sandboxed thread, streaming image transformations directly to the HTML5 Canvas context. Angular Signals manage viewfinder states and calibration masks with Angular Signals architecture.

Edge Inference & Compositing Engine

On-Device Computer Vision

Local WebGL/WebAssembly segmentation network executing client-side contour detection and alpha-matte composition without external network calls.

Hardware-accelerated on-device background subtraction
Automated head-to-chin biometric ratio validation
Multi-country passport & visa specification matrices
No cloud photo persistence or transmission
WebGL WebAssembly HTML5 Canvas Capacitor Bridge

Reactive Client Application

Mobile UI & Viewfinder Control

Zoneless Angular application running on Ionic and Capacitor providing a 60FPS viewfinder overlay and print grid generator.

Signals-driven state synchronization with non-blocking UI thread
Native hardware camera sensor integration
High-DPI printable sheet export (4x6", A4, Single Cut)
Complete offline functionality
Angular Signals Ionic Framework Capacitor Tailwind CSS

Regulatory Schema Microservice

Metadata & Specification Backend

Stateless PHP 8.4 REST API providing updated ICAO and ISO/IEC 19794-5 passport dimension metadata to client devices.

Dynamic country photo dimension profile updates
Stateless micro-payload JSON responses (< 5KB)
Edge-cached through Cloudflare CDN
PHP 8.4 REST API Nginx Linux VPS

07 · Key Technical Decisions & Tradeoffs

Client-Side WebGL Inference over Server-Side GPU Endpoints

Rationale

Eliminates recurring per-request cloud GPU infrastructure costs and provides complete biometric privacy compliance.

Tradeoff & Mitigation

Segmentation model payload size had to be aggressively quantized under 8MB to prevent mobile memory pressure.

Angular Signals State Graph over Monolithic Store Libraries

Rationale

Removes heavy store boilerplate and eliminates Zone.js change-detection overhead during 60FPS camera stream overlay updates.

Tradeoff & Mitigation

Required explicit computed signal composition for manual mask correction undo/redo state stacks.

Stateless Microservice for Dimension Specifications

Rationale

Decouples regulatory photo rule updates from binary app store releases, allowing remote compliance updates.

Tradeoff & Mitigation

Clients must cache dimension definitions locally to maintain full offline usability when network is absent.

08 · Deployment & Production Infrastructure

Client application compiled into optimized Android App Bundles (AAB) via Android SDK / Gradle and published to the Google Play Store. The specification metadata API is deployed on a Linux VPS behind Nginx with TLS 1.3 encryption and Cloudflare CDN caching.

09 · Comprehensive Stack Architecture

Client & Mobile UI

Ionic Framework Angular (Zoneless) Signals Tailwind CSS

Edge Vision & Runtime

Capacitor Native Bridge WebGL WebAssembly HTML5 Canvas 2D/3D

Backend & APIs

PHP 8.4 RESTful API JSON Schema Validation Nginx

DevOps & Distribution

Android SDK / Gradle Google Play Console Linux VPS Cloudflare
Direct Line: WhatsApp