Nanoporous materials (e.g., zeolite, activated carbon, metal-organic framework, polymeric membranes, etc.) have various technological applications, including gas separation, gas storage, catalytic transformations, etc. The functionalities of nanoporous materials strongly depend on their pore size and shape distribution—which present virtually limitless degrees of freedom. Here, based on high-throughput lattice density functional theory (LDFT) simulations and a convolutional neural network (CNN) predictor, we present a model allowing us to predict the water sorption isotherm of nanoporous configurations. The training of an inverse CNN generator then enables the inverse design of optimal porous microstructures featuring tailored/unusual sorption isotherms.