A professional Flutter mobile application that leverages state-of-the-art deep learning models to detect pneumonia from chest X-ray images with real-time analysis capabilities.
Features • Installation • Usage • Model Performance • License
This application provides a comprehensive solution for X-ray pneumonia detection using multiple pre-trained deep learning models. It supports four advanced architectures: VGG16, EfficientNet, InceptionV3, and ResNet50, allowing users to compare model performance and select the most suitable classifier for their needs.
- 🧠 Multiple AI Models: Choose from 4 state-of-the-art deep learning architectures (VGG16, EfficientNet, InceptionV3, ResNet50)
- ⚡ Real-time Analysis: Instant image processing and prediction with optimized TensorFlow Lite inference
- 📊 Confidence Scores: Detailed prediction confidence levels for transparent decision-making
- 📈 Performance Metrics: Built-in model comparison with accuracy and F1 score statistics
- 🎨 Modern UI/UX: Clean, intuitive interface with gradient design and smooth animations
- 📱 Cross-platform: Native performance on both Android and iOS devices
- 🔒 Privacy-focused: All processing performed on-device with no data transmission
The following table presents the performance metrics for each model on the test dataset:
| Model | Accuracy | F1 Score | Precision | Recall |
|---|---|---|---|---|
| ResNet50 | 93.70% | 95.42% | - | - |
| VGG16 | 91.87% | 93.91% | - | - |
| EfficientNet | 90.13% | 92.67% | - | - |
| InceptionV3 | 89.55% | 92.51% | - | - |
Note: ResNet50 demonstrates the highest accuracy and F1 score, making it the recommended model for production use.
Before you begin, ensure you have the following installed:
- Flutter SDK (>=3.38.5) - Installation Guide
- Dart SDK (>=3.10.4) - Included with Flutter
- Android Studio or VS Code with Flutter extensions
- Android SDK (API level 21 or higher) for Android development
- Xcode (latest version) for iOS development (macOS only)
- Android: Minimum SDK 21 (Android 5.0 Lollipop)
- iOS: iOS 12.0 or later
- RAM: Minimum 4GB (8GB recommended)
- Storage: At least 2GB free space for dependencies and models
git clone https://github.com/ErselSeyit/XrayPneumonia.git
cd XrayPneumoniaflutter pub getRun Flutter doctor to ensure all dependencies are properly configured:
flutter doctorEnsure all TensorFlow Lite model files are present in the assets/ directory:
vgg16_model_finetuned.tfliteEfficientnetB3_fine_tuning.tfliteInceptionV3_model_finetuned.tfliteResNet50_model_finetuned.tflitelabels.txt
Run the app in debug mode on a connected device or emulator:
flutter runTo run on a specific device:
flutter devices # List available devices
flutter run -d <device-id> # Run on specific deviceBuild a release APK optimized for production:
# Single APK (universal)
flutter build apk --release
# Split APKs by ABI (recommended for smaller size)
flutter build apk --split-per-abi --releaseBuild an Android App Bundle for Google Play Store:
flutter build appbundle --releaseBuild for iOS (requires macOS and Xcode):
flutter build ios --releaseXrayPneumonia/
├── lib/
│ ├── main.dart # Main application entry point and UI
│ ├── classifier_vgg16.dart # VGG16 model classifier implementation
│ ├── classifier_efficientnet.dart # EfficientNet model classifier
│ ├── classifier_inceptionv3.dart # InceptionV3 model classifier
│ └── classifier_resnet.dart # ResNet50 model classifier
│
├── assets/
│ ├── vgg16_model_finetuned.tflite
│ ├── EfficientnetB3_fine_tuning.tflite
│ ├── InceptionV3_model_finetuned.tflite
│ ├── ResNet50_model_finetuned.tflite
│ └── labels.txt # Model labels (NORMAL, PNEUMONIA)
│
├── android/ # Android platform-specific code
├── ios/ # iOS platform-specific code
├── test/ # Unit and widget tests
├── pubspec.yaml # Flutter dependencies and configuration
└── README.md # Project documentation
- Launch the Application: Open the app on your device or emulator
- Select an Image: Tap the photo icon in the bottom-right corner to choose an X-ray image from your gallery
- Automatic Analysis: The app will automatically process the image using the currently selected model
- View Results: Review the prediction (NORMAL or PNEUMONIA) along with the confidence score
- Switch Models: Use the drawer menu (hamburger icon) to switch between different AI models and compare results
- Use high-quality X-ray images for better accuracy
- Ensure images are properly oriented and well-lit
- Compare results across multiple models for validation
- Review confidence scores to assess prediction reliability
- Flutter (3.38.5+) - Cross-platform mobile application framework
- Dart (3.10.4+) - Programming language
- TensorFlow Lite - On-device machine learning inference engine
- tflite_flutter - Flutter plugin for TensorFlow Lite
- tflite_flutter_helper - Helper utilities for TensorFlow Lite operations
- VGG16 - Visual Geometry Group 16-layer convolutional neural network
- EfficientNet - Efficient convolutional neural network architecture
- InceptionV3 - Google's Inception architecture v3
- ResNet50 - 50-layer residual neural network
- image_picker - Image selection from gallery
- image - Image processing and manipulation
- logger - Logging and debugging utilities
- permission_handler - Runtime permission management
- Always consult with qualified healthcare professionals for medical decisions
- This tool is not intended to diagnose, treat, cure, or prevent any disease
- Results should be interpreted by licensed medical professionals
- The developers assume no liability for any medical decisions made based on this application
- Model accuracy may vary based on image quality and conditions
- Results are probabilistic and should be validated by medical professionals
- The application is not a replacement for clinical expertise
Contributions, issues, and feature requests are welcome! Feel free to check the issues page.
This project is licensed under the MIT License - see the LICENSE file for details.
Ersel Seyit
- GitHub: @ErselSeyit
- Email: erselseyit@gmail.com
Made with ❤️ using Flutter and TensorFlow Lite
⭐ Star this repository if you find it helpful!