This Android application demonstrates image classification using a pre-trained machine learning model to classify fruits into categories such as Apple, Banana, and Orange. The model is integrated into the app using TensorFlow Lite, with optimization for inference using NNAPI (Android Neural Networks API) for improved performance on Android devices.
- Image Classification: Allows users to select an image from the device's gallery and classify it into one of the predefined fruit categories.
- Real-time Inference: Performs real-time inference on the device, providing instant results without the need for internet connectivity.
- Simple User Interface: Features an intuitive and user-friendly interface for easy interaction.
![Screenshot 4](https://private-user-images.githubusercontent.com/104339650/323362675-b5861a4a-67b9-4458-b3e1-99c2fc4d295f.jpg?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MjQ1NTgyMDgsIm5iZiI6MTcyNDU1NzkwOCwicGF0aCI6Ii8xMDQzMzk2NTAvMzIzMzYyNjc1LWI1ODYxYTRhLTY3YjktNDQ1OC1iM2UxLTk5YzJmYzRkMjk1Zi5qcGc_WC1BbXotQWxnb3JpdGhtPUFXUzQtSE1BQy1TSEEyNTYmWC1BbXotQ3JlZGVudGlhbD1BS0lBVkNPRFlMU0E1M1BRSzRaQSUyRjIwMjQwODI1JTJGdXMtZWFzdC0xJTJGczMlMkZhd3M0X3JlcXVlc3QmWC1BbXotRGF0ZT0yMDI0MDgyNVQwMzUxNDhaJlgtQW16LUV4cGlyZXM9MzAwJlgtQW16LVNpZ25hdHVyZT00OWU4YTc1YzkxNjkyZDI2N2JlNGQ4OGZmZmNkNGVlNzczMGE5YTAxODA5OWFjYjg4YTA1YzBhOWYxMTU5MTAyJlgtQW16LVNpZ25lZEhlYWRlcnM9aG9zdCZhY3Rvcl9pZD0wJmtleV9pZD0wJnJlcG9faWQ9MCJ9.CqnBR1pVKB77lrr-X2xU8ROthqxOrzA0abA1zd1YWYo)
![Screenshot 3](https://private-user-images.githubusercontent.com/104339650/323362692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Z25hdHVyZT0zYjYxYWY2YmI5MTEyNzNhOWE1YzgyZGM3NjQ1MTliMmY1ODFmYzJkZDkwMGNhMDcyZTQ0NmM2N2Q2N2RkNzUwJlgtQW16LVNpZ25lZEhlYWRlcnM9aG9zdCZhY3Rvcl9pZD0wJmtleV9pZD0wJnJlcG9faWQ9MCJ9.0XV10_AJZgwiptPpRyA_P9GpzunREWF3EWpPKvj5Ouk)
To install the app on your Android device, follow these steps:
- Clone the repository:
git clone https://github.com/Yogender21505/Classification.git
- Open the project in Android Studio.
- Build and run the project on an Android device or emulator.
- Launch the app on your Android device.
- Tap the "Choose File" button to select an image from your device's gallery.
Once the image is selected, the app will classify it into one of the fruit categories: Apple, Banana, or Orange.
- TensorFlow Lite: Used for integrating and running the machine learning model on Android devices.
- Kotlin: The programming language used for developing the Android application.
- Android Jetpack: Utilized for building modern Android apps with ease.
- NNAPI (Android Neural Networks API): Integrated for optimized model inference on Android devices.
The pre-trained machine learning model used for image classification is available in the model.tflite file. It was optimized for inference on Android devices using NNAPI.
To reproduce the model building process, refer to the provided Google Colab notebook model_building.ipynb
. Once the model is trained, you can convert it to TensorFlow Lite format (model.tflite
) and optimize it for NNAPI using the provided instructions.
This project was inspired by [source], which provided the initial implementation and model.
This project is licensed under the MIT License.