Back to selected work
Project 01 / 04 · On-device ML

PayProtect

An Android scam-detection project connecting multilingual text classification, TensorFlow Lite inference, and warning overlays—all on the device.

My focusModel development, on-device inference & warning UI

  • Python
  • TensorFlow
  • Keras
  • TensorFlow Lite
  • Android
reported model size
4.8 MB
reported inference
<20 ms
reported accuracy
97.1%

Project-reported evaluation from my resume, not an independently reproduced benchmark. Device and test-split details are not documented here.

Overview

PayProtect explores a practical question: can multilingual scam detection run directly on a phone? The project combines a compact text classification model with TensorFlow Lite for local inference, keeping private message content on the device.

The problem

A useful SMS classifier needs to handle regional languages and mixed-language messages. On a phone, model size and inference time also matter. This project addresses those constraints with support for English, Hindi, Marathi, and Hinglish.

Approach

Trained on a 30,000-message multilingual SMS dataset. Parallel Conv1D branches with kernel sizes 3, 4, and 5 capture text patterns at different lengths before combining their outputs for classification.

System design

When Android screen content changes, ScamDetectorService uses Accessibility to extract the active window’s node hierarchy and text. TFLiteScamPredictor cleans and normalizes that text, tokenizes it with a JSON vocabulary up to a sequence length of 100, and runs TensorFlow Lite inference with XNNPACK acceleration. A scam confidence above 0.5 triggers PopupManager to display a warning overlay; otherwise, no warning is shown. This runtime flow is separate from the model’s parallel Conv1D training architecture.

On-device runtime flow

Android screen view

Screen content changes

ScamDetectorService

Android Accessibility service

Extracts the node hierarchy and text from active windows.

Extracted raw text

TFLiteScamPredictor

  1. Clean and normalize text.
  2. Tokenize using a JSON vocabulary, with a maximum sequence length of 100.
  3. Run TensorFlow Lite inference with XNNPACK acceleration.
Decision

Scam confidence > 0.5?

Yes · above 0.5

PopupManager

Triggers a top-window overlay and displays a warning alert.

No · 0.5 or below

No action

No warning overlay is triggered.

Text processing and classification run on the device. The sequence limit and decision threshold describe configuration, not measured accuracy.

Implementation

Built and trained the model using TensorFlow and Keras, then applied TensorFlow Lite quantization for mobile deployment. The optimized model occupies 4.8 MB, compared with approximately 20 MB before optimization. Designed an Android overlay interface to display warning alerts while message classification runs locally.

Engineering tradeoffs

The main engineering challenges were mixed scripts and code-switching, along with the tradeoff between model capacity and the memory and latency constraints of a mobile device.

Results & evaluation

Reported project results are a 4.8 MB model, inference below 20 ms, and 97.1% accuracy across a multilingual SMS classification task. Device specifications, evaluation split, and per-language metrics are not yet included here, so the figures describe the project's reported evaluation rather than performance on every device or dataset.

What I learned

This project developed my understanding of multilingual text classification, TensorFlow Lite deployment, and the tradeoffs between model size and inference speed. Accuracy, false-positive rates, and per-language evaluation are important additions to a complete performance assessment.