Commit 7e1fccf0 authored by mweigert's avatar mweigert
parents 97f0fcf6 b2d455b2
......@@ -9,16 +9,14 @@
"# Demo: Denoising of 2D cell images\n",
"\n",
"\n",
"This notebook demonstrates how to use CARE for a simple 2D denoising task, where corresponding pairs of low and high signal-to-noise ration (SNR) images of cells are available. \n",
"The high SNR images are acquistions of Human U2OS cells taken from the [Broad Bioimage Benchmark Collection](https://data.broadinstitute.org/bbbc/BBBC006/) and the low SNR images were created by synthetically adding strong gaussian noise. \n",
"This notebook demonstrates how to use [CARE](http://csbdeep.bioimagecomputing.com/) for a simple 2D denoising task, where corresponding pairs of low and high signal-to-noise ratio (SNR) images of cells are available. \n",
"The high SNR images are acquistions of Human U2OS cells taken from the [Broad Bioimage Benchmark Collection](https://data.broadinstitute.org/bbbc/BBBC006/) and the low SNR images were created by synthetically adding strong Gaussian noise. \n",
"\n",
"![Test](imgs/img_intro.png)\n",
"![](imgs/img_intro.png)\n",
"\n",
"Each image pair should be registered, which in a real application setting is best achieved by acquiring both stacks _interleaved_, i.e. as different channels that correspond to the different exposure/laser settings. \n",
"\n",
"\n",
"Each pair should be registered, which in a real application setting is best achieved by acquiring both stacks _interleaved_, i.e. as different channels that correspond to the different exposure/laser settings. \n",
"\n",
"As in this example the image pairs were created synthetically, they are already aligned perfectly."
"Since the image pairs were synthetically created in this example, they are already aligned perfectly."
]
},
{
......@@ -51,9 +49,9 @@
"source": [
"<hr style=\"height:2px;\">\n",
"\n",
"# Download example data\n",
"# Example data\n",
"\n",
"Next we download the example data, consisting of low-SNR and high-SNR 2D images of human U2OS cells. \n",
"The example data consists of low-SNR and high-SNR 2D images of human U2OS cells. \n",
"Note that `GT` stands for [ground truth](https://en.wikipedia.org/wiki/Ground_truth) and represents high signal-to-noise ratio (SNR) stacks."
]
},
......
......@@ -31,7 +31,7 @@
"from csbdeep.utils import axes_dict, plot_some, plot_history\n",
"from csbdeep.utils.tf import limit_gpu_memory\n",
"from csbdeep.io import load_training_data\n",
"from csbdeep.models import Config, CARE\n"
"from csbdeep.models import Config, CARE"
]
},
{
......@@ -74,7 +74,7 @@
"\n",
"# Training and validation data\n",
"\n",
"Here we load the data patches generated via [1_datagen.ipynb](1_datagen.ipynb), and split them into 90% actually training data and 10% *validation data*. The later is used during model training as independent indicator of the restoration accuracy. Model performance on the training data is often better than on the validation data, in which case the model is *overfitting*. Monitoring the validation performance gives us a chance to detect that. "
"Here we load the data patches generated via [1_datagen.ipynb](1_datagen.ipynb), and split them into 90% actual training data and 10% *validation data*. The latter is used during model training as independent indicator of the restoration accuracy. Model performance on the training data is often better than on the validation data, in which case the model is *overfitting*. Monitoring the validation performance gives us a chance to detect that. "
]
},
{
......@@ -116,9 +116,7 @@
"* the loss function, and\n",
"* whether the model is probabilistic or not.\n",
"\n",
"![Test](imgs/carenet.png)\n",
"\n",
"\n",
"![](imgs/carenet.png)\n",
"\n",
"The defaults should be sensible in many cases, so a change should only be necessary if the training process fails. \n",
"\n",
......@@ -181,7 +179,7 @@
},
"outputs": [],
"source": [
"history = model.train(X,Y, validation_data=(X_val,Y_val), epochs = 200)"
"history = model.train(X,Y, validation_data=(X_val,Y_val))"
]
},
{
......
......@@ -6,9 +6,9 @@
"source": [
"<hr style=\"height:2px;\">\n",
"\n",
"# Demo: Apply trained CARE model for denoising of *Tribolium castaneum*\n",
"# Demo: Denoising of 2D cell images\n",
"\n",
"This notebook demonstrates applying a CARE model for a 3D denoising task, assuming that training was already completed via [2_training.ipynb](2_training.ipynb). \n",
"This notebook demonstrates applying a CARE model for a 2D denoising task, assuming that training was already completed via [2_training.ipynb](2_training.ipynb). \n",
"The trained model is assumed to be located in the folder `models` with the name `my_model`.\n",
"\n",
"More Documentation is available at http://csbdeep.bioimagecomputing.com/doc/."
......@@ -40,7 +40,7 @@
"\n",
"# Raw low-SNR image and associated high-SNR ground truth\n",
"\n",
"Plot the test stack pair and define its image axes, which will be needed later for CARE prediction."
"Plot the test image (with associated ground truth) and define its image axes, which will be needed later for CARE prediction."
]
},
{
......@@ -117,7 +117,7 @@
"\n",
"# Raw low/high-SNR image and denoised image via CARE network\n",
"\n",
"Plot the test stack pair and the predicted restored stack (middle)."
"Plot the test image pair and the predicted restored image (middle)."
]
},
{
......@@ -128,7 +128,7 @@
"source": [
"plt.figure(figsize=(16,10))\n",
"plot_some(np.stack([x,restored,y]),\n",
" title_list=[['low (maximum projection)','CARE (maximum projection)','GT (maximum projection)']], \n",
" title_list=[['low','CARE','GT']], \n",
" pmin=2,pmax=99.8);"
]
},
......@@ -138,7 +138,7 @@
"source": [
"## Save restored image\n",
"\n",
"Save the restored image stack as a ImageJ-compatible TIFF image, i.e. the image can be opened in ImageJ/Fiji with correct axes semantics."
"Save the restored image as a ImageJ-compatible TIFF image, i.e. the image can be opened in ImageJ/Fiji with correct axes semantics."
]
},
{
......@@ -148,7 +148,7 @@
"outputs": [],
"source": [
"Path('results').mkdir(exist_ok=True)\n",
"save_tiff_imagej_compatible('results/input.tif', restored, axes)\n",
"save_tiff_imagej_compatible('results/input.tif', x, axes)\n",
"save_tiff_imagej_compatible('results/output.tif', restored, axes)"
]
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment