ABSTRACT The uneven velocity distribution formed at the lateral inlet/outlet poses a significant risk of damaging the trash racks. Reasonable design of the inlet/outlet structures requires the consideration of two major aspects: the average velocity (Vm) and the coefficient of unevenness (Uc). This paper developed an optimization framework that combines an interpretable Gradient Boosting Decision Tree (SOBOL-GBDT) with a Non-dominated Sorting Genetic Algorithm (NSGA-II). 125 conditions are simulated by performing CFD simulations to generate the dataset, followed by GBDT implemented to establish a nonlinear mapping between the input parameters including vertical (α) and horizontal (β) diffusion angles, diffusion segment length (LD), channel area (CA), and the objectives Uc and Vm. The SOBOL analysis reveals that in Uc prediction, CA and α play more significant roles in the model development compared to β and LD. Besides, GBDT is observed to better capture interactive effects of the input parameters compared with other machine learning models. Subsequently, a multi-objective optimization framework using GBDT-NSGA-II is developed. The framework calculates the optimal Pareto front and determines the best solution using a pseudo-weight method. The results demonstrate that this framework leads to significant improvements in flow separation reduction in the diffusion segment and the normalized velocity distribution. The SOBOL-GBDT-NSGA-II framework facilitates a rational and effective design of the inlet/outlet.