OSCR

Deep optimization-guided hybrid neural network for accurate detection and segmentation of white matter hyperintensities in clinical MRI images.

Code ↔ Paper

The paper beside its authors' code: matches between them have not been computed for this paper yet.

Paper

Loaded from Europe PMC by your browser, not stored by OSCR: doi.org · Europe PMC

The paper is loaded when this pane is shown.

The authors' code

Jupyter notebook · 271 lines · 7.1 KB · CC-BY-4.0

  1. # %%
  2. !pip install torch torchvision opencv-python tqdm
  3. # %%
  4. from google.colab import files
  5. uploaded = files.upload()
  6. # %%
  7. !unzip mini_dataset.zip
  8. # %%
  9. import os, cv2, torch, torch.nn as nn
  10. import matplotlib.pyplot as plt
  11. from torch.utils.data import Dataset, DataLoader
  12. import random
  13. import numpy as np
  14. device = "cuda" if torch.cuda.is_available() else "cpu"
  15. # ===== DATASET =====
  16. class MiniWMH(Dataset):
  17. def __init__(self, root="mini_dataset", size=128):
  18. self.imgs=sorted(os.listdir(f"{root}/images"))
  19. self.root=root; self.size=size
  20. def __len__(self): return len(self.imgs)
  21. def __getitem__(self,i):
  22. img=cv2.imread(f"{self.root}/images/{self.imgs[i]}",0)
  23. mask=cv2.imread(f"{self.root}/masks/{self.imgs[i]}",0)
  24. img=cv2.resize(img,(self.size,self.size))/255.0
  25. mask=cv2.resize(mask,(self.size,self.size))/255.0
  26. return torch.tensor(img).unsqueeze(0).float(), torch.tensor(mask).unsqueeze(0).float()
  27. dataset=MiniWMH()
  28. loader=DataLoader(dataset,8,shuffle=True)
  29. # ===== LOSS =====
  30. def weighted_bce(pred,target):
  31. w = target*10 + 1
  32. return nn.functional.binary_cross_entropy_with_logits(pred,target,weight=w)
  33. def dice_loss(pred,target):
  34. pred=torch.sigmoid(pred)
  35. inter=(pred*target).sum()
  36. return 1-(2*inter+1)/(pred.sum()+target.sum()+1)
  37. def loss_fn(pred,target):
  38. return weighted_bce(pred,target) + dice_loss(pred,target)
  39. def dice(pred,target):
  40. pred=(torch.sigmoid(pred)>0.3).float()
  41. inter=(pred*target).sum()
  42. return (2*inter)/(pred.sum()+target.sum()+1e-8)
  43. # ===== MODEL A: Inception =====
  44. class InceptionBlock(nn.Module):
  45. def __init__(self,in_c,out_c):
  46. super().__init__()
  47. self.b1=nn.Conv2d(in_c,out_c,1)
  48. self.b3=nn.Conv2d(in_c,out_c,3,padding=1)
  49. self.b5=nn.Conv2d(in_c,out_c,5,padding=2)
  50. def forward(self,x):
  51. return torch.relu(self.b1(x)+self.b3(x)+self.b5(x))
  52. class InceptionUNet(nn.Module):
  53. def __init__(self):
  54. super().__init__()
  55. self.e1=InceptionBlock(1,16)
  56. self.e2=InceptionBlock(16,32)
  57. self.e3=InceptionBlock(32,64)
  58. self.pool=nn.MaxPool2d(2)
  59. self.up=nn.Upsample(scale_factor=2)
  60. self.d2=InceptionBlock(64,32)
  61. self.d1=InceptionBlock(32,16)
  62. self.out=nn.Conv2d(16,1,1)
  63. def forward(self,x):
  64. e1=self.e1(x)
  65. e2=self.e2(self.pool(e1))
  66. e3=self.e3(self.pool(e2))
  67. d2=self.d2(self.up(e3))
  68. d1=self.d1(self.up(d2))
  69. return self.out(d1)
  70. # ===== MODEL B: ResNet =====
  71. class ResBlock(nn.Module):
  72. def __init__(self,c):
  73. super().__init__()
  74. self.c1=nn.Conv2d(c,c,3,padding=1)
  75. self.c2=nn.Conv2d(c,c,3,padding=1)
  76. def forward(self,x):
  77. return torch.relu(self.c2(torch.relu(self.c1(x)))+x)
  78. class ResUNet(nn.Module):
  79. def __init__(self):
  80. super().__init__()
  81. self.c1=nn.Conv2d(1,16,3,padding=1)
  82. self.r1=ResBlock(16)
  83. self.pool=nn.MaxPool2d(2)
  84. self.c2=nn.Conv2d(16,32,3,padding=1)
  85. self.r2=ResBlock(32)
  86. self.up=nn.Upsample(scale_factor=2)
  87. self.out=nn.Conv2d(32,1,1)
  88. def forward(self,x):
  89. x=torch.relu(self.c1(x))
  90. x=self.r1(x)
  91. x=self.pool(x)
  92. x=torch.relu(self.c2(x))
  93. x=self.r2(x)
  94. x=self.up(x)
  95. return self.out(x)
  96. # ===== DOGHNN HYBRID =====
  97. class DOGHNN(nn.Module):
  98. def __init__(self):
  99. super().__init__()
  100. self.a=InceptionUNet()
  101. self.b=ResUNet()
  102. self.fuse=nn.Conv2d(2,1,1)
  103. def forward(self,x):
  104. a=self.a(x)
  105. b=self.b(x)
  106. return self.fuse(torch.cat([a,b],1))
  107. # ===== PSO SEARCH =====
  108. print("\nRunning PSO on DOGHNN...\n")
  109. best_lr=0
  110. best_score=0
  111. for particle in range(5):
  112. lr=random.uniform(1e-4,5e-3)
  113. model=DOGHNN().to(device)
  114. opt=torch.optim.Adam(model.parameters(),lr)
  115. # train particle
  116. for epoch in range(8):
  117. for img,mask in loader:
  118. img,mask=img.to(device),mask.to(device)
  119. pred=model(img)
  120. loss=loss_fn(pred,mask)
  121. opt.zero_grad();loss.backward();opt.step()
  122. # evaluate
  123. total=0
  124. with torch.no_grad():
  125. for img,mask in loader:
  126. img,mask=img.to(device),mask.to(device)
  127. pred=model(img)
  128. total+=dice(pred,mask).item()
  129. score=total/len(loader)
  130. print(f"Particle {particle+1} | LR: {lr:.6f} | Dice: {score:.4f}")
  131. if score>best_score:
  132. best_score=score
  133. best_lr=lr
  134. print("\nBest LR:",best_lr)
  135. print("Best Dice:",best_score)
  136. # ===== FINAL TRAIN =====
  137. print("\nTraining final DOGHNN with PSO LR...\n")
  138. model=DOGHNN().to(device)
  139. opt=torch.optim.Adam(model.parameters(),best_lr)
  140. for epoch in range(15):
  141. total=0
  142. for img,mask in loader:
  143. img,mask=img.to(device),mask.to(device)
  144. pred=model(img)
  145. loss=loss_fn(pred,mask)
  146. opt.zero_grad();loss.backward();opt.step()
  147. total+=dice(pred,mask).item()
  148. print("Epoch",epoch,"Dice:",total/len(loader))
  149. # ===== FINAL METRICS =====
  150. dice_scores=[]
  151. model.eval()
  152. with torch.no_grad():
  153. for img,mask in loader:
  154. img,mask=img.to(device),mask.to(device)
  155. pred=model(img)
  156. dice_scores.append(dice(pred,mask).item())
  157. print("\nFinal Hybrid Dice:",np.mean(dice_scores))
  158. # ===== VISUALIZATION =====
  159. print("\nShowing hybrid segmentation examples\n")
  160. for i in range(5):
  161. img,mask=dataset[i]
  162. img=img.unsqueeze(0).to(device)
  163. with torch.no_grad():
  164. pred=model(img)
  165. pred=(torch.sigmoid(pred)>0.3).float().cpu()
  166. plt.figure(figsize=(10,3))
  167. plt.subplot(1,3,1);plt.imshow(img.cpu()[0][0],cmap='gray');plt.title("Input");plt.axis('off')
  168. plt.subplot(1,3,2);plt.imshow(mask[0],cmap='gray');plt.title("GT");plt.axis('off')
  169. plt.subplot(1,3,3);plt.imshow(pred[0][0],cmap='gray');plt.title("DOGHNN+PSO");plt.axis('off')
  170. plt.show()
  171. # %%
  172. # %%
  173. import numpy as np
  174. model.eval()
  175. dice_list=[]
  176. iou_list=[]
  177. precision_list=[]
  178. recall_list=[]
  179. specificity_list=[]
  180. accuracy_list=[]
  181. f1_list=[]
  182. with torch.no_grad():
  183. for img,mask in loader:
  184. img,mask=img.to(device),mask.to(device)
  185. pred=model(img)
  186. pred=(torch.sigmoid(pred)>0.3).float()
  187. TP=(pred*mask).sum().item()
  188. FP=(pred*(1-mask)).sum().item()
  189. FN=((1-pred)*mask).sum().item()
  190. TN=((1-pred)*(1-mask)).sum().item()
  191. dice=(2*TP)/(2*TP+FP+FN+1e-8)
  192. iou=TP/(TP+FP+FN+1e-8)
  193. precision=TP/(TP+FP+1e-8)
  194. recall=TP/(TP+FN+1e-8)
  195. specificity=TN/(TN+FP+1e-8)
  196. accuracy=(TP+TN)/(TP+TN+FP+FN+1e-8)
  197. f1=(2*precision*recall)/(precision+recall+1e-8)
  198. dice_list.append(dice)
  199. iou_list.append(iou)
  200. precision_list.append(precision)
  201. recall_list.append(recall)
  202. specificity_list.append(specificity)
  203. accuracy_list.append(accuracy)
  204. f1_list.append(f1)
  205. print("\n===== FINAL EVALUATION METRICS =====")
  206. print("Dice:", np.mean(dice_list))
  207. print("IoU:", np.mean(iou_list))
  208. print("Precision:", np.mean(precision_list))
  209. print("Recall:", np.mean(recall_list))
  210. print("Specificity:", np.mean(specificity_list))
  211. print("Accuracy:", np.mean(accuracy_list))
  212. print("F1-score:", np.mean(f1_list))

DOGHNN_with_PSO.ipynb, under CC-BY-4.0 · at the source

Overview

Authors: Bharathi Panduri1, O. Srinivasa Rao1
  1. Department of Computer Science and Engineering, Jawaharlal Nehru Technological University,Kakinada, India
Journal: Scientific reports, volume 16, issue 1, article 16211
Dates: received 28 October 2025; accepted 18 February 2026; published online 13 March 2026
Type: Research article · Language: English
License: CC BY
Identifiers: DOI 10.1038/s41598-026-41137-7 · PMID 41826522 · PMCID PMC13201642 · OpenAlex W7135224539
Open access: gold, a free copy (OpenAlex)
Status: code verified
Categories: structural MRI / diffusion (modality), human (organism), stroke (population)
Methods: Preprocessing, Machine learning, Single-unit activity, calcium imaging
Keywords: Deep Neural Network, Brain MRI Images, White Matter Hyperintensities Segmentation, ResNet50, Inception-v3, Computational biology and bioinformatics, Engineering, Mathematics and computing, Neurology, Neuroscience
MeSH: Image Processing, Computer-Assisted*, Magnetic Resonance Imaging*, Neural Networks, Computer*, White Matter*, Brain, Convolutional Neural Networks, Deep Learning, Humans (* major topic)
Topic: Medical Image Segmentation Techniques (Computer Vision and Pattern Recognition, Computer Science), according to OpenAlex
Citations: not cited yet (Europe PMC); 45 references in the paper

Abstract

White matter hyperintensities (WMHs) are common radiological findings in brain magnetic resonance imaging (MRI) and are strongly associated with neurological disorders such as stroke, dementia, and multiple sclerosis. Accurate detection and segmentation of WMHs are crucial for early diagnosis, disease progression analysis, and treatment planning. However, manual delineation of WMHs is labour-intensive, time-consuming, and prone to inter-observer variability, which limits its practicality in large-scale clinical and research settings. Deep learning has shown promise in automating WMH analysis; however, challenges remain due to heterogeneous lesion sizes, low contrast boundaries, and imaging noise. We propose a Deep Optimization-Guided Hybrid Neural Network (DOGHNN) that combines Inception-v3, ResNet-50, and Practical Swarm Optimization (PSO) for enhanced WMH segmentation. Inception-v3 is employed to capture multi-scale lesion features, enabling the detection of both small punctate and large confluent WMHs. ResNet-50 is integrated to extract deep contextual representations, leveraging residual learning to distinguish true lesions from surrounding tissue and artifacts. Finally, PSO is incorporated as an optimization strategy to iteratively refine fusion weights, segmentation thresholds, and key parameters, minimizing segmentation loss and improving boundary delineation. This hybrid approach ensures both fine-grained lesion sensitivity and robust global feature learning. The DOGHNN framework was evaluated on benchmark WMH MRI datasets with diverse lesion loads and anatomical complexities. Comparative experiments showed superior performance over baseline deep learning models. Quantitative evaluation yielded a maximum precision of 93.2%, recall of 91.5%, dice score 91.1%, and f1-score of 90.5% were achieved by the suggested DOGHNN, and Hausdorff distance of 6.5, confirming its robustness and reliability. By combining multi-scale learning, residual contextual modelling, and optimization-driven refinement, the DOGHNN framework delivers accurate and efficient WMH segmentation. This approach holds strong potential for clinical integration, supporting automated neuroimaging workflows and improving diagnostic decision-making in neurological care.

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

Repository

Its files are read in the Code ↔ Paper reader above.

Zenodo 18604208

License: CC-BY-4.0
State: the link answers, verified on 30 September 2026
Evidence: files inventoried
Languages: Jupyter (4)
Size: 5 files, 4 scripts
Software Heritage: not checked
Found in: “Code availability”
Holds: 4 notebooks
Not found: README, license file, CITATION.cff, environment file, tests, continuous integration, documentation
Tools: NumPy (4 files), OpenCV (4 files), PyTorch (4 files), Matplotlib (3 files)
Availability: 1 check, the latest on 30 September 2026: the link answers (HTTP 200)
  • 30 September 2026: the link answers (HTTP 200)
4 files
At the source:

Code availability

The custom code and implementation of the proposed model used to generate the results reported in this study are publicly available at Zenodo: 10.5281/zenodo.18604208. The archived repository contains the complete source code, model implementation, preprocessing scripts, and all necessary instructions to reproduce the experimental results presented in this paper.

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

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;
  • 4 scripts, each with its path and the digest of its content;
  • no match between paragraphs and code yet;
  • 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 datasets used and/or analysed during the current study available from: [https://doi.org/10.5281/zenodo.18604208](https:/doi.org/10.5281/zenodo.18604208) .

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, 30 September 2026: the first record

Recorded: type, language, journal, volume, issue, pages, dates, 2 authors, 10 keywords, 8 MeSH terms, 33 references.

Cite

This paper

Panduri, B., & Rao, O. S. (2026). Deep optimization-guided hybrid neural network for accurate detection and segmentation of white matter hyperintensities in clinical MRI images. Scientific reports, 16(1), 16211. https://doi.org/10.1038/s41598-026-41137-7

BibTeX

@article{panduri2026deep,
author = {Panduri, Bharathi and Rao, O. Srinivasa},
title = {{Deep optimization-guided hybrid neural network for accurate detection and segmentation of white matter hyperintensities in clinical MRI images}},
journal = {Scientific reports},
year = {2026},
month = mar,
volume = {16},
number = {1},
pages = {16211},
publisher = {Nature Publishing Group},
issn = {2045-2322},
doi = {10.1038/s41598-026-41137-7},
url = {https://doi.org/10.1038/s41598-026-41137-7},
pmid = {41826522},
pmcid = {PMC13201642}
}

RIS

TY - JOUR
AU - Panduri, Bharathi
AU - Rao, O. Srinivasa
TI - Deep optimization-guided hybrid neural network for accurate detection and segmentation of white matter hyperintensities in clinical MRI images
T2 - Scientific reports
J2 - Sci Rep
PY - 2026
DA - 2026/03/13
VL - 16
IS - 1
SP - 16211
SN - 2045-2322
PB - Nature Publishing Group
DO - 10.1038/s41598-026-41137-7
UR - https://doi.org/10.1038/s41598-026-41137-7
LA - en
ER -

CSL-JSON

{
"id": "10.1038/s41598-026-41137-7",
"type": "article-journal",
"title": "Deep optimization-guided hybrid neural network for accurate detection and segmentation of white matter hyperintensities in clinical MRI images",
"container-title": "Scientific reports",
"author": [
{
"family": "Panduri",
"given": "Bharathi"
},
{
"family": "Rao",
"given": "O. Srinivasa"
}
],
"container-title-short": "Sci Rep",
"volume": "16",
"issue": "1",
"page": "16211",
"DOI": "10.1038/s41598-026-41137-7",
"PMID": "41826522",
"PMCID": "PMC13201642",
"ISSN": "2045-2322",
"publisher": "Nature Publishing Group",
"URL": "https://doi.org/10.1038/s41598-026-41137-7",
"language": "en",
"issued": {
"date-parts": [
[
2026,
3,
13
]
]
}
}

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.1186/s12938-026-01555-0 [code]
Incorporating normal periventricular changes for enhanced pathological white matter hyperintensity segmentation: on multiclass deep learning approaches.
Journal: Biomedical engineering online
In common: OpenCV, Matplotlib, NumPy, stroke, structural MRI / diffusion, 2 references
[2] doi:10.1186/s12880-026-02481-2 [code]
Deep learning-based neuroanatomical profiling reveals population-specific brain changes in multiple sclerosis: a large-scale Middle Eastern study.
Journal: BMC medical imaging
In common: OpenCV, Matplotlib, NumPy, structural MRI / diffusion, 1 reference
[3] doi:10.1002/alz.71649 [code]
Postmortem brain MRI reveals differential associations of subcortical and limbic volumes with cortical thinning and neurodegenerative pathologies.
Journal: Alzheimer's & dementia : the journal of the Alzheimer's Association
In common: OpenCV, PyTorch, Matplotlib, 1 other tool, structural MRI / diffusion
[4] doi:10.1093/braincomms/fcag253 [code]
Disease detection and classification in temporal lobe epilepsy: step-wise versus simultaneous AI decision models in a multisite neuroimaging study.
Journal: Brain communications
In common: OpenCV, PyTorch, Matplotlib, 1 other tool, structural MRI / diffusion
[5] doi:10.1016/j.crmeth.2026.101473 [code]
AmygdalaGo-BOLT for boundary-aware segmentation of the human amygdala.
Journal: Cell reports methods
In common: OpenCV, PyTorch, Matplotlib, 1 other tool, structural MRI / diffusion
[6] doi:10.1093/radadv/umag025 [code]
OpenMAP-BrainAge: generalizable and interpretable brain age predictor from MRI.
Journal: Radiology advances
In common: OpenCV, PyTorch, Matplotlib, 1 other tool, structural MRI / diffusion
[7] doi:10.1038/s41598-026-55136-1 [code]
CAHA-Net: A novel MR image classification model based on DenseNet incorporating coordinate attention and hybrid augmentation.
Journal: Scientific reports
In common: OpenCV, PyTorch, Matplotlib, 1 other tool, structural MRI / diffusion
[8] doi:10.1002/mrm.70431 [code]
SelExNet: A Self-Supervised Physics-Informed Framework for Multi-Channel Joint RF and Gradient Waveform Optimization in 2D Spatially Selective Excitation.
Journal: Magnetic resonance in medicine
In common: OpenCV, PyTorch, Matplotlib, 1 other tool, structural MRI / diffusion
[9] doi:10.1038/s41598-026-50791-w [code]
Hybrid Vi+ECNN framework for advanced ADHD diagnostic accuracy in medical imaging.
Journal: Scientific reports
In common: OpenCV, PyTorch, Matplotlib, 1 other tool, structural MRI / diffusion
[10] doi:10.21037/qims-2026-0792 [code]
An nnU-Net-based framework with adaptive feature representation for 3D brain tumor segmentation.
Journal: Quantitative imaging in medicine and surgery
In common: OpenCV, PyTorch, Matplotlib, 1 other tool, structural MRI / diffusion

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.

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: questions and error reports about this paper and its code, from signed-in readers and its authors. It opens with sign-in.

Reproductions: reports from readers who ran the authors' code: what they reproduced, with which environment, commit and data. It opens with sign-in.

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