Objective: To quantify cerebral cortical and deep gray matter atrophy in patients with multiple sclerosis (MS) and explore its correlation with impairment in domains of cognitive function. Methods: Twenty patients with MS and 16 healthy controls (HC) matched for age, sex, and education level were included. Using FreeSurfer software, based on 3D-MRI technology, the differences in cortical thickness and deep gray matter volume between the two groups were comparatively analyzed. A neuropsychological scale that included six domains of cognitive function was scored on both study groups to analyze the correlation between cortical thickness and volume of deep gray matter in MS patients with impairment in cognitive function domains. Results: Impairment in domains of cognitive function: cognitive impairment was present in 60% MS patients in this study, mainly manifesting as impairment of verbal memory, verbal fluency, visuospatial memory, and information processing speed function (all P<0.05). Of these, the majority had impaired visuospatial memory function (55.0%), and the least number of patients had impaired information processing speed (15.0%). Changes in cortical thickness: compared with the HC group, the MS group showed that cortical atrophy was mainly concentrated in the frontoparietal region, including significant thinning of cortical thickness in the left inferior parietal gyrus, right superior frontal gyrus, and the right superior parietal gyrus (all P<0.05). Among them, atrophy of the left inferior parietal gyrus was significantly positively correlated with the impairment of verbal memory, verbal fluency, and information processing speed (all P<0.05). There was a significant positive correlation between the right superior frontal gyrus atrophy and verbal memory, verbal fluency, and visuospatial memory impairment (all P<0.05). Changes in deep gray matter volume: compared with the HC group, deep gray matter volume in the MS group decreased significantly in the bilateral thalamus, bilateral putamen, bilateral pallidum (all P<0.01), and right nucleus accumbens (P<0.05). Among them, left thalamus atrophy was significantly positively correlated with visuospatial memory impairment (r=0.45, P=0.046), and left putamen atrophy was both significantly positively correlated with visuospatial memory (r=0.45, P=0.047) and information processing speed impairment (r=0.50, P=0.026). Conclusions: Early structural brain changes in MS are dominated by gray matter atrophy. Deep gray matter is more prominent than cortical atrophy.