Scan one item. Get the waste class, confidence, and a practical way to dispose of it.
English · Tiếng Việt
Waste Classification is a Flutter Android app built for IT-Challenge II 2026. The important part is not just taking a photo: the image sent to the model must match the frame shown on screen. The app captures that exact region, classifies it through the API, then keeps the result locally for history and statistics.
waste-classification-demo.mp4
![]() Start a scan |
![]() Keep one item in frame |
![]() Result and disposal advice |
![]() Daily, weekly and monthly statistics |
![]() Saved scan details |
![]() Vietnamese and English |
- Camera capture with an on-screen guide; only the visible scan frame is uploaded.
- Nine model labels:
Cardboard,Food Organics,Glass,Metal,Miscellaneous Trash,Paper,Plastic,Textile Trash, andVegetation. - Confidence score, waste-group explanation, and disposal guidance.
- Local scan history with image, timestamp, label, and confidence.
- Waste distribution by day, week, or month.
- Vietnamese and English interface.
Camera preview → exact frame crop → POST /predict → result → local SQLite history
The model is served separately from the APK. The current contract follows the project notebooks:
| Item | Value |
|---|---|
| Model | EfficientNet-B0, exported to ONNX |
| Input | RGB 224 × 224, ImageNet normalization |
| Request | multipart/form-data, field name file |
| Response | predicted_class, confidence, all_probabilities |
| Deployment | Public Docker Space |
The app maps the nine model labels into three practical groups: organic, recyclable, and other waste.
Requirements: Flutter SDK, Android SDK, and an Android 7.0+ device or emulator.
flutter pub get
flutter runUse your own API endpoint when developing:
flutter run \
--dart-define=WASTE_API_BASE_URL=https://your-api.example.comFor an offline UI demo without inference:
flutter run --dart-define=CLASSIFIER_MODE=mockRelease builds use the project's public Hugging Face Docker Space by default.
The API source, Dockerfile, tests, and exact ONNX model are kept in
huggingface-space/. Free Spaces can take a short time to
wake up after being idle, so the app allows for a cold start before retrying.
lib/
├── core/ theme, configuration, shared widgets
├── data/ models, SQLite repository, local image storage
├── features/ home, camera scan, result, history, settings
└── services/ API/mock classifiers and camera permission
huggingface-space/ FastAPI, Dockerfile, ONNX model, and backend tests
Flutter Riverpod selects the classifier implementation. SQLite stores scan metadata, while captured images remain in the app's private directory. easy_localization handles the two interface languages, and Be Vietnam Pro is bundled with the app.
dart format --output=none --set-exit-if-changed lib test
flutter analyze
flutter test
flutter build apk --releaseOn Windows, use the verified release script to clean stale outputs, run all checks, build the APK, and confirm that translations and bundled fonts are present:
.\tool\build_release.ps1Scan history is local to the device. In API mode, one cropped image is sent to the configured /predict endpoint for inference; the app does not use that endpoint as cloud storage. Clearing app data or uninstalling the app may remove local history.
Released under the GNU General Public License v3.0.





