Porphyromonas gingivalis, a Gram-negative anaerobic bacillus, is the primary pathogen in periodontitis. Herein, we cultivated strains of oral bacteria, including P. gingivalis and the oral commensal bacteria Actinomyces viscosus and Streptococcus mutans, and recorded the infrared absorption spectra of the gases released by the cultured bacteria at a resolution of 0.5cm-1 within the wavenumber range of 500-7500cm-1. From these spectra, we identified the infrared wavenumbers associated with characteristic absorptions in the gases released by P. gingivalis using a decision tree-based machine learning algorithm. Finally, we compared the obtained absorbance spectra of ammonia (NH3) and carbon monoxide (CO) using the HITRAN database. We observed peaks at similar positions in the P. gingivalis gases, NH3, and CO spectra. Our results suggest that P. gingivalis releases higher amounts of NH3 and CO than A. viscosus and S. mutans. Thus, combining Fourier transform infrared spectroscopy with machine learning enabled us to extract the specific wavenumber range that differentiates P. gingivalis from a vast dataset of peak intensity ratios. Our method distinguishes the gases from P. gingivalis from those of other oral bacteria and provides an effective strategy for identifying P. gingivalis in oral bacteria. Our proposed methodology could be valuable in clinical settings as a simple, noninvasive pathogen diagnosis technique.