###### Abstract  
There are many methods to detect plant pests and diseases, but they are primarily time-consuming and costly. Computer vision techniques can recognize the pest- and disease-damaged fruits and provide clues to identify and treat the diseases and pests in their early stages. This study aimed to identify common pests, including the apple capsid (_Plesiocoris rugicollis_)/AC, apple coding moth (_Cydia pononcola_)/AC, Pear lace bug (_Stephanitis pyri_)/PLB, and one physiological disease-apple russeting/AR in two cultivars, Golden Delicious and Red Delicious, using the digital image processing and sparse coding method. The Sparse coding method is used to reduce the storage of the elements of images so that the matrix can be processed faster. There have been numerous studies on the identification of apple fruit diseases and pests. However, most of the previous studies focused only on diagnosing a pest or disease, not on computational volume reduction and rapid detection. This research focused on the comprehensive study on identifying pests and diseases of apple fruit using sparse coding. The sparse coding algorithm in this work was designed using Matlab software. The apple pest and disease detection were performed based on 11 characteristics: R, G, B, L, a, b, H, S, V, Sift, and Harris. The class detection accuracy using the sparse coding method was obtained for 10 classes with three views of apple for _S. pyri_ of red apple as 81%, _S. pyri_ of golden apple as 88%, golden apple russeting as 85%, _S. pyri_ and russeting of golden apple as 80%, codling moth of red apple as 86%, codling moth of golden apple as 72%, _S. pyri_ of red apple as 83%, _S. pyri_ of golden apple as 90%, codling moth and _S. pyri_ of red apple as 80%, and codling moth and _S. pyri_ of golden apple as 67%. The total processing time for developing the dictionary was 220 s. Once the dictionary was developed, pest and disease detection took only 0.175 s. The results of this study can be useful in developing automatic devices for the early detection of common pests and diseases of apples. Although the study was focused on apple diseases, results for this work have huge potential for other crops. p 202  
tree and reported that the number of pests varies from season to season throughout the year. Maintaining effective storage and identifying the pests and risk levels caused by different species are among the most critical tasks for protecting the apple tree. About 200 pests and diseases attack and destroy the apple [2; 3; 4].The traditional methods of apple pest and disease control, such as the use of chemicals, have failed to meet the expectations of growers and have had a devastating effect on the environment. The biological structure and different quantitative and qualitative evaluations for crops have led to the development of non-destructive experiments in recent years, among which computer vision has a particular position [5].With the recent advancement of precision agriculture in spot treatment, this technology's efficacy lies in the accuracy of detection of the area, where it needs intervention. The accuracy can be either on how accurate the sensors are used or the efficient algorithm using commercial off-the-shelf (cots) sensors. Therefore, it is beneficial to develop a system that can provide an easy, fast, inexpensive, and accurate method for the detection of plant pests and diseases [6; 7]. The automatic early detection of plant pests and diseases can help monitor large farms and gardens. In some developing countries, farmers spend considerable time detecting pests and diseases while working on other essential aspects of farming. Farmers understand that effective pest management only occurs when done at the right time. Failure to address this in a timely manner will have destructive consequences. There are numerous studies on identifying diseases and pests, but only a handful of investigations focused on storage volume reduction and rapid detection have been considered. [PERSON] et al.