Home » Posts tagged 'KNN algorithm'

Tag Archives: KNN algorithm

3D modeling of the stratigraphic and structural architecture of the Crotone basin (southern Italiy) using machie learning with Python

The 3D modeling and representation of geological data have experienced significant growth within last years, due to the use of new technologies derived from advancements in land representation methods. These technologies enable interactive, intuitive and clear geological visualizations. This paper shows how, by using the open-source Python software (operable with a simple internet browser) for machine learning (linear and KNN interpolations), together with Geographic Information Systems (GIS), it is possible to achieve interactive 3D visualizations of geological features in sedimentary basins. This study is performed in the onshore-offshore Crotone area (southern Italy) where a large amount of stratigraphic datasets are available from core perforation and seismic profiles due to the presence of a natural gas extraction field. Thanks to a database of 63 drilling lithologic records and 43 check points obtained from 9 interpreted seismic sections, several 3D HTML models were constructed defining three stratigraphic units (Pre-Messinian, Messinian, and Post-Messinian). An overlap of the Post-Messinian top surface and an erosional truncation of the Messinian top surface toward the N were observed, together with a rising of the Pre-Messinian top surface in the northwestern area. This stratigraphic architecture may indicate differential subsidence and/or uplifting due to syn-sedimentary fault kinematics in the whole studied area. The 3D models with the stratigraphic unit boundary surfaces obtained with KNN interpolation (showing stepped and abrupt edges) allowed the interpretation in terms of structural architecture and synsedimentary fault kinematics. Three main sets of faults were deduced: N–S; NNW-SSE, and ENE-WSW. A minorly represented E-W set was added to the main sets. These faults generated a horsts-grabens structure, and in many cases a determinate set of faults caused a progressive lowering or rising of some areas with an “en echelon” arrangement. According to previous works, these deduced sets of faults (most of them strike-slip faults) have a good agreement with the general structural architecture and defined faults in the area.

Vertical sections obtained with KNN interpolation and exported as png files with sketch index map in the right-up corner. A to E) sections A to E.

Cite as: Falsetta, E., Bullejos, M., Critelli, S. and Martín-Martín M. (2024). 3D modeling of the stratigraphic and structural architecture of the Crotone basin (southern Italy) using machine learning with Python. Marine and Petroleum Geology 164 (2024) 106825. https://doi.org/10.1016/j.marpetgeo.2024.106825

Python libraries and k-Nearest neighbors algorithms to delineate syn-sedimentary faults

 This paper introduces a methodology based on Python libraries and machine learning k-Nearest Neighbors (KNN) algorithms to create an interactive 3D HTML model (3D_Vertical_Sections_Faults_LRD.html) that combines 2D grain-size KNN-prediction vertical maps (vertical sections) from which syn-sedimentary faults and other features in sedimentary porous media can be delineated. The model can be visualized and handled with conventional web browsers. The grain-size physical parameter is measurable, constant over instrumental time, handleable mathematically, and its range can be associated to lithological classes. Grain-size input data comes from a public database of 433 boreholes in the Llobregat River Delta (LRD) in NE Spain. Four lithological classes were defined: Pre-Quaternary basement, and Quaternary gravel, sand, and clay–silt. Using a new KNN-prediction algorithm, seven NW–SE (transversal) and three SW–NE (longitudinal) vertical sections were created following the orientation of faults identified in surface and detected in reflection seismic geophysical surveys. For exploratory K values in the 1–75 range were used. K around 25 provides the general and smoothy shape of the basement top surface, whereas K = 1 is a optimal value to represent the heterogeneity of the LRD at short distance. Using a new KNN-prediction confidence algorithm inspired in the Similarity Ratio algorithm for machine-learning KNN, the vertical sections overall confidence was evaluated as satisfactory. A general decreasing confidence trend according to the decreasing data density with depth and from inland to seaward was found. The vertical sections created with K = 1 show horizontal interruptions (displacements or vertical steps) in the basement continuity and in the Quaternary coarse bodies (gravel and sand) attributable to the action of Quaternary active faults. These faults have been linked or correlated with well-known active faults in the area related in much cases with the Valencia Trough opening. Moreover, several faults detected in surface and other identified in this paper by the first time have been revealed as fault zones made of fault branches with different steps in an echelon-like arrangement.

Longitudinal (SW–NE) vertical sections A–B to M–N with the grain-size (lithological) classes, showing the location of correlated syn-sedimentary faults, and lateral migration of syn-tectonic gravel bodies and channels. The boundary of the Lower and Upper Detrital Complexes and the location of the boreholes (highlighted accordingly to their proximity) are also indicated.

Faulting seems to be more evident in the Pleistocene Lower Detrital Complex and much less active or inactive in the Holocene Upper Detrital Complex. Syn-tectonic gravel channels faulty controlled, progradation of gravel lobes, and lateral migration of channel bars were also observed. At its current development stage, this methodology could also be applied to other geological environments, making the due minor modifications of the code, and is especially suitable to reduce the high (usually unmeasurable) uncertainty associated to the qualitative geological data used in more complex numerical tools aimed at modelling a lot of geological resources (groundwater, minerals, geothermal, petroleum) or different Earth phenomena. 

Cite as: Martín-Martín,  M., Bullejos, M., Cabezas, D., Alcalá, F. J., (2023). Using python libraries and k-Nearest neighbors algorithms to delineate syn-sedimentary faults in sedimentary porous media. Marine and Petroleum Geology, 153. 106283. doi: 10.1016/j.marpetgeo.2023.106283 


K-nearest neighbors algorithm used for classifying geological variables.

The k-nearest neighbors (KNN) algorithm is a non-parametric supervised machine learning classifier; which uses proximity and similarity to make classifications or predictions about the grouping of an individual data point. This ability makes the KNN algorithm ideal for classifying datasets of geological variables and parameters prior to 3D visualization. This paper introduces a machine learning KNN algorithm and Python libraries for visualizing the 3D stratigraphic architecture of sedimentary porous media in the Quaternary onshore Llobregat River Delta (LRD) in northeastern Spain. A first HTML model showed a consecutive 5 m-equispaced set of horizontal sections of the granulometry classes created with the KNN algorithm from 0 to 120 m below sea level in the onshore LRD. A second HTML model showed the 3D mapping of the main Quaternary gravel and coarse sand sedimentary bodies (lithosomes) and the basement (Pliocene and older rocks) top surface created with Python libraries. These results reproduce well the complex sedimentary structure of the LRD reported in recent scientific publications and proves the suitability of the KNN algorithm and Python libraries for visualizing the 3D stratigraphic structure of sedimentary porous media, which is a crucial stage in making decisions in different environmental and economic geology disciplines.

The 3D stratigraphic architecture (coarse lithosomes and the basement top surface (BTS)) of the onshore LRD. (A) Gravel and coarse sand lithosomes and BTS. (B) Gravel lithosomes and BTS. (C) Coarse sand lithosomes and BTS. (D) Basement top surface. The color assigned to each granulometry class is cyan for gravel, yellow for coarse sand, and reddish-brownish for the basement. An interactive 3D HTML version of this model is included in Supplementary Materials

Interactive figures here

Cite as: Bullejos, M., Cabezas, D., Martín-Martín, M., Alcalá, F.J., 2022. A K-Nearest Neighbors Alborithm in Python for Visualizing the 3D Stratigraphic Architecture of the Llobregat River Delta in NE Spain.  J. Mar. Sci. Eng. https://doi.org/10.3390/jmse10070986