## 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  
The present algorithm classifies one \(\mathcal{H}_{i}\) as a micro-pore or a fracture based on its size and shape. In general, the size of a fracture is often found to be larger than that of a pore (although this proposition remains arguable in several situations). Hence, the adopted logic [31; 32; 33; 34] to classify a pore initially checks the number of dark pixels in \(\mathcal{H}_{i}\) (or area(\(\mathcal{H}_{i}\))) and if the area(\(\mathcal{H}_{i}\)) lies within a specific range \(l_{p}\leq\text{area}(\mathcal{H}_{i})>\mu_{p}\) (decided by the model developers) and at least one among the three \(\alpha\leq\frac{\operatorname{major}(\mathcal{H}_{i})}{\operatorname{minor }(\mathcal{H}_{i})}\leq\beta\), \(0\leq\mathcal{V}_{\mathcal{E}}(\mathcal{H}_{i})\leq\beta\) is satisfied then we can classify \(\mathcal{H}_{i}\) as a pore (see line no. 23 in Algorithm 2). Here, \(l_{p}\), \(\mu_{p}\in\mathbb{Z}^{+}\) are the lower and upper-bounds of area (\(\mathcal{H}_{i}\)) respectively, values of which should be decided based on the historical information about the sizes of the pores and fractures and porosity of the original rock sample. Again, a region containing a large number of dark pixels or \(\mathcal{H}_{i}\) should be classified as a fracture if \(l_{p}\leq\text{area}(\mathcal{H}_{i})\leq\mu_{f}\) and at least one among the three conditions \(\frac{\operatorname{major}(\mathcal{H}_{i})}{\operatorname{minor}(\mathcal{H} _{i})}>\beta\), \(\mathcal{V}_{\mathcal{E}}(\mathcal{H}_{i})>\gamma\) and \(\mathcal{V}_{\mathcal{E}}(\mathcal{H}_{i})>\delta\) is satisfied (see line no. 24 in Algorithm 2). Quite similarly,\(I_{i},\ \mu_{f}\in\mathbb{Z}^{+}\) are, respectively, the lower and upper-bounds of the area(\(\mathcal{H}_{i}\)) for fracture. We may again repeated that the model parameters are flexible and depend on the problem definitions, sample rock porosity, and other geophysical properties. We have also computed some other measures for a specific \(\mathcal{H}_{i}\) such as compactness(\(\mathcal{H}_{i}\)), curl(\(\mathcal{H}_{i}\)) and width(\(\mathcal{H}_{i}\)). Here, compactness(\(\mathcal{H}_{i}\)) is an intrinsic property of \(\mathcal{H}_{i}\) and defined as the ratio of the area of \(\mathcal{H}_{i}\) to the area of a circle with the same perimeter (perimeter(\(\mathcal{H}_{i}\))). Mathematically, compactness(\(\mathcal{H}_{i}\)) = \(\frac{\left(\text{perimeter($\mathcal{H}_{i}$)}\right)^{2}}{4\ \pi\times\text{area}\ (\mathcal{H}_{i})}\), where perimeter(\(\mathcal{H}_{i}\)) is the total number of pixels residing on the perimeter of \(\mathcal{H}_{i}\) and area(\(\mathcal{H}_{i}\)) is the total number of pixels in \(\mathcal{H}_{i}\); curl(\(\mathcal{H}_{i}\)) of \(\mathcal{H}_{i}\) is the degree to which an object is curled up. Lastly, the width(\(\mathcal{H}_{i}\)) is the average width of any \(\mathcal{H}_{i}\). These shape-specific measures can be used as features in deep-CNN, which will be considered in our upcoming research work. Visual representations of these measures are shown in Figure 1b,c. 4.8 Overall High-Level Architecture and Computational Complexity of the Proposed Pixel-Wise k-IN Algorithm  
We felt that the overall architecture/logical flow of our proposed approach would help us explain it comprehensively. Below, we present an overall flowchart (Figure 4) combining the above steps to provide a snapshot view of our proposed algorithm: (a) images extracted from the carbonate rocks using CT Scan, (b) binarizing the pixel to dark or bright classes (c) procedure to find \(k\)-INs of any pixels as per Algorithm 1 (d) calculation of 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 pore and fracture also with shape variances, (e) Classification as per the logic into pore or fracture. Further to the overview above, we would like to deliberate on the computational complexity of Algorithm 2.