A PyQt6-based interactive segmentation tool with U-Net training, prediction, and mask editing capabilities. MOSS provides an intuitive interface for training deep learning models on microscopy images through direct annotation and real-time feedback.
- Interactive Training: Paint masks on images and train U-Net models in real-time
- Multiple Architectures: UNet, UNetDeep, UNetDeepDice, 2.5D models
- Live Predictions: See model predictions as you work
- Refiner Mode: Train a refinement model that learns from your edits
- Batch Processing: Reslice, predict, and vote across multiple views
- Mask Editing Tools: Brush, eraser, fill, and component-based editing
- Multi-User Training: Collaborate with others anywhere (requires relay server)
python -m venv moss-env
source moss-env/bin/activate
pip install torch torchvision
pip install -e .python -m venv moss-env
source moss-env/bin/activate
pip install torch torchvision --index-url https://download.pytorch.org/whl/cu118
pip install -e .python -m venv moss-env
source moss-env/bin/activate # On Windows: moss-env\Scripts\activate
pip install torch torchvision --index-url https://download.pytorch.org/whl/cpu
pip install -e .# Create environment from file
conda env create -f environment.yml
# Activate environment
conda activate moss
# Install the package
pip install -e .# Install dependencies
pip install -r requirements.txt
# Install the package
pip install -e .After installation, run:
mossOr run as a Python module:
python -m segmentation_suite| Key | Action |
|---|---|
| A / Left Arrow | Previous slice |
| D / Right Arrow | Next slice |
| B | Brush tool |
| E | Eraser tool |
| H | Hand (pan) tool |
| F + Click | Fill tool |
| S | Toggle predictions |
| Space | Accept hovered prediction component |
| Shift + Space | Accept ALL predictions (replace mask) |
| Tab | Capture crop for training (refiner mode) |
| Ctrl + S | Save project |
| Ctrl + Z | Undo |
| +/- | Zoom in/out |
| Shift + Scroll | Adjust brush size |
When you create a project, the following folders are created:
project_folder/
├── project_config.json # Project settings
├── masks/ # Saved masks (mask_00000.tif, etc.)
├── train_images/ # Training image crops
├── train_masks/ # Training mask crops
├── checkpoint_*.pth # Model checkpoints (per architecture)
├── refiner_images/ # Refiner training data
├── refiner_masks_before/ # Mask state before edits
├── refiner_masks_after/ # Mask state after edits
└── refiner_checkpoint.pth # Refiner model checkpoint
- Python 3.9+
- PyQt6 6.4+
- PyTorch 2.0+
- CUDA (optional, for GPU acceleration)
- macOS MPS (optional, for Apple Silicon acceleration)
If you get errors about PyQt6, try:
pip install PyQt6 --force-reinstallFor Apple Silicon Macs, ensure you have a recent PyTorch version:
pip install --upgrade torch torchvisionReduce batch size in the training settings or use a smaller tile size.
Supported formats: TIFF (.tif, .tiff), PNG, JPEG. For best results, use single-channel grayscale TIFF images.
Nelson Medina - Creator and primary developer GitHub: @nelsmedina
If you use MOSS in your research, please cite:
Medina, N. (2025). MOSS: Microscopy Oriented Segmentation with Supervision [Computer software].
https://github.com/nelsmedina/MOSS
MIT License