## 3 Proposed Algorithm
### Classification of Good and Bad Postures in Front of a Computer  
In the proposed algorithm, the OpenPose algorithm described earlier is used to detect the human skeleton in the side-view images, and based on this, the features of the angles for each body part are identified, and the postures are classified. The proposed algorithm is constructed to classify the three postures, and the algorithm process is shown in Figure 2. First, a side-view image of a user using a desktop computer is obtained, and the user's skeleton is determined using the OpenPose algorithm. As shown in Figure 3, we can obtain the skeletons for each posture obtained using the OpenPose algorithm, where (a) represents the good posture, (b) represents the text neck posture, and (c) represents the L-posture. In Figure 3, the assigned numbers for each body part are as follows: head (0), neck (1), chest (2), and hip (3), and they are connected by lines representing 'head-neck', 'neck-chest', and 'chest-hip'. Then, as shown in Figure 4, the angles of 'head-neck' (\(\theta_{1}\)), 'neck-chest' (\(\theta_{2}\)), and 'chest-hip' (\(\theta_{3}\)) are calculated. At this point, the angles of \(\theta_{1}\), \(\theta_{2}\), and \(\theta_{3}\) are calculated as shown in Figure 4 using Equation (2):  
\[\theta_{i}=\arctan\biggl{(}\frac{y_{1}-y_{2}}{x_{1}-x_{2}}\biggr{)},i=1,2,3, \tag{2}\]  
where (\(x_{1},\ y_{1}\)) represents the coordinate point of the first part, and (\(x_{2}\),\(y_{2}\)) represents the coordinate point of the second part. For example, when calculating 'head-neck' (\(\theta_{1}\)), (\(x_{1},\ y_{1}\)) represents the coordinate values of the head (0) within the image, and (\(x_{2}\),\(y_{2}\)) represents the coordinate values of the neck (1). Therefore, theta_1 can be calculated using the values \(x_{1}\), \(y_{1}\), \(x_{2}\), and \(y_{2}\) in Equation (2). And then, based on the characteristics of the three angles specific to each posture, the postures are classified. In Figure 3a, a good posture maintains a straightened back and shoulders while preserving the natural curves of the spine. Therefore, the values of these three angles are larger than those of the text neck posture. The L-posture is leaning against a chair with the hips pushed forward, so the angles for 'neck-chest' and 'chest-hip' are larger compared to the good posture and text neck posture. On the other hand, the text neck posture is a posture where the shoulders and waist are bent, and the neck is pulled forward, so the angle values for 'head-neck', 'neck-chest', and 'chest-hip' are relatively smaller compared to the good posture, and in particular, the 'head-neck' angle is much smaller. Therefore, a new variable \(\theta_{4}\) is defined by using the weight of each angle to better reflect these characteristics of the text neck posture, and the formula is as follows:  
\[\theta_{4}=\theta_{1}\times 0.6+\theta_{2}\times 0.2+\theta_{3}\times 0.2, \tag{3}\]  
In Equation (3), the text neck posture is given a weight of 60% due to its characteristic of having a smaller angle between the head and neck compared to other postures, while the angle ratios of \(\theta_{2}\) and \(\theta_{3}\) are equally weighted at 20% each. Using the four angles obtained earlier, the three postures are classified. If both \(\theta_{2}\) and \(\theta_{3}\) are greater than the threshold values \(Th_{1}\) and \(Th_{2}\), respectively, the posture is classified as L-posture. Then, if both \(\theta_{1}\) and \(\theta_{4}\) are smaller than the threshold values \(Th_{3}\) and \(Th_{4}\), respectively, the posture is classified as text neck posture (T-posture), while if they are both greater, it is classified as a good posture (G-posture). Since there was no posture classification defined based on the exact angle values in previous studies, the four threshold values used in this study are defined based on the experimental data conducted in Section 4.