Because of the low accuracy of the current machine olfactory algorithms in detecting two mixed gases, this study proposes a hybrid gas detection algorithm based on an extreme random tree to greatly improve the classification accuracy and time efficiency. The method mainly uses the dynamic time warping algorithm (DTW) to perform data pre-processing and then extracts the gas characteristics from gas signals at different concentrations by applying a principal component analysis (PCA). Finally, the model is established by using a new extreme random tree algorithm to achieve the target gas classification. The sample data collected by the experiment was verified by comparison experiments with the proposed algorithm. The analysis results show that the proposed DTW algorithm improves the gas classification accuracy by 26.87%. Compared with the random forest algorithm, extreme gradient boosting (XGBoost) algorithm and gradient boosting decision tree (GBDT) algorithm, the accuracy rate increased by 4.53%, 5.11% and 8.10%, respectively, reaching 99.28%. In terms of the time efficiency of the algorithms, the actual runtime of the extreme random tree algorithm is 66.85%, 90.27%, and 81.61% lower than that of the random forest algorithm, XGBoost algorithm, and GBDT algorithm, respectively, reaching 103.2568 s.