An Android mobile application that uses on-device machine learning to classify skipjack tuna quality in real-time, helping fishery inspectors and processors identify defects instantly from a camera photo or gallery image.
- Overview
- Features
- Classification Categories
- Tech Stack
- Architecture
- Screenshots
- Getting Started
- Project Structure
- How It Works
- Contributing
- License
- Author
CatchGrade was developed as a capstone research project to address quality control challenges at the General Santos City Fish Port Complex β the largest tuna landing port in the Philippines. Manual visual inspection of skipjack tuna is time-consuming and prone to human error. CatchGrade automates this process using a trained TensorFlow Lite image classification model deployed directly on-device for instant, offline-capable results.
Traditional tuna quality assessment relies on manual visual inspection by trained personnel, which is:
- Slow β inspectors can only process a limited number of fish per hour
- Subjective β results vary between inspectors
- Error-prone β fatigue leads to missed defects
CatchGrade provides a mobile, camera-based classification tool that delivers consistent, instant results β reducing inspection time and improving accuracy for fishery quality control operations.
- πΈ Real-Time Camera Capture β Use CameraX back-camera preview to photograph tuna specimens directly
- πΌοΈ Gallery Upload β Import existing images from device gallery for classification
- π§ On-Device ML Inference β TensorFlow Lite model runs entirely on-device (no internet required)
- π Instant Classification β Results displayed in under 1 second with confidence scoring
- π Scan History β Horizontal scrollable history reel showing all previous scans with thumbnails
- π Re-Review Scans β Tap any history thumbnail to re-display the image and its classification result
- π± Optimized for Field Use β Designed for use in processing plants and port facilities
| Category | Description |
|---|---|
| β Healthy | Tuna specimen shows no visible defects β passes quality inspection |
| Abnormal coloring on the skin surface indicating potential quality degradation | |
| π΄ Eye Deterioration | Visible deterioration of the eye area, a key freshness indicator |
The TFLite model accepts 224Γ224 RGB images and outputs probability scores across all three classes.
| Layer | Technology |
|---|---|
| Language | Kotlin 2.0 |
| Platform | Android (minSdk 24 / Android 7.0+) |
| ML Framework | TensorFlow Lite + TFLite Support Library |
| Camera | CameraX 1.3.1 (camera-core, camera2, lifecycle, view) |
| UI | XML Views, ConstraintLayout, Material Design 3 |
| Build | Gradle 8.9.2 (Kotlin DSL), AGP 8.9.2 |
| IDE | Android Studio |
βββββββββββββββββββββββββββββββββββββββββββββββ
β MainActivity β
β ββββββββββββ ββββββββββββ βββββββββββββ β
β β CameraX β β Gallery β β History β β
β β Preview β β Picker β β Adapter β β
β ββββββ¬ββββββ ββββββ¬ββββββ βββββββββββββ β
β β β β
β βΌ βΌ β
β βββββββββββββββββββββββββββ β
β β Bitmap Processing β β
β β (resize to 224Γ224) β β
β βββββββββββββ¬ββββββββββββββ β
β βΌ β
β βββββββββββββββββββββββββββ β
β β TunaClassifier β β
β β (TFLite Interpreter) β β
β β tuna_model.tflite β β
β βββββββββββββ¬ββββββββββββββ β
β βΌ β
β βββββββββββββββββββββββββββ β
β β Classification Result β β
β β + Confidence Score β β
β βββββββββββββββββββββββββββ β
βββββββββββββββββββββββββββββββββββββββββββββββ
π Screenshots coming soon β run the app in Android Studio to preview the UI.
- Android Studio Arctic Fox or later (recommended: latest stable)
- JDK 11 or higher
- Android SDK with API Level 24+ installed
- A physical Android device or emulator (camera features work best on a real device)
-
Clone the repository
git clone https://github.com/YOUR_USERNAME/CatchGrade.git cd CatchGrade -
Open in Android Studio
- File β Open β select the cloned
CatchGradedirectory - Wait for Gradle sync to complete
- File β Open β select the cloned
-
Build and Run
- Connect an Android device (USB debugging enabled) or start an emulator
- Click Run βΆ or press
Shift + F10 - Grant camera permission when prompted
If you don't have access to tuna specimens, you can test by:
- Tap "Upload Picture"
- Select any fish image from your gallery
- The model will classify it based on visual features
CatchGrade/
βββ app/
β βββ build.gradle.kts # App-level build config
β βββ src/
β β βββ main/
β β β βββ AndroidManifest.xml # Permissions & activity config
β β β βββ assets/
β β β β βββ tuna_model.tflite # Trained ML model (2.5 MB)
β β β βββ java/com/example/catchgrade/
β β β β βββ MainActivity.kt # Camera, gallery, UI logic
β β β β βββ TunaClassifier.kt # TFLite inference engine
β β β β βββ HistoryAdapter.kt # Scan history RecyclerView
β β β βββ res/
β β β βββ layout/
β β β β βββ activity_main.xml # Main UI layout
β β β β βββ item_history.xml # History thumbnail item
β β β βββ values/
β β β β βββ colors.xml
β β β β βββ strings.xml
β β β β βββ themes.xml
β β β βββ mipmap-*/ # App launcher icons
β β βββ test/ # Unit tests
β βββ proguard-rules.pro
βββ build.gradle.kts # Root build config
βββ settings.gradle.kts
βββ gradle.properties
βββ gradlew / gradlew.bat # Gradle wrapper
βββ LICENSE
βββ README.md
The app uses CameraX to provide a live back-camera preview. When the user taps "Take Picture," an in-memory image is captured and auto-rotated to correct orientation.
The captured or uploaded bitmap is:
- Decoded safely using Software rendering (avoiding
Hardware Bitmapcrashes) - Resized to 224Γ224 pixels (the model's expected input size)
- Normalized from 0β255 to 0.0β1.0 float values per RGB channel
The TunaClassifier loads tuna_model.tflite from the app's assets directory and runs inference using the TensorFlow Lite Interpreter. The model outputs a probability array across 3 classes.
The class with the highest probability is displayed on a blue banner at the top of the screen. The image and result are also added to the scan history reel for later review.
| Property | Value |
|---|---|
| Format | TensorFlow Lite (.tflite) |
| Input | 224Γ224Γ3 (RGB float32, normalized 0β1) |
| Output | 1Γ3 probability array |
| Classes | Skin Discoloration, Healthy, Eye Deterioration |
| Size | ~2.5 MB |
| Training | Transfer learning (trained offline, exported to TFLite) |
Contributions are welcome! If you'd like to improve CatchGrade:
- Fork the repository
- Create a feature branch (
git checkout -b feature/your-feature) - Commit your changes (
git commit -m 'feat: add your feature') - Push to the branch (
git push origin feature/your-feature) - Open a Pull Request
This project is licensed under the MIT License β see the LICENSE file for details.
Dayle Angelo PeΓ±a
- π§ daylepena@gmail.com
- π B.S. Computer Science β Notre Dame of Dadiangas University
- π General Santos City, Philippines
- General Santos City Fish Port Complex β domain expertise and research support
- Notre Dame of Dadiangas University β academic guidance
- TensorFlow β open-source ML framework
- CameraX β modern Android camera API