Skip to content

Commit

Permalink
Update capabilities overview notebook
Browse files Browse the repository at this point in the history
  • Loading branch information
wigginno committed Jan 23, 2024
1 parent de1f4e4 commit 308cf43
Showing 1 changed file with 50 additions and 1 deletion.
51 changes: 50 additions & 1 deletion notebooks/capabilities_overview.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,9 @@
"\n",
"1. $\\gamma = 0$: Pixels with intensities greater than $ \\mu_{\\text{foreground}} $ will pass the threshold\n",
"2. $\\gamma > 0$: More strict than (1). Smaller $ \\gamma \\Longrightarrow $ fewer pixels pass the threshold\n",
"3. $\\gamma < 0$: Less strict than (1). Larger $ \\gamma \\Longrightarrow $ more pixels pass the threshold\n"
"3. $\\gamma < 0$: Less strict than (1). Larger $ \\gamma \\Longrightarrow $ more pixels pass the threshold\n",
"\n",
"**Notes**: The cell area script assumes that the brightest regions of your images are the cells. If this isn't the case, consider including a preprocessing step to make them this way."
]
},
{
Expand Down Expand Up @@ -164,6 +166,53 @@
"2. A collection of classifications, $ \\hat{y}_{p} $ thresholded at a given value (typically $p_i > 0.5$,\n",
"$$ \\hat{\\mathbf{y}} = (\\hat{y}_{k}, \\hat{y}_{k-1}, ..., \\hat{y}_0) $$"
]
},
{
"cell_type": "markdown",
"id": "58718ffc",
"metadata": {},
"source": [
"## 4. Microvessel formation\n",
"\n",
"Microvessel formation is analyzed using a two-step process: semantic binary segmentation and topological data analysis.\n",
"\n",
"### Semantic Binary Segmentation\n",
"A trained U-Net Xception-style model segments microvessels from the image background. The model outputs a probabilistic segmentation, indicating the likelihood of each pixel being part of a vessel.\n",
"\n",
"Training of the model involves:\n",
"\n",
"1. Data Preparation: Dataset of fifty high-resolution, manually annotated images, split into training, validation, and test sets.\n",
"2. Data Augmentation: Application of transformations such as rotation, cropping, flipping, brightness and contrast alteration, noise addition, gaussian blur, and elastic deformations.\n",
"3. Model Training: Conducted with a grid search to determine optimal hyperparameters. The model is trained for fifty epochs.\n",
"\n",
"Inference on a whole image involves two steps:\n",
"1. Segment individual, overlapping tiles on the image, with a similar crop size used during training.\n",
"2. Uses code from [Smoothly-Blend-Image-Patches](https://github.com/Vooban/Smoothly-Blend-Image-Patches) to blend the overlapping tiles together, producing a realistic, smooth segmentation of the whole image.\n",
"\n",
"### Topological Data Analysis\n",
"After segmentation, the microvessel network is analyzed using the Disperse algorithm to extract a graph representation, referred to as the Morse skeleton. This step involves:\n",
"\n",
"1. Preprocessing: Images are preprocessed to remove background noise and isolate the microvessel network.\n",
"2. Graph Extraction: The Disperse algorithm extracts a graph representation from the segmented images.\n",
"3. Network Simplification: Includes removing branches shorter than a threshold and smoothing branch trajectories. At this point, we can extract a color-coded visualization of the network.\n",
"4. Persistence Homology: Utilizes persistent homology to characterize the branching structure of the microvessels, resulting in a persistence barcode. The basic metrics we extract are the average branch length and number of branches."
]
},
{
"cell_type": "markdown",
"id": "1d28603f",
"metadata": {},
"source": [
"**Notes**:\n",
"- Like the cell area script, the microvessel analysis script assumes that the brightest regions of your images are the cells. If this isn't the case, consider including a preprocessing step to make them this way.\n",
"- The script requires a trained model. See notebooks/microvessels_segmentation_training. Recommended: Try using the pretrained model first. If the pretrained model does not work well, use an interactive segmentation tool to annotate 50 or so of your images and train a new model."
]
},
{
"cell_type": "markdown",
"id": "2c7aaf7d",
"metadata": {},
"source": []
}
],
"metadata": {
Expand Down

0 comments on commit 308cf43

Please sign in to comment.