File size: 3,420 Bytes
4e29c4d
b77a7a9
5f4232a
4e29c4d
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
f854fa8
4e29c4d
 
f854fa8
4e29c4d
b77a7a9
c6b851c
 
 
 
 
 
 
 
 
 
 
 
6f5184e
281c647
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
4e04c5c
237df14
 
 
4e04c5c
237df14
 
 
 
 
 
 
 
 
 
f854fa8
 
b8f7d2d
 
 
 
 
 
 
 
 
 
27ef812
b8f7d2d
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
---

license: apache-2.0
tags:
  - brain-mri
  - segmentation
  - medical-imaging
  - deep-learning
  - unet
base_model: "tf-keras/imagenet-mobilenetv2"
model-index:
  - name: Brain MRI Segmentation - FLAIR Abnormality Segmentation
    results:
      - task:
          type: image-segmentation
          name: Image Segmentation
        dataset:
          name: LGG Segmentation Dataset
          type: medical-imaging
          link: https://www.kaggle.com/datasets/mateuszbuda/lgg-mri-segmentation
        metrics:
          - type: dice
            value: 0.77
            name: Dice Coefficient
          - type: iou
            value: 0.62
            name: Intersection over Union (IoU)
---


# Brain MRI Segmentation - FLAIR Abnormality Segmentation v1.0.0

This repository hosts the trained model for **FLAIR Abnormality Segmentation** in Brain MRI scans. The model is a U-Net architecture with a MobileNetV2 encoder pretrained on ImageNet, designed to segment FLAIR abnormalities from MRI images effectively.

## Model Details

- **Architecture:** U-Net with MobileNetV2 encoder and custom decoder layers.
- **Dataset:** [LGG Segmentation Dataset](https://www.kaggle.com/datasets/mateuszbuda/lgg-mri-segmentation)
- **Version:** v1.0.0
- **Task:** Image Segmentation
- **License:** Apache 2.0

## Usage

To use this model for inference, you can load it using the `tensorflow` library.

```bash

# Clones the repository and install dependencies

!git clone https://huggingface.co/preethamganesh/bms-flair-abnormality-segmentation-v1.0.0

!pip install tensorflow



# Imports TensorFlow

import tensorflow as tf



# Loads the pre-trained model from the cloned directory

model_path = "bms-flair-abnormality-segmentation-v1.0.0"

exported_model = tf.saved_model.load(model_path)



# Retrieves the default serving function from the loaded model

model = exported_model.signatures["serving_default"]



# Prepares a dummy input tensor for inference (batch size: 1, height: 256, width: 256, channels: 3)

input_data = tf.ones((1, 256, 256, 3), dtype=tf.float32)



# Performs inference using the model. The output will be a dictionary, with the segmentation map in the key 'output_0'

output = model(input_data)["output_0"]



# Prints the shape of the output tensor for verification

print("Output shape:", output.shape)

```

## Training Details

### Compute

- The model was trained on a GeForce 4070Ti GPU with 16GB VRAM.
- Training completed in approximately 4.9 minutes over 24 epochs.

### Dataset

- The model was trained on the [LGG Segmentation Dataset](https://www.kaggle.com/datasets/mateuszbuda/lgg-mri-segmentation), which includes Brain MRI images labeled for FLAIR abnormality segmentation.
- Only images with positive FLAIR abnormalities were selected for training.

### Performance on test set

- **Dice Coefficient:** 0.77
- **Intersection over Union (IoU):** 0.62

## Citation

If you use this model in your research, please cite the repository:

```bash

@misc{preethamganesh2024brainmri,

  title={Brain MRI Segmentation - FLAIR Abnormality Segmentation},

  author={Preetham Ganesh},

  year={2025},

  url={https://huggingface.co/preethamganesh/brain-mri-flair-abnormality-segmentation-v1.0.0},

  note={Apache-2.0 License}

}

```

## Contact

For any questions or support, please contact [email protected].