Accurate and reliable prediction of porosity forms the foundational basis for evaluating reservoir quality, which is essential for the systematic deployment of oil and gas exploration and development plans. When data quality of samples is low, and critical model parameters are typically determined through subjective experience, resulting in diminished accuracy and reliability of porosity prediction methods utilizing gated recurrent units (GRU), a committee-voting ensemble learning (EL) method, and an enhanced particle swarm optimization (PSO) algorithm are proposed to optimize the GRU-based porosity prediction model. Initially, outliers are eliminated through box plots and the min–max normalization is applied to enhance data quality. To address issues related to model accuracy and high training costs arising from dimensional complexity, substantial noise, and redundant information in logging data, a committee-voting EL strategy based on four feature selection algorithms is introduced. Following data preprocessing, this approach is employed to identify logging parameters highly correlated with porosity, thereby furnishing the most pertinent data samples for the GRU model, mitigating constraints imposed by single-feature selection methods. Second, an improved PSO algorithm is suggested to tackle challenges associated with low convergence accuracy stemming from random population initialization, alongside the absence of global optimal solutions due to overly rapid particle movement during iteration. This algorithm uses a good-point set for population initialization and incorporates a compression factor to devise an adaptive velocity updating strategy, thereby enhancing search efficacy. The enhanced PSO algorithm’s superiority is substantiated through comparison with four alternative swarm intelligent algorithms across 10 benchmark test functions. Ultimately, optimal hyper-parameters for the GRU model are determined using the improved PSO algorithm, thereby minimizing the influence of human factors. Experimental findings based on approximately 15,000 logging data points from well A01 in an operational field validate that, relative to three other deep learning methodologies, the proposed model proficiently extracts spatiotemporal features from logging data, yielding enhanced accuracy in porosity prediction. The mean squared error on the test set was 7.19 × 10–6, the mean absolute error stood at 0.0082, and coefficient of determination reached 0.99, offering novel insights for predicting reservoir porosity.