Changes in lying pattern and lying center position can reflect information about the production efficiency, health, and welfare of pigs. This study investigates the lying pattern and lying center position of grouped pigs by using unsupervised clustering, deep learning, and image processing technology under commercial farming conditions. Images of the lying pattern of grouped pigs under commercial conditions were collected over 110 days, and then ellipse fitting was used to calculate the center of the target pigs. Unsupervised clustering was used to calculate the cluster center of pigs (lying pattern central location). Variance and standard deviation of the distance from the cluster center to each pig were calculated, Finally, the lying patterns of pigs were classified as “Crowded,” “Close,” “Normal,” “Dispersed,” and “Far.” These patterns were based on the standard deviation. In this research, a Convolutional Neural Network-Support Vector Machine (CNN-SVM) classification model was used to classify five lying patterns of grouped pigs; classification accuracy was up to 97.1%. We studied the change in the lying pattern center of grouped pigs over time, and found that the lying pattern center of grouped pigs showed positional variations over time. We collected experimental site data during the period from July 15, 2021 to October 31, 2021 and analyzed the lying patterns of the grouped pigs. Our results showed that pigs mainly had three lying patterns: “Crowded,” “Close,” and “Normal.” Their proportions were 35%, 33.75%, and 18%, respectively. In addition, the study also found that there were significant changes among the five lying patterns in a day. Standard deviation of grouped pigs showed positive correlation with pigpen temperature, and lying pattern variation of grouped pigs was affected by pigpen temperature. Based on these conclusions, suitable environmental conditions could be created for grouped pigs. In the future, more experiments and research will be extended to other types of livestock, as this technology is helpful for large-scale automatic welfare breeding of livestock.