A lightweight SwiftUI application demonstrating on-device image classification using Apple's Vision and Core ML frameworks.
Select a photo from your library and run image classification entirely on-device.
LiteVision is a lightweight iOS application that demonstrates on-device image classification using Apple's Vision and Core ML frameworks. The app is built with SwiftUI, MVVM, and Swift Concurrency to showcase a clean, modern iOS architecture.
- SwiftUI-based interface
- PhotosPicker image selection
- On-device Core ML inference
- Async image classification with Swift Concurrency
- Pre-trained MobileNetV2 model
- Top 3 prediction display
- Inference time display
- Error handling and loading state
- UI: SwiftUI
- Architecture: MVVM
- Image Picker: PhotosPicker
- ML Framework: Core ML + Vision
- ML Model: MobileNetV2
- Concurrency: Swift Concurrency
PhotosPicker
↓
UIImage
↓
Vision (VNImageRequestHandler)
↓
Core ML (MobileNetV2)
↓
Predictions
↓
SwiftUI
├── LiteVision/
│ └── LiteVisionApp.swift
├── Models/
│ ├── Prediction.swift
│ ├── ImageClassifier.swift // Protocol
│ ├── CoreMLImageClassifier.swift // Vision + Core ML implementation
│ └── MobileNetV2.mlmodel
├── ViewModels/
│ └── ContentViewModel.swift
├── Views/
│ └── ContentView.swift
├── LiteVisionTests/
└── LiteVisionUITests/
- Clone the repository.
- Open
LiteVision.xcodeprojin Xcode. - Select an iOS Simulator or connected device.
- Build and run the app.
- Select a photo from your library to start image classification.
LiteVision focuses on integrating machine learning into a modern iOS application rather than developing or training custom machine learning models.
It demonstrates a responsive on-device inference pipeline using Vision, Core ML, SwiftUI, MVVM, and Swift Concurrency.
The protocol-based image classification architecture also makes it straightforward to add interchangeable inference backends, such as TensorFlow Lite, in the future.
- TensorFlow Lite backend
- Runtime switching between Core ML and TensorFlow Lite
- Camera-based real-time classification
- Object Detection
- Benchmark inference performance
- Xcode 26.x
- iOS 26.x
- Swift 6 (as configured by project settings)
This project uses Apple's publicly available MobileNetV2 Core ML model for demonstration purposes.
The implementation was inspired by Apple's official Vision and Core ML documentation and sample applications.
MIT. See LICENSE.


