This study analyses the toxicity levels of fruits and vegetables by identifying the presence of polycyclic aromatic hydrocarbons (PAHs), particularly in areas affected by industrial and vehicle pollution. The presence of PAHs on plant surfaces, caused mostly by air pollution particulate matter, raises serious concerns about the nutritional value of these foods. Traditional techniques for measuring PAH levels include Gas Chromatography/Mass Spectrometry (GC/MS) and High-Performance Liquid Chromatography (HPLC). Although successful, these procedures are expensive and time-consuming. Toxicity detection is often based on expert knowledge or experimental analysis relative to the European Food Safety Authority’s (EFSA) limits. In response to these challenges, this work uses artificial intelligence approaches to determine toxicity levels using 16 PAHs. Data on PAH concentrations in fruits and vegetables were collected from a variety of sources, classified as safe or harmful, and verified using statistical analysis. The validated dataset was subsequently classified using several machine learning techniques. The level of toxicity is scaled and compared to the expected outputs using the results obtained from the neural network. An experimental investigation validates the promising findings of level of toxicity classification using artificial intelligence approaches, which are then evaluated statistically. The study shows that machine learning algorithms obtained classification accuracies of over 90 %, including the evaluation of harmfulness. The accuracy for the two-class (Safe and Unsafe) category was 98.27 %, while the accuracy for the four-class (No harm, Low harm, Moderate Harm, and Severe harm) category was 98.68 %. These findings highlight the potential of artificial intelligence in improving food safety and public health by presenting an innovative multidisciplinary method to assessing the impacts of environmental pollutants on the edibility of fruits and vegetables in the context of climate change.