Skip to content
 
 

Repository files navigation

Mycol

A lightweight, human-in-the-loop microscopy image analysis app.

Homepage  ·  FAQ  ·  Functionality Guide  ·  Preprint

Mycol is a Streamlit-based application that makes machine-learning-assisted microscopy analysis accessible to non-specialists. It enables fast annotation, automated segmentation and classification, model fine-tuning, and quantitative phenotyping, all on a standard laptop and without coding.

Overview  ·  1 Upload  ·  2 Annotate  ·  3 Train  ·  4 Visualize  ·  5 Downloads  ·  Install


◆    THE MYCOL WORKFLOW

How It Works

Mycol guides you through a clear, step-by-step pipeline - from raw microscopy images to trained AI models and quantitative cell-level insights.

Each stage builds on the last, but you can enter or exit at any point depending on what you already have.

Start by uploading your images and any existing masks or models. Move to the annotation page to segment cells automatically with Cellpose or SAM2, correct any errors interactively, and classify cells manually or with a DenseNet model. If you want better automated results, use the training page to fine-tune a Cellpose or DenseNet model on your own annotated data - newly trained models feed directly back into annotation. Finally, the analysis page lets you visualize and export cell population statistics across classes and experiments. At any point you can download your annotated data, trained models, or a full session restore file for reuse and publication.

Mycol pipeline overview


STEP 1  ·  UPLOAD MODELS AND DATA

Upload Your Data

This is where your analysis begins.

Upload the key files Mycol will use in later steps:

  • Images (required) - the microscopy or sample images you want to analyze.
  • Masks (optional) - segmentation masks that outline cells or regions of interest.
  • Cellpose model (optional) - a trained model for automatic cell segmentation. Learn about Cellpose →
  • DenseNet model (optional) - a classification model for labeling segmented cells. Learn about DenseNet →

Once uploaded, a summary table shows which images have masks linked, how many cells are highlighted in each image, and any models you've provided.

Upload models, images, masks, or saved sessions - just drag and drop.

Upload demo

STEP 2  ·  ANNOTATE IMAGES

Segment and Classify Your Cells

The central workspace where annotated datasets are produced.

Here you can:

  • View images overlaid with their associated cell masks.
  • Generate new masks automatically with Cellpose or SAM2.
  • Manually edit or correct masks - add, remove, or adjust individual cells.
  • Classify cells using an uploaded DenseNet model for automated classification, or by clicking directly on cells in the image for manual labeling.

Once ready, download your dataset (including images, masks and tabulated cell counts) or move on to phenotypic comparison or training new models.

Navigate images overlaid with their masks and change display options on the fly.

Annotation demo 1

Add and remove masks and assign classes directly on interactive images.

Annotation demo 2

Generate accurate cell masks using Cellpose and SAM2 models.

Annotation demo 3

STEP 3  ·  TRAIN MODELS

Train Your Own Analysis Models

Use the datasets you've created to fine-tune your own models.

Choose from:

  • Cellpose segmentation model - improve or customize how cells are automatically detected and outlined.
  • DenseNet classification model - fine-tune how cells are categorized based on their features.

Sensible default parameters are provided, but you can also run hyperparameter optimization to explore how different settings affect model performance.

After training, performance plots show training progress, accuracy, loss, and validation metrics. Trained models can be used immediately in the annotation page or downloaded for reuse.

Fine-tune Cellpose models to your dataset with a single click.

Training demo 1

Monitor training progress in real time.

Training demo 2

Assess fine-tuning results through automatically generated diagnostic plots.

Training demo 3

STEP 4  ·  COMPARE PHENOTYPES

Get to Know Your Data

Explore and summarize the quantitative results of your analyses.

Create and download plots of cell population statistics - such as cell area, perimeter, and other morphological features - grouped by cell class.

Select which classes and characteristics to include, and Mycol generates plots that help you:

  • Compare cell features across classes or conditions.
  • Identify trends in cell populations across multiple images or experiments.
  • Quantify variability and relationships among measured features.

Downloadable results include cell counts per class, descriptive statistics, and publication-ready plots.

Visualize and compare the morphologies of identified cell populations through interactive graphs.

Analysis demo

DOWNLOADS

Export Your Results

The Downloads page lets you package and export everything produced during your session.

Choose exactly what to include before preparing the zip:

  • Images & Masks - export your images with colored mask overlays, optional per-image class count labels, intensity-normalized images, and cropped cell patch images for every individual segmented cell.
  • Tables - CSV files with per-image cell counts and full cell metrics (area, circularity, elongation, and more) for every cell.
  • Trained Models - fine-tuned Cellpose or DenseNet weights together with the training dataset, loss curves, and evaluation metrics.
  • Session Restore - save a zip you can re-upload to pick up exactly where you left off in a future session.

Click Prepare Download to build the zip, then Download Files to save it locally.

Export options summary


Features

Annotation & QC

  • Upload images and optional masks
  • Manual mask drawing and editing
  • SAM2-guided segmentation
  • Automated Cellpose segmentation (single or batch mode)
  • Interactive classification (manual or DenseNet-based)

Model Fine-Tuning

  • Train Cellpose (segmentation) and DenseNet (classification) models directly in the app
  • Default training settings for general use
  • Diagnostic outputs:
    • Loss curves
    • IoU scores
    • True vs. predicted counts
    • Accuracy, precision, F1, confusion matrix
  • Download trained models and training summaries

Cell Metrics & Phenotyping

  • Automatic computation of cell descriptors (size, shape, elongation, compactness, etc.)
  • Visual comparison of phenotypic classes
  • Export plots and tabulated descriptors
  • Built-in explanations for descriptor interpretation

Lightweight & Accessible

  • Runs locally on standard hardware
  • Minimal dependencies
  • Designed for small-scale workflows

Installation

Note

This project uses uv as its package manager. It is a drop-in replacement for pip and conda that handles the virtual environment and dependencies for you. To install it, run pip install uv or follow the official instructions.

1. Clone the repository

git clone https://github.com/biosustain/mycol.git

2. Navigate into the repository in your terminal

cd mycol

3. Install dependencies

This automatically creates a virtual environment and installs everything the app needs.

uv sync

Run the App Locally

From inside the repository, run:

uv run streamlit run app.py

uv run executes the command inside the project's virtual environment. Alternatively, you can activate the environment first (source .venv/bin/activate on macOS/Linux or .venv\Scripts\activate on Windows) and then run streamlit run app.py.


Example Use Cases

  • Rapid cell counting
  • Creating curated datasets of annotated images
  • Automating image annotation (with human QC)
  • Morphology-based phenotypic comparison

Each example below was segmented in Mycol and exported with its mask overlay. Where the study defines classes, cells are coloured by class; where it does not, masks take the unlabelled colour.

Colony (CFU) counting

Colonies on an agar plate, segmented into 734 individual masks. No classes are defined for this study, so the masks are drawn in the unlabelled colour.

Agar plate with segmented colony masks

Spore germination

Segmented cells classified as Germinated (red) or Ungerminated (blue). This frame carries 27 and 35 of each.

Spore germination example, cells coloured by germination class

Larval morphology

Larvae segmented and classified as normal (blue) or abnormal (red), so shape descriptors can be compared between the two groups.

Larval morphology example, larvae coloured by normal or abnormal class

License

MIT

About

An app facilitating intuitive access to computer vision models for biological data analysis.

Resources

Stars

3 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages