The graded distribution of Pt loading in the catalyst layer (CL) and the porosity of the gas diffusion layer (GDL) significantly affect the spatial distributions of electrochemical reaction and mass transport rates, thus influencing the cell performance and durability. A sophisticated physics-based model is established to study the influence of graded Pt loading and GDL porosity at the cathode, with their distribution function obeying the elliptic equation along the in-plane and through-plane directions, on the current density and its uniformity at a given cell voltage. To reduce the computational time and resources, an RNN algorithm-based data-driven surrogate model is developed to assist in the identification of the relationship between the design parameters and the objective functions. Latin hypercube sampling (LHS) method is implemented for sampling and then the initial data acquisition is conducted for training and testing the surrogate model. Results show that the machine learning (ML) algorithm could effectively assist the optimal design of the functionally graded electrode, and the surrogate model achieves > 97.9% prediction accuracy for current density and < 0.13 root mean square error (RMSE) for current homogeneity. Both the individual variation of Pt loading and GDL porosity and their interaction are respectively analysed. Results also indicate that the inhomogeneous Pt distribution improves the current density. On the contrary, GDL porosity has a greater impact on the cell performance since current density monotonically increases with the homogeneous GDL porosity. When both the inhomogeneous distributions of Pt loading and GDL porosity are simultaneously considered, the homogeneity of current density is improved. However, the improvement of the homogeneity of current density (increases by 54%) sacrifices the maximum current density (reduces by 22%).