MALLI is a blood-smear malaria analysis project that combines a TensorFlow training and evaluation pipeline with a Flutter mobile app for offline-friendly sample capture and result review.
The repository contains two connected parts:
- A Python ML stack for loading malaria datasets, training a MobileNetV3-small classifier, evaluating saved weights, and exporting INT8 TFLite models.
- A Flutter app that displays completed samples, captures new images, and stores results locally with SQLite.
The main Python entry points are train.py, models/evaluate.py, and the helpers under models/. The Flutter app starts from lib/main.dart.
MALLI is designed for field and low-resource workflows where malaria screening needs to be portable, repeatable, and easy to review. It provides:
- A staged training pipeline for NIH and synthetic blood-smear data.
- TFRecord caching for faster dataset reuse on larger runs.
- Quantized model export for mobile deployment.
- A cell-counting pipeline for parasite and ROI analysis.
- A simple Flutter UI for reviewing completed samples on device.
- Python 3.10 or newer
- Conda or
venv - Flutter SDK
- Access to the malaria datasets used by the training scripts
Using Conda:
conda env create -f environment.yml
conda activate malli
pip install -r requirements.txtUsing venv:
python -m venv .venv
.venv\Scripts\activate
pip install -r requirements.txtThe pinned Python stack is intentional. The checked-in versions in requirements.txt and environment.yml are the safest place to start.
flutter pub getpython train.py --launch-dashboardThis runs the staged training pipeline defined in train.py. You can pass --config to load a JSON override file.
python models/evaluate.py \
--weights models/best_mobilenetv3_small.weights.h5 \
--data-root nih_data \
--synthetic-root synthetic_field_ready \
--synthetic-labels-csv labels.csvflutter runfrom models import predict_image, CellCounter
probability, label = predict_image(
"models/best_mobilenetv3_small.weights.h5",
"nih_data/cell_images/Parasitized/example.png",
)
counter = CellCounter(verbose=True)
result = counter.process_image("nih_data/cell_images/Parasitized/example.png")
print(probability, label)
print(result.to_dict())Start with the project docs that describe the supported workflows:
- START_HERE_TRAINING_PIPELINE.md
- DEPENDENCY_MANAGEMENT.md
- docs/CELL_COUNTER_GUIDE.md
- docs/PIPELINE_STAGES_REFERENCE.md
- docs/Roadmap.md
- docs/deep_dive/README.md
- IMPLEMENTATION_SUMMARY.md
- DETECTION_PIPELINE_IMPLEMENTATION.md
If you are debugging a specific module, the most useful starting points are data/data_loader.py, data/synthetic_data_loader.py, models/inference.py, and lib/services/image_processor.dart.
The project is maintained in the JFrusher/MALLI repository workspace by the MALLI project team.
Contributions should follow CONTRIBUTING.md. Keep changes focused, document behavior changes, and run the relevant Python or Flutter checks before opening a pull request.
If you are extending the ML pipeline, start from train.py and the files under models/. For mobile work, start from lib/main.dart and the files under lib/.