# Natural Hydrocarbon Samples Classification by Topological Analysis Method
## 1 Introduction
A more detailed description of multiscale structures is possible using persistent homology. Persistent homology (PH) is a tool of topological data analysis showing how the topological structure of data changes during the change on a scale of its perception. The theory of persistent data analysis started to develop at the end of the last century independently by three groups of scientists [22; 23; 24]. In 2002, the stability of persistent homology was shown [25], meaning that small changes in the source data lead to small changes in the barcodes of the corresponding homologies. PH has found applications in material sciences [26], medical images analysis [27], bioscience [28], and geophysics [29]. This method has been applied to extract more detailed geometric information about amorphous solids compared to traditional methods [30]. Quantitative description based on tomographic images of the sphere packings [31; 32; 33] and natural rocks [34; 35; 36] was also performed using persistent homology. Dynamic processes inside porous media, such as single-phase [37] and multiphase flows [38; 39; 40], mechanical deformations [40], or chemical dissolution [41; 42], can also be quantitatively described using the PH. It should be noted that a similar approach can also be used for the analysis of dynamic processes into continuous media [43]. For example, a persistent homology approach for determining the trigger sites of crack initiation in iron does has been presented [44]. The novel approach [45; 46] based on the combination of persistent homology with machine learning techniques also demonstrates efficiency in the geometric description of media with complex internal structure. We propose an automated porous media 3D image classification method based on its topological properties using persistent data analysis. It should be quick in terms of calculation computing power, stable, and allow for complex multiscale structure analysis. The initial images of porous media obtained by CT scanning are in grayscale, and the voxel brightness is the X-ray density of the corresponding volume of the sample. Usually, porous medium models are described through the composition, properties, and distribution of the \"phases\" that form the object under study [33]. In the simplest and most common case, these phases are rock (solid mineral) and pore. This model is called binary. Therefore, in order to assign a voxel to one of the two phases, the image binarization procedure is performed, that is, the transition from grayscale to a black-and-white image. The binarization threshold is understood as the value by which the distinction is made. There are a number of methods for performing this procedure; in addition, the original image of the same object may slightly change (due to the noise signal) depending on the equipment used and the scanning mode. In this regard, the final binarized images of the same object may differ slightly--having an \"error\" relative to the \"ideal\" image. For this reason, the algorithms and methods used to analyze binary images must be robust, i.e., give a similar result with minor variations in the original image. This is extremely important for practical work with images of different quality; therefore, in this work, we consider the influence of the selected binarization threshold (allowing the error of choosing its optimal value in a number of cases) on the result and interpretation. The literature describes various metrics that can be used for the classification and analysis of persistent diagrams obtained for solving the exact class of problems or studying some type of object. However, it is not known which of them are optimal for the objects under consideration: samples of porous media-natural reservoirs and what advantages and disadvantages each of them has. Therefore, a number of well-known metrics are tested to develop approaches, priorities, and restrictions in the subsequent analysis of similar objects.