A framework for porous media topology reconstruction from petrographic thin sections for clastic rocks is proposed. The framework is based on two sequential stages: segmentation of thin sections imagesinto grains, porous media, cement (with further mineralogical classification of segmented elements) and reconstructing a three-dimensional voxel model of rock at pore scale. The framework exploits machine learning algorithms in order to segment2D thin section images, perform structural and mineralogical classification of grains, cement, pore space, and reconstruct 3D models of porous media. Segmentation of petrographic thin section images and mineral classification of the segmented objects are performed by the means of combination of image processing methods and Convolutional Neural Networks (CNNs). The 3D porous media reconstruction is done by means of the Generative Adversarial Networks (GANs) are applied to the segmented and classified 2D images of thin sections. As the criteria of the reconstruction quality, the following metrics were numerically calculated and compared for original and reconstructed synthetic 3D models of porous rocks: Minkowski functionals (porosity, surface area, mean breadth, Euler characteristic) and absolute permeability. Absolute permeability was calculated using pore network model. The 3D reconstruction framework was tested on a set of thin sections and CT tomograms of the clastic samples from the Achimovskiy formation (Western Siberia). The results showed the validity of the goodness-of-fit metrics based on Minkowski functionals for reconstruction the topology of porous media. The combined usage of CNN and GAN allowed to create a robust 3D topology reconstruction framework. The calculated poroperm characteristics are correlated with laboratory measurements of porosity and permeability. The developed algorithms of automatic feature extraction from petrographic thin sections and 3D reconstruction based on these features allow to achieve the following goals. First is the reduction of the amount of the routine work done by an expert during petrographic analysis. Second leads to the reduction of the number of expensive and time-consuming CT scannings required for each physical sample in order to perform further absolute and relative permeability calculations. The proposed method can bring the petrographic thin section and CT data analysis to a new level and significantly change traditional core experiments workflow in terms of speed, data integration and rock sample preparation.