Metadata-Version: 2.4
Name: dinocell
Version: 0.74
Summary: Generalized Live Cell Segmentation with DINOv2 Pretraining
Home-page: https://github.com/kadenstillwagon/DINOCell
Author: Kaden Stillwagon
Author-email: kstillwagon26@gatech.edu
Classifier: Development Status :: 4 - Beta
Classifier: Intended Audience :: Science/Research
Classifier: License :: OSI Approved :: MIT License
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python :: 3.11
Classifier: Topic :: Scientific/Engineering :: Bio-Informatics
Classifier: Topic :: Scientific/Engineering :: Image Processing
Classifier: Topic :: Scientific/Engineering :: Artificial Intelligence
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: annotated-doc==0.0.4
Requires-Dist: anyio==4.12.1
Requires-Dist: appnope==0.1.4
Requires-Dist: asttokens==3.0.1
Requires-Dist: cellpose==4.0.9
Requires-Dist: certifi==2026.2.25
Requires-Dist: click==8.3.1
Requires-Dist: comm==0.2.3
Requires-Dist: contourpy==1.3.3
Requires-Dist: cycler==0.12.1
Requires-Dist: debugpy==1.8.20
Requires-Dist: decorator==5.2.1
Requires-Dist: executing==2.2.1
Requires-Dist: fastremap==1.17.7
Requires-Dist: filelock==3.25.2
Requires-Dist: fill_voids==2.1.1
Requires-Dist: fonttools==4.62.1
Requires-Dist: fsspec==2026.2.0
Requires-Dist: h11==0.16.0
Requires-Dist: hf-xet==1.4.2
Requires-Dist: httpcore==1.0.9
Requires-Dist: httpx==0.28.1
Requires-Dist: huggingface_hub==1.7.1
Requires-Dist: idna==3.11
Requires-Dist: imagecodecs==2026.3.6
Requires-Dist: ImageIO==2.37.3
Requires-Dist: ipykernel==7.2.0
Requires-Dist: ipython==9.11.0
Requires-Dist: ipython_pygments_lexers==1.1.1
Requires-Dist: jedi==0.19.2
Requires-Dist: Jinja2==3.1.6
Requires-Dist: jupyter_client==8.8.0
Requires-Dist: jupyter_core==5.9.1
Requires-Dist: kiwisolver==1.5.0
Requires-Dist: lazy-loader==0.5
Requires-Dist: markdown-it-py==4.0.0
Requires-Dist: MarkupSafe==3.0.3
Requires-Dist: matplotlib==3.10.8
Requires-Dist: matplotlib-inline==0.2.1
Requires-Dist: mdurl==0.1.2
Requires-Dist: mpmath==1.3.0
Requires-Dist: natsort==8.4.0
Requires-Dist: nest-asyncio==1.6.0
Requires-Dist: networkx==3.6.1
Requires-Dist: numpy==2.4.3
Requires-Dist: opencv-python==4.13.0.92
Requires-Dist: opencv-python-headless==4.13.0.92
Requires-Dist: packaging==26.0
Requires-Dist: parso==0.8.6
Requires-Dist: pexpect==4.9.0
Requires-Dist: pillow==12.1.1
Requires-Dist: platformdirs==4.9.4
Requires-Dist: prompt_toolkit==3.0.52
Requires-Dist: psutil==7.2.2
Requires-Dist: ptyprocess==0.7.0
Requires-Dist: pure_eval==0.2.3
Requires-Dist: Pygments==2.19.2
Requires-Dist: pyparsing==3.3.2
Requires-Dist: python-dateutil==2.9.0.post0
Requires-Dist: PyYAML==6.0.3
Requires-Dist: pyzmq==27.1.0
Requires-Dist: regex==2026.2.28
Requires-Dist: rich==14.3.3
Requires-Dist: roifile==2026.2.10
Requires-Dist: safetensors==0.7.0
Requires-Dist: scikit-image==0.26.0
Requires-Dist: scipy==1.17.1
Requires-Dist: segment-anything==1.0
Requires-Dist: setuptools==82.0.1
Requires-Dist: shellingham==1.5.4
Requires-Dist: six==1.17.0
Requires-Dist: stack-data==0.6.3
Requires-Dist: sympy==1.14.0
Requires-Dist: tifffile==2026.3.3
Requires-Dist: tokenizers==0.22.2
Requires-Dist: torch==2.10.0
Requires-Dist: torchvision==0.25.0
Requires-Dist: tornado==6.5.5
Requires-Dist: tqdm==4.67.3
Requires-Dist: traitlets==5.14.3
Requires-Dist: transformers==5.3.0
Requires-Dist: typer==0.24.1
Requires-Dist: typing_extensions==4.15.0
Requires-Dist: wcwidth==0.6.0
Dynamic: author
Dynamic: author-email
Dynamic: classifier
Dynamic: description
Dynamic: description-content-type
Dynamic: home-page
Dynamic: license-file
Dynamic: requires-dist
Dynamic: summary

# DINOCell: Self-supervised Pretraining of Cell Segmentation Models

[![Python 3.8+](https://img.shields.io/badge/python-3+-blue.svg)](https://www.python.org/downloads/)
[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)
[![Paper](https://img.shields.io/badge/Paper-Arxiv-red.svg)](https://arxiv.org/abs/2604.10609)

DINOCell is an automated cell segmentation model for live cell microscopy images. Through initialization with DINOv2 weights, pretrained on 1.2B images, and domain-adaptation on 130k unlabeled cell images, DINOCell achieves unparalleled performance across a wide variety of cell types and microscope conditions.

![PBL HEK Segmentation](https://github.com/kadenstillwagon/DINOCell/blob/main/assets/PBL_HEK_example_out.png)

## Key Features

- **State-of-the-art Performance**: Outperforms existing methods like Cellpose-SAM and SAMCell on both test-set and zero-shot cross-dataset evaluation
- **Zero-shot Generalization**: Works on novel cell types and microscopes not seen during training
- **Vision Transformer Architecture**: Leverages DINOv2's ViT-based encoder pretrained on 1.2B images for robust image representations, which are further tuned for microscopy through domain-adaptation on 130k unlabeled cell images.
- **Flows Regression**: Predicts Cellpose-style Flows instead of binary masks, enabling better separation of densely packed cells

## Performance

DINOCell demonstrates superior performance in both test-set and zero-shot cross-dataset evaluation:

### LIVECell Test-Set Performance

| Method | SEG | DET | MMA |
|--------|-----|-----|------|
|**DINOCell** | **0.784** | **0.926** | **0.876** |
| Cellpose-SAM | 0.710 | 0.852 | 0.807 |
| SAMCell-LIVECell | 0.744 | 0.911 | 0.834 |

### Zero-Shot Cross-Dataset Performance

| Dataset | Method | SEG | DET | MMA |
|---------|--------|-----|-----|--------|
| PBL-HEK | **DINOCell** | **0.553** | **0.818** | **0.734** |
| | Cellpose-SAM | 0.452 | 0.627 | 0.617 |
| | SAMCell-cyto | 0.458 | 0.765 | 0.628 |
| | SAMCell-LIVECell | 0.365 | 0.660 | 0.519 |
| PBL-N2A | **DINOCell** | **0.859** | **0.947** | **0.923** |
| | Cellpose-SAM | 0.778 | 0.899 | 0.801 |
| | SAMCell-cyto | 0.822 | 0.932 | 0.849 |
| | SAMCell-LIVECell | 0.610 | 0.699 | 0.668 |
| Glioma-C6 | **DINOCell** | **0.697** | **0.684** | **0.737** |
| | Cellpose-SAM | 0.315 | 0.387 | 0.360 |
| | SAMCell-cyto | 0.475 | 0.576 | 0.513 |
| | SAMCell-LIVECell | 0.000 | 0.000 | 0.000 |


## Quick Start

### Installation

```bash
# Install from PyPI (recommended)
pip install dinocell

# Or install from source
git clone https://github.com/kadenstillwagon/DINOCell.git
cd DINOCell
pip install -e .
```

### Basic Usage

```python
import matplotlib.pyplot as plt
from dinocell import segment

#Set Image Path
img_path = 'demo_images/LiveCell_test_image.png'

#Get Model Output
output_segmentations = segment(img_path)

#Visualize
plt.imshow(output)
plt.show()
```

### Command Line Interface

```bash
# Segmentation
dinocell segment image.png --output results/

```

## Citation

If you use DINOCell in your research, please cite our paper:

Stillwagon K, VandeLoo AD*, Magondu B, Forest C.R. (2026) Self-supervised Pretraining of Cell Segmentation Models. https://arxiv.org/abs/2604.10609.

```bibtex
  @misc{stillwagon2026selfsupervisedpretrainingcellsegmentation,
        title={Self-supervised Pretraining of Cell Segmentation Models}, 
        author={Kaden Stillwagon and Alexandra Dunnum VandeLoo and Benjamin Magondu and Craig R. Forest},
        year={2026},
        eprint={2604.10609},
        archivePrefix={arXiv},
        primaryClass={cs.CV},
        url={https://arxiv.org/abs/2604.10609}, 
  }
```

## Support

- **Issues**: [GitHub Issues](https://github.com/kadenstillwagon/DINOCell/issues)
- **Discussions**: [GitHub Discussions](https://github.com/kadenstillwagon/DINOCell/discussions)
- **Email**: kstillwagon26@gatech.edu

## License

This project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details.

## Institutions

This work was developed at:
- **Georgia Institute of Technology**
  - School of Biological Sciences
  - School of Computer Science  
  - Department of Biomedical Engineering
  - School of Mechanical Engineering

## Acknowledgments

- Meta AI for the original DINOv2
- The open-source community for tools and datasets
- Georgia Tech for computational resources
- All contributors and users of DINOCell

---
