SkinConditionClassifier is an Android application that uses Firebase AutoML to classify skin conditions from images. The app allows users to select an image from their device, crop it, and then processes the image using a local TFLite model to predict the skin condition. The model can classify 15 different skin conditions, including Eczema, Acne, Melanoma, and more.
The project aims to provide a quick, on-device tool for preliminary skin condition assessment. By leveraging machine learning, it helps users identify potential skin issues without requiring immediate professional consultation, thus raising awareness and encouraging timely medical advice.
- Image Selection & Cropping: Users can select an image from their device and crop it for better analysis.
- On-Device Classification: Utilizes a local TFLite model for fast, offline skin condition classification.
- Multiple Condition Detection: Classifies 15 different skin conditions with confidence scores.
- User-Friendly Interface: Simple UI with an image preview and clear classification results.
graph TB
subgraph Android App
UI[User Interface]
ImagePicker[Image Picker]
Cropper[Image Cropper]
MLKit[Firebase ML Kit]
TFLite[TFLite Model]
end
subgraph Firebase Services
AutoML[Firebase AutoML]
ModelManager[Model Manager]
end
UI --> ImagePicker
ImagePicker --> Cropper
Cropper --> MLKit
MLKit --> TFLite
TFLite --> Results[Classification Results]
AutoML -.-> ModelManager
ModelManager -.-> TFLite
sequenceDiagram
participant User
participant App
participant MLKit
participant Model
User->>App: Select Image
App->>App: Crop Image
App->>MLKit: Process Image
MLKit->>Model: Run Inference
Model->>MLKit: Return Predictions
MLKit->>App: Format Results
App->>User: Display Classification
classDiagram
class MainActivity {
+onCreate()
+onActivityResult()
+setLabelerFromLocalModel()
+processImageLabeler()
}
class FirebaseML {
+getInstance()
+getOnDeviceAutoMLImageLabeler()
}
class ImageProcessor {
+cropImage()
+prepareImage()
}
class ModelManager {
+downloadModel()
+updateModel()
}
MainActivity --> FirebaseML
MainActivity --> ImageProcessor
FirebaseML --> ModelManager
- User Interface: Built using Android XML layouts (
activity_main.xml
). - Image Selection & Cropping: Uses the
android-image-cropper
library. - Firebase AutoML: Integrates Firebase ML Kit for model management and inference.
- TFLite Model: A local model (
model.tflite
) bundled in the assets folder, with labels defined indict.txt
.
- Image Selection: The user taps the "Select Image" button, which opens the device's image picker.
- Image Cropping: The selected image is cropped using the
CropImage
library. - Model Inference: The cropped image is processed by the local TFLite model using Firebase AutoML.
- Classification: The model predicts the skin condition and displays the result with a confidence score.
- Clone the repository.
- Open the project in Android Studio.
- Update
google-services.json
with your Firebase API key. - Build and run the application on an Android device or emulator.
- Launch the app.
- Tap "Select Image" to choose an image from your device.
- Crop the image as needed.
- View the classification result displayed below the image.
- Integration of Firebase ML Kit with Android applications.
- Handling image selection and cropping in Android.
- On-device machine learning using TFLite models.
- Remote Model Updates: Implement dynamic model updates from Firebase.
- Enhanced UI: Improve the user interface with better styling and feedback.
- Additional Conditions: Expand the model to classify more skin conditions.
- Offline Support: Ensure robust offline functionality.
This project is licensed under the MIT License. Special thanks to Firebase and the Android community for their tools and libraries.