Abstract Pain assessment plays a critical role in clinical decision-making, yet conventional methods rely heavily on subjective self-reports such as the Visual Analog Scale (VAS) or the Numeric Rating Scale (NRS). These approaches fail in scenarios involving infants, sedated patients, unconscious individuals, or those with cognitive or communication impairments. To address this gap, this research proposes PainNet, an AI-driven, real-time facial pain recognition system that integrates deep learning-based object detection with Action Unit (AU)–based pain intensity scoring. The system uses YOLOv8 for rapid facial expression detection and incorporates Py-Feat to extract pain-relevant AUs, enabling computation of the Prkachin and Solomon Pain Intensity (PSPI) score. A balanced dataset comprising 500 images sourced from Delaware, BioVid, and RaFD was curated, annotated, and preprocessed for training. The YOLOv8-based binary pain vs. no-pain classifier achieved a mean Average Precision (mAP) of 0.89 and an F1-score of 0.80 on the test dataset, demonstrating strong performance in diverse environments and facial variations. The design emphasizes computational efficiency by activating AU analysis only when YOLOv8 detects probable pain, making PainNet suitable for continuous monitoring in ICUs, elder-care facilities, and telemedicine systems. This study demonstrates that the fusion of real-time object detection and clinically validated AU scoring can significantly advance automated, objective, and scalable pain assessment.