Image classification is the classical issue in computer vision, machine learning, and image processing. The image classification is measured by differentiating the image into the prescribed category based on the content of the vision. In this paper, a novel classifier named RideSFO-NN is developed for image classification. The proposed method performs the image classification by undergoing two steps, namely feature extraction and classification. Initially, the images from various sources are provided to the proposed Weighted Shape-Size Pattern Spectra for pattern analysis. From the pattern analysis, the significant features are obtained for the classification. Here, the proposed Weighted Shape-Size Pattern Spectra is designed by modifying the gray-scale decomposition with Weight-Shape decomposition. Then, the classification is done based on Neural Network (NN) classifier, which is trained using an optimization approach. The optimization will be done by the proposed Ride Sunflower optimization (RideSFO) algorithm, which is the integration of Rider optimization algorithm (ROA), and Sunflower optimization algorithm (SFO). Finally, the image classification performance is evaluated using RideSFO-NN based on sensitivity, specificity, and accuracy. The developed RideSFO-NN method achieves the maximal accuracy of 94%, maximal sensitivity of 93.87%, and maximal specificity of 90.52% based on K-Fold.