## 3 Proposed Method
### Proposed Framework  
This paper proposes a deep CA-based feature extraction approach for image classification. Figure 5 presents an overview of the proposed framework, and it is divided into two stages: training and testing. The images in different magnification factors are performed separately. For the training stage, the images in the training set are resized from 700 \(\times\) 460 pixels to 350 \(\times\) 320 pixels. Then, each image is randomly extracted into 100 patches with sizes of 64 \(\times\) 64 pixels, and the images' contrast is improved using the GLCM-CA algorithm suggested by [15]. We then feed all image patches to separately train the DeepCA model for each class via the DeepCA training algorithm according to Algorithm 1 and Figure 6. This process determines the best rule vector for the CA and the score matrices. Then, the rule vector and the score matrices are adopted to  
Figure 4: Totalistic rules: (**a**) the neighboring rules’ numbering conventions; (**b**–**e**) examples of rules 35, 137, 273, and 511, respectively. reproduce the training set and feed the data to train fully connected neural networks (FCNNs). Finally, during the testing stage, the images in the testing set are subjected to the same process except for the configuration of DeepCA and the FCNNs that apply the rule vector, score matrices and weights obtained by the training process to determine the classification results. The main architecture of DeepCA is shown in Figure 7, which is constructed with multiple layers from \(Layer-1\) to \(Layer-n\) by applying Equation (12) as \(F(x)=f_{out}(f_{pool}(f_{pool}(f_{conv}(f_{pool}(f_{conv}(f_{pool}(f_{conv}(f_{ fin}(x)))))))))\)). In this architecture, the first functional layer (\(f_{in}\)) separates each input image into R, G, and B channels and then feeds the image to the next layer. Then, we apply the convolution function (\(f_{conv}\)) to convolve each image channel with the rule vector in the second layer. The initial parameters of the model in this layer are set as follows: the size of the kernel is set to 3 \(\times\) 3 according to the Moore neighborhood, the zero padding level is set to 2, and the number of strides is set to 1. Then, the data features extracted by the rules produce the results to be used as feature matrices. Finally, the scoring matrices can be built from the feature matrices obtained from several layers according to Equation (8) and Figure 7; the \(maxPool\) function is employed for all pooling functions (\(f_{pool}\)), and then the score matrices can be directly obtained by the functional output layer (\(f_{out}\)). Figure 5: Overview of the proposed framework. Figure 6: DeepCA training process. ```
Input :Images \(I\) in RGB format. Output :\(S_{model}\) and \(R_{out}\). 1 Initialization : 2-3
2\(N\gets 3\times 3\)
3\(I\leftarrow\{i_{1},i_{2},\cdots_{k}\}\)
4 LOOP Process: 5-26
5 foreach layer \(n|(n=1,2,\ldots,L)\)do
6\(I^{n}\gets I\)\(\triangleright\) Assign \(I\) to \(I\) at \(n^{th}\)layer
7\(R^{n}\leftarrow\{r_{1},r_{2},\ldots,r_{m}\}\)\(\triangleright\) Initial \(R^{n}\) by Equation (10)
8\(F^{n}_{max}\gets 0,i\gets 0\)\(\triangleright\) Initial \(F^{n}_{max}\) and \(I\) with 0
9 while!convergencedo
10 foreachimage\(\in I^{n}\)do
11 forall\(r\in R^{n}\)do
12\(F^{n}\gets f_{conv}(I^{n},R^{n},s)\)\(\triangleright\) Compute \(F^{n}\) by Equation (7)
13\(F^{temp}_{max}\gets f_{pool}(F^{n},N,s)\)
14
15 end for
16\(F^{n}_{max}\gets sum(F^{n}_{max^{\prime}}F^{temp}_{max})\)\(\triangleright\) Sum \(F^{n}_{max}\) of all images. 17
18 end for
19\(r_{i}\leftarrow\operatorname*{arg\,max}_{r\in R^{n}}(\sum F^{n}_{max}(r))\)
20\(R_{out}\gets r_{i}\)\(I^{new}\gets f_{conv}(I^{n},R_{out},s)\)
21\(I^{n}\gets I^{new}\)
22\(i\gets i+1\)
23 end for
24\(F^{n}\gets f_{conv}(I,R_{out},s)\)\(\triangleright\) Define the score matrix. 25\(S\gets F^{n}\)\(\triangleright\) Build final score matrix. 26
27 end for return\(S_{model}\) and \(R_{out}\)
```  
**Algorithm 1**Training algorithm for DeepCA.