Due to its widespread cultivation and large yields by most farmers, cotton is another vital cash crop. However, a number of illnesses lower the quantity and quality of cotton harvests, which causes a large loss in output. Early diagnosis detection of these illnesses is essential. This study employs a thorough methodology to solve the crucial job of cotton leaf disease identification by utilising the "Cotton-Leaf-Infection" dataset. Preprocessing is the first step, in which noise is removed from the dataset using a Prewitt filter, which improves the signal-to-noise ratio. Next, a state-of-the-art process for image classification errands called Vision Transformer (ViT) model is used to carry out the disease categorization. Additionally, the study presents the African Buffalo Optimisation (ABO) method, which optimises weight during the classification procedure. The African buffalo's cooperative behaviour served as the model's inspiration for the ABO algorithm, which is remarkably effective at optimising the model's parameters. By integrating ABO, the problems caused by the dynamic character of real-world agricultural datasets are addressed and improved model resilience and generalisation are facilitated. The suggested ViT-based categorization model shows remarkable effectiveness, with a remarkable 99.3% accuracy rate. This performance is higher than current models.