CellViT is an innovative deep learning-based tool that automates the segmentation and classification of cell nuclei in digitized tissue samples. This guide aims to provide step-by-step instructions on setting up and using CellViT effectively. Let’s dive into the world of CellViT!
Key Features
- State-of-the-Art Performance in nuclei instance segmentation.
- Utilizes Vision Transformer (ViT) encoders for enhanced performance.
- Employs a U-Net architecture for efficient segmentation.
- Fast inference results with large patch sizes for Whole Slide Images (WSI).
Installation
To install CellViT, follow these steps:
- Clone the repository:
- Create a conda environment with Python 3.9.7 version:
- Activate the environment:
- Install torch (version 2.0) for your system:
- Install optional dependencies for performance optimizations:
git clone https://github.com/TIO-IKIM/CellViT.git
conda env create -f environment.yml
conda activate cellvit_env
Refer to PyTorch Installation Guide for the appropriate version.
pip install -r optional_dependencies.txt
How to Use CellViT
Once you have installed CellViT, you can start utilizing its functionalities for training and inference. Here’s how:
Project Structure
The project is organized as follows:
- cell_segmentation: For training and inference files
- datasets: Contains datasets for PyTorch
- configs: Configuration and example files
- models: Machine Learning models and encoders
Training the Model
Use the command line interface (CLI) to train the CellViT model:
python3 cell_segmentation/run_cellvit.py --config
Replace
Dataset Preparation
It is crucial to follow the customized dataset structures as described in the PanNuke documentation.
Running Inference
Run inference on cell detection using the appropriate command:
python3 cell_segmentation/inference/cell_detection.py --model --wsi_path
Visualization
You can visualize the results using tools like QuPath.
Troubleshooting
If you encounter issues during setup or usage:
- Error: cannot import name CuImage from cucim: Uninstall the previous version with
pip uninstall cupy-cuda117
and use conda to install. - Error resolving packages: Comment out problematic packages in your
environment.yml
file as stated in the documentation. - Pydantic Validation Errors: Install the specified version with
pip install pydantic==1.10.4
.
For more insights, updates, or to collaborate on AI development projects, stay connected with fxis.ai.
Conclusion
At fxis.ai, we believe that such advancements are crucial for the future of AI, as they enable more comprehensive and effective solutions. Our team is continually exploring new methodologies to push the envelope in artificial intelligence, ensuring that our clients benefit from the latest technological innovations.