The pursuit of next-generation non-steroidal anti-inflammatory drugs (NSAIDs) remains a critical focus in pharmaceutical research, given that over a billion individuals experience pain and inflammation. A key strategy in this effort involves developing a quantitative correlation between the anti-inflammatory potential and the molecular descriptors of cyclooxygenase-2 (COX-2) inhibitors, which will facilitate the identification and advancement of novel NSAIDs that minimize adverse effects associated with COX-1 inhibition. In this study, the random forest (RF) algorithm was used to construct a highly predictive quantitative model to assess the inhibitory activity of various compounds targeting COX-2. The resulting model demonstrated an outstanding classification accuracy of 93% with an AUC of 0.98. When applied to external datasets, it identified 759 newly designed COX-2 inhibitor derivatives and 188 structurally related compounds as active, with 19 emerging as strong candidates for COX-2-targeted anti-inflammatory agents. Among these compounds, the top two compounds showed the highest probability of activity and exhibited superior binding affinity to COX-2 compared to existing selective inhibitors. Furthermore, the RF model proved to be conservative in predicting active compounds, reducing the risk of late-stage failures in drug discovery and increasing the efficiency of the development process.