|
66 | 66 | using `torch.set_num_threads <https://pytorch.org/docs/stable/generated/torch.set_num_threads.html>`_ or through the environment
|
67 | 67 | variables ``OMP_NUM_THREADS`` or ``MKL_NUM_THREADS`` as described
|
68 | 68 | `here <https://pytorch.org/docs/stable/threading_environment_variables.html>`_.
|
| 69 | + |
| 70 | + |
| 71 | +**Q: How does HITL work?** |
| 72 | + |
| 73 | + In cellpose HITL training always starts from a pretrained model but incorporates more training |
| 74 | + data with each iteration. To start, only a single image is used as training data. |
| 75 | + After an iteration another image is included in the training data. Since there is more |
| 76 | + training data, the model should be more accurate on subsequent images. |
| 77 | + |
| 78 | + The goal of HITL training is to produce a model that is finetuned on your data and also generalist |
| 79 | + enough to segment new images not in the training set. One of the problems with annotating |
| 80 | + images is that it can be time-consuming to annotate your images to produce a finetuned model. |
| 81 | + Cellpose also circumvents this tedium by using the already generalist-trained model to predict |
| 82 | + your image segmentation. This prediction will be better than nothing, and it will get some |
| 83 | + segmentation masks correct. That is helpful becuase you can accept the correct masks, and add |
| 84 | + or edit the incorrect ones. Now you have a new image that can be used for training a new finetuned |
| 85 | + model. This new finetuned model can then also predict segmentation for an image in your dataset, |
| 86 | + and, since it's finetuned on your data, will do somewhat better than the 'base' cellpose model. |
| 87 | + You can repeat these steps, (predict using the latest model, annotate the predictions, train, |
| 88 | + and predict again) until you have a model that performs well enough on your data. |
| 89 | + |
| 90 | + |
| 91 | +**Q: What is a 'model'?** |
| 92 | + |
| 93 | + A model is the neural network architecture and parameters (fitted numbers) in that architecture. |
| 94 | + The CPSAM model we distribute is a 'model', and you can have another 'model' made from finetuning |
| 95 | + on your data. These models are similar becuase they have the same architecture, but distinct |
| 96 | + because they have different weights. |
| 97 | + |
| 98 | + |
| 99 | +**Q: How can I do HITL without the GUI? (I don't have GPU hardware on my machine, but I want to use |
| 100 | +colab/a cluster)** |
| 101 | + |
| 102 | + You can do the following steps: |
| 103 | + |
| 104 | + 1. Load the images onto the remote machine. |
| 105 | + |
| 106 | + 2. Use a script to segment the image using the pretrained model. |
| 107 | + |
| 108 | + 3. Download the segmented image masks and annotate it with the cellpose GUI. |
| 109 | + |
| 110 | + 4. Load the annotated masks onto the remote machine and train a model with all the images in the folder (only 1 at first) |
| 111 | + |
| 112 | + 5. Evaluate the trained model on the next image. |
| 113 | + |
| 114 | + 6. Repeat 3-5 until you have a working fine-tuned model. |
0 commit comments