## 2 Materials and Methods--Porosity Classification and Fracture Identification
### Pixel-Wise k-IN Approach to Determine Rock Fractures and Pores
#### 2.4.7 Classification Logic
Assuming that for each operation the computer takes the same time, and \(n\) is the size of the input. Where image length = \(\frac{n}{2}\) and breadth = \(\frac{n}{2}\) assuming a  
Figure 4: Overall architectural flow: (a) Images extracted from the carbonate rocks using CT Scan, (b) binarizing the pixel to dark or bright classes (c) find contiguous pixels using k-IN (d) procedure to find \(k\)-INs of any pixels as per Algorithm 1 (d) finding shape geometry kPI’s such as area(\(\mathcal{H}_{i}\)), major(\(\mathcal{H}_{i}\) ), minor(\(\mathcal{H}_{i}\) ), perimeter(\(\mathcal{H}_{i}\) ) and curl(\(\mathcal{H}_{i}\) ) of a pore and fracture and (e) classification into pore or fracture. square image for the convenience of calculating computational complexity, and \(n_{1}\) is the size of \(\mathbb{L}\) (bag of pixels) \(\forall\)\(n_{1}\)\(<\)\(n\); \(n_{1}\)\(\subset\)\(n\). As we can see, we have mainly a few blocks of code as follows:  
(a) Computing computational complexity of our proposed approach:  
1. Ingest pixels for process # runs \(n\) times
2. 2 nested loop #runs \(\frac{n^{2}}{4}\) (\(\frac{n}{2}\times\frac{n}{2}\))--(line 5) 1. Outer for loop to iterate on the length of the image (starting LoC 1), runs \(\frac{n}{2}\) times 2. Inner for loop to iterate on the height of the image (starting LoC 2), runs \(\frac{n}{2}\) times
3. Similarly, additional loop starting, runs \(\frac{n^{2}}{4}\) times--(line 6)
4. Similarly, next 3 nested loops, runs \(n^{3}\) times--(line 10)
5. Next steps are the calculation and if statements, runs \(n_{1}\) times each 1. compute the major axis length of \(\mathcal{H}_{i}\) or major(\(\mathcal{H}_{i}\))--(line 14) 2. compute the major_angle(\(\mathcal{H}_{i}\))--(line 15) 3. compute the minor(\(\mathcal{H}_{i}\))--(line 16) 4. compute area(\(\mathcal{H}_{i}\))--(line 17) 5. compute the perimeter(\(\mathcal{H}_{i}\))--(line 18) 6. compute \(\mathcal{V}_{c}(\mathcal{H}_{i}\)) and \(\mathcal{V}_{\mathcal{E}}(\mathcal{H}_{i}\)); \(2n\) time--(line 19) 7. compactness(\(\mathcal{H}_{i}\))--(line 20) 8. \(\text{curl}(\mathcal{H}_{i})\)--(line 21) 9. width(\(\mathcal{H}_{i}\))--(line 22) 1. check for Pore or Fracture--(line 23)  
Thus, the combined execution time is \(n+\frac{n^{2}}{4}+n+n^{3}+11n_{1}\). Now we can ignore the lower order terms since the lower order terms are relatively insignificant for large inputs compared to the highest order term. Therefore only the highest order term is taken (without constant). So, the calculation complexity Big(0) will be O(\(n^{3}\)). (b). Computing the computational complexity of YOLO and RCNN approaches:  
1. In general, an MLP with \(n\) inputs and \(m\) hidden layers, where the \(i\)-th hidden layer contains \(m_{i}\) hidden neurons and \(k\) output neurons, will perform the following multiplications (excluding activation functions): \[nm_{1}+m_{1}m_{2}+m_{2}m_{3}+m_{3}m_{4}.....+m_{M-1}m_{M}+m_{M}k\] (6) which in a big-O notation can be written as \[\Omega(nm_{1}+n_{M}k+\sum_{i=1}^{M-1}m_{i}m_{i+1})\] (7) where \(\Omega\) is the lower bound and big-O is the upper bound. 2. Add the convolution layer: Inputs: Image (\(\frac{n}{2}\times\frac{n}{2}\)) and convolution mask (\(s\)\(\times\)\(s\)). The convolution computation complexity is O(\(\frac{n^{2}}{4}\times s^{2}\)). For simplicity, we assume \(n=\frac{n}{10}\). The equation translates to O(\(\frac{n^{4}}{400}\)). Dropping the constant and considering only highest-order terms again will result in O(\(n^{4}\)). 3. By putting them together, we have \[\Omega(nm_{1}+n_{M}k+\sum_{i=1}^{M-1}m_{i}m_{i+1})+\text{O}\Big{(}n^{4}\Big{)}.\] (8) By generalising the above steps for the RCNN and YOLO, the computation complexity for both will be \(\Omega(n^{4})\). The comparison of both shows that the RCNN and YOLO approaches tend to be more complex than the proposed approach.