賽題名稱:腦PET疾病預測挑戰賽
賽題類型:計算機視覺、圖像分類
賽題報名鏈接?:https://challenge.xfyun.cn/topic/info?type=pet-2023&ch=vWxQGFU
賽題背景
腦PET全稱為(wei) 腦部正電子發射計算機斷層顯像(brain positron emission tomography PET),是反映腦部病變的基因、分子、代謝及功能狀態的顯像。它是利用正電子核素標記葡萄糖等人體(ti) 代謝物作為(wei) 顯像劑,通過病灶對顯像劑的攝取來反映其代謝變化,從(cong) 而為(wei) 臨(lin) 床提供疾病的生物代謝信息,為(wei) 腦癲癇病、腦腫瘤、帕金森病、阿爾茨海默綜合征等提供了有效的檢測手段。
可利用腦PET圖像檢測出輕度認知障礙病灶,並提前介入治療,從(cong) 而延緩發病,對後續患者康複治療有著積極的意義(yi) 。因此本賽題以輕度認知障礙為(wei) 例對腦PET圖像進行分析與(yu) 疾病預測。
賽事任務
為(wei) 研究基於(yu) 腦PET圖像的疾病預測,本次大賽提供了海量腦PET數據集作為(wei) 腦PET圖像檢測數據庫的訓練樣本,參賽者需根據提供的樣本構建模型,對輕度認知障礙進行分析和預測。
腦PET圖像檢測數據庫,記錄了老年人受試誌願者的腦PET影像資料,其中包括確診為(wei) 輕度認知障礙(MCI)患者的腦部影像數據和健康人(NC)的腦部影像數據。
被試者按醫學診斷分為(wei) 兩(liang) 類:
- NC:健康
- MCI:輕度認知障礙
賽題數據
本次大賽所用腦PET圖像檢測數據庫,圖像格式為(wei) nii。
評估指標
本次競賽的評價(jia) 標準采用F1_score,分數越高,效果越好。
解題思路
賽題是一個(ge) 典型的圖像分類的比賽,但需要單獨的對數據格式進行讀取,並進行數據增強。
步驟0:讀取圖片
import nibabel as nib from nibabel.viewers import OrthoSlicer3D
train_path = glob.glob('./腦PET圖像分析和疾病預測挑戰賽公開數據/Train/*/*')
test_path = glob.glob('./腦PET圖像分析和疾病預測挑戰賽公開數據/Test/*')
np.random.shuffle(train_path)
np.random.shuffle(test_path)
for path in train_path:
img = nib.load(path) print(path, img.dataobj[:, :, :, 0].shape)
步驟1:定義模型
class XunFeiNet(nn.Module): def __init__(self): super(XunFeiNet, self).__init__() model = models.resnet18(True) model.avgpool = nn.AdaptiveAvgPool2d(1) model.fc = nn.Linear(512, 9) self.resnet = model def forward(self, img): out = self.resnet(img) return out
步驟2:模型訓練
def train(train_loader, model, criterion, optimizer):
model.train()
train_loss = 0.0 for i, (input, target) in enumerate(train_loader):
input = input.cuda(non_blocking=True)
target = target.cuda(non_blocking=True)
# compute output output = model(input)
loss = criterion(output, target)
# compute gradient and do SGD step optimizer.zero_grad()
loss.backward()
optimizer.step()
if i % 20 == 0: print('Train loss', loss.item())
train_loss += loss.item() return train_loss/len(train_loader)
步驟3:模型預測
def predict(test_loader, model, criterion):
model.eval()
val_acc = 0.0
test_pred = []
with torch.no_grad():
end = time.time() for i, (input, target) in enumerate(test_loader):
input = input.cuda()
target = target.cuda()
# compute output output = model(input)
test_pred.append(output.data.cpu().numpy()) return np.vstack(test_pred)
方案開源地址:
https://github.com/datawhalechina/competition-baseline/tree/master/competition/%E7%A7%91%E5%A4%A7%E8%AE%AF%E9%A3%9EAI%E5%BC%80%E5%8F%91%E8%80%85%E5%A4%A7%E8%B5%9B2023
評論已經被關(guan) 閉。