This paper presents a deep-learning-based system for classifying pig postures, aiming to improve the management of sustainable smart pigsties. The classification of pig postures is a crucial concern for researchers investigating pigsty environments and for on-site pigsty managers. To address this issue, we developed a comprehensive system framework for pig posture classification within a pigsty. We collected image datasets from an open data sharing site operated by a public organization and systematically conducted the following steps: object detection, data labeling, image preprocessing, model development, and training. These processes were carried out using the acquired datasets to ensure comprehensive and effective training for our pig posture classification system. Subsequently, we analyzed and discussed the classification results using techniques such as Grad-CAM. As a result of visual analysis through Grad-CAM, it is possible to identify image features when posture is correctly classified or misclassified in a pig image. By referring to these results, it is expected that the accuracy of pig posture classification can be further improved. Through this analysis and discussion, we can identify which features of pig postures in images need to be emphasized to improve the accuracy of pig posture classification. The findings of this study are anticipated to significantly improve the accuracy of pig posture classification. In practical applications, the proposed pig posture classification system holds the potential to promptly detect abnormal situations in pigsties, leading to prompt responses. Ultimately, this can greatly contribute to increased productivity in pigsty operations, fostering efficiency enhancements in pigsty management.