The traditional methods used to identify plant diseases mostly rely on expert opinion, which causes long waits and enormous expenses in the control of crop diseases and field activities, especially given that the majority of crop infections now in existence have tiny targets, occlusions, and looks that are similar to those of other diseases. To increase the efficiency and precision of rust disease classification in a fava bean field, a new optimized multilayer deep learning model called YOLOv8 is suggested in this study. 3296 images were collected from a farm in eastern Morocco for the fava bean rust disease dataset. We labeled all the data before training, evaluating, and testing our model. The results demonstrate that the model developed using transfer learning has a higher recognition precision than the other models, reaching 95.1%, and can classify and identify diseases into three severity levels: healthy, moderate, and critical. As performance indicators, the needed standards for mean Average Precision (mAP), recall, and F1 score are 93.7%, 90.3%, and 92%, respectively. The improved model's detection speed was 10.1 ms, sufficient for real-time detection. This study is the first to employ a new method to find rust in fava bean crops. Results are encouraging and supply new opportunities for crop disease research.