Artificial intelligence (AI) based business process optimization has a significant impact on a countryâs economic development. We argue that the use of artificial neural networks in business processes will help optimize these processes ensuring the necessary level in the functioning and compliance with the foundations of sustainable development. In this paper, we proposed a mathematical model using AI to detect outliers in the daily return of Saudi stock market (Tadawul). An outlier is defined as a data point that deviates too much from the rest of the observations in a data sample. Based on the Engle and Granger Causality test, we selected inflation rate, repo rate, and oil prices as input variables. In order to build the mathematical model, we first used the Tukey method to detect outliers in the stock return data from Tadawul that are collected during the period from October 2011 to December 2019. In this way, we categorized the stock return data into two classes, namely, outliers and nonoutliers. These data are further used to train artificial neural network in conjunction with particle swarm optimization algorithm. In order to assess the performance of the proposed model, we employed the mean squared error function. Our proposed model is signified by the mean squared error value of 0.05. The proposed model is capable of detecting outlier values directly from the inflation rate, repo rate, and oil prices. The proposed model can be helpful in developing and applying intelligent optimization techniques to solve problems in business processes.