You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/res/guides/training_wnet.rst
+30-6Lines changed: 30 additions & 6 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -15,21 +15,45 @@ the model was trained on; you can retrain from our pretrained model to your set
15
15
The model has two losses, the SoftNCut loss which clusters pixels according to brightness, and a reconstruction loss, either
16
16
Mean Square Error (MSE) or Binary Cross Entropy (BCE).
17
17
Unlike the original paper, these losses are added in a weighted sum and the backward pass is performed for the whole model at once.
18
-
The SoftNcuts is bounded between 0 and 1; the MSE may take large values.
18
+
The SoftNcuts is bounded between 0 and 1; the MSE may take large positive values.
19
19
20
-
For good performance, one should wait for the SoftNCut to reach a plateau, the reconstruction loss must also diminish but it's generally less critical.
20
+
For good performance, one should wait for the SoftNCut to reach a plateau; the reconstruction loss must also diminish but it's generally less critical.
21
21
22
+
Parameters
23
+
-------------------------------
24
+
25
+
When using the WNet training module, additional options will be provided in the Advanced tab of the training module:
26
+
27
+
- Number of classes : number of classes to segment (default 2). Additional classes will result in a more progressive segmentation according to brightness; can be useful if you have "halos" around your objects or artifacts with a significantly different brightness.
28
+
- Reconstruction loss : either MSE or BCE (default MSE). MSE is more sensitive to outliers, but can be more precise; BCE is more robust to outliers but can be less precise.
29
+
30
+
- NCuts parameters:
31
+
- Intensity sigma : standard deviation of the feature similarity term (brightness here, default 1)
32
+
- Spatial sigma : standard deviation of the spatial proximity term (default 4)
33
+
- Radius : radius of the loss computation in pixels (default 2)
34
+
35
+
.. note::
36
+
Intensity sigma depends on pixel values in the image. The default of 1 is tailored to images being mapped between 0 and 100, which is done automatically by the plugin.
37
+
.. note::
38
+
Raising the radius might improve performance in some cases, but will also greatly increase computation time.
39
+
40
+
- Weights for the sum of losses :
41
+
- NCuts weight : weight of the NCuts loss (default 0.5)
42
+
- Reconstruction weight : weight of the reconstruction loss (default 0.5*1e-2)
43
+
44
+
.. note::
45
+
The weight of the reconstruction loss should be adjusted according to its empirical value; ideally the reconstruction loss should be of the same order of magnitude as the NCuts loss after being multiplied by its weight.
22
46
23
47
Common issues troubleshooting
24
48
------------------------------
25
-
If you do not find a satisfactory answer here, please `open an issue`_ !
49
+
If you do not find a satisfactory answer here, please do not hesitate to `open an issue`_ on GitHub.
26
50
27
-
- **The NCuts loss explodes after a few epochs** : Lower the learning rate
51
+
- **The NCuts loss explodes after a few epochs** : Lower the learning rate, first by a factor of two, then ten.
28
52
29
53
- **The NCuts loss does not converge and is unstable** :
30
-
The normalization step might not be adapted to your images. Disable normalization and change intensity_sigma according to the distribution of values in your image; for reference, by default images are remapped to values between 0 and 100, and intensity_sigma=1.
54
+
The normalization step might not be adapted to your images. Disable normalization and change intensity_sigma according to the distribution of values in your image. For reference, by default images are remapped to values between 0 and 100, and intensity_sigma=1.
31
55
32
-
- **Reconstruction (decoder) performance is poor** : switch to BCE and set the scaling factor of the reconstruction loss ot 0.5, OR adjust the weight of the MSE loss to make it closer to 1.
56
+
- **Reconstruction (decoder) performance is poor** : switch to BCE and set the scaling factor of the reconstruction loss ot 0.5, OR adjust the weight of the MSE loss to make it closer to 1 in the weighted sum.
33
57
34
58
35
59
.. _WNet, A Deep Model for Fully Unsupervised Image Segmentation: https://arxiv.org/abs/1711.08506
0 commit comments