1. Introduction
Fasting, particularly during periods like Ramadan, has widespread implications not only for individual health but also for workplace productivity and well-being. It is mandatory for Muslim adolescents who have reached puberty and healthy adults to fast every day from sunrise to sunset during the ninth month of the Islamic calendar. They have to refrain from eating, drinking, and engaging in any other physical indulgences during this fasting period. While eating and drinking are permitted during the night, during Ramadan there are usually only two meals per day—one before sunrise and one after sunset—instead of the customary three or more meals, and there is no opportunity for mid-day snacks. This change in eating habits might, therefore, have a detrimental effect on energy intake, body weight, and hydration levels over the month [
1,
2]. Fasting, particularly for the whole day, also influences physical activity levels through various physiological and psychological mechanisms, including reduced energy, hormonal changes, altered metabolic rate, negative mood and mental states, and decreased motivation [
3]. Understanding how fasting influences physical activity, particularly in sedentary office environments, can help shape both personal health practices and organizational policies. Monitoring fasting’s effect on movement and energy expenditure can provide objective data to inform workplace accommodations, such as adjusting work hours or physical activity recommendations during fasting periods.
How does fasting affect an individual’s physical activity? Previous studies have yielded mixed results. For example, subjective questionnaires and self-reported diaries [
4,
5,
6] suggest that low to moderate daily activity remains relatively unaffected by Ramadan fasting. However, a decrease in high-intensity activities has been observed [
4,
7]. For instance, soccer players experience a significant reduction in running quantity during Ramadan, along with decreased aerobic capacity, speed endurance, and jumping performance [
7]. But these findings were based on self-reported data, which may not accurately reflect true physical activity levels. Objective measurements using wearables in studies [
8,
9,
10] primarily rely on step counts to assess physical activity levels, showing a reduction in step counts during Ramadan. While this method provides accurate data, it predominantly focuses on lower body movements, only partially capturing overall physical activity, and often overlooks the significant time individuals spend seated in office environments. During Ramadan fasting, most people spend substantial time sitting or lying down, sometimes exceeding 10 h per day [
4,
5]. There is currently a lack of objective, real-time monitoring systems that capture upper body movement during fasting, which is crucial for understanding its impact on productivity and health. The effect of fasting on physical activity during prolonged periods of sitting remains unclear. It would be valuable to investigate whether fasting influences activity levels while sitting, especially in typical daily environments, with a particular focus on upper body movements.
This research aims to address this gap by employing a non-invasive, vision-based system to evaluate how fasting affects upper body movement during typical office work, offering a more detailed understanding of fasting’s impact on physical activity in a sedentary setting. Compared to traditional wearables, the vision-based method is hands-free, easy to set up, and less invasive, allowing for natural observation without disrupting participants’ routines. It provides objective measurements at clinically acceptable accuracy [
11], free from the bias associated with self-reporting [
4], and captures comprehensive upper body movements without requiring multiple devices. This approach supports longitudinal tracking of changes across fasting and non-fasting periods.
To achieve this, a vision-based human body motion measurement system consisting of a compact computer processor and an RGB-D camera was used to estimate upper body movements during fasting and non-fasting periods. The system monitored five participants’ body movements for 3 to 5 days during both fasting and non-fasting periods, and the differences were compared.
Figure 1 illustrates the monitoring system alongside a participant. The experimental results show that fasting affects the movement patterns of the five participants differently. Two participants show statistically significant (
) yet opposite changes in movement, while the others do not, demonstrating substantial interpersonal variability.
3. Method
This research involved five participants (P1: M, 29; P2: M, 70; P3: M, 40; P4: M, 37; P5: M, 35; profiles shown in
Table 1), who performed daily tasks while seated in various university offices. Specifically, three of the participants engaged in full daytime fasting without skipping a day during Ramadan, whereas two participants practiced intermittent full daytime fasting after Ramadan. Each participant was monitored for 3 to 5 days under both conditions. The monitoring process was completely unscripted and involved natural observation without disrupting participants’ routines. The monitoring dates were not necessarily continuous due to participants’ absences from the workplace (e.g., weekends, remote working days, etc.).
The vision-based system employs standard, off-the-shelf equipment, including an RGB-D camera (RealSense D415 [
12]) and a compact computer processor (Jetson Orin Nano [
13]). The camera is positioned on a shelf, approximately 1 m above the participants, to ensure full upper-body visibility (see
Figure 1). It provides both color and depth images at 640 × 480 resolution and 30 frames per second and captures human movements in real time. Standard image processing functions, such as body region extraction and optical flow estimation for body movement measurement [
25,
26], are performed by the compact processor.
Specifically, computer vision algorithms were employed, including non-parametric background modeling in the depth map [
27] and human body identification in the foreground. This was followed by the detection of significant pixel variations on the human body based on changes in RGB color-channel values. Detailed calculations and parameters for these methods are described in [
28]. Subsequently, the pixel-wise movement vector was computed using dense optical flow [
29] applied to the significantly varying pixels extracted in the previous step. The method processes visual data at a rate of 7–8 frames per second, with no original images saved to protect privacy. For each frame, the 2D coordinates of the extracted human-body bounding box, the number of significantly varying pixels, and their respective 2D coordinates and optical flow were used to calculate movement statistics. The pipeline for the monitoring system that extracts body movement features is illustrated in
Figure 2.
It achieves a 0% false positive rate for inactivity detection (with a ±3-frame temporal tolerance) [
28]. Additionally, it attains a Root Mean Square Error (RMSE) of 0–2.5 pixels per frame for 2D human body movement speed estimation [
30]. The camera’s sensors enable accurate identification of body regions and movements without requiring wearable devices, making the system non-interactive and unobtrusive.
To compare movement patterns between fasting and non-fasting periods and to explore potential changes in overall activity levels, three key performance metrics describing upper body movement were calculated:
Inactivity: The proportion of time during which no movement is detected while the person is within view is calculated as the number of frames with no detected body motion (
) divided by the total number of frames with detected bodies (
) captured during that time period. This metric measures the ratio of inactivity.
Movement Scale: The ratio of the area occupied by moving parts of the body (defined by the bounding box of pixels with significant variations) to the total area of the body (
—defined by the bounding box of the entire body). This metric indicates the proportion of the body that is actively moving.
where
is the area of the bounding box surrounding the pixels with significant variations across all RGB channels on the human body [
28] and
is the area of the bounding box surrounding the entire body detected by the YOLO object detector [
31].
Movement Speed: The average 2D speed of body movement per frame is measured as the mean rate of change in pixel positions.
where
is the 2D movement speed of pixel
i, calculated as the magnitude at each pixel of the dense optical flow [
29], and
n is the total number of pixels with significant variations across all RGB channels on the human body [
28], as illustrated in red in
Figure 3b.
Examples of detections of the features are shown in
Figure 3. The three feature statistics were computed on a per-minute basis, then averaged hourly. Minutes in which the participant was present for less than 40% of the time and hours in which the participant was present for less than 40% of the minutes were discarded.
Statistical Test: T tests were conducted to compare fasting and non-fasting statistics for each participant. The null hypothesis states that there is no significant behavioral change between fasting and non-fasting periods. Welch’s t test, which does not assume equal variances between the two groups, was used to analyze the differences between the two conditions due to the imbalanced sample sizes of the fasting and non-fasting groups.
The samples for Welch’s
t test included all hourly features from fasting and non-fasting days, with sample sizes ranging from 9 to 24 in each group. The
t test can be represented as
where
is the set of hourly feature data for non-fasting days and
is the set of hourly feature data for fasting days. A discussion of the statistical significance of the performance achieved by individuals based on the
p values of the
t tests presented in
Table 2 is included in the next section.
Energy Expenditure: When comparing energy expenditure during fasting and non-fasting periods within the same individual, the following assumptions are made: Faster movements generally require more energy, so speed positively contributes to energy expenditure. Larger movements (i.e., greater movement scale) typically involve more muscle groups and, therefore, require more energy, also contributing positively to energy expenditure. Inactivity (rest) results in less energy being expended, contributing less to overall energy expenditure.
Although energy expenditure is influenced by individualized factors such as age, gender, height, and weight [
32], for simplicity, a unified equation is applied to all participants to calculate the average hourly energy expenditure here, as follows:
where
,
, and
are coefficients that represent the relative contribution of each feature (extracted for each minute) to energy expenditure and
m is the number of minutes the person is present in the camera’s view. Equations (
1)–(
3) describe how the raw measurements are computed. All features from each participant are standardized, then normalized to the range of [0, 1] to minimize personal effects when comparing energy expenditure between fasting and non-fasting behaviors.
A one-minute window is selected to compute all features.
Figure 4 shows the correlation between the features and the first principal component derived from Singular Value Decomposition (SVD) [
33]. This suggests that faster and larger movements are associated with lower levels of inactivity. The coefficients from Equation (
5) are assigned using the absolute values of the normalized first principal component coefficients, i.e.,
,
, and
.
4. Results
Figure 5 illustrates the movement statistics across different hours of the day for each participant. The analysis focused on three motion descriptors: (i) inactivity, (ii) movement scale, and (iii) movement speed. These descriptors were averaged for both fasting and non-fasting days. To ensure reliability and avoid bias, any hour with fewer than two samples from either the fasting or non-fasting group was discarded. Only hours with at least four appearances by participants across all days were included in the comparison.
This analysis is particularly relevant in Ramadan fasting, where the fasting period is synchronized with daylight hours, typically from sunrise to sunset, which aligns with participants’ daily activity patterns. The monitored data primarily cover the hours of 9:00 to 18:00, reflecting the period when participants were in the lab during normal working hours (although working hours are typically reduced in most Muslim countries during Ramadan [
34]). During these hours, the fasting period was still ongoing, making this time window particularly relevant for comparing movement patterns between fasting and non-fasting conditions.
Participant 1 (P1) exhibited increased activity levels during fasting days compared to non-fasting days. This participant showed significantly less inactivity across almost all hours during fasting (), a markedly larger upper body movement scale throughout the day (), and a faster movement speed during most hours of fasting.
Participant 3 (P3) displayed a similar pattern to P1, being more active on fasting days; however, this was not statistically significant. General declines in movement speed and scale over the day were evident, possibly due to energy depletion without compensatory intake during fasting.
Participant 4 (P4), in contrast to P1 and P3, was notably less active during fasting days, exhibiting significantly more inactivity (), an obviously reduced movement scale in the morning, and slower movement throughout the day ().
Participant 2 (P2), who engaged in intermittent fasting for non-consecutive days, showed no significant differences between fasting and non-fasting days. For Participant 5 (P5), there was a slight increase in inactivity, suggesting more rest during fasting days, though it was not statistically significant. The scale of body movements followed similar trends during both fasting and non-fasting periods, showing a decrease throughout working hours. However, these differences were also not statistically significant.
In conclusion, P1 demonstrated significant changes in both inactivity and movement scale during fasting, while P4 showed significant changes in inactivity and movement speed. P2, P3, and P5 did not exhibit significant changes across these metrics. For the significantly different features, the changes are consistent across hours of the day, indicating that fasting influences these behavioral aspects.
Figure 6 shows the energy expenditure of each participant derived using Equation (
5). For participants without significant behavioral changes (P2, P3, and P5), although there are differences between fasting and non-fasting energy expenditure at certain hours (
Figure 6a), the accumulated energy expenditure averaged across all days (
Figure 6b) remains very close. P1 shows a noticeable increase in accumulated energy expenditure during fasting, indicating more physical activity during this period. In contrast, P4 shows reduced energy expenditure during fasting hours, with a noticeable dip compared to non-fasting periods, suggesting reduced physical activity.
Overall, the results are mixed across participants and movement features. Although two participants showed significant changes in movement, their responses were opposite.
Figure 7 compares movement feature across each day, averaged across all hours. A clear difference is observed in the statistically significant groups based on daily means.
Figure 8 illustrates (a) the variance among days (inter-day variance) and (b) the variance among hours (intra-day variance). Non-fasting days exhibit a typically larger variance compared to fasting days among most of the participants (
Figure 8a), indicating that movement behaviors are more consistent during fasting. This consistency could be due to reduced energy levels leading to more uniform behavior throughout the fasting period. However, the variance among hours (
Figure 8b) does not show any clear trend when comparing normal and fasting days, which could be because intra-day fluctuations are driven more by task demands or environmental factors than fasting status. It shows that the variance among hours is generally greater than that among days, suggesting that monitoring over longer periods can provide more consistent and reliable statistics for the participants.
5. Discussion
The visual monitoring system proposed in this research offers significant benefits by examining the effects of fasting on upper body movement and energy expenditure. It enables non-invasive, continuous, and objective data collection, allowing for natural observation without disrupting participants’ routines. The system, equipped with an RGB-D camera and a compact processor, provides high-resolution spatial and temporal data processed in real time, capable of capturing subtle body movements. The RGB-D camera, with its infrared-based depth measurement, is well suited for robust human detection in various home environments, especially in low-light conditions, compared to standard RGB cameras [
28]. Its automation and scalability make it suitable for larger studies, while its cost-effectiveness enhances applicability in diverse settings. By tracking movement over multiple fasting and non-fasting days, the system offers insights into behavioral adaptations during fasting in professional environments. Although fasting was the control variable here, the approach might also be usable for assessing the impact of different approaches to dieting.
The impact of fasting on upper body movement during office work did not show a consistent trend among the five participants, highlighting significant interpersonal differences. According to
Table 1, the five participants, despite variations in age and BMI, have similar lifestyles. Among all participants, P2 showed the least changes in all motion features (less than 6%), primarily due to intermittent fasting (similar to P5, who exhibited no significant change despite being in a different age group, though P5’s changes were still twice as large as P2’s). Age may be a factor here, but this study considered too few participants to draw definitive conclusions.
For P3 and P5, who are close in age to P4, the observed differences in the experimental results may stem from their varied fasting experiences and habits. P5, for example, engaged in three daytime fasts outside of Ramadan, a relatively short period that may not have been sufficient for significant fasting effects to emerge. In contrast, P3 not only fasted long-term during Ramadan but also maintained a regular practice of fasting one or two days weekly throughout the year. This consistency likely contributed to higher adaptability to fasting in P3’s body. Meanwhile, P4 fasted only during Ramadan, suggesting less frequent exposure to fasting conditions. It is also possible that upper body monitoring is not as sensitive to fasting, especially compared to walking or exercise monitoring. However, in such cases, individuals are unlikely to engage in these activities for the entire daytime.
The opposite changes between P1 and P4 could be attributed to (i) personal differences and habits, with the inconsistency matching previous studies that indicate fasting has different effects on different people, and (ii) the content of work, where differing tasks and patterns seem to be related factors; for example, P1 mentioned working primarily on programming with a PC and felt that their working hours were somewhat reduced, though they did not notice any significant changes in their daily routine. In contrast, P4, who focused mostly on online meetings, hands-on experiments, and data analysis, reported difficulty concentrating during fasting due to lack of sleep, frequent headaches, dry mouth, and a need for more naps and rest.
People may adjust their working hours during Ramadan, often shifting to shorter hours or different timings to accommodate fasting and prayer times (e.g., staying up late to ensure a meal before sunrise), which can impact their energy, focus, and productivity levels [
35]. Regarding changes in working hours, the mean working hours during fasting and non-fasting periods are shown in the first row of
Table 3. The average number of hours spent at a desk is 5.07 (SD 1.45) during non-fasting and 5.18 (SD 1.2) during fasting. This indicates that the average change in working hours is less than an hour for all participants. For the primary monitoring period, from 9:00 to 18:00 for all participants, the start and end working times were compared, and no shifts from their normal working routines during fasting were observed, suggesting that adjusted working hours were not a significant factor in this research.
Other underlying personal variations could also play a role, including differences in genetics, metabolic rate, hormone levels, stress levels, and previous diet. These factors can affect how individuals respond to fasting, which may explain the differences seen among participants.
The limitations of this research include (i) the small size of the dataset, which limits diversity in terms of gender and age and affects the generalizability of fasting’s impact on individuals; (ii) the fact that observation was restricted to desk work and upper body movements during working hours, failing to capture full-day energy expenditure; and (iii) the fact that the experimental setup was a natural observation, where participants were monitored on different dates, and their monitoring periods were not necessarily continuous due to participants’ absences from the workplace. Conducting longer-term research, beyond just a few days, would provide deeper insights into how behavior changes over extended fasting periods.