In order to stop deterioration and give patients with Alzheimer's disease (AD) early therapy, it is crucial to correctly diagnose AD and its early stage, mild cognitive impairment (MCI). A framework for diagnosing AD is presented in this paper, which includes magnetic resonance imaging (MRI) image preprocessing, feature extraction, and the Fuzzy k-nearest neighbor algorithm (FKNN) model. In particular, the framework's novelty lies in the use of an improved Harris Hawks Optimization (HHO) algorithm named SSFSHHO, which integrates the Sobol sequence and Stochastic Fractal Search (SFS) mechanisms for optimizing the parameters of FKNN. The HHO method improves the quality of the initial population overall by incorporating the Sobol sequence, and the SFS mechanism increases the algorithm's capacity to get out of the local optimum solution. Comparisons with other classical meta-heuristic algorithms, state-of-the-art HHO variants in low and high dimensions, and enhanced meta-heuristic algorithms on 30 typical IEEE CEC2014 benchmark test problems show that the overall performance of SSFSHHO is significantly better than other comparative algorithms. Moreover, the created framework based on the SSFSHHO-FKNN model is employed to classify AD and MCI using MRI scans from the ADNI dataset, achieving high classification performance for 6 representative cases. Experimental findings indicate that the proposed algorithm performs better than a number of high-performance optimization algorithms and classical machine learning algorithms, thus offering a promising approach for AD classification. Additionally, the proposed strategy can successfully identify relevant features and enhance classification performance for AD diagnosis.