Skip to content
/ DeepSpot Public

DeepSpot is a deep learning method for the enhancement of mRNA fluorescent spots in microscopy images

License

Notifications You must be signed in to change notification settings

cbib/DeepSpot

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

20 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

DeepSpot

DeepSpot is a CNN (Convolutional Neural Network) dedicated to the enhancement of fluorescent spots in microscopy images, enabling downstream mRNA spot detection using commonly used tools without need for parameter fine-tuning. DeepSpot is based on a multi-network architecture, using Atrou convolution (A) for context reasonning and a twisted ResNet architecture (B) to automatically enhance the mRNA spots in images.

DeepSpot Network Architecture

DeepSpot plugin for Napari

A Napari plugin is available here to use DeepSpot pretrained model. Napari uses a lot of memory so for large volume of images it is recommended to use the following instruction instead of the DeepSpot plugin.

Build DeepSpot from source

Installation

Clone the repository from github

git clone https://github.com/cbib/deepspot.git

Install dependencies with Conda

DeepSpot requires Python >= 3.6 and TensorFlow >= 2.2.

To use a tested environment :

conda env create deepspot.yaml

Then activate the environment:

conda activate deepspot

Usage

Code organization

DeepSpot is organized as a Python package :

  • dataset.py to generate dataset of paired images (raw images and ground truth)

  • global_var.py is the config file containing data paths and training variables (batch size, learning rate...)

  • network.py contains the architecture of the network

  • predict.py used for prediction when the network is trained

  • residual_blocks.py contains residual blocks called by the network

  • train.py to train the network

Configuration file

To launch you own training and prediction, global_var.py needs to be updated according to your needs.

The default configuration is the one giving the best results according to the HyperParameter search performed with Ray Tune. However, if needed you can change the number of epochs, batch size, image size, learning rate, dropout rate, number of filters...)

Check and update the paths to the data before training.

Training

Before training, if you have multiple GPUs, please set the cuda visible device variable to the desired GPU id, for example 0 : os.environ["CUDA_VISIBLE_DEVICES"] = "0"

Then launch the training with

python train.py

The training will output a model (the model name can be set in global_var.py)

Prediction

Be sure to have set :

  • The right path to the data to be predicted
  • The right path to the model you want to use

Then launch

python predict.py

The prediction will output the predicted images in a /prediction folder under the prediction path set in global_var.py

Use an existing model

To use our best model for prediction let the save_model_folder default value or save_model_folder = "models/Mmixed/" in global_var.py

Then launch

python predict.py

Support

If you have any question relative to the repository, please open an issue. You can also contact Emmanuel Bouilhol.

Contributiting

Contributions are very welcome. Please use Pull requests. For major changes, please open an issue first to discuss what you would like to change.

About

DeepSpot is a deep learning method for the enhancement of mRNA fluorescent spots in microscopy images

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages