Skip to main content

MIRA_logo

MIRA - Microscopy Image Recognition and Analysis

Documentation Status License: GPL v3 Python 3.10+

MIRA is a professional PyQt5 application designed for real-time spore detection and quantification using deep learning (YOLO) and microscopy imaging.


📖 Documentation

Full documentation is available at mira-microscopy.readthedocs.io

The documentation includes:

  • Detailed installation guides for all platforms.
  • Comprehensive usage tutorials.
  • Hardware configuration and camera settings.
  • Advanced data analysis and export workflows.

Key Features

  • 🔬 Real-time Analysis: Live video feed with YOLO-based object detection.
  • 🧪 Standardized Chambers: Built-in support for Malassez and KOVA slides.
  • 📊 Automated Quantification: Automatic calculation of spores/mL and titer with dilution factors.
  • 📈 Professional Export: Multi-sheet Excel reports with statistical analysis (Mean, SD, CV%).
  • 📷 High-Res Support: Optimized for ArduCam 20MP and industrial microscopy cameras.
  • 🎨 Modern UI: Auto dark/light mode (OS detection), HiDPI support, resizable panels, and real-time quality indicators.

Installation

Requirements

  • Python 3.10 to 3.13
  • A USB microscopy camera (ArduCam recommended)

Quick Install (PyPI)

pip install mira-microscopy
pip install opencv-python-headless --force-reinstall  # Linux only — avoids Qt conflict

Install from Source

git clone https://forge.ird.fr/phim/sravel/mira.git
cd mira
pip install .
pip install opencv-python-headless --force-reinstall  # Linux only

Quick Start

  1. Launch MIRA: Run mira in your terminal.
  2. Configure: Select your camera and load a YOLO .pt model.
  3. Analyze: Select a chamber on the interactive grid, set your dilution factor, and capture images.
  4. Export: Click "Save to Excel" to get your full report.

Pretrained Models

Four pretrained YOLO models accompany the MIRA paper (Mejias et al., 2026) and are distributed on the CIRAD Dataverse:

Model Task Weights (Dataverse) mAP@0.5
M. oryzae spore counter Detect (yolo26m) spore-m-oryzae-xzewf_v9_yolo26m_20260721_0.765.pt 0.765
F. oxysporum micro/macroconidia Detect (yolo26m) spore-fusarium-object_v6_yolo26m_20260721_0.884.pt 0.884
P. fijiensis spore + surface Segment (yolo26m-seg) spore-fijiensis-seg_v6_yolo26m-seg_20260721_0.766.pt 0.770
Mix multi-genus (6 rice-associated) Segment (yolo26m-seg) curvularia-genus_v12_yolo26m-seg_20260721_0.820.pt 0.823

The Mix model covers 6 rice-associated fungal genera: Alternaria, Bipolaris, Curvularia, Exserohilum, Fusarium, Pyricularia.

Weights are distributed compressed with xz -9 (~12 % smaller). Decompress before use:

# Linux / Mac
xz -d *.pt.xz          # produces the .pt files

# Windows
# Right-click each .pt.xz → 7-Zip → Extract Here

Then place the .pt files in <repo>/models/, or set the environment variable:

export MIRA_MODELS_DIR=/path/to/models

Training your own models

MIRA models are trained with the VEGA CLI (Versatile Engine for Generic Automated-training):

https://forge.ird.fr/phim/sravel/vega

VEGA handles Roboflow dataset download, SLURM job submission, per-run reporting, and canonical weight naming. See its README for the full workflow.

Authors

Development Team:

  • Sébastien RAVEL (CIRAD) - Lead Developer

  • Joffrey MEJIAS (CIRAD) - Co-Developer

Institution: CIRAD (Centre de coopération internationale en recherche agronomique pour le développement)

License

This project is licensed under the GNU General Public License v3.0 or later (GPLv3+).

Free for non-commercial use. For commercial licensing, contact the authors.

Citation

If you use MIRA in your research, please cite the software AND the accompanying dataset:

@software{mira2026,
  title     = {MIRA: Microscopy Image Recognition and Analysis},
  author    = {Ravel, S{\'e}bastien and Mejias, Joffrey and Adreit, Henri and Blanc, Ana{\"e}lle and Lubin, Nadia and Jolivet, Cassandre and Guyot, Valentin and Brayle, O{\"i}ana and Poncelet, Nicolas and Fournier, Elisabeth and Wicker, Emmanuel and Carlier, Jean and Tharreau, Didier},
  year      = {2026},
  institution = {CIRAD, UMR PHIM, Montpellier, France},
  url       = {https://forge.ird.fr/phim/sravel/mira},
  version   = {1.0.0}
}

@dataset{mira_dataverse_2026,
  title     = {MIRA: dataset and trained YOLO weights for automated counting and sizing of fungal spores --- France, 2024--2026},
  author    = {Ravel, S{\'e}bastien and Mejias, Joffrey and others},
  year      = {2026},
  publisher = {CIRAD Dataverse},
  doi       = {10.18167/DVN1/E0JRDL},
  url       = {https://doi.org/10.18167/DVN1/E0JRDL}
}

Support

For questions, bug reports, or feature requests:

Made with ❤️ by CIRAD for the scientific community

Metadata

Release files for mira-microscopy 1.0.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for mira-microscopy 1.0.0
File Size Uploaded
mira_microscopy-1.0.0.tar.gz 1.7 MB Details

Built distribution (wheel)

Table of built distributions (wheels) for mira-microscopy 1.0.0
File Interpreter ABI Platform
mira_microscopy-1.0.0-py3-none-any.whl Python 3 none any Details

Total release size: 2.9 MB

Release files / mira_microscopy-1.0.0.tar.gz

Download URL mira_microscopy-1.0.0.tar.gz
Size 1.7 MB
Tags Source
SHA-256 checksum
How to use checksums
1b2fb90b3047f51a5832f9566a90a3dc1fbccd0299988a1d8ada7ce8fa300e3c
BLAKE2b-256 checksum
How to use checksums
e2530de4092b1316b6477d653b1ac2953700672bd2d6a76c75c73f4fb9da1076
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.12.3

Release files / mira_microscopy-1.0.0-py3-none-any.whl

Download URL mira_microscopy-1.0.0-py3-none-any.whl
Size 1.3 MB
Tags Python 3
SHA-256 checksum
How to use checksums
a741583df2f43f85e3e3495ca5c95f3dfcda03255fbe354a3f5b3792e39fc290
BLAKE2b-256 checksum
How to use checksums
d801f98c90a894758633a59e1f59d88edfdd904f56e395405efa00ca49f47d02
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.12.3

Release history Release notifications | RSS feed

This release

1.0.0 This release

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page