OSCR

Development and application of a multi-task fusion model using susceptibility-weighted imaging-based substantia nigra and adjacent structures for prognostic prediction of subthalamic nucleus deep brain stimulation in Parkinson's disease.

Code ↔ Paper

2 matches between paragraphs of the paper and lines of its authors' code, computed by the harvester (lexical-v1). Click a colored paragraph or line to see its counterpart.

The 2 matches
  1. [1] § Materials and methods › Model development ↔ PD_model.py, lines 410 to 460 · score 0.56 · Conv3d, MaxPool3d, ReLU, layers, softmax, blocks · Report a mismatch
  2. [2] § Materials and methods › Model development ↔ PD_model.py, lines 113 to 176 · score 0.52 · logistic regression, MaxPool3d, ReLU, linear, Model · Report a mismatch

Paper

Loaded from Europe PMC by your browser; OSCR does not store it: doi.org · Europe PMC

The paper is loaded when this pane is shown.

The authors' code

Python · 561 lines · 19 KB · no license · 2 matches

  1. import torch
  2. import torch.nn as nn
  3. import torch.nn.functional as F
  4. import math
  5. def maxpool_3d1():
  6. pool = nn.MaxPool3d(kernel_size=1, stride=1, padding=0)
  7. return pool
  8. def maxpool_3d2():
  9. pool = nn.MaxPool3d(kernel_size=2, stride=2, padding=0)#
  10. return pool
  11. def conv_block_3dd(in_dim, out_dim,kernel_size,stride):
  12. model = nn.Sequential(
  13. nn.Conv3d(in_dim,out_dim, kernel_size=kernel_size, stride=stride, padding=1),
  14. nn.InstanceNorm3d(out_dim,affine=False),
  15. nn.LeakyReLU(inplace=True)
  16. )
  17. return model
  18. class PD_class_Net2(nn.Module):
  19. def __init__(self,in_dim,out_dim):
  20. super(PD_class_Net2,self).__init__()
  21. self.in_dim=in_dim
  22. self.out_dim=out_dim
  23. self.level1_Dim=64
  24. self.level3_Dim=128
  25. self.level5_Dim=256
  26. self.conv_3d1=conv_block_3dd(self.in_dim,16,3,1)
  27. self.pool1=nn.MaxPool3d(kernel_size=(1,2,2),stride=(1,2,2),padding=0)
  28. self.conv_3d2=conv_block_3dd(16,32,3,1)
  29. self.pool2=nn.MaxPool3d(kernel_size=(1,2,2),stride=(1,2,2),padding=0)
  30. self.conv_3d3=conv_block_3dd(32,64,3,1)
  31. self.pool3=nn.MaxPool3d(kernel_size=2,stride=2,padding=0)
  32. #self.avgpool = nn.AdaptiveAvgPool3d((1, 1, 1))
  33. self.fc=nn.Sequential(
  34. nn.Dropout(0.2),
  35. nn.Flatten(),
  36. nn.ReLU(),
  37. nn.Linear(16000, 512), # 1124864,512;106496,512
  38. nn.Sigmoid(),
  39. nn.ReLU(),
  40. nn.Linear(512, 64),
  41. nn.Dropout(0.5),
  42. nn.ReLU(),
  43. nn.Linear(64, 2)
  44. )
  45. def forward(self,x):#[10,40,80]
  46. conv1=self.conv_3d1(x)
  47. pool1=self.pool1(conv1)#[10,20,40]
  48. #print(pool1.shape)
  49. conv2=self.conv_3d2(pool1)
  50. pool2=self.pool2(conv2)
  51. #print(pool2.shape)#[10,10,20]
  52. conv3=self.conv_3d3(pool2)
  53. pool3=self.pool3(conv3)#[5,5,10]
  54. #print(pool3.shape)
  55. #x = pool3.view(pool3.size(0), -1)
  56. x=pool3
  57. #x=pool3.view(-1,16000)
  58. #print(x.shape)
  59. out=self.fc(x)#[[-0.3055,-0.2215]]
  60. return out
  61. class PD_reg_Net2(nn.Module):
  62. def __init__(self,in_dim,out_dim):
  63. super(PD_reg_Net2,self).__init__()
  64. self.in_dim=in_dim
  65. self.out_dim=out_dim
  66. self.level1_Dim=64
  67. self.level3_Dim=128
  68. self.level5_Dim=256
  69. self.conv_3d1=conv_block_3dd(self.in_dim,16,3,1)
  70. self.pool1=nn.MaxPool3d(kernel_size=(1,2,2),stride=(1,2,2),padding=0)
  71. self.conv_3d2=conv_block_3dd(16,32,3,1)
  72. self.pool2=nn.MaxPool3d(kernel_size=(1,2,2),stride=(1,2,2),padding=0)
  73. self.conv_3d3=conv_block_3dd(32,64,3,1)
  74. self.pool3=nn.MaxPool3d(kernel_size=2,stride=2,padding=0)
  75. #self.avgpool = nn.AdaptiveAvgPool3d((1, 1, 1))
  76. self.fc=nn.Sequential(
  77. nn.Dropout(0.2),
  78. nn.Flatten(),
  79. nn.ReLU(),
  80. nn.Linear(16000, 512), # 1124864,512;106496,512
  81. nn.Sigmoid(),
  82. nn.ReLU(),
  83. nn.Linear(512, 64),
  84. nn.Dropout(0.5),
  85. nn.ReLU(),
  86. nn.Linear(64, 1)
  87. )
  88. def forward(self,x):#[10,40,80]
  89. conv1=self.conv_3d1(x)
  90. pool1=self.pool1(conv1)#[10,20,40]
  91. #print(pool1.shape)
  92. conv2=self.conv_3d2(pool1)
  93. pool2=self.pool2(conv2)
  94. #print(pool2.shape)#[10,10,20]
  95. conv3=self.conv_3d3(pool2)
  96. pool3=self.pool3(conv3)#[5,5,10]
  97. #print(pool3.shape)
  98. #x = pool3.view(pool3.size(0), -1)
  99. x=pool3
  100. #x=pool3.view(-1,16000)
  101. #print(x.shape)
  102. out=self.fc(x)#[[-0.3055,-0.2215]]
  103. out=torch.sigmoid(out)
  104. return out
  105. class PD_all_Net2(nn.Module):
  106. def __init__(self, in_dim, out_dim):
  107. super(PD_all_Net2, self).__init__()
  108. self.in_dim = in_dim
  109. self.out_dim = out_dim
  110. self.level1_Dim = 64
  111. self.level3_Dim = 128
  112. self.level5_Dim = 256
  113. self.conv_3d1 = conv_block_3dd(self.in_dim, 16, 3, 1)
  114. self.pool1 = nn.MaxPool3d(kernel_size=(1, 2, 2), stride=(1, 2, 2), padding=0)
  115. self.conv_3d2 = conv_block_3dd(16, 32, 3, 1)
  116. self.pool2 = nn.MaxPool3d(kernel_size=(1, 2, 2), stride=(1, 2, 2), padding=0)
  117. self.conv_3d3 = conv_block_3dd(32, 64, 3, 1)
  118. self.pool3 = nn.MaxPool3d(kernel_size=2, stride=2, padding=0)
  119. self.avgpool = nn.AdaptiveAvgPool3d((1, 1, 1))
  120. self.fc1 = nn.Sequential(
  121. nn.Dropout(0.2),
  122. nn.Flatten(),
  123. nn.ReLU(),
  124. nn.Linear(16000, 512), # 1124864,512;106496,512
  125. nn.Sigmoid(),
  126. nn.ReLU(),
  127. nn.Linear(512, 64),
  128. nn.Dropout(0.5),
  129. nn.ReLU(),
  130. nn.Linear(64, 2),
  131. nn.Softmax(dim=1)
  132. )
  133. self.fc2 = nn.Sequential(
  134. nn.Dropout(0.2),
  135. nn.Flatten(),
  136. nn.ReLU(),
  137. nn.Linear(16000, 512), # 1124864,512;106496,512
  138. nn.Sigmoid(),
  139. nn.ReLU(),
  140. nn.Linear(512, 64),
  141. nn.Dropout(0.5),
  142. nn.ReLU(),
  143. nn.Linear(64, 1),
  144. nn.Sigmoid()
  145. )
  146. self.logistic_regression = nn.Sequential(
  147. nn.Linear(2, out_dim),
  148. nn.Softmax(dim=1)
  149. )
  150. def forward(self, x): # [10,40,80]
  151. conv1 = self.conv_3d1(x)
  152. pool1 = self.pool1(conv1) # [10,20,40]
  153. conv2 = self.conv_3d2(pool1)
  154. pool2 = self.pool2(conv2)
  155. conv3 = self.conv_3d3(pool2)
  156. pool3 = self.pool3(conv3) # [5,5,10]
  157. #pool3 = self.avgpool(pool3)
  158. x = pool3#.view(pool3.size(0), -1)
  159. out1 = self.fc1(x) # [[-0.3055,-0.2215]]
  160. out2 = self.fc2(x)
  161. a = out1[:, 1]
  162. b = out2[:, 0]
  163. # print(a,b)
  164. ab = torch.stack((a, b), dim=1)
  165. # print('ab',ab)
  166. out = self.logistic_regression(ab)
  167. return out,out1,out2
  168. #@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
  169. class PD_3dNet(nn.Module):
  170. def __init__(self,in_dim,out_dim):
  171. super(PD_3dNet,self).__init__()
  172. self.in_dim=in_dim
  173. self.out_dim=out_dim
  174. self.level1_Dim=64
  175. self.level2_Dim=96
  176. self.level3_Dim=128
  177. self.level4_Dim=196
  178. self.level5_Dim=256
  179. self.level6_Dim=512
  180. self.conv_3d1=conv_block_3dd(self.in_dim,4,3,2)
  181. self.conv_3d2=conv_block_3dd(4,16,3,2)
  182. self.pool1=maxpool_3d2()
  183. self.conv_3d3=conv_block_3dd(16,64,3,2)
  184. self.pool2=maxpool_3d2()
  185. self.conv_3d5=conv_block_3dd(64,128,2,1)
  186. self.pool3=maxpool_3d1()
  187. self.conv_3d9=conv_block_3dd(128,256,1,1)
  188. self.conv_3d12=conv_block_3dd(256,512,1,1)
  189. self.pool4=maxpool_3d1()
  190. self.fc=nn.Sequential(
  191. nn.Dropout(0.2),
  192. nn.Flatten(),
  193. nn.Linear(200704,512),#1124864,512#150528
  194. nn.Sigmoid(),
  195. nn.Linear(512,256),
  196. nn.Dropout(0.5 ),
  197. nn.Linear(256,128),
  198. nn.Linear(128,2))
  199. #self.out=nn.Softmax(dim=0)#[1,1]
  200. self.out=nn.Softmax(dim=1)
  201. class PD_3d_seg_Net(nn.Module):
  202. def __init__(self,in_dim,out_dim):
  203. super(PD_3d_seg_Net,self).__init__()
  204. self.in_dim=in_dim
  205. self.out_dim=out_dim
  206. self.level1_Dim=64
  207. self.level2_Dim=96
  208. self.level3_Dim=128
  209. self.level4_Dim=196
  210. self.level5_Dim=256
  211. self.level6_Dim=512
  212. self.conv_3d1=conv_block_3dd(self.in_dim,4,3,1)
  213. self.conv_3d2=conv_block_3dd(4,16,3,1)
  214. self.pool1=nn.MaxPool3d(kernel_size=(1,2,2),stride=(1,2,2),padding=0)
  215. self.conv_3d3=conv_block_3dd(16,64,3,1)
  216. self.pool2=nn.MaxPool3d(kernel_size=(1,2,2),stride=(1,2,2),padding=0)
  217. self.conv_3d4=conv_block_3dd(64,128,3,1)
  218. self.conv_3d5=conv_block_3dd(128,256,3,1)
  219. self.pool3=nn.MaxPool3d(kernel_size=2,stride=2,padding=0)
  220. self.fc=nn.Sequential(
  221. nn.Dropout(0.2),
  222. nn.Flatten(),
  223. #nn.ReLU(),
  224. nn.Linear(64000,512),#1124864,512;106496,512
  225. nn.Sigmoid(),
  226. nn.ReLU(),
  227. nn.Linear(512,128),
  228. nn.Dropout(0.5 ),
  229. nn.ReLU(),
  230. nn.Linear(128,1)
  231. )
  232. #self.out=nn.Softmax(dim=0)#[1,1]
  233. #self.out=nn.Softmax(dim=1)
  234. def forward(self,x):
  235. conv1=self.conv_3d1(x)
  236. conv2=self.conv_3d2(conv1)
  237. pool1=self.pool1(conv2)
  238. conv3=self.conv_3d3(pool1)
  239. pool2=self.pool2(conv3)
  240. conv4=self.conv_3d4(pool2)
  241. conv5=self.conv_3d5(conv4)
  242. pool3=self.pool3(conv5)
  243. fc=self.fc(pool3)#[[-0.3055,-0.2215]]
  244. #out=self.out(fc)
  245. return fc
  246. class BasicBlock(nn.Module):
  247. expansion=1
  248. def __init__(self,inplanes,planes,kernel_size=3,stride=1,downsample=None):
  249. super(BasicBlock,self).__init__()
  250. self.conv1=nn.Conv3d(inplanes,planes,kernel_size=kernel_size,stride=stride,padding=1,bias=False)
  251. self.bn1=nn.InstanceNorm3d(planes)
  252. self.relu=nn.LeakyReLU(inplace=True)
  253. self.conv2=nn.Conv3d(planes,planes,kernel_size=kernel_size,stride=stride,padding=1,bias=False)
  254. self.bn2=nn.InstanceNorm3d(planes)
  255. self.downsample=nn.Sequential(nn.Conv3d(inplanes,planes,kernel_size=1,stride=2),nn.InstanceNorm3d(planes))
  256. self.stride=stride
  257. def forward(self, x):
  258. residual=x
  259. out=self.conv1(x)
  260. out=self.bn1(out)
  261. out=self.relu(out)
  262. out=self.conv2(out)
  263. out=self.bn2(out)
  264. #if self.downsample is not None:
  265. # residual=self.downsample(x)
  266. out=F.relu(out)
  267. return out
  268. class PD_3d_seg_resNet(nn.Module):
  269. def __init__(self,in_dim,out_dim):
  270. super(PD_3d_seg_resNet,self).__init__()
  271. self.in_dim=in_dim
  272. self.out_dim=out_dim
  273. self.level1_Dim=64
  274. self.level2_Dim=96
  275. self.level3_Dim=128
  276. self.level4_Dim=196
  277. self.level5_Dim=256
  278. self.level6_Dim=512
  279. self.conv_3d1=conv_block_3dd(self.in_dim,4,3,1)
  280. self.conv_3d2=conv_block_3dd(4,16,3,1)
  281. self.pool1=nn.MaxPool3d(kernel_size=(1,2,2),stride=(1,2,2),padding=0)
  282. self.block1=BasicBlock(16,32)
  283. self.block2=BasicBlock(32,64)
  284. #self.conv_3d3=conv_block_3dd(16,64,3,1)
  285. self.pool2=nn.MaxPool3d(kernel_size=(1,2,2),stride=(1,2,2),padding=0)
  286. self.block3=BasicBlock(64,128)
  287. self.block4=BasicBlock(128,256)
  288. #self.conv_3d4=conv_block_3dd(64,128,3,1)
  289. #self.conv_3d5=conv_block_3dd(128,256,3,1)
  290. self.pool3=nn.MaxPool3d(kernel_size=2,stride=2,padding=0)
  291. self.fc=nn.Sequential(
  292. nn.Dropout(0.2),
  293. nn.Flatten(),
  294. #nn.ReLU(),
  295. nn.Linear(64000,512),#1124864,512;106496,512
  296. nn.Sigmoid(),
  297. nn.ReLU(),
  298. nn.Linear(512,128),
  299. nn.Dropout(0.5 ),
  300. nn.ReLU(),
  301. nn.Linear(128,1)#(128,2)->分类,(128,1)->回归
  302. )
  303. #self.out=nn.Softmax(dim=0)#[1,1]
  304. ##self.out=nn.Softmax(dim=1)
  305. def forward(self,x):
  306. conv1=self.conv_3d1(x)
  307. conv2=self.conv_3d2(conv1)
  308. pool1=self.pool1(conv2)
  309. block1=self.block1(pool1)
  310. block2=self.block2(block1)
  311. pool2=self.pool2(block2)
  312. block3=self.block3(pool2)
  313. block4=self.block4(block3)
  314. pool3=self.pool3(block4)
  315. fc=self.fc(pool3)#[[-0.3055,-0.2215]]
  316. #out=self.out(fc)
  317. return fc
  318. #分类+回归
  319. class BasicBlock3D(nn.Module):
  320. expansion = 1
  321. def __init__(self, in_channels, out_channels, stride=1, downsample=None):
  322. super(BasicBlock3D, self).__init__()
  323. self.conv1 = nn.Conv3d(in_channels, out_channels, kernel_size=3, stride=stride, padding=1, bias=False)
  324. self.bn1 = nn.BatchNorm3d(out_channels)
  325. self.relu = nn.ReLU(inplace=True)
  326. self.conv2 = nn.Conv3d(out_channels, out_channels, kernel_size=3, stride=1, padding=1, bias=False)
  327. self.bn2 = nn.BatchNorm3d(out_channels)
  328. self.downsample = downsample
  329. self.stride = stride
  330. def forward(self, x):
  331. residual = x
  332. out = self.conv1(x)
  333. out = self.bn1(out)
  334. out = self.relu(out)
  335. out = self.conv2(out)
  336. out = self.bn2(out)
  337. if self.downsample is not None:
  338. residual = self.downsample(x)
  339. out += residual
  340. out = self.relu(out)
  341. return out
  342. class Bottleneck3D(nn.Module):
  343. expansion = 4
  344. def __init__(self, in_channels, out_channels, stride=1, downsample=None):
  345. super(Bottleneck3D, self).__init__()
  346. self.conv1 = nn.Conv3d(in_channels, out_channels, kernel_size=1, bias=False)
  347. self.bn1 = nn.BatchNorm3d(out_channels)
  348. self.conv2 = nn.Conv3d(out_channels, out_channels, kernel_size=3, stride=stride, padding=1, bias=False)
  349. self.bn2 = nn.BatchNorm3d(out_channels)
  350. self.conv3 = nn.Conv3d(out_channels, out_channels * self.expansion, kernel_size=1, bias=False)
  351. self.bn3 = nn.BatchNorm3d(out_channels * self.expansion)
  352. self.relu = nn.ReLU(inplace=True)
  353. self.downsample = downsample
  354. self.stride = stride
  355. def forward(self, x):
  356. residual = x
  357. out = self.conv1(x)
  358. out = self.bn1(out)
  359. out = self.relu(out)
  360. out = self.conv2(out)
  361. out = self.bn2(out)
  362. out = self.relu(out)
  363. out = self.conv3(out)
  364. out = self.bn3(out)
  365. if self.downsample is not None:
  366. residual = self.downsample(x)
  367. out += residual
  368. out = self.relu(out)
  369. return out
  370. class ResNet3D(nn.Module):
  371. def __init__(self, block, layers, num_classes=2):
  372. super(ResNet3D, self).__init__()
  373. self.in_channels = 64
  374. self.conv1 = nn.Conv3d(1, 64, kernel_size=7, stride=2, padding=3, bias=False)
  375. self.bn1 = nn.BatchNorm3d(64)
  376. self.relu = nn.ReLU(inplace=True)
  377. self.maxpool = nn.MaxPool3d(kernel_size=3, stride=2, padding=1)
  378. self.layer1 = self._make_layer(block, 64, layers[0])
  379. self.layer2 = self._make_layer(block, 128, layers[1], stride=2)
  380. self.layer3 = self._make_layer(block, 256, layers[2], stride=2)
  381. self.layer4 = self._make_layer(block, 512, layers[3], stride=2)
  382. self.avgpool = nn.AdaptiveAvgPool3d((1, 1, 1))
  383. self.fc = nn.Sequential(nn.Linear(64, num_classes))#,nn.Softmax(dim=1))
  384. def _make_layer(self, block, out_channels, blocks, stride=1):
  385. downsample = None
  386. if stride != 1 or self.in_channels != out_channels * block.expansion:
  387. downsample = nn.Sequential(
  388. nn.Conv3d(self.in_channels, out_channels * block.expansion, kernel_size=1, stride=stride, bias=False),
  389. nn.BatchNorm3d(out_channels * block.expansion),
  390. )
  391. layers = []
  392. layers.append(block(self.in_channels, out_channels, stride, downsample))
  393. self.in_channels = out_channels * block.expansion
  394. for _ in range(1, blocks):
  395. layers.append(block(self.in_channels, out_channels))
  396. return nn.Sequential(*layers)
  397. def forward(self, x):
  398. x = self.conv1(x)
  399. x = self.bn1(x)
  400. x = self.relu(x)
  401. x = self.maxpool(x)
  402. x1 = self.layer1(x)
  403. x2 = self.layer2(x1)
  404. x3 = self.layer3(x2)
  405. x4 = self.layer4(x3)
  406. x =self.avgpool(x)
  407. x = x.view(x.size(0), -1)
  408. x = self.fc(x)
  409. return x
  410. class ResNet3D1(nn.Module):
  411. def __init__(self, block, layers, num_classes=2):
  412. super(ResNet3D1, self).__init__()
  413. self.in_channels = 64
  414. self.conv1 = nn.Conv3d(1, 64, kernel_size=7, stride=2, padding=3, bias=False)
  415. self.bn1 = nn.BatchNorm3d(64)
  416. self.relu = nn.ReLU(inplace=True)
  417. self.maxpool = nn.MaxPool3d(kernel_size=3, stride=2, padding=1)
  418. self.layer1 = self._make_layer(block, 64, layers[0])
  419. self.layer2 = self._make_layer(block, 128, layers[1], stride=2)
  420. self.layer3 = self._make_layer(block, 256, layers[2], stride=2)
  421. self.layer4 = self._make_layer(block, 512, layers[3], stride=2)
  422. self.avgpool = nn.AdaptiveAvgPool3d((1, 1, 1))
  423. self.fc = nn.Sequential(nn.Linear(2048, num_classes))#,nn.Softmax(dim=1))
  424. def _make_layer(self, block, out_channels, blocks, stride=1):
  425. downsample = None
  426. if stride != 1 or self.in_channels != out_channels * block.expansion:
  427. downsample = nn.Sequential(
  428. nn.Conv3d(self.in_channels, out_channels * block.expansion, kernel_size=1, stride=stride, bias=False),
  429. nn.BatchNorm3d(out_channels * block.expansion),
  430. )
  431. layers = []
  432. layers.append(block(self.in_channels, out_channels, stride, downsample))
  433. self.in_channels = out_channels * block.expansion
  434. for _ in range(1, blocks):
  435. layers.append(block(self.in_channels, out_channels))
  436. return nn.Sequential(*layers)
  437. def forward(self, x):
  438. x = self.conv1(x)
  439. x = self.bn1(x)
  440. x = self.relu(x)
  441. x = self.maxpool(x)
  442. x1 = self.layer1(x)
  443. x2 = self.layer2(x1)
  444. x3 = self.layer3(x2)
  445. x4 = self.layer4(x3)
  446. x = self.avgpool(x4)
  447. x = x.view(x.size(0), -1)
  448. x = self.fc(x)
  449. return x
  450. class ResNet3D2(nn.Module):
  451. def __init__(self, block, layers, num_classes=2):
  452. super(ResNet3D2, self).__init__()
  453. self.in_channels = 64
  454. self.conv1 = nn.Conv3d(1, 64, kernel_size=7, stride=2, padding=3, bias=False)
  455. self.bn1 = nn.BatchNorm3d(64)
  456. self.relu = nn.ReLU(inplace=True)
  457. self.maxpool = nn.MaxPool3d(kernel_size=3, stride=2, padding=1)
  458. self.avgpool = nn.AdaptiveAvgPool3d((1, 1, 1))
  459. self.fc = nn.Sequential(nn.Linear(64, num_classes))#,nn.Softmax(dim=1))
  460. def forward(self, x):
  461. x = self.conv1(x)
  462. x = self.bn1(x)
  463. x = self.relu(x)
  464. x = self.maxpool(x)
  465. x = self.avgpool(x)
  466. x = x.view(x.size(0), -1)
  467. x = self.fc(x)
  468. return x
  469. def pd_all_net2(num_classes=2):
  470. #return ResNet3D2(Bottleneck3D, [3, 4, 6, 3], num_classes=2)
  471. #return PD_class_Net2(1,2)
  472. #return PD_reg_Net2(1,2)
  473. return PD_all_Net2(1,2)
  474. #return ResNet3D1(Bottleneck3D, [3, 4, 6, 3], num_classes=2)
  475. def pd_resnet3d2(num_classes=2):
  476. return ResNet3D2(Bottleneck3D, [3, 4, 6, 3], num_classes=2)
  477. def pd_class_net2(num_classes=2):
  478. return PD_class_Net2(1,2)
  479. def pd_reg_net2(num_classes=2):
  480. return PD_reg_Net2(1,2)
  481. def pd_resnet3d1(num_classes=2):
  482. return ResNet3D1(Bottleneck3D, [3, 4, 6, 3], num_classes=2)

PD_model.py at commit 8d75c50, no license · at the source

Overview

Authors: Chi Xiong1,2,3, Kun Wang1, Erkang Cheng1, Zhiyong Sun1, Bin Cai1,2, Chaoshi Niu2,3, Bo Song1,2
  1. Institute of Intelligent Machines, Hefei Institutes of Physical Science, Chinese Academy of Sciences, Hefei 230031, P.R. China
  2. University of Science and Technology of China, Hefei 230026, P.R. China
  3. Department of Neurosurgery, The First Affiliated Hospital of USTC, Division of Life Sciences and Medicine, University of Science and Technology of China, Hefei 230001, P.R. China
Journal: Brain communications, volume 8, issue 5, article fcag333
Dates: received 8 January 2026; accepted 17 August 2026; published online 11 September 2026
Type: Research article · Language: English
License: CC BY
Identifiers: DOI 10.1093/braincomms/fcag333 · PMID 42729974 · PMCID PMC13563298 · OpenAlex W7212136710
Open access: gold, a free copy (OpenAlex)
Status: code verified (how the code is found and verified)
Categories: structural MRI / diffusion (modality), human (organism), Parkinson's (population), clinical / translational (subfield)
Methods: Statistics, Machine learning, Connectivity
Keywords: Parkinson’s disease, deep brain stimulation, prognostic prediction, deep learning, susceptibility-weighted imaging
Topic: Deep Brain Stimulation and Movement Disorders (Clinical Neurology, Medicine), according to OpenAlex
Funding: National Natural Science Foundation of China (61973294); Anhui Provincial Key R&D Program (2023s07020017, 2022i01020020); University Synergy Innovation Program of Anhui Province (GXXT-2021-030); Anhui Provincial Key Laboratory of Bionic Sensing and Advanced Robot Technology
Citations: not cited yet (Europe PMC); 38 references in the paper

Abstract

We developed and evaluated a deep learning framework using susceptibility-weighted imaging signatures of the substantia nigra and adjacent structures to predict motor outcomes following subthalamic nucleus deep brain stimulation in Parkinson’s disease. This retrospective study included patients undergoing bilateral subthalamic nucleus deep brain stimulation, and motor response was defined as the percentage improvement in the original Unified Parkinson’s Disease Rating Scale Part III score from the preoperative medication-off condition to the 1-year postoperative stimulation-on/medication-off condition. Patients with at least 50% improvement were classified as optimal responders. A multi-task fusion network integrating prognostic classification and complementary regression learning was developed using preoperative susceptibility-weighted imaging data. In the initial 36-patient cohort, the proposed model outperformed baseline models and showed consistent 5-fold cross-validation performance. Substantia nigra and adjacent structures-centred sub-volumes showed better prognostic performance than non-substantia nigra and adjacent structures regions. In the expanded 60-patient cohort, the model achieved 88.3% accuracy. Additional analyses showed greater percentage improvement in the 39-item Parkinson’s Disease Questionnaire in optimal responders and no prognostic association between swallow-tail sign ratings and motor outcome. These findings suggest that preoperative susceptibility-weighted images covering the substantia nigra and adjacent structures may support prognostic prediction of subthalamic nucleus deep brain stimulation and may provide a practical decision-support tool for preoperative patient selection.

Reproduced under the paper's license (CC BY), from the paper cited above.

Repository

Its files are read in the Code ↔ Paper reader above, with 2 matches between paragraphs and lines of code.

ceasorcai/PD

License: none: the authors keep all their rights
State: the link answers, verified on 26 September 2026
Evidence: files inventoried
Commit: 8d75c50f0ae0a640a7a3f7e9bc94457f96bd5cd7, 27 May 2026
Languages: Python (3)
Size: 3 files, 3 scripts
Software Heritage: not archived
Found in: “Data availability”
Not found: README, license file, CITATION.cff, environment file, tests, continuous integration, documentation
Tools: NumPy (2 files), PyTorch (2 files)
Availability: 1 check, the latest on 26 September 2026: the link answers
  • 26 September 2026: the link answers
3 files

The paper's code and data availability statement is in the Data section.

Tracing map

Proposed by the machine: these links were found in the paper and verified at the source, without human review. The map will receive a Zenodo DOI once one of the paper's authors has validated it with their ORCID.

What the map holds:

  • 1 repository of the authors' code, each at its verified commit, with its license and how the link was found in the paper;
  • 3 scripts, each with its path and the digest of its content;
  • 2 matches between paragraphs of the paper and lines of the code (method lexical-v1);
  • neither the text of the paper nor the code itself.

Its JSON (tracing-map.json) is deposited on Zenodo with its DOI once the map is validated.

Data

No dataset and no data link were found in the paper.

Data availability

The clinical and imaging data supporting the findings of this study are available from the corresponding author upon reasonable request, subject to institutional and ethical restrictions. The code used for model training, performance evaluation, statistical analysis, and DBS-related metric extraction is available at https://github.com/ceasorcai/PD. Clinical and imaging data are not publicly available because of institutional and ethical restrictions.

Reproduced under the paper's license (CC BY), from the paper cited above.

Versions

The history of this record: each version stored by the harvester or made by a correction of its authors or of the maintainers of its code, and what changed in its facts. The texts of the paper (its abstract, its availability statements) are not part of it; versions that changed only those are not listed.

Version 1, 27 September 2026: the first record

Recorded: type, language, journal, volume, issue, pages, dates, 7 authors, 5 keywords, 4 funders, 38 references.

Cite

This paper

Xiong, C., Wang, K., Cheng, E., Sun, Z., Cai, B., Niu, C., & Song, B. (2026). Development and application of a multi-task fusion model using susceptibility-weighted imaging-based substantia nigra and adjacent structures for prognostic prediction of subthalamic nucleus deep brain stimulation in Parkinson's disease. Brain communications, 8(5), fcag333. https://doi.org/10.1093/braincomms/fcag333

BibTeX

@article{xiong2026development,
author = {Xiong, Chi and Wang, Kun and Cheng, Erkang and Sun, Zhiyong and Cai, Bin and Niu, Chaoshi and Song, Bo},
title = {{Development and application of a multi-task fusion model using susceptibility-weighted imaging-based substantia nigra and adjacent structures for prognostic prediction of subthalamic nucleus deep brain stimulation in Parkinson's disease}},
journal = {Brain communications},
year = {2026},
month = sep,
volume = {8},
number = {5},
pages = {fcag333},
publisher = {Oxford University Press},
issn = {2632-1297},
doi = {10.1093/braincomms/fcag333},
url = {https://doi.org/10.1093/braincomms/fcag333},
pmid = {42729974},
pmcid = {PMC13563298}
}

RIS

TY - JOUR
AU - Xiong, Chi
AU - Wang, Kun
AU - Cheng, Erkang
AU - Sun, Zhiyong
AU - Cai, Bin
AU - Niu, Chaoshi
AU - Song, Bo
TI - Development and application of a multi-task fusion model using susceptibility-weighted imaging-based substantia nigra and adjacent structures for prognostic prediction of subthalamic nucleus deep brain stimulation in Parkinson's disease
T2 - Brain communications
J2 - Brain Commun
PY - 2026
DA - 2026/09/11
VL - 8
IS - 5
SP - fcag333
SN - 2632-1297
PB - Oxford University Press
DO - 10.1093/braincomms/fcag333
UR - https://doi.org/10.1093/braincomms/fcag333
LA - en
ER -

CSL-JSON

{
"id": "10.1093/braincomms/fcag333",
"type": "article-journal",
"title": "Development and application of a multi-task fusion model using susceptibility-weighted imaging-based substantia nigra and adjacent structures for prognostic prediction of subthalamic nucleus deep brain stimulation in Parkinson's disease",
"container-title": "Brain communications",
"author": [
{
"family": "Xiong",
"given": "Chi"
},
{
"family": "Wang",
"given": "Kun"
},
{
"family": "Cheng",
"given": "Erkang"
},
{
"family": "Sun",
"given": "Zhiyong"
},
{
"family": "Cai",
"given": "Bin"
},
{
"family": "Niu",
"given": "Chaoshi"
},
{
"family": "Song",
"given": "Bo"
}
],
"container-title-short": "Brain Commun",
"volume": "8",
"issue": "5",
"page": "fcag333",
"DOI": "10.1093/braincomms/fcag333",
"PMID": "42729974",
"PMCID": "PMC13563298",
"ISSN": "2632-1297",
"publisher": "Oxford University Press",
"URL": "https://doi.org/10.1093/braincomms/fcag333",
"language": "en",
"issued": {
"date-parts": [
[
2026,
9,
11
]
]
}
}

The tracing map gets a citation of its own once an author has validated it and it has a DOI.

Similar papers

The papers with a page that share the most with this one: the tools found in their code, their categories, datasets, cited references and authors, the rarest counting most.

[1] doi:10.1590/0004-282x-anp-2022-s133
Deep brain stimulation in Parkinson's disease: state of the art and future perspectives.
Journal: Arquivos de neuro-psiquiatria
In common: Parkinson's, clinical / translational, 4 references
[2] doi:10.1016/j.nicl.2024.103607
The connection of motor improvement after deep brain stimulation in Parkinson's disease and microstructural integrity of the substantia nigra and subthalamic nucleus.
Journal: NeuroImage. Clinical
In common: Parkinson's, structural MRI / diffusion, clinical / translational, 4 references
[3] doi:10.1177/1877718x251319697 [code]
Predicting motor function improvement following deep brain stimulation of the subthalamic nucleus for Parkinson's disease based on STN-T2MRI radiomics.
Journal: Journal of Parkinson's disease
In common: NumPy, Parkinson's, structural MRI / diffusion, clinical / translational, 3 references
[4] doi:10.1038/s41531-025-01252-0
Video-based machine learning models for predicting deep brain stimulation outcomes in Parkinson's disease patients.
Journal: NPJ Parkinson's disease
In common: Parkinson's, clinical / translational, 4 references
[5] doi:10.1016/j.nicl.2024.103577 [code]
Increased iron in the substantia nigra pars compacta identifies patients with early Parkinson'sdisease: A 3T and 7T MRI study.
Journal: NeuroImage. Clinical
In common: NumPy, Parkinson's, structural MRI / diffusion, clinical / translational, 3 references
[6] doi:10.1038/s41746-024-01253-y [code]
Machine learning explains response variability of deep brain stimulation on Parkinson's disease quality of life.
Journal: NPJ digital medicine
In common: Parkinson's, clinical / translational, 3 references
[7] doi:10.1002/mdc3.13825
The Role of Levodopa Challenge in Predicting the Outcome of Subthalamic Deep Brain Stimulation.
Journal: Movement disorders clinical practice
In common: Parkinson's, clinical / translational, 3 references
[8] doi:10.1002/mdc3.14199 [code]
Quality of Life after Deep Brain Stimulation in Parkinson's Disease: Does the Target Matter?
Journal: Movement disorders clinical practice
In common: Parkinson's, clinical / translational, 3 references
[9] doi:10.3390/healthcare11040507 [code]
A Low-Cost System Using a Big-Data Deep-Learning Framework for Assessing Physical Telerehabilitation: A Proof-of-Concept.
Journal: Healthcare (Basel, Switzerland)
In common: PyTorch, NumPy, Parkinson's, clinical / translational, 2 references
[10] doi:10.1002/mdc3.70108
Functional Connectivity and Volumetrics Improve Outcome Prediction for Deep Brain Stimulation in Parkinson's Disease.
Journal: Movement disorders clinical practice
In common: Parkinson's, structural MRI / diffusion, clinical / translational, 2 references

Contribute

The authors of this paper can claim it, correct its record and validate its tracing map, and the maintainers of its code (its owner, or a public member of its organization) correct what it says of their repository; anyone signed in can ask for its removal. Every request goes to OSCR's own machine, which answers it; your account page follows them.

Sign in with ORCID to claim this paper as one of its authors, correct its record or validate its tracing map: when the paper's metadata lists your ORCID iD, you are recognized at once. Maintainers of its code: sign in with GitHub, then claim the repository on your account page.

Add the badge to the code's README

OSCR: the badge of this paper

If you are an author or a maintainer of this paper's code, you can add this badge. It says what OSCR knows of the paper (its code, its validated tracing map) and links the code to this page. Paste one of these snippets under the README's title. Keep the two marks around it, so that the badge can be replaced in place and is never added twice. OSCR changes nothing in your repository.

Markdown
<!-- oscr-badge:start -->
[![OSCR](https://openscicode.org/badge/doi/10.1093/braincomms/fcag333.svg)](https://openscicode.org/badge/doi/10.1093/braincomms/fcag333)
<!-- oscr-badge:end -->
reStructuredText
.. oscr-badge:start

.. image:: https://openscicode.org/badge/doi/10.1093/braincomms/fcag333.svg
   :target: https://openscicode.org/badge/doi/10.1093/braincomms/fcag333
   :alt: OSCR

.. oscr-badge:end
HTML
<!-- oscr-badge:start -->
<a href="https://openscicode.org/badge/doi/10.1093/braincomms/fcag333"><img src="https://openscicode.org/badge/doi/10.1093/braincomms/fcag333.svg" alt="OSCR"></a>
<!-- oscr-badge:end -->

On GitHub, open the README, choose Edit (the pencil), paste the snippet under the title, then "Commit changes".

If you choose to, you can have the badge kept up to date for you, with oscr badge --write from the command line or with the GitHub Action in your repository's workflows. Every other form and option (a card, AsciiDoc, LaTeX, shields.io) is on the badge page.

Request its removal

To ask OSCR to remove this record, the copies of its authors' scripts or its tracing map, use the removal request page: signed in, you say who you are, what to remove and why, then review and confirm the request. Published rules decide every request (how).

Discussion, reproductions, activity

Discussion: code errors and mismatches between the code and the paper about this paper and its code, from readers and its authors, beside the paper and its tracing map.

Report a mismatch between the code and the paper · Report a code error (signed in)

Reproductions: reports from readers who ran the authors' code and did not get the paper's result, what they ran, with which environment, commit and data.

Report a reproduction failure (signed in)

Versions of its code: the releases of its code tied to a version of this paper (the preprint, the accepted manuscript, the version of record…), each with the tracing map versioned with it.

Activity: what happens around this paper: new versions of its record, its map's validation, discussions and reproductions. It opens with sign-in.