  Respiratory rate (RR) is an important biomarker as RR changes can reflect
severe medical events such as heart disease, lung disease, and sleep disorders.
Unfortunately, standard manual RR counting is prone to human error and cannot
be performed continuously. This study proposes a method for continuously
estimating RR, RRWaveNet. The method is a compact end-to-end deep learning
model which does not require feature engineering and can use low-cost raw
photoplethysmography (PPG) as input signal. RRWaveNet was tested
subject-independently and compared to baseline in four datasets (BIDMC,
CapnoBase, WESAD, and SensAI) and using three window sizes (16, 32, and 64
seconds). RRWaveNet outperformed current state-of-the-art methods with mean
absolute errors at optimal window size of 1.66 \pm 1.01, 1.59 \pm 1.08, 1.92
\pm 0.96 and 1.23 \pm 0.61 breaths per minute for each dataset. In remote
monitoring settings, such as in the WESAD and SensAI datasets, we apply
transfer learning to improve the performance using two other ICU datasets as
pretraining datasets, reducing the MAE by up to 21$\%$. This shows that this
model allows accurate and practical estimation of RR on affordable and wearable
devices. Our study also shows feasibility of remote RR monitoring in the
context of telemedicine and at home.
