## 4 Development of ANN Models  
ANNs generally consist of input, hidden and output layers. Each layer is composed of interconnected neurons. Every signal from each neuron in a layer is summed up by the neuron in the next layer. Then, bias and weights, which are adjusted by the training process, are applied to this summed-up value. Every signal from each neuron is calculated by the activation function. ANN models are of different types according to their structure, training method or method of processing data through the network. The feed-forward neural network, which comprises neurons in the input layer connected to only one succeeding layer, is the most common type of ANN [47; 48; 49]. Previous research [27] proved that a feed-forward neural network with two hidden layers is effective for viscosity estimation of pH-sensitive polymers for enhanced oil recovery. The parameters that are influential on the viscosity of the polymer solution need to be included in the input layer; therefore, polymer physics and oil field conditions should be considered in the selection of neurons for the input layer. A polymer solution for enhanced oil recovery is a non-Newtonian fluid, and the shear rate was included in the input layer. The viscosity of a polymer solution increases as the polymer concentration increases. The increased number of polymer molecules induces more interactions between polymer chains and results in more frictional effects that increase viscosity. Various monocations and divalent cations are found in the reservoir and can neutralize the charge in the polymer side chains. The viscosity of a polymer solution decreases when a cation is added. Na\({}^{+}\) is one of the most common cations in injection water and formation water that is directly in contact with the polymer. Previous studies [11; 15] reported that Ca\({}^{2+}\) causes greater viscosity reduction than other common divalent cations, such as Mg\({}^{2+}\). An increase in temperature results in enhanced activity of polymer molecules and reduced friction between molecules, which decreases viscosity. In this study, the input layer consists of five neurons, namely, shear rate, polymer concentration, NaCl concentration, Ca\({}^{2+}\) concentration and temperature. This study proposes three ANN models, one each for FlopaamTM 3330S, FlopaamTM 3630S and AN-125. Thus, the molecular weight and the degree of hydrolysis, which are polymer properties, were not included in the input layer. For training, validating and testing of the ANN model, the measured viscosity data for each polymer from the literature [46] based on shear rate, polymer concentration, NaCl concentration, Ca\({}^{2+}\) concentration and temperature were used as shown in Table 2. These data were randomly divided into training (70%), validation (15%) and test (15%) sets. For training the ANN model, the Levenberg-Marquardt method [50; 51] was applied as shown in Appendix. This method has been used for viscosity estimation effectively [23; 25; 27; 23]. \begin{table}
\begin{tabular}{c c c c c c} \hline \hline  & \multicolumn{4}{c}{**FlopaamTM 3330S, FlopaamTM 3630S, AN-125**} \\ \hline \multirow{2}{*}{**Case (\#)**} & **Shear** & **Polymer** & **NaCl concentration** & **Ca\({}^{2+}\) concentration** & **Temperature** \\  & **rate (s\({}^{-1}\))** & **concentration (wt \%)** & **(wt \%)** & **(wt \%)** & **(\({}^{\circ}\)C)** \\ \hline
1 & & & 0.1 & 0 & 25 \\
2 & & 0.05, 0.1, 0.2, 0.3 & 1 & 0 & 25 \\
3 & & & 4 & 0 & 25 \\
4 & & 0.1 & & 0 & 25 \\
5 & 0.01–1000 & 0.2 & 0.1, 0.5, 1, 2, 4 & 0 & 25 \\
6 & & 0.3 & & 0 & 25 \\
7 & & 0.3 & 0.1 & & 25 \\
8 & & 0.3 & 1 & 0, 0.05, 0.1, 0.15 & 25 \\
9 & & 0.3 & 4 & & 25 \\
10 & & 0.2 & 1 & 0 & 25, 50, 70, 90 \\ \hline \hline \end{tabular}
\end{table} 
Table 2: Conditions of polymer solutions. To identify the appropriate structure of the ANN model, a trial-and-error process was applied based on the number of neurons in the hidden layer and the activation function with data processing.