Confidence of a k-Nearest Neighbors Python Algorithm for the 3D Visualization of Sedimentary Porous Media
Abstract
:1. Introduction
2. Study Area
3. Methodology
3.1. Data Compilation
3.2. Python Programming Language
3.3. KNN Algorithm
3.4. The 3D Mapping of the Essential Stratigraphic Elements
3.5. The 3D Models as HTML Files
3.6. The 3D Mapping of the Confidence of the Essential Stratigraphic Elements
4. Results
4.1. The Mapping of the Grain-Size Horizontal Sections: KNN Predictions and Confidences
4.2. The 3D Mapping of the Stratigraphic Architecture and Basement Top Surface: KNN Predictions and Confidences
5. Discussion and Conclusions
Supplementary Materials
Author Contributions
Funding
Institutional Review Board Statement
Informed Consent Statement
Data Availability Statement
Acknowledgments
Conflicts of Interest
References
- Jessell, M. Three-dimensional geological modelling of potential-field data. Comput. Geosci. 2001, 27, 455–465. [Google Scholar] [CrossRef]
- Wycisk, P.; Hubert, T.; Gossel, W.; Neumann, C. High-resolution 3D spatial modelling of complex geological structures for an environmental risk assessment of abundant mining and industrial megasites. Comput. Geosci. 2009, 35, 165–182. [Google Scholar] [CrossRef]
- Ford, J.; Mathers, S.; Royse, K.; Aldiss, D.; Morgan, D.J.R. Geological 3D modelling: Scientific discovery and enhanced understanding of the subsurface, with examples from the UK. Z. Der Dtsch. Ges. Fur Geowiss. 2010, 161, 205–218. [Google Scholar] [CrossRef] [Green Version]
- Rohmer, O.; Bertrand, E.; Mercerat, E.D.; Régnier, J.; Pernoud, M.; Langlaude, P.; Alvarez, M. Combining borehole log-stratigraphies and ambient vibration data to build a 3D Model of the Lower Var Valley, Nice (France). Eng. Geol. 2020, 270, 105588. [Google Scholar] [CrossRef]
- GemPy: Open-Source 3D Geological Modeling. Available online: https://www.gempy.org (accessed on 9 June 2022).
- OSGeo: The Open Source Geospatial Foundation. Available online: https://www.osgeo.org/ (accessed on 9 June 2022).
- GeoPandas. Available online: https://geopandas.org/en/stable (accessed on 9 June 2022).
- Albion: 3D Geological Models in QGIS. Available online: https://gitlab.com/Oslandia/albion (accessed on 9 June 2022).
- GISgeography. 15 Python Libraries for GIS and Mapping. Available online: https://gisgeography.com/python-libraries-gis-mapping (accessed on 9 June 2022).
- Parpoil, B. Open Source and Geology. Available online: https://oslandia.com/en/2020/07/09/geologie-open-source (accessed on 9 June 2022).
- Hobona, G.; James, P.; Fairbairn, D. Web-based visualization of 3D geospatial data using Java3D. IEEE Comput. Graph. Appl. 2006, 26, 28–33. Available online: https://ieeexplore.ieee.org/document/1652923 (accessed on 17 November 2022). [CrossRef] [PubMed]
- Evangelidis, K.; Papadopoulos, T.; Papatheodorou, K.; Mastorokostas, P.; Hilas, C. 3D geospatial visualizations: Animation and motion effects on spatial objects. Comput. Geosci. 2018, 111, 200–212. [Google Scholar] [CrossRef]
- Semmo, A.; Trapp, M.; Jobst, M.; Doellner, J. Cartography-oriented design of 3D geospatial information visualization–overview and techniques. Cartogr. J. 2015, 52, 95–106. [Google Scholar] [CrossRef]
- Miao, R.; Song, J.; Zhu, Y. 3D geographic scenes visualization based on WebGL. In Proceedings of the 6th International Conference on Agro-Geoinformatics, Fairfax VA, USA, 7–10 August 2017; Volume 1, pp. 1–6. Available online: https://ieeexplore.ieee.org/stamp/stamp.jsp?tp=&arnumber=8046999 (accessed on 9 June 2022).
- Husillos, C. cesarhusrod/sarai_piezo_precip: Mejora de la Documentación (v1.0.1). Zenodo. 2022. Available online: https://doi.org/10.5281/zenodo.7197288 (accessed on 17 November 2022).
- Pyrcz, M. GeostatsGuy Lectures. Available online: https://www.youtube.com/c/GeostatsGuyLectures (accessed on 9 June 2022).
- Bullejos, M.; Cabezas, D.; Martín-Martín, M.; Alcalá, F.J. A Python Application for Visualizing the 3D Stratigraphic Architecture of the Onshore Llobregat River Delta in NE Spain. Water 2022, 14, 1882. [Google Scholar] [CrossRef]
- Bullejos, M.; Cabezas, D.; Martín-Martín, M.; Alcalá, F.J. A K-Nearest Neighbors Algorithm in Python for Visualizing the 3D Stratigraphic Architecture of the Llobregat River Delta in NE Spain. J. Mar. Sci. Eng. 2022, 10, 986. [Google Scholar] [CrossRef]
- Delany, S.J.; Cunningham, P.; Doyle, D. Generating estimates of classification confidence for a case-based spam filter. In International Conference on Case-Based Reasoning; 3620 of LNAI; Springer: Berlin/Heidelberg, Germany, 2005; pp. 170–190. [Google Scholar]
- Hu, R.; Delany, S.J.; Mac Namee, B. Sampling with confidence: Using k-nn confidence measures in active learning. In Proceedings of the 8th International Conference on Case-based Reasoning, ICCBR, Seattle, WA, USA, 20−23 July 2009; Volume 9, pp. 181–192. [Google Scholar]
- Murphy, A.; Redfern, S. Confidence Measures in Multiclass Speech Emotion Recognition using Ensemble Learning to Catch Blunders. Int. J. Sci. Technol. Eng. 2015, 2, 118–122. Available online: https://ijste.org/Article.php?manuscript=IJSTEV2I3013 (accessed on 17 November 2022).
- Custodio, E. Seawater intrusion in the Llobregat Delta near Barcelona (Catalonia, Spain). In Groundwater Problems in the Coastal Areas, Studies and Reports in Hydrology; UNESCO: Paris, France, 1987; Volume 45, pp. 436–463. [Google Scholar]
- Abarca, E.; Vázquez-Suñé, E.; Carrera, J.; Capino, B.; Gámez, D.; Batlle, F. Optimal design of measures to correct seawater intrusion. Water Resour. Res. 2006, 42, W09415. [Google Scholar] [CrossRef]
- Vázquez-Suñé, E.; Abarca, E.; Carrera, J.; Capino, B.; Gámez, D.; Pool, M.; Simó, T.; Batlle, F.; Niñerola, J.M.; Ibáñez, X. Groundwater modelling as a tool for the European Water Framework Directive (WFD) application. The Llobregat case. Phys. Chem. Earth 2006, 31, 1015–1029. [Google Scholar] [CrossRef]
- Postigo, C.; Ginebreda, A.; Barbieri, M.V.; Barceló, D.; Martín-Alonso, J.; de la Cal, A.; Boleda, M.R.; Otero, N.; Carrey, R.; Solà, V.; et al. Investigative monitoring of pesticide and nitrogen pollution sources in a complex multi-stressed catchment: The lower Llobregat River basin case study (Barcelona, Spain). Sci. Total Environ. 2021, 755, 142377. [Google Scholar] [CrossRef]
- Resolution 12956/1994. Cooperation agreement on infrastructure and environment in the Llobregat Delta. In Official Journal of Spain; Ministry of Public Works, Transports and Environment; Government of Spain: Madrid, Spain, 1994; Available online: https://www.boe.es/diario_boe/txt.php?id=BOE-A-1994-12956 (accessed on 18 April 2022).
- Official Statement. The water authority of Catalonia creates the technical unit of the Llobregat Aquifers. In Official Journal of Catalonia; Department of the Environment and Housing, Government of Catalonia: Barcelona, Spain, 2004; Available online: https://govern.cat/salapremsa/notes-premsa/68710/agencia-catalana-aigua-crea-mesa-tecnica-dels-aqueifers-del-llobregat (accessed on 18 April 2022).
- Medialdea, J.; Solé-Sabarís, L. Geological Map of Spain, Scale 1:50,000, Sheet nº 420; Hospitalet de Llobregat, Memory and Maps, Geological Survey of Spain: Madrid, Spain, 1973; Available online: http://info.igme.es/cartografiadigital/geologica/Magna50Hoja.aspx?language=es&id=420 (accessed on 18 April 2022).
- Medialdea, J.; Solé-Sabarís, L. Geological Map of Spain, Scale 1:50,000, Sheet nº 448; El Prat de Llobregat, Memory and Maps, Geological Survey of Spain: Madrid, Spain, 1991; Available online: http://info.igme.es/cartografiadigital/geologica/Magna50Hoja.aspx?language=es&id=448 (accessed on 18 April 2022).
- Almera, J. Mapa Geológico y Topográfico De La Provincia De Barcelona: Región Primera o De Contornos de la Capital Detallada, Scale 1:40,000, Memory and Maps, Diputación de Barcelona, Barcelona. 1891. Available online: https://cartotecadigital.icgc.cat/digital/collection/catalunya/id/2174 (accessed on 18 April 2022).
- Alonso, F.; Peón, A.; Rosell, J.; Arrufat, J.; Obrador, A. Geological Map of Spain, Scale 1:50,000, Sheet nº 421; Barcelona, Memory and Maps, Geological Survey of Spain: Madrid, Spain, 1974; Available online: http://info.igme.es/cartografiadigital/geologica/Magna50Hoja.aspx?language=es&id=421 (accessed on 18 April 2022).
- Llopis, N. Tectomorfología del Macizo del Tibidabo y valle inferior del Llobregat. Estud. Geográficos 1942, 3, 321–383. [Google Scholar]
- Solé-Sabarís, L. Ensayo de interpretación del Cuaternario Barcelonés. Misc. Barcinonensia 1963, 2, 7–54. [Google Scholar]
- Marqués, M.A. Les Formacions Quaternàries del Delta del Llobregat; Institut d’Estudis Catalans: Barcelona, Spain, 1984. [Google Scholar]
- Manzano, M. Estudio Sedimentológico del Prodelta Holoceno del Llobregat. Master’s Thesis, University of Barcelona, Barcelona, Spain, 1986. [Google Scholar]
- IGME. Geological Map of the Spanish Continental Shelf and Adjacent Areas, Scale 1:200,000, Sheet nº 42E.; Barcelona, Memory and Maps, Geological Survey of Spain: Madrid, Spain, 1989; Available online: https://info.igme.es/cartografiadigital/tematica/Fomar200Hoja.aspx?language=es&id=42E (accessed on 18 April 2022).
- IGME. Geological Map of the Spanish Continental Shelf and Adjacent Areas, Scale 1:200,000, Sheet nº 42; Tarragona, Memory and Maps, Geological Survey of Spain: Madrid, Spain, 1986; Available online: https://info.igme.es/cartografiadigital/tematica/Fomar200Hoja.aspx?language=es&id=42 (accessed on 18 April 2022).
- Serra, J.; Verdaguer, A. La plataforma holocena en el prodelta del Llobregat. In X Congreso Nacional de Sedimentología; Obrador, A., Ed.; University of Barcelona: Barcelona, Spain, 1983; Volume 2, pp. 49–51. [Google Scholar]
- Iribar, V.; Carrera, J.; Custodio, E.; Medina, A. Inverse modelling of seawater intrusion in the Llobregat delta deep aquifer. J. Hydrol. 1997, 198, 226–247. [Google Scholar] [CrossRef]
- Gámez, D.; Simó, J.A.; Lobo, F.J.; Barnolas, A.; Carrera, J.; Vázquez-Suñé, E. Onshore–offshore correlation of the Llobregat deltaic system, Spain: Development of deltaic geometries under different relative sea-level and growth fault influences. Sediment. Geol. 2009, 217, 65–84. [Google Scholar] [CrossRef]
- Alcalá-García, F.J.; Miró, J.; García-Ruz, A. Sobre la intrusión marina en el sector oriental del acuífero profundo del delta del Llobregat (Barcelona, España). Breve descripción histórica y evolución actual. Boletín Real Soc. Española Hist. Nat. 2002, 97, 42–49. [Google Scholar]
- Alcalá-García, F.J.; Miró, J.; Rodríguez, P.; Rojas-Martín, I.; Martín-Martín, M. Actualización geológica del delta del Llobregat (Barcelona, España). Implicaciones geológicas e hidrogeológicas. In Tecnología de la Intrusión de Agua de Mar en Acuíferos Costeros: Países Mediterráneos; López-Geta, J.A., de la Orden, J.A., Gómez, J.D., Ramos, G., Mejías, M., Rodríguez, L., Eds.; Geological Survey of Spain: Madrid, Spain, 2003; Volume 1, pp. 45–52. [Google Scholar]
- Alcalá-García, F.J.; Miró, J.; Rodríguez, P.; Rojas-Martín, I.; Martín-Martín, M. Características estructurales y estratigráficas del substrato Plioceno del Delta de Llobregat (Barcelona, España). Aplicación a los estudios hidrogeológicos. Geo-Temas 2003, 5, 23–26. [Google Scholar]
- Simó, J.A.; Gàmez, D.; Salvany, J.M.; Vàzquez-Suñé, E.; Carrera, J.; Barnolas, A.; Alcalá, F.J. Arquitectura de facies de los deltas cuaternarios del río Llobregat, Barcelona, España. Geogaceta 2005, 38, 171–174. [Google Scholar]
- Font, J.; Julia, A.; Rovira, J.; Salat, J.; Sanchez-Pardo, J. Circulación marina en la plataforma continental del Ebro determinada a partir de la distribución de masas de agua y los microcontaminantes orgánicos en el sedimento. Acta Geol. Hisp. 1987, 21, 483–489. [Google Scholar]
- Chiocci, F.L.; Ercilla, G.; Torres, J. Stratal architecture of Western Mediterranean Margins as the result of the stacking of Quaternary lowstand deposits below ‘glacio-eustatic fluctuation base-level’. Sediment. Geol. 1997, 112, 195–217. [Google Scholar] [CrossRef]
- Alcalá, F.J.; Martín-Martín, M.; García-Ruz, A. A lithology database from historical 457 boreholes in the Llobregat River Delta aquifers in northeastern Spain. Figshare Dataset 2020. [CrossRef]
- Python Programming Language. Available online: https://www.python.org (accessed on 9 June 2022).
- Numpy. Available online: https://numpy.org (accessed on 13 June 2022).
- Pandas. Available online: https://pandas.pydata.org (accessed on 13 June 2022).
- Plotly. Available online: https://plotly.com (accessed on 9 June 2022).
- Scipy. Available online: https://scipy.org (accessed on 13 June 2022).
- Scikit-learn. Available online: https://scikit-learn.org/stable/install.html#installation-instructions (accessed on 13 June 2022).
- GEODOSE. Available online: https://www.geodose.com/2019/09/3d-terrain-modelling-in-python.html (accessed on 13 June 2022).
- Gou, J.; Ma, H.; Ou, W.; Zeng, S.; Rao, Y.; Yang, H. A generalized mean distance-based k-nearest neighbor classifier. Expert Syst. Appl. 2019, 115, 356–372. [Google Scholar] [CrossRef]
- Pratama, H. Machine Learning: Using Optimized KNN (K-Nearest Neighbors) to Predict the Facies Classifications. In Proceedings of the 13th SEGJ International Symposium, Tokyo, Japan, 12–14 November 2018; Society of Exploration Geophysicists of Japan: Tokyo, Japan, 2018; Volume 1, pp. 538–541. [Google Scholar] [CrossRef]
- Wang, X.; Yang, S.; Zhao, Y.; Wang, Y. Lithology identification using an optimized KNN clustering method based on entropy-weighed co-sine distance in Mesozoic strata of Gaoqing field, Jiyang depression. J. Pet. Sci. Eng. 2018, 166, 157–174. [Google Scholar] [CrossRef]
- Huang, S.; Huang, M.; Lyu, Y. An Improved KNN-Based Slope Stability Prediction Model. Adv. Civ. Eng. 2020, 8894109. [Google Scholar] [CrossRef]
- Wentworth, C.K. A Scale of Grade and Class Terms for Clastic Sediments. J. Geol. 1922, 30, 377–392. [Google Scholar] [CrossRef]
- Leifeld, P. texreg: Conversion of Statistical Model Output in R to LATEX and HTML Tables. J. Stat. Softw. 2013, 55, 1–24. [Google Scholar] [CrossRef] [Green Version]
- Li, Y.; Yang, Z.; Chen, X.; Yuan, H.; Liu, W. A stacking model using URL and HTML features for phishing webpage detection. Future Gener. Comput. Syst. 2019, 94, 27–39. [Google Scholar] [CrossRef]
- Gur, I.; Nachum, O.; Miao, Y.; Safdari, M.; Huang, A.; Chowdhery, A.; Narang, S.; Fiedel, N.; Faust, A. Understanding HTML with Large Language Models. arXiv 2022, arXiv:2210.03945v1. [Google Scholar] [CrossRef]
- Scikit-learn: KNeighborsClassifier, Predict_Proba. Available online: https://scikit-learn.org/stable/modules/generated/sklearn.neighbors.KNeighborsClassifier.html#sklearn.neighbors.KNeighborsClassifier.predict_proba (accessed on 9 September 2022).
- Salvany, J.M.; Aguirre, J. The Neogene and Quaternary deposits of the Barcelona city through the high-speed train line. Geologica Acta 2020, 18, 1–19. [Google Scholar] [CrossRef]
- Parcerisa, D.; Gámez, D.; Gómez-Gras, D.; Usera, J.; Simó, J.A.; Carrera, J. Estratigrafía y petrología del subsuelo precuaternario del sector SW de la depresión de Barcelona (Cadenas Costeras Catalanas, NE de Iberia). Rev. Soc. Geológica España 2008, 21, 93–109. [Google Scholar]
Gravel Sedimentary Bodies | AW Confidence 1 | AW Depth 2 | Depth Min 2 | Depth Max 2 | LRD Interval |
---|---|---|---|---|---|
grlit1 | 0.50 | –72.4 | –40 | –100 | Lower |
grlit2 | 0.51 | –51.4 | –40 | –60 | Lower |
grlit3 | 0.52 | –55.5 | –45 | –70 | Lower |
grlit4 | 0.49 | –56.6 | –50 | –65 | Lower |
grlit5 | 0.51 | –45.7 | –35 | –50 | Middle |
grlit6 | 0.50 | –28.3 | 0 | –40 | Middle to Lower |
grlit7 | 0.48 | –29.8 | –10 | –40 | Middle to Lower |
grlit8 | 0.44 | –29.5 | –25 | –35 | Middle |
grlit9 | 0.53 | –19.7 | –10 | –25 | Middle to Lower |
grlit10 | 0.29 | –20.0 | –15 | –25 | Middle to Lower |
grlit11 | 0.45 | –17.5 | –15 | –20 | Lower |
grlit12 | 0.49 | –12.7 | 0 | –25 | Lower |
grlit13 | 0.50 | –25.0 | 0 | –40 | Middle to Lower |
Median | 0.50 | –29.5 | –15 | –40 | |
Average | 0.48 | –35.7 | –21.9 | –45.8 | |
Standard Deviation (±1σ) | 0.06 | 18.6 | 18.2 | 22.9 | |
CV 3 | 0.13 | –0.52 | –0.83 | –0.50 | |
Coarse sand sedimentary bodies | AW confidence 1 | AW depth 2 | Depth min 2 | Depth max 2 | LRD interval |
snlit1 | 0.51 | –83.9 | 0 | –100 | Upper to Lower |
snlit2 | 0.54 | –35.0 | 0 | –90 | Upper to Lower |
snlit3 | 0.54 | –25.5 | 0 | –90 | Upper to Lower |
snlit4 | 0.53 | –39.7 | 0 | –100 | Upper to Lower |
snlit5 | 0.42 | –65.9 | 0 | –80 | Upper to Lower |
snlit6 | 0.54 | –12.7 | 0 | –60 | Upper to Lower |
snlit7 | 0.54 | –24.4 | 0 | –90 | Upper to Lower |
snlit8 | 0.54 | –8.8 | 0 | –40 | Middle to Lower |
snlit9 | 0.51 | –10.5 | –5 | –20 | Lower |
snlit10 | 0.46 | –49.1 | –5 | –80 | Upper to Lower |
snlit11 | 0.46 | –17.1 | 0 | –40 | Middle to Lower |
snlit12 | 0.55 | –10.1 | –5 | –55 | Upper to Lower |
snlit13 | 0.43 | –40.6 | 0 | –60 | Upper to Lower |
snlit14 | 0.53 | –16.3 | 0 | –60 | Upper to Lower |
snlit15 | 0.54 | –4.6 | 0 | –10 | Lower |
snlit16 | 0.53 | –9.2 | 0 | –60 | Upper to Lower |
snlit17 | 0.30 | –6.6 | 0 | –15 | Lower |
Median | 0.53 | –12.7 | 0 | –60 | |
Average | 0.50 | –21.2 | –1.2 | –51.5 | |
Standard Deviation (±1σ) | 0.07 | 18.9 | 2.2 | 25.4 | |
CV 3 | 0.13 | –0.89 | –1.90 | –0.49 | |
Basement top surface | AW confidence 1 | AW depth 2 | Depth min 2 | Depth max 2 | LRD interval |
basement | 0.78 | –70.4 | 0 | –100 | Upper to Lower |
Disclaimer/Publisher’s Note: The statements, opinions and data contained in all publications are solely those of the individual author(s) and contributor(s) and not of MDPI and/or the editor(s). MDPI and/or the editor(s) disclaim responsibility for any injury to people or property resulting from any ideas, methods, instructions or products referred to in the content. |
© 2023 by the authors. Licensee MDPI, Basel, Switzerland. This article is an open access article distributed under the terms and conditions of the Creative Commons Attribution (CC BY) license (https://creativecommons.org/licenses/by/4.0/).
Share and Cite
Bullejos, M.; Cabezas, D.; Martín-Martín, M.; Alcalá, F.J. Confidence of a k-Nearest Neighbors Python Algorithm for the 3D Visualization of Sedimentary Porous Media. J. Mar. Sci. Eng. 2023, 11, 60. https://doi.org/10.3390/jmse11010060
Bullejos M, Cabezas D, Martín-Martín M, Alcalá FJ. Confidence of a k-Nearest Neighbors Python Algorithm for the 3D Visualization of Sedimentary Porous Media. Journal of Marine Science and Engineering. 2023; 11(1):60. https://doi.org/10.3390/jmse11010060
Chicago/Turabian StyleBullejos, Manuel, David Cabezas, Manuel Martín-Martín, and Francisco Javier Alcalá. 2023. "Confidence of a k-Nearest Neighbors Python Algorithm for the 3D Visualization of Sedimentary Porous Media" Journal of Marine Science and Engineering 11, no. 1: 60. https://doi.org/10.3390/jmse11010060
APA StyleBullejos, M., Cabezas, D., Martín-Martín, M., & Alcalá, F. J. (2023). Confidence of a k-Nearest Neighbors Python Algorithm for the 3D Visualization of Sedimentary Porous Media. Journal of Marine Science and Engineering, 11(1), 60. https://doi.org/10.3390/jmse11010060