  The high thermal efficiency and reliability of the compression-ignition
engine makes it the first choice for many applications. For this to continue, a
reduction of the pollutant emissions is needed. One solution is the use of
machine learning (ML) and model predictive control (MPC) to minimize emissions
and fuel consumption, without adding substantial computational cost to the
engine controller. ML is developed in this paper for both modeling engine
performance and emissions and for imitating the behaviour of an Linear
Parameter Varying (LPV) MPC. Using a support vector machine-based linear
parameter varying model of the engine performance and emissions, a model
predictive controller is implemented for a 4.5 Cummins diesel engine. This
online optimized MPC solution offers advantages in minimizing the
\nox~emissions and fuel consumption compared to the baseline feedforward
production controller. To reduce the computational cost of this MPC, a deep
learning scheme is designed to mimic the behavior of the developed controller.
The performance in reducing NOx emissions at a constant load by the imitative
controller is similar to that of the online optimized MPC compared to the
Cummins production controller. In addition, the imitative controller requires
50 times less computation time compared to that of the online MPC optimization.
