## 3 The Proposed Method
### Fitness Function  
In this paper, only a few random instances are selected from the training set and the classification success is evaluated only after the training of the instances. Therefore, it is aimed to obtain more information from the instances. The classification accuracy is not used as a fitness function alone in order to avoid models over-fitting training instances. Instead, the fitness function that evaluates the distance along with the classification accuracy. To make a reliable and fair comparison, same parameter values are chosen as in [29] and the fitness function (objective function) is adapted as defined in Equation (4). \[\mathit{Fitness}=1-(\frac{Accuracy+Distance}{2}) \tag{4}\]  
The classification accuracy is obtained by the ratio of the number of correctly classified instances to the total number of instances. Accuracy is defined Equation (5). \[Accuracy=\frac{N_{correct}}{N_{total}} \tag{5}\]  
\(N_{correct}\) is the number of correctly classified instances and \(N_{total}\) is the total number of instances. Distance is the function that calculates the distance between classes and the distance within classes. Since the logical function range is in the range [5; 5], the range of [1; 2; 1] has been adjusted by adapting the function. The representation of the logical function is given in Figure 10.  
Figure 8: Row feature vector representation. Figure 9: ABCP program representation. The logical function shown in Figure 10a is defined Equation (6); Figure 10b is defined Equation (7). \[S(t)=\frac{1}{1+exp^{-t}} \tag{6}\]  
\[S(t)=\frac{1}{1+exp^{-5t}} \tag{7}\]  
Adapted version of the distance function according to the logical function (Equation (7)) is shown in Equation (8). \(D_{b}\) (between distances) calculates the average distance between classes, and \(D_{w}\) (within Distances) calculates the average distance within classes. \(D_{b}\) and \(D_{w}\), respectively are defined in Equations (9) and (10). \[\textit{Distance}=\frac{1}{1+exp^{-5(D_{b}-D_{w})}} \tag{8}\]  
\[D_{b}=\frac{1}{z(z-n)}\sum_{ \begin{subarray}{c}u^{2},\overrightarrow{v}\in S _{tr}\\ \forall u\in u^{2}\\ \forall\overrightarrow{v}\in v^{2}\end{subarray} }\chi^{2}(\overrightarrow{u },\overrightarrow{v}),\;\alpha,\beta\in[1,c],\;\alpha\
eq\beta \tag{9}\]  
\[D_{w}=\frac{1}{z(n-1)}\sum_{ \begin{subarray}{c}u^{2},\overrightarrow{v}\in S _{tr}\\ \forall\overrightarrow{v}\in v^{2}\end{subarray} }\chi^{2}(\overrightarrow{u },\overrightarrow{v})\alpha\in[1,c] \tag{10}\]  
where \(S_{tr}=\left\{(\overrightarrow{x_{i}},y_{i})\right\}\) the set of instances is selected in the training set, \(\overrightarrow{x_{i}}\) is the feature vector of each instance, and \(y_{i}\) is the class label. \(i\in\left\{1,\ldots,z\right\}\); \(c\) and \(n\) respectively define the total number of classes and the number of instances per class. The total number of instances in the training set is \(z\left(c^{*}n\right)\); \(x^{\alpha}\) is all instances of the class in \(S_{tr}\). The distance between vectors with two normalized equal number of elements is shown in Equation (11). \[\chi^{2}=\frac{1}{2}\sum_{i}\frac{\left(u_{i}-v_{i}\right)^{2}}{u_{i}+v_{i}} \tag{11}\]  
where \(u_{i}\) and \(v_{i}\), respectively are defined \(i\). element is \(u\) and \(v\) vectors. If the divisor of Equation (11) is 0, the protected function returns 0 as a result. The classification accuracy (Equation (5)) and the distance (Equation (8)) take the value 1 in the best case and 0 in the worst case. Therefore, the fitness function (Equation (4)) for the automatic programming method can be defined as a minimization problem. In summary, the following steps are followed to extract the feature vector from the image descriptor. Figure 10: Logical Functions; (**a**): logical function range is in the range [–5, 5], (**b**): logical function range is in the range [–1, 1]. * **Step 1. ** Instances are converted to feature vectors of the previously defined window size (for example 5*5). (Figure 8)
* **Step 2.