Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
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
26 changes: 26 additions & 0 deletions recognition/AttUNetOASIS/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
# Attention U-Net for OASIS Brain Tissue Segmentation

## Algorithm Description
This implementation uses an Attention U-Net architecture to perform semantic segmentation of brain MRI scans from the OASIS dataset. It solves the problem of automatic tissue classifcation: that is, given a 2D image of an MRI slice, the model predicts a label for every pixel indicating whether it belongs to the background, cerebrospinal fluid (CSF), gray matter (GM), or white matter (WM). This helps avoid the need to rely traditional methods such as pixel counting and voxel-based morphometry, which are time-consuming and subject to inter-rater variability.

## How It Works
The Attention U-Net is an improved version of the traditional U-Net neural network. In line with its predecessor, Attention U-Net features an encoder-decoder architecture that uses convolution blocks to perform feature extraction, performs hierarchical downsampling and upsampling, and produces a pixelwise segmentation output, with the added benefit of attention mechanisms. In the context of the OASIS dataset, the encoder progressively downsamples the input MRI slices, extracting hierarchical features from low-level edges to high-level anatomical patterns. The decoder symmentrically upsamples these features back to the original resolution. But critically, before joining encoder features via the skip connections, attention gates are used to dynamically highlight regions with brain tissue while suppressing irrelevant background areas. This is particularly useful for brain segmentation where tissue boundaries can be subtle and structures vary in size.

The network is trained using a combined Dice and Cross-Entropy loss function, which directly optimises the segmentation quality metric while maintaining stable gradients. It also employs data augmentation via horizontal flipping to improve generalization across the anatomical variability present across patients. The AdamW optimiser is also used to dynamically adjust the learning rate with decoupled weight decay.

![Attention U‑Net architecture](https://www.researchgate.net/publication/347344899/figure/fig6/AS:971357475069952@1608601077414/The-architecture-of-Attention-U‑Net‑Attention‑gate‑selects‑features‑by‑using‑the.png)
*Figure 1: Attention U-Net architecture. Source: Hwang et al., 2020. Licensed under CC BY-NC 4.0.*

## Dependencies
Python 3.10.19 was used for this implementation. Packages used and their versions listed below:
| Packages | Version |
| :------- | :------: |
| torch+cu118 | 2.7.1 |
| pillow | 12.0.0 |

Results are highly reproducible for homogenous data, i.e. MRI scans with unique pixel values for brain regions.

## Training data
The training process involved using preprocessed slices from 3D OASIS MRI volumes, which served as training targets and were used to measure the loss from the original input.

**SID** 48915768
Loading