Using Adaptive Neuro-Fuzzy Inference System and Deep Learning to
Predict and Estimate the Current Stock Prices
Ying Bai
1
and Dali Wang
2
1
Johnson C. Smith University, 100 Beatties Ford Rd., Charlotte, U.S.A.
2
Christopher Newport Newport News, U.S.A.
ybai@jcsu.edu, dwang@cnu.edu
Keywords: ANFIS Algorithm, Deep Learning Model, Estimate and Predict Current Stock Prices, AI Applications in
Financial Implementations.
Abstract: To correctly and accurately predict and estimate the stock prices to get the maximum profit is a challenging
task, and it is critical important to all financial institutions under the current fluctuation situation. In this study,
we try to use different AI methods and algorithms, such as Adaptive Neuro Fuzzy Inference System (ANFIS)
and Deep Learning (DL), to easily and correctly predict and estimate the current and future possible stock
prices. Combining with some appropriate pre-data-processing techniques, the current stock prices could be
accurately and quickly estimated via those models. In this research, both algorithms are designed and built to
help decision makers working in the financial institutions to easily and conveniently predict the current stock
prices. The minimum training and checking RMSE values for ANFIS model can be 0.0009828 and 0.001713.
The minimum MSE value for DL model is 0.0000047 with a regression value of 0.9958.
1 INTRODUCTION
As the fast development of AI technologies, such as
fuzzy inference systems, machine learning and deep
learning, today various AI related algorithms have
been widely implemented in financial fields to
estimate and predict the stock values, currency
exchanging rates, bonus analyses and all other related
applications (Chen et al, 2019).
Most of research are concentrated on stock
predictions or estimations based on neural networks,
machine learning, and deep learning studies.
Different and various machine learning algorithms
accompanied with some sophisticated additions are
applied on stock analyses and predications to improve
the accuracy of prediction on stock markets. Chong et
al. reported to use Ensemble of Deep Neural
Networks to performance prediction for stock
markets (Chong et al, 2020). L. Yu developed an
algorithm based on deep learning and neural networks
to improve the analyses for economic and financial
data (Yu, 2022). Polepally et al. and Pardeshi and
Kale reported to use machine learning and deep
learning algorithms to improve the prediction
accuracy for current stock prices (Pardeshi and Kale,
2021). H. J. Singh, et al. (Singh, et al., 2022) and Y.
Lin et al. (Lin et al., 2021) developed a novel
multivariate recurrent neural network and a new
convolutional neural network with long short term
memory combined model to estimate the current
stock prices and their tendency (Lin et al, 2021).
Singh et al. performed a comparative studies and
analysis for different stock price prediction
techniques developed in recent years (Singh et al,
2022). S. Roy and S. Tanveer, 2023 (Roy and
Tanveer, 2023) developed an algorithm to forecast
stock price by using DeepNet method. Instead of
using any traditional machine learning model, Tarsi
et al. (Tarsi et al., 2023) utilized a Long Short Term
Memory (LSTM), which is a variation of machine
learning model, to predict the stock price. (Mandee,
A. et al. (Mandee et al., 2022) utilized an explainable
artificial intelligence XAI to predict stock market
trends.
Chinprasatsak et al. (Chinprasatsak et al., 2020)
reported to use neural network for forecasting high
and low price on foreign exchange market. A.
Alamsyah and W. H. Aprillia and P. Aggarwal and A.
K. Sahani (Alamsyah et al., 2020) performed some
studies in comparisons of the foreign currency
prediction performance with neural network
algorithms. T. A. Bui et al (Bui et al., 2022) reported
to use neural networks and CNN-RNN based hybrid
Bai, Y. and Wang, D.
Using Adaptive Neuro-Fuzzy Inference System and Deep Learning to Predict and Estimate the Current Stock Prices.
DOI: 10.5220/0013335100003956
Paper published under CC license (CC BY-NC-ND 4.0)
In Proceedings of the 7th International Conference on Finance, Economics, Management and IT Business (FEMIB 2025), pages 183-188
ISBN: 978-989-758-748-1; ISSN: 2184-5891
Proceedings Copyright © 2025 by SCITEPRESS Science and Technology Publications, Lda.
183
machine learning model to predict the currency
exchange rate. E. Sarmas et al (Sarmas et al., 2022)
performed a comparison study among different
machine learning classification methods used for
currency exchange rate trends. A. L. C. Tak and R.
Logeswaran (Tak and Logeswaran, 2022) also
developed a foreign currency prediction method
based on machine learning techniques.
To correctly and accurately predict and estimate
the current stock prices to get the maximum profit via
different AI methods, some correct AI models are
necessary with popular algorithms, such as Adaptive
Neuro Fuzzy Inference System (ANFIS) and Deep
Learning (DL). Combining with some appropriate
pre-data-processing techniques, the current stock
prices could be accurately and quickly estimated via
those models. In this research, both algorithms are
designed and built to help decision makers working
in the financial institutions to easily and conveniently
predict the current stock prices.
Stock prices are changed at any moment, and they
may be varied significantly day by day, month by
month and year by year. Due to the heavy complicity
and unforeseen variations on the current market, to
correctly and accurately predict the stock prices needs
the following factors and operational steps to be
taken:
1) The changing or variation of the stock prices
can be considered as a periodic function, and
this period could be 3 months, 6 months or
longer, which depends on the target period on
each research. In our case, we used 3 months
as a period.
2) Based on assumptions above, we utilized the
Google Stock dataset to train and check our
target ANFIS and DL models.
This study is divided into 6 sections; after this
Introduction, an introduction to two Google Stock
datasets used to train and check AI models is given in
section 2. The ANFIS and its implementations is
discussed in section 3. A discussion about DL is given
in section 4. The experiment studies and results are
given in section 5. The conclusion and future works
are provided in section 6.
2 GOOGLE STOCK DATASET
Two Google Stock datasets (Kaggle, 2012), one
contained 5-year stock transaction records from Jan.
3, 2012 to December 30, 2016, and the other
included1-month stock transaction records from
January 3, 2017 to January 31, 2017, are utilized in
this study. The first one is used as the training and
checking data for ANFIS and DL models, and the
second works as the testing and validation purpose for
those models.
Figure 1: A typical structure of the ANFIS.
Each dataset contained six columns, Date, Open,
High, Low, Volume and Close, with both 5-year and
1-month stock price records. Each related column can
be mapped to the Opening price, Highest price,
Lowest price, transaction Volume and Closing price.
For our study, we only need four of them; Open,
High, Low and Close. In fact, we use the first three
columns, Open, High, Low as inputs and the Close
column as the output.
A critical key issue in using those data to train,
check and test our ANFIS or DL models is the data
preprocessing. As everybody knows, the stock prices
are changed or varied in every moment at a time, not
each day, and the amounts they changed are
significant with a relatively wider range, or even
dynamically, for a period of time. This provided a
challenging issue when using ANFIS, especially
using the fuzzy rules, to estimate the output or the
closing price due to the significant variations in the
price values. In the worst case, the ANFIS could not
perform its normal or correct FIS function due to the
out-of-bound of the input values with significant large
or big different price values for different time period.
To effectively correct or solve this important and
key issue, we need to preprocess those data, exactly
to perform a normalization job for those data to
enable them to be used in our model training and
checking processes. In summary or in a short word,
we only take care of those relative changing values on
the prices, but not for the absolute changing values,
which is good enough for us since we only pay our
attention to the changing values in trends or tendency
on the stock prices.
H
M
Π
Π
Π
Π
N
N
N
N
W
11
W
12
Σ
Close
W
13
W
31
W
11
W
12
W
13
W
21
Layer 1
Layer 2
Layer 3
Layer 4
Layer 5
L
H
L
Π
N
N
W
32
W
33
W
32
f
33
M
……
Open
High
Lo
w
Open
L
High Low
MFs
FEMIB 2025 - 7th International Conference on Finance, Economics, Management and IT Business
184
3 INTRODUCTION TO ANFIS
The so-called ANFIS is exactly a combination of two
soft-computing techniques: Artificial Neural
Network (ANN) and Fuzzy Inference System (FIS),
which was first introduced by (Jyh-Shing Roger Jang,
1992). The FIS used a Sugeno fuzzy inference system
and its structure is similar to a multilayer feed
forward neural network structure, but the difference
is that the links between nodes in ANFIS define the
signals’ flow direction and there are no associated
weight factors with the links. It consists of a network
of neurons that communicate between the input and
hidden layers, as well as the hidden and output layers.
Each layer consists of neurons constructed
according to the principles of fuzzy control. Figure 1
shows a Sugeno fuzzy model with 27 rules along with
a corresponding ANFIS architecture. In our case,
total 27 rules in the method of “If-Then” for the
Sugeno model are considered with x and y as inputs
and f as output (Imran et al., 2019). 27 rules are
defined as below (three input columns – Open, High,
Low, L: value low, M: value mid, H: value high):
R
1
: If Open is L and High is L, and Low is L,
then f
111
= p
111
Open + q
111
High + r
111
Low + c
111
R
2
: If Open is L and High is L, and Low is M,
then f
112
= p
112
Open+ q
112
High + r
112
Low + c
112
R
3
: If Open is L and High is M, and Low is L,
then f
21
= p
113
Open + q
113
High + r
113
Low + c
113
R
4
: If Open is L and High is M, and Low is M,
then f
22
= p
211
Open + q
211
High + r
211
Low + c
211
4 ANN AND DEEP LEARNING
An artificial neural network (ANN) has multiple
nodes with multiple layers, including input layer,
output layer and hidden layers. Figure 2 shows a
model of multiple layers feed forward ANN or DL.
The dash lines means that multilayer are included in
this ANN and these layers cannot be observable. In
Figure 2, on each feed forward arrow branch from
one node to another, a weight factor w
ij
should be
multiplied to obtain a complete transfer signal.
Figure 2: A multilayer feed-forward ANN or DL model.
A neural network can be adjusted or trained, so
that a particular input leads to a corresponding target
output. The network is adjusted, based on a
comparison between the output and the target, until
the network output matches the target. Typically,
many such input-target pairs are needed to train a
network, which is called a supervised learning model.
As we did for the ANFIS, the Google Stock
dataset is utilized to train, check and test this DL
model. Three columns, Open, High and Low, work
asinputs and the Close as the output. Totally 1200 sets
of data are used with 70% as training data, 15%
as
checking data and 15% as testing data. The
Levenberg-Marquard training
algorithm and
MATLAB Deeping Learning Toolbox are used to
perform these tasks to generate our desired ANN/DL
model with 15 hidden layers. The ANN/DL structure
is shown in Figure 3.
Figure 3: The structure used in our ANN/DL model.
5 EXPERIMENTAL RESULTS
By using the Google Stock 5-year dataset as the
training and checking data to train and check our
ANFIS model, the model structure and the training
result is shown in Figure 4.
Figure 4: The ANFIS model training results.
The testing and performance results for the
ANN/DL model are shown in Figure 5.
.
.
.
Inputs
Outputs
Hidden Layers
Using Adaptive Neuro-Fuzzy Inference System and Deep Learning to Predict and Estimate the Current Stock Prices
185
Figure 5: The validation and performance results.
(a)
(b)
Figure 6: Comparison ANFIS and ANN/DL algorithms.
A comparison study is performed for the validation
errors between the ANFIS and ANN/DL model, and
this comparison result is shown in Figure 6. Both
validation errors are RMS values by comparing the
actual output and the checking data inputs for ANFIS
and ANN/DL systems used in this study.
It can be found that the RMSE value for the
ANFIS method is about 0.0016, and the RMSE value
for ANN/DL model is 0.0044 with a regression value
of 0.9954. The ANFIS algorithm result is better
compared with the ANN/DL algorithm for our study,
exactly the ANFIS algorithm is about 64% better than
that of ANN/DL algorithm by checking the validation
RMSE error values in Figure 6 for our study.
6 CONCLUSIONS
With the help of MATLAB Fuzzy Logic and Deep
Learning Toolboxes as well as Google Stock dataset,
we develop two AI models with two related
algorithms, ANFIS and ANN/DL, to perform
prediction for stock prices. First we utilized Google
Stock 5-year dataset to train ANFIS and ANN
models. To confirm and check the effectiveness and
accuracy, we utilized another Google Stock 1-month
dataset to validate both models. A comparison result
shows that the ANFIS model overtakes the ANN/DL
model for our study.
REFERENCES
Aggarwal P. and Sahani A. K., (2020), "Comparison of
Neural Networks for Foreign Exchange Rate
Prediction," IEEE 15th International Conference on
Industrial and Information Systems (ICIIS),
RUPNAGAR, India, pp. 415-419, doi:
10.1109/ICIIS51140.2020.9342733.
Alamsyah and Aprillia W. H., (2022), "Comparison of
Predictions Foreign Currency Exchange Rates (USD,
JPY, EUR, GBP, CHF, CAD) to Rupiah (IDR) using
Artificial Neural Network and Long Short-Term
Memory," 6th International Conference on Information
Technology, Information Systems and Electrical
Engineering (ICITISEE), Yogyakarta, Indonesia, pp.
585-590, doi: 10.1109/ICITISEE57756.2022.
10057683.
Biswal A., (2023), Stock Price Prediction Using Machine
Learning: An Easy Guide, lesson 21 of 34, Simplilearn.
Bui T. A., Pashchenko F. F., Pashchenko A. F. and Kudinov
Y. I., (2020), "Using Neural Networks To Predict
Exchange Rates," 13th International Conference
"Management of large-scale system development"
(MLSD), Moscow, Russia, pp. 1-5, doi:
10.1109/MLSD49919.2020.9247748.
Chen C. T., Chiang L. K., Huang Y. C. and Huang S. H.,
(2019), "Forecasting Interaction of Exchange Rates
Between Fiat Currencies and Cryptocurrencies Based
on Deep Relation Networks," IEEE International
FEMIB 2025 - 7th International Conference on Finance, Economics, Management and IT Business
186
Conference on Agents (ICA), Jinan, China, 2019, pp.
69-72, doi: 10.1109/AGENTS.2019.8929155.
Chinprasatsak K., Niparnan N. and Sudsang A., (2020),
"Neural Network for Forecasting High Price and Low
Price on Foreign Exchange Market," 17th International
Conference on Electrical Engineering/Electronics,
Computer, Telecommunications and Information
Technology (ECTI-CON), Phuket, Thailand, pp. 461-
465, doi: 10.1109/ECTI-CON49241.2020.9158133.
Chong L. S., Lim K. M. and Lee C. P., (2020), "Stock
Market Prediction using Ensemble of Deep Neural
Networks," 2020 IEEE 2nd International Conference
on Artificial Intelligence in Engineering and
Technology (IICAIET), Kota Kinabalu, Malaysia, pp.
1-5, doi: 10.1109/IICAIET49801.2020.9257864.
Guo Y., (2020), "Stock Price Prediction Based on LSTM
Neural Network: the Effectiveness of News Sentiment
Analysis," 2nd International Conference on Economic
Management and Model Engineering (ICEMME),
Chongqing, China, pp. 1018-1024, doi:
10.1109/ICEMME51517.2020.00206.
https://www.kaggle.com/datasets/vaibhavsxn/google-
stock-prices-training-and-test-data (2012).
Imran M., Alsuhaibani Sarah A., (2019), Chapter 7 - A
Neuro-Fuzzy Inference Model for Diabetic Retinopathy
Classification, Editor(s): D. Jude Hemanth, Deepak
Gupta, Valentina Emilia Balas, In Intelligent Data-
Centric Systems, Intelligent Data Analysis for
Biomedical Applications, Academic Press, Pages 147-
172, ISBN 9780128155530.
Jang J. R., "Self-learning fuzzy controllers based on
temporal back propagation," (1992), in IEEE
Transactions on Neural Networks, Vol. 3, No. 5,
pp.714-723, doi: 10.1109/72.159060.
Lamba V., Hooda S., Solanki V., Ahuja R., Ahuja S. and
Kaur A., (2021), "Comparative Analysis of Artificial
Neural Networks for Predicting Nifty 50 value in The
Indian Stock Market," 5th International Conference on
Information Systems and Computer Networks
(ISCON), Mathura, India, pp. 1-5, doi:
10.1109/ISCON52037.2021.9702400.
Lin Y., Zhong Q., Huang Q., Li M. and Ma F., (2021), "A
new convolutional neural network and long short term
memory combined model for stock index prediction,"
14th International Congress on Image and Signal
Processing, BioMedical Engineering and Informatics
(CISP-BMEI), Shanghai, China, pp. 1-6, doi:
10.1109/CISP-BMEI53629.2021.9624337.
Mandee, Agarwal A., Bhatia A., Malhi A., Kaler P. and
Pannu H. S., (2022), "Machine Learning Based
Explainable Financial Forecasting," 4th International
Conference on Computer Communication and the
Internet (ICCCI), Chiba, Japan, pp. 34-38, doi:
10.1109/ICCCI55554.2022.9850272.
Moghaddam H., Moghaddam M. H., Esfandyari M.,
(2016),Stock market index prediction using artificial
neural network”, Journal of Economics, Finance and
Administrative Science, pp.1-12.
Pardeshi Y. K. and Kale P. P., (2021), "Technical Analysis
Indicators in Stock Market Using Machine Learning: A
Comparative Analysis," 12th International Conference
on Computing Communication and Networking
Technologies (ICCCNT), Kharagpur, India, pp. 1-6,
doi: 10.1109/ICCCNT51525.2021.9580172.
Polepally V., Nandini Reddy N. S., Sindhuja M., Anjali and
Reddy, (2021), "A Deep Learning Approach for
Prediction of Stock Price Based on Neural Network
Models: LSTM and GRU," 12th International
Conference on Computing Communication and
Networking Technologies (ICCCNT), Kharagpur,
India, pp. 1-4, doi: 10.1109/ICCCNT51525.
2021.9579782.
Roy and Tanveer, (2023), "Stock Price Forcasting using
DeepNet," International Conference on Computational
Intelligence, Communication Technology and
Networking (CICTN), Ghaziabad, India, pp. 418-420,
doi: 10.1109/CICTN57981.2023.10141100.
Sarmas E. et al., (2022), "Comparison of Machine Learning
Classifiers for Exchange Rate Trend Forecasting," 13th
International Conference on Information, Intelligence,
Systems & Applications (IISA), Corfu, Greece, pp. 1-
7, doi: 10.1109/IISA56318.2022.9904380.
Singh A., Bhardwaj G., Srivastava A. P., Bindra A.,
Chaudhary and Ritika, (2022), "Application of Neural
Network to Technical Analysis of Stock Market
Prediction," 3rd International Conference on Intelligent
Engineering and Management (ICIEM), London,
United Kingdom, pp. 302-306, doi:
10.1109/ICIEM54221.2022.9853162.
Singh G. et al., (2022), "CNN-RNN based Hybrid Machine
Learning Model to Predict the Currency Exchange
Rate: USD to INR," 2nd International Conference on
Advance Computing and Innovative Technologies in
Engineering (ICACITE), Greater Noida, India, pp.
1668-1672, doi: 10.1109/ICACITE53722.
2022.9823844.
Singh H. J., Ghosh K. and Sharma S., (2022), "A Novel
Multivariate Recurrent Neural Network based Analysis
Model for Predicting Stock Prices," 2nd International
Conference on Innovative Sustainable Computational
Technologies (CISCT), Dehradun, India, pp. 1-6, doi:
10.1109/CISCT55310.2022.10046540.
Singh K., Thapliyal and Barthwal, (2022), "A comparative
analysis of stock price prediction techniques," 2022 7th
International Conference on Computing,
Communication and Security (ICCCS), Seoul, Korea,
Republic of, pp.1-4, doi: 10.1109/ICCCS55188.
2022.10079696.
Tak A. L. C. and Logeswaran R., (2022), "Foreign
Currency Exchange Market Prediction using Machine
Learning Techniques," IEEE International Conference
on Distributed Computing and Electrical Circuits and
Electronics (ICDCECE), Ballari, India, pp. 1-5, doi:
10.1109/ICDCECE53908.2022.9792832.
Tarsi M., Douzi S. and Marzak A., (2023), "Predicting
stock price using LSTM and Social Media dataset," 3rd
International Conference on Innovative Research in
Applied Science, Engineering and Technology
(IRASET), Mohammedia, Morocco, pp. 1-4, doi:
10.1109/IRASET57153.2023.10152930.
Using Adaptive Neuro-Fuzzy Inference System and Deep Learning to Predict and Estimate the Current Stock Prices
187
Thu H. G. T., Thanh T. N. and Quy T. L., (2021), "A
Neighborhood Deep Neural Network Model using
Sliding Window for Stock Price Prediction," IEEE
International Conference on Big Data and Smart
Computing (BigComp), Jeju Island, Korea (South), pp.
69-74, doi: 10.1109/BigComp51126.2021.00022.
Yu L., 2022, "Economic and Financial Data Analysis
System Based on Deep Learning and Neural Network
Algorithm," (2022), International Conference on
Knowledge Engineering and Communication Systems
(ICKES), Chickballapur, India, pp. 1-5, doi:
10.1109/ICKECS56523.2022.10060240.
FEMIB 2025 - 7th International Conference on Finance, Economics, Management and IT Business
188