# AI4Imaging-Hackathon-2023 — Data

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

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

The dataset consists of 150 MRI exams from patients, split into training and testing sets. The training set includes 100 patients, and the testing set includes 50 patients. Each patient has two different phases: diastolic and systolic. Each phase includes one original 3D MRI image and one segmentation mask file, which indicates the location of RIOs. Additionally, each patient file in the training file has a label of the disease. If you plan to use Google Colab for training, you can also access the dataset via the link: https://drive.google.com/drive/folders/1Aa4xKJuDOqK_8eDlnye5LDoCgcYtiJjs?usp=drive_link


## 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. 


## Training Files
(example of subject 'p0001')
*   **p0001_frame01.nii.gz** - the systolic frame of 3D MRI
*   **p0001_frame01_gt.nii.gz** - the corresponding segmentation mask of the systolic frame
*   **p0001_frame06.nii.gz** - the diastolic frame of 3D MRI
*   **p0001_frame06_gt.nii.gz** - the corresponding 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

## Testing 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_frame014_gt.nii.gz** - the segmentation mask of the diastolic frame
*   Note: The testing dataset does not include labels


## Explanation of the segmentation ROIs
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 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？

```python
# 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 RIOs, we recommend you multiply or concatenate the image and ROIs.

```python
# Multiplication
image_frame_ROI = image_frame_1 * image_frame_1_gt

# Concatenation
import numpy as np
print(image_frame_1.shape, image_frame_1_gt.shape)
image_frame_ROI = np.stack((image_frame_1, image_frame_1_gt))
print(image_frame_ROI.shape)
```

- What if the sizes of images of different subjects are different?

ask chatGPT 🙂

- 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.

```python
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.g., monai.networks.nets.ResNet

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







## Citation

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