An advanced web application for automated malaria cell classification using deep learning. This project provides a comprehensive solution for medical professionals and researchers to quickly and accurately classify blood cell images as infected or uninfected with malaria parasites.
- Single Image Classification: Upload individual cell images for instant classification
- Batch Processing: Process multiple images simultaneously (up to 50 images)
- Real-time Predictions: Get results with confidence scores in seconds
- Advanced AI Model: CNN-based deep learning model with 95%+ accuracy
- Modern Web Interface: Beautiful, responsive React frontend
- Drag & Drop Upload: Intuitive file upload with preview
- Real-time Feedback: Live progress indicators and status updates
- Mobile Responsive: Works seamlessly on all devices
- Dark Mode Support: Comfortable viewing in any lighting condition
- RESTful API: FastAPI backend with comprehensive endpoints
- Image Preprocessing: Advanced image enhancement and validation
- Result History: Track and manage classification results
- User Authentication: Secure user management system
- Statistics Dashboard: Detailed analytics and insights
- Model Versioning: Track and manage model improvements
- Docker Support: Containerized deployment
- CI/CD Pipeline: Automated testing and deployment
- Model Auto-retraining: Automated model updates with new data
- Health Monitoring: Built-in health checks and monitoring
- Scalable Architecture: Ready for production scaling
MalariaDetect/
βββ backend/ # FastAPI backend
β βββ main.py # Main application entry point
β βββ models/ # ML model and utilities
β βββ utils/ # Helper utilities
β βββ schemas/ # Pydantic models
β βββ tests/ # Backend tests
βββ frontend/ # React frontend
β βββ src/
β β βββ components/ # React components
β β βββ pages/ # Page components
β β βββ context/ # React context
β β βββ utils/ # Frontend utilities
β βββ public/ # Static assets
βββ scripts/ # Setup and utility scripts
βββ nginx/ # Nginx configuration
βββ docker-compose.yml # Docker orchestration
βββ README.md # This file- Python 3.11+
- Node.js 18+
- Git
git clone https://github.com/rufilboss/MalariaDetect.git
cd MalariaDetectchmod +x scripts/setup.sh
./scripts/setup.sh./start_all.sh- Web Interface:
http://localhost:3000 - API Documentation:
http://localhost:8000/docs - API Health Check:
http://localhost:8000/
# Create virtual environment
python3 -m venv venv
source venv/bin/activate # On Windows: venv\Scripts\activate
# Install dependencies
pip install -r requirements.txt
# Start backend
cd backend
python main.py# Install dependencies
cd frontend
npm install
# Start development server
npm start# Build and start all services
docker-compose up -d
# View logs
docker-compose logs -f
# Stop services
docker-compose down# Build production images
docker-compose -f docker-compose.prod.yml up -d
# Scale services
docker-compose up -d --scale backend=3- Netlify: Connect your GitHub repository for automatic deployments
- Vercel: Deploy with zero configuration
- AWS S3 + CloudFront: For high-performance static hosting
- Heroku: Easy deployment with Git integration
- Railway: Modern platform with automatic scaling
- DigitalOcean App Platform: Managed container deployment
- AWS ECS: Enterprise-grade container orchestration
- SQLite: Default for development (included)
- PostgreSQL: Production-ready database
- MongoDB: NoSQL option for flexible data storage
Create a .env file in the root directory:
# Backend Configuration
ENVIRONMENT=production
DATABASE_URL=postgresql://user:password@localhost/malaria_db
SECRET_KEY=your-secret-key-here
DEBUG=False
# Frontend Configuration
REACT_APP_API_URL=https://your-api-domain.com
REACT_APP_VERSION=2.0.0
# Model Configuration
MODEL_PATH=backend/models/saved_model
MODEL_INFO_PATH=backend/models/model_info.jsonThe API supports the following endpoints:
POST /classify- Single image classificationPOST /classify/batch- Batch image classificationGET /results/{result_id}- Get specific resultGET /results/user/{user_id}- Get user resultsGET /stats- Get API statisticsPOST /model/retrain- Trigger model retrainingGET /model/status- Get model status
- Type: Convolutional Neural Network (CNN)
- Input Size: 128x128x3 RGB images
- Output: Binary classification (Parasitized/Uninfected)
- Accuracy: 95%+ on validation set
- Training Data: 27,558 cell images
Conv2D(16) β MaxPool2D β Dropout(0.2)
Conv2D(32) β MaxPool2D β Dropout(0.3)
Conv2D(64) β MaxPool2D β Dropout(0.3)
Flatten β Dense(64) β Dropout(0.5) β Dense(1, sigmoid)- Training Accuracy: 95.6%
- Validation Accuracy: 94.5%
- Average Processing Time: < 1 second per image
- Model Size: ~2MB
We welcome contributions! Please follow these steps:
- Fork the repository
- Create a feature branch:
git checkout -b feature/amazing-feature - Commit your changes:
git commit -m 'Add amazing feature' - Push to the branch:
git push origin feature/amazing-feature - Open a Pull Request
- Follow PEP 8 for Python code
- Use ESLint and Prettier for JavaScript/React code
- Write tests for new features
- Update documentation as needed
cd backend
python -m pytest tests/ -vcd frontend
npm testnpm run test:e2e- Model quantization for faster inference
- TensorRT integration for GPU acceleration
- Batch processing optimization
- Response caching with Redis
- Database query optimization
- Async processing for batch operations
- Code splitting and lazy loading
- Image compression and optimization
- Service worker for offline support
- JWT authentication
- Rate limiting
- Input validation and sanitization
- CORS configuration
- Secure file upload handling
- Data encryption at rest
- GDPR compliance features
- Audit logging
This project is licensed under the MIT License - see the LICENSE file for details.
- Dataset provided by NIH Malaria Dataset
- Built with FastAPI, React, and TensorFlow
- Icons from Lucide React
- UI components from Headless UI
- Documentation: Wiki
- Issues: GitHub Issues
- Discussions: GitHub Discussions
- Email: support@malariadetect.com
This project was developed by a team of 5 students as part and finall of their traning project. The team focused on creating a production-ready solution that could compete with commercial alternatives.
Made with β€οΈ for better healthcare through AI