# AI4Imaging-Hackathon-2024 — Data

来源：https://www.kaggle.com/competitions/ai4imaging-hackathon-2024/data

采集时间：2026-10-19T08:01:44Z

The dataset comprises 150 MRI exams from patients, divided into training and testing sets. The training set consists of 100 patients, while the testing set includes 50 patients. Each patients has MRI data for two cardiac phases: diastolic and systolic. For each phase, there is one original 3D MRI image and a corresponding segmentation mask file that delineates the region of interest (ROI). Additionally, each patient in the training set is labeled with the disease diagnosis. The dataset is accessible via a provided link and can be used with Google Colab for training purposes.
https://drive.google.com/drive/folders/1fQE2qf52oKyhx5ezoLKmClt0t4mdIMbP?usp=sharing

# Task 
Your task is to build a multi-classification deep learning or radiomics model that is able to use two-frame of cardiac MRI to predict the category of heart disease.

# Train Files
(example of subject 'p0001')
- **p0001_frame01.nii.gz** - the systolic frame of 3D MRI
- **p0001_frame01_gt.nii.gz** - the segmentation mask of the systolic frame
- **p0001_frame06.nii.gz** - the diastolic frame of 3D MRI
- **p0001_frame06_gt.nii.gz** - the segmentation mask of the diastolic frame
- **gt.txt** - the classification label, including '**NOR**', '**MINF**', '**DCM**', '**HCM**' and '**RV**'. You should encode the label into a one-hot representation by yourselves.

NOR - Normal subjects
MINF - Myocardial infarction
DCM - Dilated cardiomyopathy
HCM - Hypertrophic cardiomyopathy
RV - Abnormal right ventricle

# Test Files
(example of subject 'p0101')
- **p0101_frame01.nii.gz** - the systolic frame of 3D MRI
- **p0101_frame01_gt.nii.gz** - the segmentation mask of the systolic frame
- **p0101_frame14.nii.gz** - the diastolic frame of 3D MRI
- **p0101_frame14_gt.nii.gz** - the segmentation mask of the diastolic frame
Note: The test dataset does not include labels.

# Explanation of the segmentation ROI
The segmentation mask, e.g., p0001_frame01_gt.nii.gz, utilizes non-zero integer (i.e., 1-3) to highlight different anatomical structures of the heart. The numbers 1, 2, and 3 represent the right ventricle, left ventricle, and myocardium, respectively.

# Expected Model Input
The model should receive a batch of patient images as an input. The input tensor should be in the shape of [batch, channel, height, width, depth]. Please note that the channel number should be set to 2 due to the two-frame input setting. Also, image sizes may vary due to different acquisition settings.

# Expected Model Output
The model output should be a five-class one-hot prediction after the Softmax layer.

# Here are some tips:
- How to read the training image?

```
# Please install nibabel by: !pip install nibabel
import nibabel as nib
image_frame_1 = nib.load(image_frame_1_path).get_fdata()
image_frame_1_gt = nib.load(image_frame_1_gt_path).get_fdata()
image_frame_2 = nib.load(image_frame_2_path).get_fdata()
image_frame_2_gt = nib.load(image_frame_2_gt_path).get_fdata()

```

- How to input the ROI together with an image?
Despite there are many ways to integrate images with ROI, we recommend you multiply or concatenate the image and ROI.

```
# Multiplication
image_frame_ROI = image_frame1 * image_frame1_gt

# Concatenation
import numpy as np
print(image_frame1.shape, image_frame1_gt.shape)
image_frame_ROI = np.stack((image_frame1, image_frame1_gt))
print(image_frame_ROI.shape)

```

- Please note that the sizes of images may vary between different subjects.
ask chatGPT:smile:

- How to input two frames together?
You can put these two frames into two different channels of the input image, or you can build two separate networks and concatenate them later.

```
import numpy as np
# Concatenate images along the new first axis (channel dimension)
combined = np.concatenate((img1, img2), axis=0)

```

- Which kind of model can we use?
MONAI package is recommended. e.d., monai.networks.nets.ResNet

```
# Please install MONAI by: !pip install monai
from monai.networks.nets import ResNet
model = ResNet(...)

```

# Citation
1.  O. Bernard, A. Lalande, C. Zotti, F. Cervenansky, et al. "Deep Learning Techniques for Automatic MRI Cardiac Multi-structures Segmentation and Diagnosis: Is the Problem Solved ?" in IEEE Transactions on Medical Imaging, vol. 37, no. 11, pp. 2514-2525, Nov. 2018. doi: 10.1109/TMI.2018.2837502