This repository implements a deep-learning-driven method for multi-scale pore network modeling (PNM) using image-derived microstructures. The method combines high-resolution imaging, pore network extraction, ANN-based fusion, and upscaling to efficiently model heterogeneous rock samples.
This project operates in two main stages:
Train the ANN to learn the connection rules between micro-scale pore networks extracted from high-resolution (HR) images.
python ANN.pyInput: HR segmented image slices (.tif)
Output: ./ML_output/trained_ann_model.h5
This model will later be used in both regular and upscaled PNM reconstructions.
After ANN training, there are two independent reconstruction paths, both using the trained model:
Creates a detailed multi-scale pore network by merging resolved and unresolved networks, using the trained ANN to predict micro-macro throat connections.
python PNM_Reconstruction.pyOutput:
- VTK file of the full network
- Permeability, porosity, capillary pressure, Kr curves and pore/throat stats (
FinalResult,output.xlsx)
Instead of inserting full micro-networks, this path replaces them with representative base pores, drastically reducing computational cost while maintaining accuracy.
python PNM_Upscaling.pyOutput:
- Simplified pore network with similar hydraulic behavior
- VTK +
output.xlsxfor permeability, capillary pressure, Kr curves
.
├── ANN.py # Trains ANN on HR extracted PNM data
├── PNM_Reconstruction.py # Builds regular multi-scale PNM using ANN
├── PNM_Upscaling.py # Builds upscaled multi-scale PNM using ANN
├── connectNetworks.py
├── connectNetworksUpscale.py
├── solver.py
└── Relperm.py All parameters (paths, voxel size, method, etc.) are defined inside each script and easily modifiable.
Generated by connecting high-resolution and low-resolution networks using the trained ANN.
Efficient version using base pores instead of full micro-networks.
- ANN predicts throat connection existence, length, and diameter between micro and macro pores.
- The model is trained on pore pairs from
snow2-extracted HR networks. - Upscaling uses hydraulic conductance-based path reduction to base pores.
This repository is based on the method published in:
A. Moslemipour et al.,
Multi-scale pore network fusion and upscaling of microporosity using artificial neural network,
Marine and Petroleum Geology, 2025, 177:107349.
https://doi.org/10.1016/j.marpetgeo.2025.107349
- Abolfazl Moslemipour
(Johannes Gutenberg University Mainz, Germany) - Saeid Sadeghnejad, F. Enzmann, T. Schäfer, S. Hupfer, M. Kersten
- GitHub: @Abolfazlmsl, @Saeid-Sli
- Email: amoslemi@uni-mainz.de, s.sadeghnejad@uni-jena.de
This project is licensed under the MIT License.
You are free to use, modify, and distribute this code under the terms of this license.
See the LICENSE file for full details.

