Skip to content

RetinaNet model augmented #17

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 44 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
44 commits
Select commit Hold shift + click to select a range
d6313ef
script for retina is done, constant file done and first run with wand…
MurielleMardenli200 Oct 11, 2024
29fefd8
wandb configuration changed, model parameters changed for training ba…
MurielleMardenli200 Oct 28, 2024
a47b993
debugging for evaluate method
MurielleMardenli200 Nov 2, 2024
1777020
sem train set duplicate removed
MurielleMardenli200 Nov 2, 2024
aa842cd
README update for RetinaNet script command
MurielleMardenli200 Nov 4, 2024
986e995
clean up for preprocessing and paths changed to absolute path
MurielleMardenli200 Nov 4, 2024
ccdba1f
git ignore changed
MurielleMardenli200 Nov 4, 2024
3b1ae44
prediction on test not working, added other log metrics for train and…
MurielleMardenli200 Nov 5, 2024
abde23f
preprocessing modified for coco due to split error, prediction of tes…
MurielleMardenli200 Nov 6, 2024
fdfb486
sem split json added
MurielleMardenli200 Nov 6, 2024
807b65b
model prediction on test set now working properly with bounding box v…
MurielleMardenli200 Nov 7, 2024
fe4fd4f
myelin and axon separation turned to 1 class, visualizations for test…
MurielleMardenli200 Nov 11, 2024
f816a46
added global conf threshold, changed max detections per image
MurielleMardenli200 Nov 17, 2024
820c6c7
hyperparameter sweep added, mAP visualizations added
MurielleMardenli200 Nov 19, 2024
bfd45bb
precision improved
MurielleMardenli200 Nov 21, 2024
3b17e8a
tweaking of hyperparameters, improved precision performance due to fo…
MurielleMardenli200 Nov 21, 2024
95045f7
preprocessing modification for category id change
MurielleMardenli200 Nov 25, 2024
22deddf
tem dataset used for training unsucessfully, preprocessing modified t…
MurielleMardenli200 Dec 20, 2024
1966461
preprocessing sem/tem modified
MurielleMardenli200 Jan 3, 2025
e80cac0
tem, sem separation and renaming, changes for visualization
MurielleMardenli200 Jan 16, 2025
0dc59e8
smaller iteration number for quick test
MurielleMardenli200 Jan 16, 2025
c32f3d6
iterations increased to 240
MurielleMardenli200 Jan 16, 2025
87a0e09
sem val prediction logged on wandb, modification of test prediction
MurielleMardenli200 Jan 16, 2025
1ef9bb0
numpy
MurielleMardenli200 Jan 16, 2025
bccc7d5
iterations changed
MurielleMardenli200 Jan 16, 2025
e60f109
offline to online wandb
MurielleMardenli200 Jan 16, 2025
caa8dab
gradient for predictions and iterations changed
MurielleMardenli200 Jan 16, 2025
aaf76bb
visualize prediction method wrong parameter
MurielleMardenli200 Jan 16, 2025
db681da
iteration increased
MurielleMardenli200 Jan 16, 2025
de0ba33
added confidence scores to boxes
MurielleMardenli200 Jan 16, 2025
f123965
confidence threshold lowered
MurielleMardenli200 Jan 17, 2025
cd92e69
lr decay removed
MurielleMardenli200 Jan 17, 2025
200fe5f
legend added to viz
MurielleMardenli200 Jan 17, 2025
da97d65
anchor boxes changed for sem
MurielleMardenli200 Jan 17, 2025
d12c25e
iterations # fixed
MurielleMardenli200 Jan 17, 2025
7d0bd7e
aspect ratios
MurielleMardenli200 Jan 17, 2025
27844de
sem to tem
MurielleMardenli200 Jan 17, 2025
ca16b2c
preprocessing tem
MurielleMardenli200 Jan 17, 2025
09ca825
test image removed
MurielleMardenli200 Jan 17, 2025
a3b8b1b
print added img path
MurielleMardenli200 Jan 17, 2025
efb0dbf
load bids
MurielleMardenli200 Jan 17, 2025
9780896
correction bids
MurielleMardenli200 Jan 17, 2025
4ffb4e9
utils load images
MurielleMardenli200 Jan 17, 2025
14166af
sem to tem
MurielleMardenli200 Jan 23, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file added .DS_Store
Binary file not shown.
13 changes: 13 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,19 @@ src/data-coco/*
src/data-yolo/*
src/data_axondeepseg_sem/*
src/runs
src/output

src/train_figures
src/output_predictions

src/retinaNet/wandb/*
src/retinaNet/output
src/retinaNet/constants/__pycache__
src/retinaNet/__pycache__

src/__pycache__
src/constants/__pycache__
src/.DS_Store

detectron2/*
venv/*
11 changes: 9 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,15 @@

This project focuses on preprocessing and segmenting axons and myelin from microscopy images stored in the BIDS format. It leverages OpenCV for image manipulation and is designed to work with object detection models like YOLO or RetinaNet.

## Features

## Overview
### General:
* Loads BIDS-formatted microscopy images.
* Automatically adjusts pixel values based on metadata.
* Resizes and pads images to fit object detection model input sizes.
* Addinded
* Includes a `utils.py` file with helper functions for easy preprocessing.


## Getting Started

### Prerequisites
Expand All @@ -35,6 +36,12 @@ This project focuses on preprocessing and segmenting axons and myelin from micro

### Running scripts
```bash
### Old yolo model:
cd src
python preprocessing.py
python yolo_train.py

### Specific script for RetinaNet model:
```bash
cd src
python -m retinaNet.retinaNet_train
522 changes: 252 additions & 270 deletions notebooks/retinanet_train.ipynb

Large diffs are not rendered by default.

3 changes: 2 additions & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,5 @@ pandas
scikit-image
ultralytics
tqdm
scikit-learn
scikit-learn
wandb
7 changes: 6 additions & 1 deletion src/constants/data_constants.py
Original file line number Diff line number Diff line change
@@ -1 +1,6 @@
SEM_DATASET_URL = "https://github.com/axondeepseg/data_axondeepseg_sem"
SEM_DATASET_URL = "https://github.com/axondeepseg/data_axondeepseg_sem"

SEM_DATA_NAME = "data_axondeepseg_sem"
TEM_DATA_NAME = "data_axondeepseg_tem"
SEM = "sem"
TEM = "tem"
1 change: 1 addition & 0 deletions src/data_axondeepseg_sem
Submodule data_axondeepseg_sem added at d7884f
14 changes: 14 additions & 0 deletions src/data_sem_split.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
{
"train": [
"sub-rat3_sample-data10.png",
"sub-rat3_sample-data11.png",
"sub-rat2_sample-data5.png",
"sub-rat8_sample-V915.png",
"sub-rat5_sample-data14.png",
"sub-rat4_sample-data12.png",
"sub-rat6_sample-data15.png",
"sub-rat7_sample-Maxo03img60.png"
],
"val": ["sub-rat3_sample-data9.png"],
"test": ["sub-rat1_sample-data1.png"]
}
166 changes: 166 additions & 0 deletions src/data_tem_split.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,166 @@
{
"train": [
"sub-nyuMouse26_sample-0007.png",
"sub-nyuMouse11_sample-0005.png",
"sub-nyuMouse12_sample-0005.png",
"sub-nyuMouse15_sample-0005.png",
"sub-nyuMouse34_sample-0008.png",
"sub-nyuMouse35_sample-0009.png",
"sub-nyuMouse36_sample-0004.png",
"sub-nyuMouse12_sample-0010.png",
"sub-nyuMouse09_sample-0008.png",
"sub-nyuMouse36_sample-0005.png",
"sub-nyuMouse30_sample-0001.png",
"sub-nyuMouse12_sample-0003.png",
"sub-nyuMouse31_sample-0001.png",
"sub-nyuMouse27_sample-0004.png",
"sub-nyuMouse33_sample-0009.png",
"sub-nyuMouse07_sample-0008.png",
"sub-nyuMouse11_sample-0004.png",
"sub-nyuMouse29_sample-0001.png",
"sub-nyuMouse14_sample-0005.png",
"sub-nyuMouse28_sample-0004.png",
"sub-nyuMouse12_sample-0002.png",
"sub-nyuMouse33_sample-0005.png",
"sub-nyuMouse33_sample-0004.png",
"sub-nyuMouse26_sample-0003.png",
"sub-nyuMouse28_sample-0008.png",
"sub-nyuMouse09_sample-0003.png",
"sub-nyuMouse11_sample-0008.png",
"sub-nyuMouse35_sample-0002.png",
"sub-nyuMouse12_sample-0004.png",
"sub-nyuMouse29_sample-0005.png",
"sub-nyuMouse27_sample-0002.png",
"sub-nyuMouse13_sample-0003.png",
"sub-nyuMouse32_sample-0002.png",
"sub-nyuMouse14_sample-0001.png",
"sub-nyuMouse14_sample-0002.png",
"sub-nyuMouse12_sample-0011.png",
"sub-nyuMouse32_sample-0006.png",
"sub-nyuMouse25_sample-0004.png",
"sub-nyuMouse30_sample-0005.png",
"sub-nyuMouse36_sample-0008.png",
"sub-nyuMouse14_sample-0003.png",
"sub-nyuMouse26_sample-0001.png",
"sub-nyuMouse13_sample-0002.png",
"sub-nyuMouse09_sample-0001.png",
"sub-nyuMouse31_sample-0002.png",
"sub-nyuMouse13_sample-0006.png",
"sub-nyuMouse15_sample-0002.png",
"sub-nyuMouse30_sample-0004.png",
"sub-nyuMouse10_sample-0001.png",
"sub-nyuMouse33_sample-0006.png",
"sub-nyuMouse25_sample-0001.png",
"sub-nyuMouse25_sample-0005.png",
"sub-nyuMouse35_sample-0005.png",
"sub-nyuMouse29_sample-0004.png",
"sub-nyuMouse30_sample-0003.png",
"sub-nyuMouse34_sample-0005.png",
"sub-nyuMouse27_sample-0005.png",
"sub-nyuMouse14_sample-0004.png",
"sub-nyuMouse13_sample-0007.png",
"sub-nyuMouse29_sample-0002.png",
"sub-nyuMouse28_sample-0001.png",
"sub-nyuMouse13_sample-0004.png",
"sub-nyuMouse36_sample-0001.png",
"sub-nyuMouse29_sample-0009.png",
"sub-nyuMouse25_sample-0008.png",
"sub-nyuMouse32_sample-0009.png",
"sub-nyuMouse10_sample-0003.png",
"sub-nyuMouse33_sample-0002.png",
"sub-nyuMouse27_sample-0008.png",
"sub-nyuMouse36_sample-0003.png",
"sub-nyuMouse15_sample-0007.png",
"sub-nyuMouse13_sample-0008.png",
"sub-nyuMouse34_sample-0004.png",
"sub-nyuMouse15_sample-0006.png",
"sub-nyuMouse15_sample-0008.png",
"sub-nyuMouse26_sample-0004.png",
"sub-nyuMouse09_sample-0006.png",
"sub-nyuMouse33_sample-0003.png",
"sub-nyuMouse30_sample-0002.png",
"sub-nyuMouse33_sample-0001.png",
"sub-nyuMouse27_sample-0006.png",
"sub-nyuMouse27_sample-0007.png",
"sub-nyuMouse07_sample-0007.png",
"sub-nyuMouse32_sample-0005.png",
"sub-nyuMouse25_sample-0006.png",
"sub-nyuMouse32_sample-0007.png",
"sub-nyuMouse32_sample-0004.png",
"sub-nyuMouse28_sample-0009.png",
"sub-nyuMouse35_sample-0007.png",
"sub-nyuMouse10_sample-0006.png",
"sub-nyuMouse07_sample-0001.png",
"sub-nyuMouse09_sample-0004.png",
"sub-nyuMouse34_sample-0009.png",
"sub-nyuMouse32_sample-0003.png",
"sub-nyuMouse09_sample-0005.png",
"sub-nyuMouse10_sample-0007.png",
"sub-nyuMouse32_sample-0001.png",
"sub-nyuMouse31_sample-0006.png",
"sub-nyuMouse34_sample-0001.png",
"sub-nyuMouse13_sample-0005.png",
"sub-nyuMouse28_sample-0002.png",
"sub-nyuMouse11_sample-0006.png",
"sub-nyuMouse26_sample-0005.png",
"sub-nyuMouse12_sample-0009.png",
"sub-nyuMouse14_sample-0008.png",
"sub-nyuMouse30_sample-0009.png",
"sub-nyuMouse28_sample-0006.png",
"sub-nyuMouse36_sample-0007.png",
"sub-nyuMouse35_sample-0001.png",
"sub-nyuMouse26_sample-0008.png",
"sub-nyuMouse27_sample-0003.png",
"sub-nyuMouse10_sample-0002.png",
"sub-nyuMouse36_sample-0006.png",
"sub-nyuMouse26_sample-0006.png",
"sub-nyuMouse30_sample-0008.png",
"sub-nyuMouse15_sample-0004.png",
"sub-nyuMouse07_sample-0005.png",
"sub-nyuMouse31_sample-0003.png",
"sub-nyuMouse34_sample-0003.png",
"sub-nyuMouse14_sample-0006.png",
"sub-nyuMouse30_sample-0006.png",
"sub-nyuMouse35_sample-0006.png",
"sub-nyuMouse31_sample-0009.png",
"sub-nyuMouse10_sample-0005.png",
"sub-nyuMouse33_sample-0008.png",
"sub-nyuMouse10_sample-0008.png"
],
"val": [
"sub-nyuMouse29_sample-0007.png",
"sub-nyuMouse27_sample-0001.png",
"sub-nyuMouse09_sample-0002.png",
"sub-nyuMouse14_sample-0007.png",
"sub-nyuMouse11_sample-0001.png",
"sub-nyuMouse28_sample-0003.png",
"sub-nyuMouse26_sample-0002.png",
"sub-nyuMouse31_sample-0004.png",
"sub-nyuMouse11_sample-0002.png",
"sub-nyuMouse11_sample-0007.png",
"sub-nyuMouse29_sample-0006.png",
"sub-nyuMouse07_sample-0006.png",
"sub-nyuMouse34_sample-0002.png",
"sub-nyuMouse13_sample-0001.png",
"sub-nyuMouse09_sample-0007.png",
"sub-nyuMouse07_sample-0002.png"
],
"test": [
"sub-nyuMouse15_sample-0003.png",
"sub-nyuMouse31_sample-0005.png",
"sub-nyuMouse35_sample-0003.png",
"sub-nyuMouse28_sample-0005.png",
"sub-nyuMouse11_sample-0003.png",
"sub-nyuMouse10_sample-0004.png",
"sub-nyuMouse25_sample-0003.png",
"sub-nyuMouse29_sample-0003.png",
"sub-nyuMouse15_sample-0001.png",
"sub-nyuMouse07_sample-0004.png",
"sub-nyuMouse12_sample-0008.png",
"sub-nyuMouse36_sample-0002.png",
"sub-nyuMouse35_sample-0004.png",
"sub-nyuMouse07_sample-0003.png",
"sub-nyuMouse31_sample-0007.png",
"sub-nyuMouse34_sample-0006.png"
]
}
1 change: 1 addition & 0 deletions src/detectron2
Submodule detectron2 added at 1a7dae
Loading