###### Abstract  
Animal behaviors are key signs of animals' stress, disease, and overall well-being. This study was conducted in an experimental farrowing building using eighteen sow pens: nine exposed to natural heat stress under summer indoor temperatures and nine receiving cooling treatments via innovative cooling pads. Sow and piglet behaviors were recorded in an ethogram through direct visual observation every 5 min for 48 h. Passive infrared detectors were used for continuous pig behavior monitoring every sec. Zmodo wireless cameras were used for video monitoring to validate sensor detection results. Visual observation revealed distinct pig behaviors between the treatments. The sows had peak times in eating, standing, and drinking approximately from 05:00 to 12:00 and from 16:00 to 22:00. The sows under heat stress spent 49.3% more time lying (\(p<0.01\)). They spent 10.7% less time sleeping (\(p<0.05\)). Piglets under heat stress spent more time sleeping but less time nursing. The sensor outputs and pig moving behaviors (i.e., sow eating + standing + drinking + sitting + piglet walking) had a strong positive correlation (\(p=0.81\) for heat stress and \(p=0.74\) for cooling). In contrast, there were strong-to-moderate negative correlations (\(p=-0.77\) for heat stress and \(p=-0.56\) for cooling) between the sensor outputs and sow on-body behaviors (i.e., sow lying + nursing + sleeping). Video recordings validated the response and sensitivity of the sensors, with them able to quickly capture changes in pig behaviors and provide behavioral information about the nuanced pig movements. Animal agriculture; behavior monitoring; continuous measurement; passive infrared detector; signal processing 2025 15 3018  
1][PERSON] 1][PERSON] 1,*][PERSON] 2,3][PERSON] 3][PERSON] 2][PERSON] 4,*][PERSON] 3][PERSON]. direct indicator of animal welfare. Activity level and changes in certain behaviors are key signs of stress, disease, and overall welfare [6]. For example, under heat stress conditions, sows exhibit decreased nursing activity [7]. Traditionally, animal activity was predominantly assessed by visual observation. However, animal operations have expanded in scale, and relying solely on visual observation has become impractical due to constraints in labor, time, and resources. Therefore, in addition to visual observations [8], different methods such as video recording [9], wearable sensor accelerometers [10], digitized image analysis [11], and carpet-type force measurement [12] have been tested in either commercial or research pig facilities. Direct visual observation can provide explicit and descriptive information of animal activity, offering a detailed understanding of animal behaviors and welfare [8; 13]. It is simple and easy to apply and does not require special equipment. However, direct visual observation is time-consuming and labor-intensive; therefore, it cannot be performed continuously as with electronic sensors and videos. A passive infrared detector (PID) sensor (referred to as \"sensor\" below) can detect animal activity. It is a relatively low-cost and effective monitoring technology. The sensor was first reported for animal activity monitoring in 1994 [14]. Later, [PERSON] and [PERSON] [15] characterized the sensor by using a heated moving body to represent an animal. They found that the sensor output signal was proportional to the velocity and temperature of the moving body. Various studies have demonstrated the versatility of the sensor in animal production settings. In the National Air Emission Monitoring Study (NAEMS) project in the USA, the PID sensor was used in 38 commercial poultry, pig, and dairy buildings to continuously monitor animal activity for a period of two years [16]. This technology has also been studied in more recent applications. For example, it was characterized in 12 experimental growing-finishing pig rooms [17] and used to monitor piglets [18] and finishing pigs [19]. Previous studies on the sensor for animal activity monitoring have some limitations.