Skip to content

Tips, tricks and FAQs

krentzd edited this page Oct 27, 2020 · 21 revisions

This page collects all tips and tricks that we discovered by testing and troubleshooting the notebooks and networks. This is a really useful section to have a read through if you encounter any issues! Also, please feel free to let us know if you find any other tips and tricks or if you have any questions!

Tips and tricks

  • It really helps to read through the relevant paper(s) corresponding to the network that you wish to use, in order to understand what the network was designed for originally. Additionally, we also have a specific Wiki page for each provided network (see sidebar on the right) which contains useful info about the notebooks/networks, file format, and how to generate and curate appropriate training dataset.

  • You can set the Google Colab interface site in "Dark mode" (white text on black background) for improved visibility. This can be done through the Tools tab, Settings..., and then in the Site tab, set the Theme to Dark.

  • It is useful to Clear the output of all cells in the notebook before starting a new session, by using Edit/Clear all output_. This way, the cells will appear blank, which will make it easier to see which cell has been run in this session.

  • Certain file formats do not work for some of the networks. The preferred file format is ".tif" files for most of them. We have tried to clearly state what formats work for each, but if info is missing, please let us know. If you have other formats at hands that you wish to analyze with the notebooks (such as common microscopy formats, e.g. ".czi" or ".nd2"), it is possible to convert them to ".tif" format with the popular open-source Fiji package.

  • The patch sizes of Label-free prediction (fnet) are hard-coded within the network itself. Currently, the patches are 64x64x32 (x,y,z). Stacks with fewer than 32 slices will only successfully train the model when they contain 16, 8, or 4 slices and other values will throw a tensor dimension error. More than 32 slices do not cause an error.

  • If an unexpected error occurs that did not appear in previous tests of the notebook given the same conditions, it may help to set Runtime to Factory reset runtime. This will reset all previously set variables and parameters, disconnect your drive, and will allow you a 'fresh' start to the notebook.

  • For U-net, the masks within the training dataset should be in 8-bit TIF, with values being either 0 or 255.

  • Although some notebooks may run without GPU access (in the case that no GPUs are available on Colab), others will not work without access to GPU (such as Fnet). In this case, you will need to wait before using the notebook with GPU again.

  • For a single Google account, it is currently possible to run up to 2 Google Colab sessions in parallel, as long as they are different notebooks. it can be useful to speed things up!

FAQs

  • How can I report any issues? If you encounter any issues, please read through this page, the paper, and watch the explanatory videos. This may already help you solve some of the problems. If not, feel free to use the issues page of the repository to describe your issue (please give us some details about what networks, what dataset and errors did you get), and we will try and reply as soon as possible. Also, some other people might have also had the same problem and may already be discussed on that page, so have a look through the page to see if that's the case. For seeking support and discussion, you can also reach out to us on the image.sc forum.

  • Where can I find my Google Drive's content on the notebooks? The Google Drive containing the data should be first mounted. There is always a dedicated cell for that in each of the notebook (see section 1.2 on the Stardist notebook for instance). Once mounted, the dataset will be accessible on the left of the notebook page in the Files tab, gdrive/My Drive. So, run the cell (1), check that the drive is mounted properly (2) and access your data on the left using the Files tab (3).

  • Can I use the training data that you provide to train a model and then use this model to process my own data? We do not recommend that our training dataset be used on any other data than those provided. More information can be found in the Supplementary Information section of our bioRxiv paper.

  • Can U-Net be used for 3D data as the Nature Methods paper highlights? Yes, you should however use the 3D U-Net implementation instead which operates directly on 3D stacks. Alternatively, you can always split your stacks into individual slices and run it as a set of 2D images using the 2D U-Net implementation.

  • Why do my training/validation error curves look like this? The training and validation error curve shown below was obtained using CARE (2D) on the provided dataset and shows a large overfitting to the training data, highlighted by the two curves deviating significantly from epoch #50. From this point, the error on the training dataset decreases but the generalization to the validation worsens.

By decreasing the number of patches significantly, we were able to prevent overfitting to the training dataset. Here, the two error curves concomitantly improve over time. This is a sign that the training improves prediction performance on the training dataset but also on a generalised dataset from the validation pool.