Contaminated fresh produce remains a prominent catalyst for food-borne illnesses, prompting the need for swift and precise pathogen detection to mitigate health risks. This paper introduces an innovative strategy for identifying food-borne pathogens in fresh produce samples from local markets and grocery stores, utilizing optical sensing and machine learning. The core of our approach is a photonics-based sensor system, which instantaneously generates optical signals to detect pathogen presence. Machine learning algorithms process the copious sensor data to predict contamination probabilities in real time. Our study reveals compelling results, affirming the efficacy of our method in identifying prevalent food-borne pathogens, including Escherichia coli ( E. coli) and Salmonella enteric, across diverse fresh produce samples. The outcomes underline our approach's precision, achieving detection accuracies of up to 95%, surpassing traditional, time-consuming, and less accurate methods. Our method's key advantages encompass real-time capabilities, heightened accuracy, and cost-effectiveness, facilitating its adoption by both food industry stakeholders and regulatory bodies for quality assurance and safety oversight. Implementation holds the potential to elevate food safety and reduce wastage. Our research signifies a substantial stride toward the development of a dependable, real-time food safety monitoring system for fresh produce. Future research endeavors will be dedicated to optimizing system performance, crafting portable field sensors, and broadening pathogen detection capabilities. This novel approach promises substantial enhancements in food safety and public health.