Abstract
INTRODUCTION: Epilepsy due to hypothalamic hamartoma (HH) is associated with epileptic encephalopathy and often requires surgical intervention, as medications are ineffective at reducing the seizures. However, the first step of disentangling the impact of the surgery on the broader whole-brain networks, a biomarker of encephalopathy compared to controls, is not quantified. Subtle pre- and post-operative networks can elude conventional rs-fMRI analysis. METHODS: We retrospectively analyzed rs-fMRI from 56 HH patients scanned before and 6 months after surgery. We developed a two-stage contrastive learning-based algorithm to classify the motor, vision, language, frontal, and temporal networks as pre- vs post-operative. In stage one, a multimodal contrastive encoder jointly ingests 3D spatial Independent Component Analysis (ICA) maps and their corresponding 1D temporal ICA time series to learn embeddings that distinguish pre-operative from post-operative states for each network while separating embeddings of different networks. In stage two, a lightweight classifier refines these embeddings, augmented by original ICA inputs, to classify each network as pre-operative or post-operative. RESULTS: Visualization of the learned feature space with t-SNE revealed clear separation by pre- vs post-surgical condition across all five networks. Across networks, mean accuracy ranged from 0.85 to 0.90, sensitivity from 0.79 to 0.90, specificity from 0.87 to 0.93, F1-score from 0.83 to 0.90 and AUC from 0.90 to 0.94 in stratified cross validation. CONCLUSIONS: Contrastive learning can sensitively detect functional shifts in critical cortical networks that previous traditional analyses may overlook. These findings inform broader shifts in whole-brain network functioning following effective HH surgery and establish a featurewise distinction between preoperative and postoperative states, motivating future studies that compare HH patients to healthy controls to quantify network recovery.