## 4 Discussion
Unlike previous methods that require complex preprocessing or proprietary software, our approach is designed to be easily applied using accessible tools, making it highly suitable for preliminary experiments, high-throughput screenings, or educational purposes where fast and low-cost measurement is desirable. By emphasizing simplicity, affordability, and ease of use, our work contributes to broadening the applicability of heart rate monitoring in zebrafish studies, especially in contexts where high-end equipment and advanced computational resources are not available. In this experiment, we showed an example of a recording with T = 10 s. Evaluating the sensitivity of instantaneous heart rate extraction to the time window duration, T, is important in several aspects. The first is the sensitivity to the time window duration, T. For a short time window (e.g., 1-5 s), the advantage is that it is possible to capture rapid changes in heart rate (heart rate variability, stress response, etc.) in a more real-time manner. The disadvantage is that the sensitivity to noise in the signal increases. Even noise or artifacts of a few beats can have a significant effect on heart rate estimation. In addition, when using frequency analysis such as fast Fourier transform (FFT), the frequency resolution decreases. Even with methods such as EMD, it is difficult to resolve stable IMFs with short signals. For a long time window (e.g., 15-30 s or more), the advantage is that the effect of noise can be averaged out, and a more stable average heart rate can be calculated. The frequency resolution also improves. The disadvantage is that the ability to capture instantaneous fluctuations is reduced because rapid changes in heart rate are smoothed out. It is not suitable for analyzing heart rate variability, and it also increases the possibility that low-frequency components, such as breathing, will affect the heart rate band. A time window of 10 s is a balanced choice that can capture relatively short-term heart rate variability while maintaining a certain degree of stability. However, depending on the research purpose and the need to evaluate heart rate variability, the value of T should be adjusted, and the sensitivity should be evaluated. For example, a short T would be suitable for seeing changes before and after stress loading, and a long T would be suitable for obtaining a stable baseline heart rate for long-term monitoring. The challenge is how much influence from other physiological movements, such as breathing, can be removed, and ensuring that the frame rate of the video is high enough (having a time resolution that can separate the heart rate). In conclusion, a time window of 10 s is long enough to extract the instantaneous heart rate, and its fluctuations can be captured by using appropriate signal processing and peak detection techniques. Also, in this study, there was a discrepancy between the estimated heart rate and the manual measurements of fish 4. Three factors were considered for this: factors on the automatic measurement side, factors on the manual measurement side, and factors on both sides. First, environmental factors are considered on the automatic measurement side. In a low temperature environment, peripheral blood vessels restrict and blood flow decreases, making it difficult for the sensor to detect the heart rate. In addition, if external light hits the sensor directly, it can be a source of noise. Factors on the manual measurement side include the skill and experience of the person who measures it, concentration, and environmental factors. The use of appropriate anesthesia protocols and fixation devices, which securely immobilize small fish while minimizing physiological effects and enabling accurate heart rate measurement with microelectrode technology, is not suitable for simplified measurement procedures.