Retraining the cellfinder classification network#
The aim of this tutorial is to get up and running retraining cellfinder using a very small training dataset. When it comes to using cellfinder with your own data, it is very important to retrain the network properly. You also may want to use the command line tool instead of using napari. For more information, please see the full cellfinder re-training documentation.
Before running this tutorial, please run the cell detection tutorial first.
You will need
napari installed on your computer - please follow
napari’s installation instructions to do so
(including their recommendation to use a
Open the curation widget by selecting
Plugins > cellfinder-napari > Curationin the napari menu bar near the top left of the window.
Load some sample data
File > Open sample > Sample data (cellfinder-napari). This will open the same small two-channel 3D image from the detection tutorial.
Files > Open File(s)and select the
cells.xmlfrom the detection tutorial. If napari prompts you to choose a plugin, choose
Add training data layers
The curation widget appears on the right-hand side of the window alongside the raw data with detected cells overlaid
Cellslayer and then choose the
Select Pointstool by clicking the arrow in the layer controls widget, or pressing the
3key on your keyboard.
Select some cells in the image by drawing a box and click
Mark as cell(s)
Select some different cells in the image and click
Mark as non cell(s)
Save training data
Create and then select a new directory on your computer (e.g.
cellfinder-retraining) and click
Close the curation widget by clicking the
xat the top left of the widget.
Open the retraining widget by selecting
Plugins > cellfinder-napari > Train networkin the napari menu bar near the top left of the window.
Select the data for retraining by clicking
Select filesnext to
YAML filesand choose the
training.ymlfile is inside the
cellfinder-retrainingdirectory created earlier
Choose a directory to save the training output, e.g., create a
The training widget appears on the right-hand side of the window.
The training will then run, watch the terminal for updates. Once complete, there will be trained models (files ending in
.h5) in the
trained_networkdirectory that can be used for cell detection.
For more information about how to use the curation and training plugins, please see the full using cellfinder in napari guide.