This research was to evaluate the effects of regular hemodialysis (HD) on the brain function of patients with end-stage renal disease (ESRD). Resting-state functional magnetic resonance imaging (rs-fMRI) based on improved k-means clustering algorithm (k-means) was proposed to scan the brains of 30 regular dialysis patients with end-stage renal disease (ESRD) (experimental group) and 30 normal volunteers (control group). The proposed algorithm was compared with the traditional k-means algorithm and mean shift algorithm and applied to the magnetic resonance scan of patients with ESRD on long-term regular HD. The results showed that the neuropsychological cognitive function (NSCF) evaluation result of the test group was much better than that of the control group, and the difference was statistically obvious (P < 0.05). The results of blood biochemistry, Digit Symbol Substitution Test (DSST), and Montreal Cognitive Assessment Scale (MoCA) in the test group showed no statistical difference compared with those in the control group. The running time of the improved k-means algorithm was dramatically shorter than that of traditional k-means algorithm, showing statistical difference (P < 0.05). Comparison among the improved and traditional k-means algorithm and mean shift algorithm suggested that the improved k-means algorithm showed a lower error rate for image segmentation, and the differences were statistically remarkable (P < 0.05). In conclusion, the improved k-means algorithm showed better time efficiency and the lowest error rate in processing rs-fMRI images than the traditional k-means algorithm and mean shift algorithm, and the effects of regular HD on the brains of patients with ESRD were evaluated effectively.