!\rm -rf val train trainreference.csv 数据说明.txt __MACOSX answer.csv.zip answer.csv
!unzip 2021A_T2_Task1_数据集含训练集和测试集.zip > out.log

赛题背景

心电图是临床最基础的一个检查项目,因为安全、便捷成为心脏病诊断的利器。每天都有大量的心电图诊断需求,但是全国范围内诊断心电图的专业医生数量不足,导致很多医院都面临专业心电图医生短缺的情况。

人工智能技术的出现,为改善医生人力资源不足的问题带来了全新的可能。由于心电图数据与诊断的标准化程度较高,相对较易于运用人工智能技术进行智能诊断算法的开发。

由于心电图可诊断的疾病类别特别丰富,目前,市面上出现较多的是针对某些特定类别的算法,尚没有看到能够按照临床诊断标准、在一定准确率标准下,提供类似医生的多标签多分类算法。本次赛事希望吸引更多优秀的算法人才,共同为心电图人工智能诊断算法的开发贡献力量。

赛题任务

针对临床标准12导联心电图数据的多标签多分类算法开展研发和竞技比拼。

选手需利用命题方提供的训练集数据,设计并实现模型和算法,能够对标准12导静息心电图进行智能诊断。需要识别的心电图包括12个类别:正常心电图、窦性心动过缓、窦性心动过速、窦性心律不齐、心房颤动、室性早搏、房性早搏、一度房室阻滞、完全性右束支阻滞、T波改变、ST改变、其它。

本赛题共分为两个关联任务:任务一为要求针对心电图输出二元(正常 v.s 异常)分类标签;任务二为针对给定的心电图输出上述12 项诊断分类的诊断结果标签。

赛题数据

心电数据的单位为mV,采样率为 500HZ,记录时长为 10 秒,存储格式为 MAT;文件中存储了 12 导联的电压信号(包含了I,II,III,aVR,aVL,aVF,V1,V2,V3,V4,V5 和 V6)

任务一的数据说明

数据将会分为参赛者可见标签的训练集,及不可见标签的测试集两大部分。数据均可下载。(请参见「参赛提交」——「下载」下的 2021A_T2_Task1_数据集,其包含了训练集和测试集)

其中训练数据提供 1600 条 MAT 格式心电数据及其对应诊断分类标签(“正常”或“异常”,csv 格式);测试数据提供 400 条 MAT格式心电数据。

  • 数据目录
   DATA |- trainreference.csv TRAIN目录下数据的LABEL
        |- TRAIN            训练用的数据
        |- VAL              测试数据
  • 数据格式
    • 12导联的数据,保存matlab格式文件中。数据格式是(12, 5000)。
    • 采样500HZ,10S长度有效数据。具体读取方式参考下面代码。
    • 0…12是I, II, III, aVR, aVL, aVF, V1, V2, V3, V4, V5和V6数据。单位是mV。
    import scipy.io as sio
    ecgdata = sio.loadmat("TEST0001.MAT")['ecgdata']
  • trainreference.csv格式:每行一个文件。 格式:文件名,LABEL (0正常心电图,1异常心电图)

评价方式

import codecs, glob, os
import numpy as np
import pandas as pd

import paddle
import paddle.nn as nn
from paddle.io import DataLoader, Dataset
import paddle.optimizer as optim
from paddlenlp.data import Pad

import scipy.io as sio
train_mat = glob.glob('./train/*.mat')
train_mat.sort()
train_mat = [sio.loadmat(x)['ecgdata'].reshape(1, 12, 5000) for x in train_mat]

test_mat = glob.glob('./val/*.mat')
test_mat.sort()
test_mat = [sio.loadmat(x)['ecgdata'].reshape(1, 12, 5000) for x in test_mat]

train_df = pd.read_csv('trainreference.csv')
train_df['tag'] = train_df['tag'].astype(np.float32)
%pylab inline
plt.plot(range(5000), train_mat[0][0][0])
plt.plot(range(5000), train_mat[0][0][1])
plt.plot(range(5000), train_mat[0][0][3])
Populating the interactive namespace from numpy and matplotlib





[<matplotlib.lines.Line2D at 0x7f0924197c90>]

[外链图片转存失败,源站可能有防盗链机制,建议将图片保存下来直接上传(img-HmfoGq09-1639097021020)(output_4_2.png)]

class MyDataset(Dataset):
    def __init__(self, mat, label, mat_dim=3000):
        super(MyDataset, self).__init__()
        self.mat = mat
        self.label = label
        self.mat_dim = mat_dim

    def __len__(self):
        return len(self.mat)

    def __getitem__(self, index):
        idx = np.random.randint(0, 5000-self.mat_dim)
        # idy = np.random.choice(range(12), 9)
        return paddle.to_tensor(self.mat[index][:, :, idx:idx+self.mat_dim]), self.label[index]

构建模型

TextCNN 模型是由 Harvard NLP 组的 Yoon Kim 在2014年发表的 Convolutional Neural Networks for Sentence Classification 一文中提出的模型,由于 CNN 在计算机视觉中,常被用于提取图像的局部特征图,且起到了很好的效果,所以该作者将其引入到 NLP 中,应用于文本分类任务,试图使用 CNN 捕捉文本中单词之间的关系。

class TextCNN(paddle.nn.Layer):
    def __init__(self, kernel_num=30, kernel_size=[3, 4, 5], dropout=0.5):
        super(TextCNN, self).__init__()
        self.kernel_num = kernel_num
        self.kernel_size = kernel_size
        self.dropout = dropout

        self.convs = nn.LayerList([nn.Conv2D(1, self.kernel_num, (kernel_size_, 3000)) 
                for kernel_size_ in self.kernel_size])
        self.dropout = nn.Dropout(self.dropout)
        self.linear = nn.Linear(3 * self.kernel_num, 1)

    def forward(self, x):
        convs = [nn.ReLU()(conv(x)).squeeze(3) for conv in self.convs]
        pool_out = [nn.MaxPool1D(block.shape[2])(block).squeeze(2) for block in convs]
        pool_out = paddle.concat(pool_out, 1)
        logits = self.linear(pool_out)

        return logits
model = TextCNN()

BATCH_SIZE = 30
EPOCHS = 200
LEARNING_RATE = 0.0005
device = paddle.device.get_device()
print(device)
gpu:0
paddle.summary(model, (64, 1, 9, 3000))
---------------------------------------------------------------------------
 Layer (type)       Input Shape          Output Shape         Param #    
===========================================================================
   Conv2D-32     [[64, 1, 9, 3000]]     [64, 30, 7, 1]        270,030    
   Conv2D-33     [[64, 1, 9, 3000]]     [64, 30, 6, 1]        360,030    
   Conv2D-34     [[64, 1, 9, 3000]]     [64, 30, 5, 1]        450,030    
   Linear-10         [[64, 90]]            [64, 1]              91       
===========================================================================
Total params: 1,080,181
Trainable params: 1,080,181
Non-trainable params: 0
---------------------------------------------------------------------------
Input size (MB): 6.59
Forward/backward pass size (MB): 0.26
Params size (MB): 4.12
Estimated Total Size (MB): 10.98
---------------------------------------------------------------------------






{'total_params': 1080181, 'trainable_params': 1080181}

训练过程

from sklearn.model_selection import StratifiedKFold
skf = StratifiedKFold(n_splits=10)
fold_idx = 0
for tr_idx, val_idx in skf.split(train_mat, train_df['tag'].values):
    Train_Loader = DataLoader(MyDataset(np.array(train_mat)[tr_idx], paddle.to_tensor(train_df['tag'].values[tr_idx])), batch_size=BATCH_SIZE, shuffle=True)
    Val_Loader = DataLoader(MyDataset(np.array(train_mat)[val_idx], paddle.to_tensor(train_df['tag'].values[val_idx])), batch_size=BATCH_SIZE, shuffle=True)
    model = TextCNN()

    optimizer = optim.Adam(parameters=model.parameters(), learning_rate=LEARNING_RATE)
    criterion = nn.BCEWithLogitsLoss()

    Test_best_Acc = 0
    for epoch in range(0, EPOCHS):
        Train_Loss, Test_Loss = [], []
        Train_Acc, Test_Acc = [], []
        model.train()
        for i, (x, y) in enumerate(Train_Loader):
            if device == 'gpu':
                x = x.cuda()
                y = y.cuda()

            pred = model(x)
            loss = criterion(pred, y)
            Train_Loss.append(loss.item())

            pred = (paddle.nn.functional.sigmoid(pred)>0.5).astype(int)
            Train_Acc.append((pred.numpy() == y.numpy()).mean())
            loss.backward()
            optimizer.step()
            optimizer.clear_grad()
        model.eval()

        for i, (x, y) in enumerate(Val_Loader):
            if device == 'gpu':
                x = x.cuda()
                y = y.cuda()
            
            pred = model(x)
            Test_Loss.append(criterion(pred, y).item())
            pred = (paddle.nn.functional.sigmoid(pred)>0.5).astype(int)
            Test_Acc.append((pred.numpy() == y.numpy()).mean())
        
        if epoch % 10 == 0:
            print(
                "Epoch: [{}/{}] TrainLoss/TestLoss: {:.4f}/{:.4f} TrainAcc/TestAcc: {:.4f}/{:.4f}".format( \
                epoch + 1, EPOCHS, \
                np.mean(Train_Loss), np.mean(Test_Loss), \
                np.mean(Train_Acc), np.mean(Test_Acc) \
                )
            )

        if Test_best_Acc < np.mean(Test_Acc):
            print(f'Fold {fold_idx} Acc imporve from {Test_best_Acc} to {np.mean(Test_Acc)} Save Model...')
            paddle.save(model.state_dict(), f"model_{fold_idx}.pdparams")
            Test_best_Acc = np.mean(Test_Acc)

    fold_idx += 1
Epoch: [1/200] TrainLoss/TestLoss: 1.1455/1.5873 TrainAcc/TestAcc: 0.5167/0.5278
Fold 0 Acc imporve from 0 to 0.5277777777777778 Save Model...
Fold 0 Acc imporve from 0.5277777777777778 to 0.5333333333333333 Save Model...
Fold 0 Acc imporve from 0.5333333333333333 to 0.611111111111111 Save Model...
Fold 0 Acc imporve from 0.611111111111111 to 0.6555555555555554 Save Model...
Epoch: [11/200] TrainLoss/TestLoss: 0.9651/0.8238 TrainAcc/TestAcc: 0.6396/0.5833
Fold 0 Acc imporve from 0.6555555555555554 to 0.6666666666666666 Save Model...
Fold 0 Acc imporve from 0.6666666666666666 to 0.7166666666666667 Save Model...
Epoch: [21/200] TrainLoss/TestLoss: 0.6664/0.9834 TrainAcc/TestAcc: 0.6757/0.5667
Epoch: [31/200] TrainLoss/TestLoss: 0.5956/0.6380 TrainAcc/TestAcc: 0.7125/0.7056
Epoch: [41/200] TrainLoss/TestLoss: 0.5672/0.6647 TrainAcc/TestAcc: 0.7507/0.6167
Fold 0 Acc imporve from 0.7166666666666667 to 0.7722222222222221 Save Model...
Epoch: [51/200] TrainLoss/TestLoss: 0.7648/0.8662 TrainAcc/TestAcc: 0.7069/0.7056
Epoch: [61/200] TrainLoss/TestLoss: 0.7060/0.6080 TrainAcc/TestAcc: 0.7222/0.7444
Epoch: [71/200] TrainLoss/TestLoss: 0.5264/0.6576 TrainAcc/TestAcc: 0.7701/0.7389
Epoch: [81/200] TrainLoss/TestLoss: 0.7941/0.9908 TrainAcc/TestAcc: 0.7313/0.7056
Epoch: [91/200] TrainLoss/TestLoss: 0.5393/0.6345 TrainAcc/TestAcc: 0.7535/0.7333
Fold 0 Acc imporve from 0.7722222222222221 to 0.8000000000000002 Save Model...
Epoch: [101/200] TrainLoss/TestLoss: 0.5399/0.6480 TrainAcc/TestAcc: 0.7639/0.7222
Epoch: [111/200] TrainLoss/TestLoss: 0.5060/0.6395 TrainAcc/TestAcc: 0.7792/0.7556
Epoch: [121/200] TrainLoss/TestLoss: 0.4982/0.5521 TrainAcc/TestAcc: 0.7840/0.7222
Epoch: [131/200] TrainLoss/TestLoss: 0.5394/0.6401 TrainAcc/TestAcc: 0.7764/0.7389
Epoch: [141/200] TrainLoss/TestLoss: 0.4799/0.6710 TrainAcc/TestAcc: 0.7931/0.7667
Epoch: [151/200] TrainLoss/TestLoss: 0.4650/1.0968 TrainAcc/TestAcc: 0.7847/0.6556
Epoch: [161/200] TrainLoss/TestLoss: 0.4875/0.6693 TrainAcc/TestAcc: 0.7965/0.7333
Epoch: [171/200] TrainLoss/TestLoss: 0.4433/0.6254 TrainAcc/TestAcc: 0.7972/0.7000
Epoch: [181/200] TrainLoss/TestLoss: 0.4214/0.4610 TrainAcc/TestAcc: 0.8139/0.7778
Epoch: [191/200] TrainLoss/TestLoss: 0.4828/0.5933 TrainAcc/TestAcc: 0.7819/0.7333
Epoch: [1/200] TrainLoss/TestLoss: 1.4649/1.1464 TrainAcc/TestAcc: 0.5285/0.5944
Fold 1 Acc imporve from 0 to 0.5944444444444444 Save Model...
Fold 1 Acc imporve from 0.5944444444444444 to 0.6 Save Model...
Fold 1 Acc imporve from 0.6 to 0.611111111111111 Save Model...
Fold 1 Acc imporve from 0.611111111111111 to 0.6222222222222222 Save Model...
Fold 1 Acc imporve from 0.6222222222222222 to 0.6666666666666666 Save Model...
Epoch: [11/200] TrainLoss/TestLoss: 0.9993/0.8352 TrainAcc/TestAcc: 0.6215/0.6611
Fold 1 Acc imporve from 0.6666666666666666 to 0.7000000000000001 Save Model...
Epoch: [21/200] TrainLoss/TestLoss: 1.2723/1.6232 TrainAcc/TestAcc: 0.6382/0.6278
Fold 1 Acc imporve from 0.7000000000000001 to 0.7111111111111111 Save Model...
Fold 1 Acc imporve from 0.7111111111111111 to 0.7444444444444445 Save Model...
Epoch: [31/200] TrainLoss/TestLoss: 1.0571/1.0026 TrainAcc/TestAcc: 0.6757/0.6389
Fold 1 Acc imporve from 0.7444444444444445 to 0.7666666666666666 Save Model...
Fold 1 Acc imporve from 0.7666666666666666 to 0.7722222222222223 Save Model...
Fold 1 Acc imporve from 0.7722222222222223 to 0.7944444444444446 Save Model...
Epoch: [41/200] TrainLoss/TestLoss: 0.6604/0.6973 TrainAcc/TestAcc: 0.7097/0.7500
Epoch: [51/200] TrainLoss/TestLoss: 0.6582/0.5585 TrainAcc/TestAcc: 0.7174/0.7889
Epoch: [61/200] TrainLoss/TestLoss: 0.7310/0.7426 TrainAcc/TestAcc: 0.7285/0.6944
Epoch: [71/200] TrainLoss/TestLoss: 0.7220/0.7461 TrainAcc/TestAcc: 0.7306/0.7333
Epoch: [81/200] TrainLoss/TestLoss: 0.5520/0.7463 TrainAcc/TestAcc: 0.7521/0.7944
Epoch: [91/200] TrainLoss/TestLoss: 0.5922/0.6005 TrainAcc/TestAcc: 0.7465/0.7111
Epoch: [101/200] TrainLoss/TestLoss: 0.6039/0.8085 TrainAcc/TestAcc: 0.7667/0.7333
Fold 1 Acc imporve from 0.7944444444444446 to 0.8055555555555557 Save Model...
Epoch: [111/200] TrainLoss/TestLoss: 0.5125/0.5133 TrainAcc/TestAcc: 0.7694/0.7944
Epoch: [121/200] TrainLoss/TestLoss: 0.6784/0.7831 TrainAcc/TestAcc: 0.7535/0.6778
Fold 1 Acc imporve from 0.8055555555555557 to 0.8222222222222223 Save Model...
Fold 1 Acc imporve from 0.8222222222222223 to 0.838888888888889 Save Model...
Epoch: [131/200] TrainLoss/TestLoss: 0.6373/0.4579 TrainAcc/TestAcc: 0.7403/0.8056
Epoch: [141/200] TrainLoss/TestLoss: 0.4658/0.6682 TrainAcc/TestAcc: 0.7917/0.7333
Epoch: [151/200] TrainLoss/TestLoss: 0.5643/0.7902 TrainAcc/TestAcc: 0.7521/0.7333
Epoch: [161/200] TrainLoss/TestLoss: 0.4162/0.5526 TrainAcc/TestAcc: 0.7937/0.7556
Epoch: [171/200] TrainLoss/TestLoss: 0.5445/0.8006 TrainAcc/TestAcc: 0.7778/0.7667
Epoch: [181/200] TrainLoss/TestLoss: 0.4326/0.5529 TrainAcc/TestAcc: 0.8056/0.7500
Epoch: [191/200] TrainLoss/TestLoss: 0.4278/0.5010 TrainAcc/TestAcc: 0.8000/0.7944
Epoch: [1/200] TrainLoss/TestLoss: 1.1794/2.0914 TrainAcc/TestAcc: 0.5007/0.5111
Fold 2 Acc imporve from 0 to 0.5111111111111111 Save Model...
Fold 2 Acc imporve from 0.5111111111111111 to 0.5777777777777778 Save Model...
Fold 2 Acc imporve from 0.5777777777777778 to 0.5833333333333334 Save Model...
Fold 2 Acc imporve from 0.5833333333333334 to 0.6333333333333334 Save Model...
Epoch: [11/200] TrainLoss/TestLoss: 0.9721/1.0011 TrainAcc/TestAcc: 0.6319/0.5778
Fold 2 Acc imporve from 0.6333333333333334 to 0.6833333333333335 Save Model...
Fold 2 Acc imporve from 0.6833333333333335 to 0.7444444444444445 Save Model...
Epoch: [21/200] TrainLoss/TestLoss: 0.7338/0.8993 TrainAcc/TestAcc: 0.6958/0.6722
Fold 2 Acc imporve from 0.7444444444444445 to 0.7888888888888889 Save Model...
Epoch: [31/200] TrainLoss/TestLoss: 0.7837/1.2746 TrainAcc/TestAcc: 0.6931/0.6889
Epoch: [41/200] TrainLoss/TestLoss: 0.6140/1.1790 TrainAcc/TestAcc: 0.7410/0.7778
Epoch: [51/200] TrainLoss/TestLoss: 0.6069/0.9275 TrainAcc/TestAcc: 0.7382/0.7222
Epoch: [61/200] TrainLoss/TestLoss: 0.5696/0.7251 TrainAcc/TestAcc: 0.7507/0.7000
Fold 2 Acc imporve from 0.7888888888888889 to 0.7944444444444444 Save Model...
Epoch: [71/200] TrainLoss/TestLoss: 0.5528/0.7285 TrainAcc/TestAcc: 0.7618/0.7278
Fold 2 Acc imporve from 0.7944444444444444 to 0.7944444444444446 Save Model...
Epoch: [81/200] TrainLoss/TestLoss: 0.5017/1.2189 TrainAcc/TestAcc: 0.7840/0.7833
Epoch: [91/200] TrainLoss/TestLoss: 0.8617/1.6286 TrainAcc/TestAcc: 0.7389/0.6833
Epoch: [101/200] TrainLoss/TestLoss: 0.5937/1.9074 TrainAcc/TestAcc: 0.7569/0.7722
Fold 2 Acc imporve from 0.7944444444444446 to 0.8111111111111112 Save Model...
Epoch: [111/200] TrainLoss/TestLoss: 0.4642/1.3935 TrainAcc/TestAcc: 0.8021/0.7278
Epoch: [121/200] TrainLoss/TestLoss: 0.5993/0.8605 TrainAcc/TestAcc: 0.7701/0.7611
Epoch: [131/200] TrainLoss/TestLoss: 0.5595/0.9355 TrainAcc/TestAcc: 0.7771/0.7667
Epoch: [141/200] TrainLoss/TestLoss: 0.4982/0.8247 TrainAcc/TestAcc: 0.7792/0.8167
Fold 2 Acc imporve from 0.8111111111111112 to 0.8166666666666668 Save Model...
Fold 2 Acc imporve from 0.8166666666666668 to 0.8277777777777778 Save Model...
Epoch: [151/200] TrainLoss/TestLoss: 0.4589/1.0118 TrainAcc/TestAcc: 0.7993/0.8000
Epoch: [161/200] TrainLoss/TestLoss: 0.5551/1.3670 TrainAcc/TestAcc: 0.7931/0.8000
Epoch: [171/200] TrainLoss/TestLoss: 0.4396/1.3678 TrainAcc/TestAcc: 0.8104/0.7500
Epoch: [181/200] TrainLoss/TestLoss: 0.4403/1.1586 TrainAcc/TestAcc: 0.8014/0.7556
Epoch: [191/200] TrainLoss/TestLoss: 0.4468/1.0213 TrainAcc/TestAcc: 0.8069/0.7500
Epoch: [1/200] TrainLoss/TestLoss: 1.1879/1.0705 TrainAcc/TestAcc: 0.5306/0.5278
Fold 3 Acc imporve from 0 to 0.5277777777777777 Save Model...
Fold 3 Acc imporve from 0.5277777777777777 to 0.5555555555555555 Save Model...
Fold 3 Acc imporve from 0.5555555555555555 to 0.6055555555555555 Save Model...
Epoch: [11/200] TrainLoss/TestLoss: 0.9977/0.9245 TrainAcc/TestAcc: 0.6236/0.5944
Fold 3 Acc imporve from 0.6055555555555555 to 0.6166666666666666 Save Model...
Fold 3 Acc imporve from 0.6166666666666666 to 0.6499999999999999 Save Model...
Epoch: [21/200] TrainLoss/TestLoss: 0.7502/1.6346 TrainAcc/TestAcc: 0.6639/0.5944
Epoch: [31/200] TrainLoss/TestLoss: 0.7055/1.3967 TrainAcc/TestAcc: 0.7083/0.5222
Fold 3 Acc imporve from 0.6499999999999999 to 0.6666666666666666 Save Model...
Epoch: [41/200] TrainLoss/TestLoss: 0.8685/2.1648 TrainAcc/TestAcc: 0.7139/0.5333
Fold 3 Acc imporve from 0.6666666666666666 to 0.7333333333333333 Save Model...
Epoch: [51/200] TrainLoss/TestLoss: 0.6225/1.3679 TrainAcc/TestAcc: 0.7278/0.5889
Epoch: [61/200] TrainLoss/TestLoss: 0.5093/0.9886 TrainAcc/TestAcc: 0.7625/0.6944
Epoch: [71/200] TrainLoss/TestLoss: 0.4987/1.2645 TrainAcc/TestAcc: 0.7778/0.6111
Epoch: [81/200] TrainLoss/TestLoss: 0.6131/1.6328 TrainAcc/TestAcc: 0.7528/0.6333
Epoch: [91/200] TrainLoss/TestLoss: 0.6083/1.3530 TrainAcc/TestAcc: 0.7597/0.6778
Fold 3 Acc imporve from 0.7333333333333333 to 0.7388888888888889 Save Model...
Epoch: [101/200] TrainLoss/TestLoss: 0.5163/2.1019 TrainAcc/TestAcc: 0.7854/0.6667
Epoch: [111/200] TrainLoss/TestLoss: 0.5260/1.0333 TrainAcc/TestAcc: 0.7653/0.7111
Epoch: [121/200] TrainLoss/TestLoss: 0.4948/1.0965 TrainAcc/TestAcc: 0.7701/0.6833
Epoch: [131/200] TrainLoss/TestLoss: 0.4977/0.8802 TrainAcc/TestAcc: 0.7833/0.7333
Epoch: [141/200] TrainLoss/TestLoss: 0.4793/1.2531 TrainAcc/TestAcc: 0.7785/0.6444
Epoch: [151/200] TrainLoss/TestLoss: 0.4537/0.9725 TrainAcc/TestAcc: 0.8063/0.6667
Epoch: [161/200] TrainLoss/TestLoss: 0.4650/1.0929 TrainAcc/TestAcc: 0.7903/0.7278
Epoch: [171/200] TrainLoss/TestLoss: 0.4993/0.9853 TrainAcc/TestAcc: 0.7903/0.6889
Epoch: [181/200] TrainLoss/TestLoss: 0.4481/1.0446 TrainAcc/TestAcc: 0.8042/0.6333
Fold 3 Acc imporve from 0.7388888888888889 to 0.7611111111111112 Save Model...
Epoch: [191/200] TrainLoss/TestLoss: 0.4466/1.3376 TrainAcc/TestAcc: 0.8132/0.6833
Epoch: [1/200] TrainLoss/TestLoss: 1.2308/1.0370 TrainAcc/TestAcc: 0.5271/0.5222
Fold 4 Acc imporve from 0 to 0.5222222222222221 Save Model...
Fold 4 Acc imporve from 0.5222222222222221 to 0.5277777777777778 Save Model...
Fold 4 Acc imporve from 0.5277777777777778 to 0.5666666666666668 Save Model...
Fold 4 Acc imporve from 0.5666666666666668 to 0.6111111111111112 Save Model...
Fold 4 Acc imporve from 0.6111111111111112 to 0.6777777777777777 Save Model...
Epoch: [11/200] TrainLoss/TestLoss: 0.9156/0.7599 TrainAcc/TestAcc: 0.6292/0.5944
Fold 4 Acc imporve from 0.6777777777777777 to 0.6833333333333332 Save Model...
Fold 4 Acc imporve from 0.6833333333333332 to 0.688888888888889 Save Model...
Epoch: [21/200] TrainLoss/TestLoss: 0.8747/1.2279 TrainAcc/TestAcc: 0.6687/0.6389
Fold 4 Acc imporve from 0.688888888888889 to 0.7000000000000001 Save Model...
Epoch: [31/200] TrainLoss/TestLoss: 0.9055/0.7659 TrainAcc/TestAcc: 0.6910/0.6611
Epoch: [41/200] TrainLoss/TestLoss: 0.7750/1.0101 TrainAcc/TestAcc: 0.7021/0.6111
Fold 4 Acc imporve from 0.7000000000000001 to 0.7166666666666667 Save Model...
Epoch: [51/200] TrainLoss/TestLoss: 0.6231/0.6024 TrainAcc/TestAcc: 0.7438/0.6944
Epoch: [61/200] TrainLoss/TestLoss: 0.7513/0.6941 TrainAcc/TestAcc: 0.7285/0.6889
Fold 4 Acc imporve from 0.7166666666666667 to 0.7277777777777779 Save Model...
Fold 4 Acc imporve from 0.7277777777777779 to 0.7388888888888889 Save Model...
Epoch: [71/200] TrainLoss/TestLoss: 0.5707/1.1881 TrainAcc/TestAcc: 0.7597/0.6722
Epoch: [81/200] TrainLoss/TestLoss: 0.5959/0.6161 TrainAcc/TestAcc: 0.7521/0.7444
Fold 4 Acc imporve from 0.7388888888888889 to 0.7444444444444445 Save Model...
Epoch: [91/200] TrainLoss/TestLoss: 0.5897/0.9231 TrainAcc/TestAcc: 0.7771/0.6389
Fold 4 Acc imporve from 0.7444444444444445 to 0.75 Save Model...
Fold 4 Acc imporve from 0.75 to 0.7555555555555555 Save Model...
Epoch: [101/200] TrainLoss/TestLoss: 0.4634/0.6121 TrainAcc/TestAcc: 0.7931/0.7500
Fold 4 Acc imporve from 0.7555555555555555 to 0.7611111111111111 Save Model...
Epoch: [111/200] TrainLoss/TestLoss: 0.4967/0.6663 TrainAcc/TestAcc: 0.7847/0.6722
Epoch: [121/200] TrainLoss/TestLoss: 0.5338/0.6963 TrainAcc/TestAcc: 0.7681/0.7056
Epoch: [131/200] TrainLoss/TestLoss: 0.4377/0.6482 TrainAcc/TestAcc: 0.8118/0.6944
Fold 4 Acc imporve from 0.7611111111111111 to 0.7611111111111112 Save Model...
Epoch: [141/200] TrainLoss/TestLoss: 0.4802/0.8962 TrainAcc/TestAcc: 0.7924/0.6722
Epoch: [151/200] TrainLoss/TestLoss: 0.5682/0.7433 TrainAcc/TestAcc: 0.7667/0.7167
Epoch: [161/200] TrainLoss/TestLoss: 0.4437/1.1631 TrainAcc/TestAcc: 0.8181/0.7000
Epoch: [171/200] TrainLoss/TestLoss: 0.4890/0.8972 TrainAcc/TestAcc: 0.7979/0.7444
Epoch: [181/200] TrainLoss/TestLoss: 0.5983/0.8343 TrainAcc/TestAcc: 0.7583/0.7000
Epoch: [191/200] TrainLoss/TestLoss: 0.4488/0.7378 TrainAcc/TestAcc: 0.8042/0.6667
Epoch: [1/200] TrainLoss/TestLoss: 1.3523/1.0622 TrainAcc/TestAcc: 0.5132/0.4944
Fold 5 Acc imporve from 0 to 0.4944444444444444 Save Model...
Fold 5 Acc imporve from 0.4944444444444444 to 0.5444444444444444 Save Model...
Fold 5 Acc imporve from 0.5444444444444444 to 0.55 Save Model...
Fold 5 Acc imporve from 0.55 to 0.6 Save Model...
Fold 5 Acc imporve from 0.6 to 0.6111111111111112 Save Model...
Epoch: [11/200] TrainLoss/TestLoss: 1.0245/0.8245 TrainAcc/TestAcc: 0.6049/0.5444
Fold 5 Acc imporve from 0.6111111111111112 to 0.6833333333333335 Save Model...
Epoch: [21/200] TrainLoss/TestLoss: 0.7551/0.9365 TrainAcc/TestAcc: 0.6674/0.6222
Epoch: [31/200] TrainLoss/TestLoss: 0.7529/0.6852 TrainAcc/TestAcc: 0.7090/0.6611
Fold 5 Acc imporve from 0.6833333333333335 to 0.6944444444444445 Save Model...
Fold 5 Acc imporve from 0.6944444444444445 to 0.7166666666666667 Save Model...
Fold 5 Acc imporve from 0.7166666666666667 to 0.7277777777777779 Save Model...
Epoch: [41/200] TrainLoss/TestLoss: 0.7260/0.7151 TrainAcc/TestAcc: 0.7326/0.6778
Epoch: [51/200] TrainLoss/TestLoss: 0.5807/0.6363 TrainAcc/TestAcc: 0.7451/0.6833
Epoch: [61/200] TrainLoss/TestLoss: 0.6445/0.8132 TrainAcc/TestAcc: 0.7229/0.6500
Fold 5 Acc imporve from 0.7277777777777779 to 0.7388888888888889 Save Model...
Epoch: [71/200] TrainLoss/TestLoss: 0.5835/0.8234 TrainAcc/TestAcc: 0.7590/0.7500
Fold 5 Acc imporve from 0.7388888888888889 to 0.75 Save Model...
Fold 5 Acc imporve from 0.75 to 0.7555555555555555 Save Model...
Epoch: [81/200] TrainLoss/TestLoss: 0.6336/0.9277 TrainAcc/TestAcc: 0.7562/0.7278
Epoch: [91/200] TrainLoss/TestLoss: 0.5203/0.8149 TrainAcc/TestAcc: 0.7771/0.7000
Fold 5 Acc imporve from 0.7555555555555555 to 0.7611111111111111 Save Model...
Epoch: [101/200] TrainLoss/TestLoss: 0.5022/0.6092 TrainAcc/TestAcc: 0.7854/0.7222
Epoch: [111/200] TrainLoss/TestLoss: 0.4805/0.6499 TrainAcc/TestAcc: 0.7938/0.6778
Epoch: [121/200] TrainLoss/TestLoss: 0.4780/0.7381 TrainAcc/TestAcc: 0.7944/0.7222
Epoch: [131/200] TrainLoss/TestLoss: 0.5076/0.5957 TrainAcc/TestAcc: 0.7792/0.6778
Epoch: [141/200] TrainLoss/TestLoss: 0.5500/0.7201 TrainAcc/TestAcc: 0.7799/0.6667
Fold 5 Acc imporve from 0.7611111111111111 to 0.7611111111111112 Save Model...
Epoch: [151/200] TrainLoss/TestLoss: 0.4680/0.6398 TrainAcc/TestAcc: 0.7965/0.7222
Epoch: [161/200] TrainLoss/TestLoss: 0.4697/0.6153 TrainAcc/TestAcc: 0.7993/0.7333
Epoch: [171/200] TrainLoss/TestLoss: 0.4191/0.5608 TrainAcc/TestAcc: 0.8063/0.7611
Epoch: [181/200] TrainLoss/TestLoss: 0.4570/0.5714 TrainAcc/TestAcc: 0.8090/0.6778
Epoch: [191/200] TrainLoss/TestLoss: 0.4343/0.5136 TrainAcc/TestAcc: 0.7986/0.7444
Fold 5 Acc imporve from 0.7611111111111112 to 0.7722222222222221 Save Model...
Epoch: [1/200] TrainLoss/TestLoss: 1.5487/1.5352 TrainAcc/TestAcc: 0.5208/0.5444
Fold 6 Acc imporve from 0 to 0.5444444444444445 Save Model...
Fold 6 Acc imporve from 0.5444444444444445 to 0.5722222222222223 Save Model...
Fold 6 Acc imporve from 0.5722222222222223 to 0.6055555555555555 Save Model...
Fold 6 Acc imporve from 0.6055555555555555 to 0.611111111111111 Save Model...
Epoch: [11/200] TrainLoss/TestLoss: 1.1524/1.2696 TrainAcc/TestAcc: 0.5840/0.5778
Fold 6 Acc imporve from 0.611111111111111 to 0.7055555555555556 Save Model...
Epoch: [21/200] TrainLoss/TestLoss: 0.8272/0.8510 TrainAcc/TestAcc: 0.6667/0.6611
Fold 6 Acc imporve from 0.7055555555555556 to 0.7277777777777779 Save Model...
Epoch: [31/200] TrainLoss/TestLoss: 0.6802/1.0690 TrainAcc/TestAcc: 0.7118/0.7000
Epoch: [41/200] TrainLoss/TestLoss: 0.6997/0.9634 TrainAcc/TestAcc: 0.7493/0.6889
Fold 6 Acc imporve from 0.7277777777777779 to 0.75 Save Model...
Fold 6 Acc imporve from 0.75 to 0.8055555555555557 Save Model...
Epoch: [51/200] TrainLoss/TestLoss: 0.6258/0.8337 TrainAcc/TestAcc: 0.7236/0.7222
Epoch: [61/200] TrainLoss/TestLoss: 0.6423/1.0393 TrainAcc/TestAcc: 0.7528/0.6833
Epoch: [71/200] TrainLoss/TestLoss: 0.6191/1.5535 TrainAcc/TestAcc: 0.7500/0.6333
Epoch: [81/200] TrainLoss/TestLoss: 0.5037/0.7086 TrainAcc/TestAcc: 0.7826/0.6667
Epoch: [91/200] TrainLoss/TestLoss: 0.5237/0.6703 TrainAcc/TestAcc: 0.7653/0.7333
Epoch: [101/200] TrainLoss/TestLoss: 0.5643/0.7639 TrainAcc/TestAcc: 0.7667/0.7444
Fold 6 Acc imporve from 0.8055555555555557 to 0.8166666666666668 Save Model...
Epoch: [111/200] TrainLoss/TestLoss: 0.5831/0.8299 TrainAcc/TestAcc: 0.7722/0.7722
Epoch: [121/200] TrainLoss/TestLoss: 0.4657/0.7723 TrainAcc/TestAcc: 0.7868/0.7056
Epoch: [131/200] TrainLoss/TestLoss: 0.6710/0.7604 TrainAcc/TestAcc: 0.7437/0.7167
Epoch: [141/200] TrainLoss/TestLoss: 0.4852/0.6594 TrainAcc/TestAcc: 0.7951/0.7944
Epoch: [151/200] TrainLoss/TestLoss: 0.5008/1.4671 TrainAcc/TestAcc: 0.7896/0.7056
Epoch: [161/200] TrainLoss/TestLoss: 0.4681/0.8425 TrainAcc/TestAcc: 0.8021/0.7111
Epoch: [171/200] TrainLoss/TestLoss: 0.5248/1.2535 TrainAcc/TestAcc: 0.7715/0.7556
Epoch: [181/200] TrainLoss/TestLoss: 0.4828/0.6388 TrainAcc/TestAcc: 0.7938/0.7389
Epoch: [191/200] TrainLoss/TestLoss: 0.5386/0.7691 TrainAcc/TestAcc: 0.7799/0.6778
Epoch: [1/200] TrainLoss/TestLoss: 1.3458/1.3748 TrainAcc/TestAcc: 0.5007/0.5278
Fold 7 Acc imporve from 0 to 0.5277777777777778 Save Model...
Fold 7 Acc imporve from 0.5277777777777778 to 0.5333333333333333 Save Model...
Fold 7 Acc imporve from 0.5333333333333333 to 0.5388888888888889 Save Model...
Fold 7 Acc imporve from 0.5388888888888889 to 0.5499999999999999 Save Model...
Fold 7 Acc imporve from 0.5499999999999999 to 0.6722222222222222 Save Model...
Epoch: [11/200] TrainLoss/TestLoss: 1.0885/0.7056 TrainAcc/TestAcc: 0.5847/0.6167
Fold 7 Acc imporve from 0.6722222222222222 to 0.688888888888889 Save Model...
Epoch: [21/200] TrainLoss/TestLoss: 0.7989/1.2696 TrainAcc/TestAcc: 0.6979/0.7111
Fold 7 Acc imporve from 0.688888888888889 to 0.7111111111111111 Save Model...
Fold 7 Acc imporve from 0.7111111111111111 to 0.7277777777777777 Save Model...
Fold 7 Acc imporve from 0.7277777777777777 to 0.7388888888888889 Save Model...
Epoch: [31/200] TrainLoss/TestLoss: 1.0609/0.9003 TrainAcc/TestAcc: 0.6674/0.6889
Fold 7 Acc imporve from 0.7388888888888889 to 0.7555555555555555 Save Model...
Epoch: [41/200] TrainLoss/TestLoss: 0.6794/1.7460 TrainAcc/TestAcc: 0.7028/0.6556
Fold 7 Acc imporve from 0.7555555555555555 to 0.7555555555555556 Save Model...
Epoch: [51/200] TrainLoss/TestLoss: 0.7443/1.5342 TrainAcc/TestAcc: 0.7333/0.6389
Fold 7 Acc imporve from 0.7555555555555556 to 0.827777777777778 Save Model...
Epoch: [61/200] TrainLoss/TestLoss: 0.7729/0.6156 TrainAcc/TestAcc: 0.7236/0.7667
Epoch: [71/200] TrainLoss/TestLoss: 0.5507/0.6142 TrainAcc/TestAcc: 0.7549/0.7222
Epoch: [81/200] TrainLoss/TestLoss: 0.5000/0.6141 TrainAcc/TestAcc: 0.7812/0.8333
Fold 7 Acc imporve from 0.827777777777778 to 0.8333333333333334 Save Model...
Epoch: [91/200] TrainLoss/TestLoss: 0.4873/0.6459 TrainAcc/TestAcc: 0.7708/0.7500
Epoch: [101/200] TrainLoss/TestLoss: 0.5377/0.5649 TrainAcc/TestAcc: 0.7618/0.6722
Epoch: [111/200] TrainLoss/TestLoss: 0.4989/0.4846 TrainAcc/TestAcc: 0.7778/0.8000
Epoch: [121/200] TrainLoss/TestLoss: 0.4681/0.5010 TrainAcc/TestAcc: 0.7917/0.7889
Epoch: [131/200] TrainLoss/TestLoss: 0.5787/1.5844 TrainAcc/TestAcc: 0.7583/0.6944
Epoch: [141/200] TrainLoss/TestLoss: 0.4489/0.6045 TrainAcc/TestAcc: 0.7979/0.8111
Epoch: [151/200] TrainLoss/TestLoss: 0.5276/0.8457 TrainAcc/TestAcc: 0.7819/0.7556
Epoch: [161/200] TrainLoss/TestLoss: 0.4697/1.0231 TrainAcc/TestAcc: 0.8014/0.7722
Epoch: [171/200] TrainLoss/TestLoss: 0.4729/0.5959 TrainAcc/TestAcc: 0.8056/0.8167
Epoch: [181/200] TrainLoss/TestLoss: 0.4057/0.4468 TrainAcc/TestAcc: 0.8111/0.8167
Epoch: [191/200] TrainLoss/TestLoss: 0.4189/0.4581 TrainAcc/TestAcc: 0.8146/0.7722
Fold 7 Acc imporve from 0.8333333333333334 to 0.838888888888889 Save Model...
Epoch: [1/200] TrainLoss/TestLoss: 1.0677/0.9791 TrainAcc/TestAcc: 0.5090/0.5333
Fold 8 Acc imporve from 0 to 0.5333333333333333 Save Model...
Fold 8 Acc imporve from 0.5333333333333333 to 0.6111111111111112 Save Model...
Fold 8 Acc imporve from 0.6111111111111112 to 0.6333333333333333 Save Model...
Epoch: [11/200] TrainLoss/TestLoss: 1.0692/1.0695 TrainAcc/TestAcc: 0.6375/0.5833
Fold 8 Acc imporve from 0.6333333333333333 to 0.6722222222222222 Save Model...
Epoch: [21/200] TrainLoss/TestLoss: 0.8125/0.8331 TrainAcc/TestAcc: 0.6625/0.6611
Fold 8 Acc imporve from 0.6722222222222222 to 0.7055555555555556 Save Model...
Epoch: [31/200] TrainLoss/TestLoss: 0.9150/0.7814 TrainAcc/TestAcc: 0.6785/0.6667
Fold 8 Acc imporve from 0.7055555555555556 to 0.7111111111111111 Save Model...
Fold 8 Acc imporve from 0.7111111111111111 to 0.7222222222222223 Save Model...
Epoch: [41/200] TrainLoss/TestLoss: 0.7170/0.7202 TrainAcc/TestAcc: 0.7049/0.7333
Fold 8 Acc imporve from 0.7222222222222223 to 0.7333333333333334 Save Model...
Fold 8 Acc imporve from 0.7333333333333334 to 0.7444444444444445 Save Model...
Fold 8 Acc imporve from 0.7444444444444445 to 0.7555555555555555 Save Model...
Epoch: [51/200] TrainLoss/TestLoss: 0.5967/0.5957 TrainAcc/TestAcc: 0.7542/0.7333
Fold 8 Acc imporve from 0.7555555555555555 to 0.7833333333333333 Save Model...
Epoch: [61/200] TrainLoss/TestLoss: 0.5721/0.6991 TrainAcc/TestAcc: 0.7556/0.6944
Epoch: [71/200] TrainLoss/TestLoss: 0.6680/0.5477 TrainAcc/TestAcc: 0.7292/0.7667
Fold 8 Acc imporve from 0.7833333333333333 to 0.7888888888888889 Save Model...
Epoch: [81/200] TrainLoss/TestLoss: 0.7018/0.6596 TrainAcc/TestAcc: 0.7201/0.7222
Epoch: [91/200] TrainLoss/TestLoss: 0.6395/0.6700 TrainAcc/TestAcc: 0.7438/0.7167
Epoch: [101/200] TrainLoss/TestLoss: 0.6690/0.6453 TrainAcc/TestAcc: 0.7333/0.7444
Fold 8 Acc imporve from 0.7888888888888889 to 0.811111111111111 Save Model...
Fold 8 Acc imporve from 0.811111111111111 to 0.8277777777777778 Save Model...
Epoch: [111/200] TrainLoss/TestLoss: 0.5739/0.7746 TrainAcc/TestAcc: 0.7562/0.7000
Epoch: [121/200] TrainLoss/TestLoss: 0.5481/0.5682 TrainAcc/TestAcc: 0.7667/0.7389
Epoch: [131/200] TrainLoss/TestLoss: 0.4625/0.5311 TrainAcc/TestAcc: 0.8035/0.7611
Epoch: [141/200] TrainLoss/TestLoss: 0.4479/0.5337 TrainAcc/TestAcc: 0.7972/0.7722
Epoch: [151/200] TrainLoss/TestLoss: 0.5520/0.6433 TrainAcc/TestAcc: 0.7715/0.7389
Epoch: [161/200] TrainLoss/TestLoss: 0.4555/0.5984 TrainAcc/TestAcc: 0.8021/0.7444
Epoch: [171/200] TrainLoss/TestLoss: 0.6110/0.5928 TrainAcc/TestAcc: 0.7569/0.7722
Epoch: [181/200] TrainLoss/TestLoss: 0.5820/0.5865 TrainAcc/TestAcc: 0.7646/0.7389
Epoch: [191/200] TrainLoss/TestLoss: 0.4371/0.6934 TrainAcc/TestAcc: 0.8063/0.7167
Epoch: [1/200] TrainLoss/TestLoss: 1.3580/2.7207 TrainAcc/TestAcc: 0.5250/0.4722
Fold 9 Acc imporve from 0 to 0.47222222222222227 Save Model...
Fold 9 Acc imporve from 0.47222222222222227 to 0.5277777777777778 Save Model...
Fold 9 Acc imporve from 0.5277777777777778 to 0.5888888888888889 Save Model...
Fold 9 Acc imporve from 0.5888888888888889 to 0.611111111111111 Save Model...
Fold 9 Acc imporve from 0.611111111111111 to 0.6166666666666667 Save Model...
Epoch: [11/200] TrainLoss/TestLoss: 0.9610/1.2944 TrainAcc/TestAcc: 0.6076/0.5111
Fold 9 Acc imporve from 0.6166666666666667 to 0.65 Save Model...
Fold 9 Acc imporve from 0.65 to 0.6555555555555554 Save Model...
Fold 9 Acc imporve from 0.6555555555555554 to 0.6666666666666666 Save Model...
Epoch: [21/200] TrainLoss/TestLoss: 0.7640/1.0518 TrainAcc/TestAcc: 0.6854/0.6278
Fold 9 Acc imporve from 0.6666666666666666 to 0.6888888888888888 Save Model...
Fold 9 Acc imporve from 0.6888888888888888 to 0.688888888888889 Save Model...
Epoch: [31/200] TrainLoss/TestLoss: 0.7907/0.7971 TrainAcc/TestAcc: 0.6812/0.6778
Fold 9 Acc imporve from 0.688888888888889 to 0.7055555555555556 Save Model...
Fold 9 Acc imporve from 0.7055555555555556 to 0.7222222222222222 Save Model...
Epoch: [41/200] TrainLoss/TestLoss: 0.7450/0.6749 TrainAcc/TestAcc: 0.6993/0.7111
Fold 9 Acc imporve from 0.7222222222222222 to 0.75 Save Model...
Epoch: [51/200] TrainLoss/TestLoss: 1.0619/0.9466 TrainAcc/TestAcc: 0.6937/0.6444
Epoch: [61/200] TrainLoss/TestLoss: 0.7655/0.6549 TrainAcc/TestAcc: 0.7146/0.6667
Epoch: [71/200] TrainLoss/TestLoss: 0.6564/1.0420 TrainAcc/TestAcc: 0.7333/0.6500
Fold 9 Acc imporve from 0.75 to 0.7722222222222221 Save Model...
Epoch: [81/200] TrainLoss/TestLoss: 0.6792/0.7501 TrainAcc/TestAcc: 0.7340/0.7278
Fold 9 Acc imporve from 0.7722222222222221 to 0.7722222222222223 Save Model...
Epoch: [91/200] TrainLoss/TestLoss: 0.5244/0.9276 TrainAcc/TestAcc: 0.7778/0.7333
Epoch: [101/200] TrainLoss/TestLoss: 0.4725/0.5840 TrainAcc/TestAcc: 0.7854/0.7444
Fold 9 Acc imporve from 0.7722222222222223 to 0.7999999999999999 Save Model...
Epoch: [111/200] TrainLoss/TestLoss: 0.6218/0.8135 TrainAcc/TestAcc: 0.7667/0.7000
Epoch: [121/200] TrainLoss/TestLoss: 0.8801/0.8178 TrainAcc/TestAcc: 0.7264/0.6611
Epoch: [131/200] TrainLoss/TestLoss: 0.6912/1.0773 TrainAcc/TestAcc: 0.7465/0.6500
Epoch: [141/200] TrainLoss/TestLoss: 0.5013/0.6756 TrainAcc/TestAcc: 0.7826/0.7000
Epoch: [151/200] TrainLoss/TestLoss: 0.5863/1.2130 TrainAcc/TestAcc: 0.7861/0.7056
Epoch: [161/200] TrainLoss/TestLoss: 0.4773/0.5033 TrainAcc/TestAcc: 0.7910/0.7722
Epoch: [171/200] TrainLoss/TestLoss: 0.4302/0.6850 TrainAcc/TestAcc: 0.8069/0.7389
Epoch: [181/200] TrainLoss/TestLoss: 0.4922/0.5143 TrainAcc/TestAcc: 0.7979/0.8000
Fold 9 Acc imporve from 0.7999999999999999 to 0.8000000000000002 Save Model...
Epoch: [191/200] TrainLoss/TestLoss: 0.5056/0.6657 TrainAcc/TestAcc: 0.7833/0.7333
Fold 9 Acc imporve from 0.8000000000000002 to 0.811111111111111 Save Model...

预测过程

test_perd = np.zeros(len(test_mat))
tta_count = 20

for fold_idx in range(10):
    Test_Loader = DataLoader(MyDataset(test_mat, paddle.to_tensor([0]*len(test_mat))), 
                    batch_size=BATCH_SIZE, shuffle=False)

    layer_state_dict = paddle.load(f"model_{fold_idx}.pdparams")
    model.set_state_dict(layer_state_dict)
    
    for tta in range(tta_count):
        test_pred_list = []
        for i, (x, y) in enumerate(Test_Loader):
            if device == 'gpu':
                x = x.cuda()
                y = y.cuda()
            
            pred = model(x)
            test_pred_list.append(
                paddle.nn.functional.sigmoid(pred).numpy()
            )

        test_perd += np.vstack(test_pred_list)[:, 0]
        
test_perd /= tta_count * 10
test_path = glob.glob('./val/*.mat')
test_path = [os.path.basename(x)[:-4] for x in test_path]
test_path.sort()

test_answer = pd.DataFrame({
    'name': test_path,
    'tag': (test_perd > 0.5).astype(int)
}).to_csv('answer.csv', index=None)

!\rm -rf  answer.csv.zip
!zip answer.csv.zip answer.csv
  adding: answer.csv (deflated 80%)

改进思路

  1. 使用多折交叉验证,训练多个模型,对测试集预测多次。
  2. 在读取数据时,加入噪音,或者加入mixup数据扩增。
  3. 使用更加强大的模型,textcnn这里还是过于简单。

Logo

学大模型,用大模型上飞桨星河社区!每天8点V100G算力免费领!免费领取ERNIE 4.0 100w Token >>>

更多推荐