The quality of fruits and vegetables plays a vital role in ensuring proper nutrition and preventing health risks. Consuming fresh produce offers significant nutritional and antioxidant benefits, whereas spoiled items may expose consumers to harmful microorganisms and nutrient loss. This study emphasizes the importance of assessing fruit and vegetable quality for human health and proposes an efficient deep learning-based approach for automatic classification of fresh and rotten samples. Deep learning techniques enable effective feature extraction from complex image datasets, allowing precise identification of subtle visual cues related to freshness or decay. In this research, two benchmark datasets were combined and analyzed to create a new labeled dataset. Three image filtering techniques were applied for enhanced preprocessing and model performance. A modified ResNet-18 architecture was developed and fine-tuned to classify fruits and vegetables based on quality. Experimental results demonstrate that the proposed model achieved a maximum accuracy of 98% using input images of size 224×224, a batch size of 64, and 10 epochs. The proposed approach provides a reliable and automated solution for fruit and vegetable quality assessment, which can assist consumers, retailers, and agricultural sectors in maintaining food safety and freshness.