r/OpenSourceAI • u/Haltaireproject • 16h ago
I built an offline on-device text classification pipeline for Android with in-app dataset labeling and TFLite inference
Enable HLS to view with audio, or disable this notification
Hi everyone,
I wanted to share an open-source project I've been working on: Halanoi AI.
Instead of sending screen text to a remote cloud API for content classification (which adds network latency and privacy issues), I wanted to see if I could build a fast, 100% on-device text moderation pipeline for Android.
Here is how the setup works:
- The Model (halanoi_transformer.tflite): A quantized 64MB TFLite model running locally on the phone. It classifies text strings into categories (distraction, entertainment, safe, productive) in under 15ms without any internet connection.
- In-App Evaluation & Ground Truth Lab: To make it easier to improve the model, the app logs inference outputs to a local SQLite database and includes a built-in UI where you can tag predictions as correct, false positive, or false negative. You can export these labeled samples to CSV or JSON with one tap.
- Training Pipeline: The companion repository contains the PyTorch / TensorFlow scripts, tokenizers, and quantization steps used to train and convert the model.
Both repositories are open source under GPL-3.0:
- Android App: https://github.com/kavinmaranravi/HalanoiApp
- Training Pipeline & Dataset: https://github.com/kavinmaranravi/Halanoi_AI
I'm looking for feedback on optimizing transformer models for mobile hardware, lowering memory usage, and improving tokenization on edge devices.
Let me know what you think!
1
Upvotes