A medical ventilator capable of analyzing infection and bacteria of pneumonia via gas identification comprises a sensor array, a sensor circuit, a stochastic neural network chip, a memory and a microcontroller. The sensor array detects a plurality of gases to be detected to generate a plurality of identification signals corresponding to each of the respective gases. The sensor circuit reads and analyzes the identification signals to generate a plurality of gas pattern signal corresponding to each of the respective gases a gas pattern signal corresponding to each of the respective gases. The stochastic neural network chip reduces the dimensions of each of the gas pattern signals to generate an analysis result. The memory is used to store a gas training data.一種利用氣體辨識而具肺炎感染與肺炎菌種疾病分析功能的呼吸器,包含有一感測器陣列、一感測器電路、一隨機類神經網路晶片、一記憶體及一微控器,該感測器陣列偵測複數待測氣體並產生對應該待測氣體的複數識別訊號,該感測器電路讀取並分析該識別訊號,以產生對應該待測氣體的複數氣體圖案訊號,該隨機類神經網路晶片降低該氣體圖案訊號的維度,以產生一分析結果,該記憶體係儲存一氣體訓練資料,該微控器係接收該分析結果,並根據該分析結果來辨識該複數待測氣體的種類。