## 4 Methods
### Fractal-Based Analysis of Microscopic Lung Images  
Fractal estimators are frequently used indicators of the complexity in binary and grayscale images [57; 58; 59]. Different fractal and similar estimators are proposed i.e., box-counting [57], lacunarity [60], variogram [61; 62], TPM (Triangular Prism Method) [63; 64], SIM (Slit Island Method) [65], APR (Area Perimeter Relation) [66] and others.  
The difference between conventional fractal and multi-parameter fractal techniques is in the number of obtained parameters [67; 68]. Classical fractal estimators assume single output scalar value-estimated FD. This value is related to the slope of linear function of Richardson's plot [65; 69]. This plot uses a logarithmic axis and typically the linear function in this plot is observed for synthetic fractals. The FD could be a function of scale. Vectors with scale-dependent FD is the output of multi-parameter estimators. The scale range and number of scales should be selected to obtain a smooth Richardson's curve.  
FD value could be calculated for non-fractal objects without relation to object structure. This phenomenon is known as a \"fractal rabbit\" [69]. Image analysis applications accept \"fractal rabbits\" if the achieved FD values are useful for a particular application.  
Two well-known algorithms are considered in this paper--2D box-counting and 2D lacunarity. Both algorithms use the sliding window approach for binary images and holes are analyzed by box-counting and lacunarity in this work.  
Figure 5: Exemplary view of HistAENNseg.  
Box-counting allows the estimation of \(FD\) using the following formula:  
\[D(r)=\frac{\log N_{r}}{\log 1/r} \tag{5}\]  
and the \(FD\) can be estimated from the least squares linear fit of \(\log N_{r}\) against \(\log 1/r\), where \(N_{r}\) is the number of boxes of side length \(r\) required to cover the set.  
Two extensions of box-counting output are also used, because \(FD\) could be a function of \(r\). Vectors with the local \(FD\)s for multi-parameter box-counting algorithm could be obtained using the following formula:  
\[FD_{local}(r_{i},r_{i+1})=\frac{\log\frac{N_{i_{j}+1}}{N_{r_{i}}}}{\log\frac{ r_{i+1}}{r_{i}}}, \tag{6}\]  
for neighborhood measurements \(r_{i}\) and \(r_{i+1}\).  
Another possibility is based on the estimation of \(FD\)s for selected regions from nonlinear [PERSON]'s plot. Local \(FD\)s are obtained as the results and correspond to region boundaries [69].  
There is some redundancy in full vector, but the vector length is fixed which is important for the simplification of classifier design. Regions-based approach uses variable-length vector with \(FD\)s and boundaries pairs.  
Lacunarity is not exactly the fractal algorithm in the strict sense, because FD is not estimated and the results of lacunarity depend on texture [60]. Fractal textures give a unique response to the lacunarity algorithm. Lacunarity estimation \(\Lambda(r)\) uses the following formulas [60]:  
\[Q(s,r)=\frac{n(s,r)}{\sum n(._{.})}, \tag{7}\]  
\[Z_{1}(r)=\sum sQ(s,r), \tag{8}\]  
\[Z_{2}(r)=\sum s^{2}Q(s,r), \tag{9}\]  
\[\Lambda(r)=\frac{Z_{2}(r)}{Z_{1}^{2}(r)}, \tag{10}\]  
where \(r\) is the sliding window height and width, \(Z_{1}\) and \(Z_{2}\) are moments of distribution \(Q\). The table \(n\) is the counting table that is addressed by \(r\) and number of counted pixels \(s\) with the specific value ('0's or '1's for binary image). The distribution \(Q\) is achieved from \(n\) by normalization.