Optimal perimeter control is one of the effective control technologies to alleviate urban congestion, which is based on macroscopic fundamental diagrams (MFDs). However, most previous optimal perimeter control methods used a linearization model at the desired point to approximate a nonlinear MFDs system, which is vulnerable to causing a potential mismatch between the linearization model and the environmental dynamics. However, this mismatch often leads to performances degradation. To solve this problem, this paper uses a neural network trained from data to approximate the complex nonlinear urban traffic system globally. To facilitate the design and control, this framework linearizes the nonlinear neural network of the traffic system to an instantaneous linearization model. The optimal perimeter control problem is finally solved by generalized predictive control (GPC) with the instantaneous linearization model. A key advantage of the proposed framework is that the global instantaneous linearization model is more accurate than the linearization model around the desired point. Simulation results show that the proposed framework significantly alleviates congestion and reduces the total travel time spent (TTS) in the traffic system compared with no control, “greedy” feedback control and PID control.