This study proposes an image recognition method to assist swine farm managers in collecting health data related to pig feeding and excretion. Analyzing the correlation between sow health data and indoor air quality in the pigsties revealed significant influences of air quality indicators on sow health. Increased levels of TVOC, CO2, and temperature were found to negatively affect feeding health, while increased temperature, humidity, and PM10 were found to negatively impact excretion health. These findings provide a basis for evaluating variables when constructing future sow disease prediction models. Analyzing the correlation between pig health status and air quality can help swine farm managers improve sow production environments, reduce disease risks, enhance production efficiency, and provide valuable insights for future research on disease prediction models.