Postoperative pain (POP) affects millions of Americans and incurs significant costs to the US healthcare system. Poorly managed acute POP can lead to increased morbidity, mortality, and complications such as chronic POP and opioid overuse. Accurate prediction of POP outcomes and in-depth understanding of POP causal mechanisms are crucial for developing effective management strategies to achieve timely POP control and reduce the risk of opioid overuse. Furthermore, POP studies have shown the heterogeneity of responses to anesthesia methods and postoperative substance use, suggesting an urgent need for effective methods to identify the optimal individualized POP management strategy. However, achieving these goals is challenging due to the complex POP mechanisms and limited data from ideal large randomized controlled trials. On the other hand, abundant observational POP data found in surgery patients’ electronic health records (EHRs) are readily available, and they can serve as cost-effective alternatives to address these fundamental knowledge gaps in POP management. However, the etiology of POP can be intricate due to their observational nature, i.e., many factors may interweave together and impact POP phenotypes in complex fashions, introducing daunting modeling and analytical challenges. In particular, confounding, a major concern associated with observational data, represents a critical challenge for conducting solid causal inference on POP data. Further, POP outcomes, e.g., POP intensity, are often irregularly and repeatedly measured, and distributed non-normally with two distinct data processes, requiring more advanced analysis methods. This proposal aims to overcome these analytic and modeling challenges by developing robust deep learning-based computational tools to improve POP management. Specifically, we will 1) establish robust deep learning models for more accurate predictions of both acute and chronic POP to achieve timely POP control and care, and reduce the risk of opioid overuse; 2) develop efficient deep learning-based semi-parametric methods to identify POP causal mechanisms for designing more effective interventions; and 3) propose powerful analytical methods to conduct robust hidden subgroup analysis to achieve the optimal individualized POP management. Methods developed in this proposal are motivated and will be tested by two unique data sets: a large EHR data from the University of North Carolina at Chapel Hill’s Carolina Data Warehouse for Health (CDW-H), and a high-quality cohort data from NIH-funded TEMporal PostOperative Pain Signatures study, which complements the CDW-H in scale and scope. Ultimately, the project aims to uncover fundamental clinical mechanisms of POP and improve clinical decision-making and POP management.