Pressure swing adsorption (PSA) technology is among the most efficient techniques for purifying and separating hydrogen. A layered adsorption bed composed of activated carbon and zeolite 5A for a gas mixture (H2: 56.4 mol%, CH4: 26.6 mol%, CO: 8.4 mol%, N2: 5.5 mol%, CO2: 3.1 mol%) PSA model was built. The simulation model was validated using breakthrough curves. Then, a six-step PSA cycle model was built, and the purification performance was studied. The Box–Behnken design (BBD) method was utilized in Design Expert software (version 10) to optimize the PSA purification performance. The independent optimization parameters included the adsorption time, the pressure equalization time, and the feed flow rate. Quadratic regression models can be derived to represent the responses of purity and productivity. To explore a better optimization solution, a novel optimization method using machine learning with a back propagation neural network (BPNN) was then proposed, and a kind of heuristic algorithm–genetic algorithm (GA) was introduced to enhance the architecture of the BPNN. The predicted outputs of hydrogen production using two kinds of models based on the BPNN–GA and the BBD method integrated with the BPNN–GA (BBD–BPNN–GA). The findings revealed that the BBD–BPNN–GA model exhibited a mean square error (MSE) of 0.0005, with its R–value correlation coefficient being much closer to 1, while the BPNN–GA model exhibited an MSE of 0.0035. This suggests that the BBD–BPNN–GA model has a better performance, as evidenced by the lower MSE and higher correlation coefficient compared to the BPNN–GA model.