DataDroid is a cross-platform, on-device image dataset studio built with Kotlin Multiplatform and Compose Multiplatform. Create image classification datasets on Android and iOS, capture or import images per class, check class balance, and export a ready-to-train zip.
Everything runs on the device, including the auto-sort model, so no image ever leaves the phone.
Platforms: Android (phone and tablet, Android 7.0+) and iOS (iPhone and iPad, iOS 18.2+).
- Features
- Requirements
- Run on Android
- Run on iOS
- Try the key features
- Architecture
- Tests
- License and attribution
-
Datasets: create, rename, delete; each starts with one class.
-
Classes: add, rename inline, clear, delete. Class names are unique per dataset.
-
Capture: one full-screen camera for the whole dataset. Chips under the square viewfinder choose where images go: Auto, or one class. Tap the shutter for one image, hold it to record (~5 frames/s, 640×640 square, what the viewfinder shows). Photos from the library go the same way. Images can also be added from a folder per class, or imported as a folder or zip of class folders (merged by class name). Originals are kept unchanged; files that aren't decodable images are skipped.
-
Auto-sort: capture without choosing a class. An on-device model (MobileNetV3-Small by default, or MobileNetV3-Large or DINOv2 ViT-S/14, chosen in Settings) embeds each image and saves it to the class whose images it's most like, with a live label over the viewfinder. Images unlike every class wait under Unknown (kept on disk, so closing the camera or the app loses none), where they can start a new class, join an existing one, or be discarded. "Unknown detection" sets how alike an image must be to a class (0 turns it off). Embeddings are cached per dataset and model (
embeddings.binfor Small), so each image is only analysed once per model. -
Review: per class, a progress bar towards 20 images and the newest thumbnails; a gallery with multi-select to move or delete; and a full-screen viewer to swipe through images, zoom, move or delete. Deletes can be undone for a few seconds.
-
Class balance: how many classes are ready, image counts, per-class bars, and warnings for empty, small (<20 images) or imbalanced (largest ≥ 1.5× smallest) classes.
-
Image settings: store images as captured, or resize (fit or square) and convert to JPEG, PNG or WebP, as an app default or per dataset.
-
Export: a zip of the dataset folder, shared through the system share sheet:
Animal_Dataset/ ├── metadata.json {"name": "Animal Dataset", "classes": ["cat", "dog", "bird"], "imageCount": 2438} ├── cat/cat_0001.jpg ├── dog/dog_0001.png └── bird/bird_0001.jpg unknown/unknown_0001.jpgEmpty classes are left out. Unknown images, if any, go in an
unknownfolder beside the dataset folder, not inside it, so a training tool pointed atAnimal_Dataset/doesn't take them for a class;metadata.jsonnames the folder ("unknownFolder": "unknown"). The same zips (or any zip of class folders) can be imported as a new dataset, and their unknown images go back under Unknown.
| Tool | Version | Needed for |
|---|---|---|
| JDK | 17 or newer to start Gradle. Gradle downloads the JDK 21 it runs on (see gradle/gradle-daemon-jvm.properties). |
Both |
| Android Studio | A recent stable release that supports Android Gradle Plugin 9.4, with Android SDK 37 | Android |
| Android device or emulator | Android 7.0 (API 24) or newer. A camera is optional. | Android |
| macOS with Xcode | Xcode 26 (the version the project is developed with), with an iOS 18.2+ simulator or device | iOS |
| Internet access | On the first build, to download Gradle dependencies and the TensorFlow Lite C framework | Both |
Clone the repository first:
git clone https://github.com/tawhidmonowar/DataDroid.git
cd DataDroidFrom Android Studio
- Open the
DataDroidfolder in Android Studio and wait for the Gradle sync to finish. - Pick the
androidApprun configuration and an emulator or a connected device. - Press Run.
From the command line
-
Connect a device with USB debugging on, or start an emulator.
-
Build and install the debug app:
./gradlew :androidApp:installDebug
-
Open DataDroid from the launcher.
To build an APK without installing it, run ./gradlew :androidApp:assembleDebug. The APK is written to
androidApp/build/outputs/apk/debug/.
The emulator camera works with its virtual scene or a webcam. On a real device, allow camera access when the app asks.
- Open
iosApp/iosApp.xcodeprojin Xcode. - Choose the
iosAppscheme and an iPhone or iPad simulator. - Press Run.
The first build takes several minutes. Xcode's build phase calls Gradle
(:shared:embedAndSignAppleFrameworkForXcode), which compiles the shared Kotlin code and downloads the
TensorFlow Lite C framework (:shared:downloadTfliteC) into third_party/. Later builds are
incremental.
On a physical iPhone or iPad (needed for the camera, since the simulator has none):
- Open
iosApp/Configuration/Config.xcconfigand setTEAM_IDto your Apple Developer team ID. A free personal team works. The bundle ID becomesorg.onedroid.dataset.DataDroid<TEAM_ID>, so it is unique to you. - Select your device in Xcode and press Run.
- If iOS blocks the app, trust your developer certificate in Settings › General › VPN & Device Management.
On the simulator, use the photo library, Import class folders or Import dataset (.zip) to add images instead of the camera. Drag images onto the simulator window to add them to its Photos library.
A two-minute tour, on either platform:
- Create a dataset. On the home screen, tap New dataset and give it a name, such as "Desk objects".
- Fill two classes. Rename
Class 1tomugand tap Capture. The camera starts onmug: tap the shutter for one image, or hold it to record about 5 frames a second. Tap New class in the chip row, name itpen, and capture some pens. Aim for 20 or more images per class; each class's progress bar fills as you go. The gallery button beside the shutter adds photos from the library instead. - Auto-sort. Tap the Auto chip and point the camera at a mug or a pen. The label over the viewfinder shows the closest class and how similar it is, and captures go straight to that class. Capture something new, like a phone: it waits under Unknown (the badge beside the shutter), where New class turns it into a third class. Photos from the library are sorted the same way while Auto is on.
- Watch the class balance. Back on the dataset, the line under the title says how many classes are ready. Tap it for per-class counts and warnings about empty, small or imbalanced classes.
- Review. Tap a thumbnail to view images full screen: swipe between them, pinch to zoom, and Move to… or Delete (with Undo). See all opens the gallery; long-press to select several images.
- Change image settings. In Settings, choose a size (Original, Fit or Square) and a format (JPEG, PNG or WebP) for new datasets. Use Image settings in a dataset's menu to change it for one dataset.
- Export. Tap Export, then Export ZIP, and share the zip through the system share sheet. It holds one folder per
class plus
metadata.json. - Import. Back on the home screen, use Import dataset (.zip) on the zip you just exported to get it back as a new dataset.
Most of the code is shared. About 85% of the app's Kotlin lives in commonMain (roughly 7,200 lines),
against about 490 lines in androidMain and 760 in iosMain. The Android and iOS app shells are a few
dozen lines each.
A single shared module holds everything, layered by package under org.onedroid.dataset:
| Package | Contents |
|---|---|
domain |
Result/DataError typed errors, models, repository interfaces (DatasetRepository, ImageSorter, SettingsRepository), use cases (class balance, class matching, name validation, folder grouping, export naming) |
data |
FileDatasetRepository (JSON record + image files per dataset), streaming ZipWriter/ZipReader with a shared CRC-32, exporter/importer, image processing, settings storage, EmbeddingImageSorter |
presentation |
MVI screens (State/Action/Event/ViewModel, Root + Screen composables), theme, components (UiText, ObserveAsEvents, dialogs), type-safe navigation |
core.platform |
expect/actual camera (CameraX / AVFoundation), pickers, share sheet, image codecs, and the image model backbone (LiteRT on Android, the TensorFlow Lite C API through cinterop on iOS) |
core.di |
Koin modules; initKoin is called from DataDroidApplication (Android) and iOSApp.init (iOS) |
Only the platform boundaries are written per platform: camera, image decoding and encoding, file and photo
pickers, the share sheet, zip inflation, and the model runtime. Image preprocessing for the model
(toInputTensor), the embedding cache, and class matching are shared, so both platforms sort images the
same way.
Storage: <app files>/datasets/<id>/dataset.json, images/<imageId>.<ext>, thumbs/<imageId>.jpg,
embeddings.bin.
The shared tests in shared/src/commonTest run on both platforms:
- JVM:
./gradlew :shared:testAndroidHostTest - iOS simulator (macOS only):
./gradlew :shared:iosSimulatorArm64Test
DataDroid is licensed under the Apache License 2.0.
It bundles a DINOv2 ViT-S/14 image encoder converted from Meta's DINOv2
(Apache 2.0; conversion script in docs/scripts/export_dinov2.py), and the MobileNetV3-Small and MobileNetV3-Large
image embedders from
Google MediaPipe (Apache 2.0),
uses LiteRT on Android and the TensorFlow Lite C runtime on iOS (Apache 2.0), and includes Material Design
icon paths (Apache 2.0). See NOTICE for details and sources.
Tawhid Monowar - Computer Science & Engineering Student
LinkedIn | Portfolio | Email
The contest essay is in ESSAY.md, and the paper on the auto-sort matcher is in docs/paper/paper.md.