Skip to content

Commit 57bdd04

Browse files
readme update
1 parent c927951 commit 57bdd04

4 files changed

Lines changed: 24 additions & 52 deletions

File tree

README.md

Lines changed: 24 additions & 52 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,16 @@
1-
# Project #19: Segmentation of sparse bacteria in human tissue
1+
<a href="https://ai4life.eurobioimaging.eu/open-calls/">
2+
<img src="https://github.com/ai4life-opencalls/.github/blob/main/AI4Life_banner_giraffe_nodes_OC.png?raw=true" width="70%">
3+
</a>
4+
</p>
25

6+
# Project #19: Segmentation of sparse bacteria in human tissue
37

48

59
## Project Overview
610

711
This repository contains the code and notebooks for preparing ground truth data for training, training a 3D Stardist model, and then use it on unseen data for **Sparse bacteria segmentation in tissue samples**.
812
The project implements deep learning approaches for automated detection and segmentation of bacterial cells in complex tissue environments using 3D microscopy data.
9-
Developed as part of the [AI4Life project](https://ai4life.eurobioimaging.eu), it uses data provided by ***.
13+
Developed as part of the [AI4Life project](https://ai4life.eurobioimaging.eu), it uses data provided by Sebastien Herbert from University of Basel in Switzerland.
1014
All images used in this tutorial are licensed under **CC-BY**. If any of the instructions are not working, please [open an issue]
1115

1216

@@ -22,9 +26,9 @@ The main goal is to develop robust AI models for:
2226
```
2327
AI4LIfe_OC_StaphInTissue/
2428
├── notebooks/
25-
│ ├── 0_dataset_split_train_test.ipynb # Dataset preparation and splitting
26-
│ ├── 0.1_Label_watershed.ipynb # Watershed-based labeling
27-
│ ├── 0.2_train_dataset_normalize_crop.ipynb # Data preprocessing
29+
│ ├── 0.1_summary_fov_per_sample_id.ipynb # Dataset preparation and splitting
30+
│ ├── 0.2_label_watershed.ipynb # Watershed-based labeling
31+
│ ├── 0.3_normalize_and_crop.ipynb # Data preprocessing
2832
│ ├── StarDist_3D_DL4MicEverywhere_Modified_AI4LifeOC.ipynb # Main StarDist 3D notebook for training and inference
2933
│ └── data_identifier.csv # Dataset metadata
3034
├── env_requirements.txt # Python dependencies
@@ -51,40 +55,26 @@ git clone https://github.com/ai4life-opencalls/****.git
5155

5256
## 📊 Workflow
5357

54-
The project follows a structured workflow for bacterial segmentation:
58+
The workflow was designed to use the available notebooks in the following order:
5559

56-
### 1. Data Preparation (`0_dataset_split_train_test.ipynb`)
57-
- Cross-reference of images with metadata
58-
- Generate summary of available data
60+
### 1. Data Preparation (`0.1_summary_fov_per_sample_id.ipynb`)
61+
- Cross-reference of images with sample ID metadata
62+
- Generates a summary of available data per sample ID, including any empty FOVs (Fields of View)
5963
- Allows for informed dataset splitting into training and testing sets by the user
6064

61-
### 2. Label Refinement (`0.1_Label_watershed.ipynb`)
62-
- Handling of touching/overlapping bacteria labeled together
65+
### 2. Label Refinement (`0.2_label_watershed.ipynb`)
66+
- Handling of touching/overlapping bacteria labeled as a single instance
6367
- Application of watershed algorithm for improved instance labeling
6468

65-
### 3. Data Preprocessing (`0.2_train_dataset_normalize_crop.ipynb`)
66-
- Image normalization and cropping
67-
- Preparation of training dataset for StarDist 3D model
68-
- Reduction of empty background regions to optimize training efficiency
69+
### 3. Data Preprocessing (`0.3_normalize_and_crop.ipynb`)
70+
- Image normalization and cropping, needed **only for the training data** due to its large size
71+
- Cropping considers regions with bacteria to balance the ratio of empty background regions and optimize training efficiency
72+
- This step is required to avoid the time consuming processing in the dataloaders during training, this step in not needed for the testing data nor inference as it is integrated in the prediction functions
6973

7074
### 4. Model Training (`StarDist_3D_DL4MicEverywhere_Modified_AI4LifeOC.ipynb`)
71-
- StarDist 3D model implementation
75+
- DL4MicEverywhere StarDist 3D model training, validation, and inference
7276
- Custom modifications for large image handling
73-
- Training and validation procedures
74-
- Model evaluation and quality control
75-
76-
## 🔬 Methodology
77-
78-
The project utilizes **StarDist 3D**, a state-of-the-art deep learning approach for:
79-
- Star-convex object detection in 3D microscopy images
80-
- Accurate segmentation of spherical bacterial cells
81-
- Instance segmentation for overlapping objects
8277

83-
### Key Features:
84-
- **3D segmentation**: Full volumetric processing of microscopy stacks
85-
- **Quality control**: Comprehensive validation metrics (IoU, precision, recall)
86-
- **Visualization**: Interactive tools for result inspection
87-
- **Scalability**: Tiled processing for large images
8878

8979
## 📈 Results
9080

@@ -93,31 +83,13 @@ The model provides:
9383
- Quality metrics and validation reports
9484
- Interactive visualization of results
9585

96-
## 🛠️ Usage
97-
98-
### Training a New Model
99-
100-
1. If multiple image sets have the same source prepare a metadata file like `data_identifier.csv`
101-
2. Run the data preparation notebooks in sequence:
102-
```
103-
notebooks/0_dataset_split_train_test.ipynb
104-
notebooks/0.1_Label_watershed.ipynb
105-
notebooks/0.2_train_dataset_normalize_crop.ipynb
106-
```
107-
3. Train the StarDist model:
108-
```
109-
notebooks/StarDist_3D_DL4MicEverywhere_Modified_AI4LifeOC.ipynb
110-
```
111-
112-
### Inference on New Data
113-
114-
Use the trained model section in the main notebook to process new images.
11586

11687
## 📚 References
11788

118-
- Schmidt, U., et al. "Cell detection with star-convex polygons." MICCAI 2018.
119-
- Weigert, M., et al. "Star-convex polyhedra for 3d object detection and segmentation in microscopy." WACV 2020.
120-
- von Chamier, L., et al. "Democratising deep learning for microscopy with ZeroCostDL4Mic." Nature Communications 2021.
89+
- Schmidt, Uwe, et al. "Cell detection with star-convex polygons." International conference on medical image computing and computer-assisted intervention. Cham: Springer International Publishing, 2018.
90+
- Weigert, Martin, et al. "Star-convex polyhedra for 3D object detection and segmentation in microscopy." Proceedings of the IEEE/CVF winter conference on applications of computer vision. 2020.
91+
- Von Chamier, Lucas, et al. "Democratising deep learning for microscopy with ZeroCostDL4Mic." Nature communications 12.1 (2021): 2276.
92+
- Hidalgo-Cenalmor, Iván, et al. "DL4MicEverywhere: deep learning for microscopy made flexible, shareable and reproducible." Nature methods 21.6 (2024): 925-927.
12193

12294
## Acknowledgements
12395
AI4Life has received funding from the European Union’s Horizon Europe research and innovation programme under grant agreement number 101057970. Views and opinions expressed are however those of the author(s) only and do not necessarily reflect those of the European Union or the European Research Council Executive Agency. Neither the European Union nor the granting authority can be held responsible for them.
File renamed without changes.
File renamed without changes.

0 commit comments

Comments
 (0)