Airborne infectious diseases have had a significant negative influence on human health, well-being and socioeconomic development. Anti-infection ventilation is a critical tool for effectively preventing the spread of airborne infectious diseases. Infectious particulate matter concentration is the most direct factor affecting the effectiveness of anti-infection ventilation. Generally coughing and sneezing are typical transient behaviors of occupants that release large amounts of infectious particulate matter. However, there is a lack of unsteady-state models for predicting the effect of sneezing and coughing on infection risk, and have not been considered in conjunction with intelligent anti-infection ventilation. In this study, computer audition was coupled with a behavior-based unsteady-state prediction model to propose an intelligent anti-infection ventilation strategy. According to the results, increasing the ventilation rate within 10 min after coughing or sneezing, was the most effective in minimizing the infection transmission. Taking a real case as an example, when coughing and sneezing occurred and after 1 h of exposure, the proposed strategy could control the infection risk to 6.9% with an energy saving rate of 53.47% (0.24 kg of carbon emission reduction per hour). In summary, this study can help balance the relationship between energy consumption and infection risk and provide some references for comprehensive intelligent control of anti-infection ventilation.