Smart Gallery
An on-device photo cleaner for Android and iOS that never touches the network.
Phones fill up with blurry shots, bursts, duplicates, screenshots and photos of receipts. Smart Gallery finds them and lets you clear them in one pass. Every photo is analysed on the phone, and the Android app has no permission to open a network socket at all.
- One SigLIP2 inference per photo gives both duplicate grouping and scene labels
- Android ships with the INTERNET permission removed, checked in the build
- Shared Kotlin grouping engine for Android and iOS, 25 of 26 milestones passed
-
First run: on-device, no account
-
Scanning the library
-
What it found
-
Copies, with a keeper picked
-
Burst shots grouped
-
Nothing is deleted without confirmation
The itch
Gallery cleaners either upload your photos to a server or ship analytics SDKs that phone home. For a library of private photos, I wanted one that provably can’t.
What I built
A Kotlin Multiplatform app with a shared core (scan coordinator, grouping engine, keeper selection, Room index) and native analysers on each platform.
- Android runs a SigLIP2 image encoder through LiteRT’s
CompiledModelon the GPU, with CPU fallback. One inference per photo gives a 768-dimension embedding, used both to group near-duplicates and to classify scenes against text anchors computed offline. - iOS uses Apple’s own Vision requests for feature prints and “utility image” detection, plus PhotoKit’s exact burst and screenshot flags.
- Sharpness is a shared Kotlin metric, so both platforms judge blur the same way.
Scans run while the phone is charging and idle. Most photos are never fully decoded: the app reads the system’s thumbnail cache, because decoding often costs more battery than inference.
The hard part
Privacy had to be enforced, not promised. MediaPipe and ML Kit were both rejected because they pull in Google’s telemetry uploader. On Android the INTERNET permission is stripped in the manifest, and the build checks the final permission list. Backups are off and the index is stored privately.
Copies were the other hard problem. Two photos can embed almost identically and still differ (a crop, an edit), so a 64×64 grayscale pixel check now confirms a “copy” before it is grouped as one.
Where it stands
The Android MVP passes its gates through a signed R8 release build and a smoke test on a real phone. The iOS app shell and Vision probe work. iOS end-to-end tests are blocked because the iOS 18.3 simulator can’t run the Vision requests.
The screens on this page are from the Android emulator, scanning the test photos the project ships with.