File size: 3,233 Bytes
c75299e
 
3a6cfb3
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
c75299e
3a6cfb3
f70b149
3a6cfb3
 
 
 
 
 
 
f70b149
3a6cfb3
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
---

license: apache-2.0
tags:
  - brain-mri
  - classification
  - medical-imaging
  - deep-learning
  - cnn
model-index:
  - name: Brain MRI Classification - FLAIR Abnormality Classification
    results:
      - task:
          type: image-classification
          name: Image Classification
        dataset:
          name: LGG Segmentation Dataset
          type: medical-imaging
          link: https://www.kaggle.com/datasets/mateuszbuda/lgg-mri-segmentation
        metrics:
          - type: accuracy
            value: 0.958
            name: Accuracy
---


# Brain MRI Classification - FLAIR Abnormality Classification v1.2.0

This repository hosts the trained model for **FLAIR Abnormality Classification** in Brain MRI scans. The model is a CNN-based architecture designed to classify Brain MRI images as normal or abnormal (FLAIR abnormality).

## Model Details

- **Architecture:** A CNN model that classifies whether a given Brain MRI image has abnormality.
- **Dataset:** [LGG Segmentation Dataset](https://www.kaggle.com/datasets/mateuszbuda/lgg-mri-segmentation)
- **Version:** v1.2.0
- **Task:** Image Classification
- **License:** Apache 2.0

## Usage

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

```bash

# Clones the repository and installs dependencies

!git clone https://huggingface.co/preethamganesh/bms-flair-abnormality-classification-v1.2.0

!pip install tensorflow



# Imports TensorFlow

import tensorflow as tf



# Loads the pre-trained model from the cloned directory

model_path = "bms-flair-abnormality-classification-v1.2.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 classification logits in the key 'output_0'

output = model(input_data)["output_0"]



# Prints the predicted class (e.g., 0 for normal, 1 for abnormal)

predicted_class = tf.argmax(output, axis=-1).numpy()

print("Predicted class: ", predicted_class)

```

## Training Details

### Compute

- The model was trained on a GeForce 4070Ti GPU with 16GB VRAM.
- Training completed in approximately 1.8 minutes over 20 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.

### Performance on test set

- **Accuracy:** 0.958

## Citation

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

```bash

@misc{preethamganesh2024brainmri,

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

  author={Preetham Ganesh},

  year={2025},

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

  note={Apache-2.0 License}

}

```

## Contact

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