With the fast advance of intelligent agriculture, a tremendous amount of toxic gas emission poses a serious threat to human health and crop growth, while traditional gas detection technology is difficult to realize online monitoring of agricultural greenhouse gases. In this article, a gas-sensing array based on Cu-, Ni- and Pd-doped CeO2 and combining a back propagation neural network (BPNN) with the crested porcupine optimizer (CPO) algorithm for quantitative detection of NO2-NH3 gas mixtures is reported. Rice, cubic and nanorod-like CeO2 samples were prepared by hydrothermal method, and the XRD, SEM, EDS and XPS characterization techniques were used to verify the successful preparation of the materials. Based on the established gas-sensitive platform, the gas-sensitive performance (concentration–response characteristics, response-recovery characteristics, repeatability and selectivity) of the CeO2-based sensors was investigated. The results showed that the CeO2-based sensor was able to selectively adsorb NO2 and NH3. Moreover, the gas adsorption mechanism was explored based on the density functional theory (DFT), and it was confirmed that the doping of Cu, Ni, and Pd elements was an effective modification strategy, and it was able to adsorb NO2-NH3 gases in an anti-interference manner. Therefore, in this work, a 3 × 2 sensing array assembled by combining CeO2-based sensors with the CPO-BPNN algorithm achieved high-precision quantitative detection of NO2 (96.70 %) and NH3 (94.19 %) for mixed NO2-NH3 under the influence of cross-interference.