MedBike: Virtual Reality for Remote Cardiac Rehabilitation

Exercise-based cardiac rehabilitation (exCR) is a key element of a multi-disciplinary cardiac rehabilitation program towards the care of patients with acute or chronic cardiac disease. Many studies have shown that patient’s adherence to these programs is low despite evidence that such programs can improve outcomes and critical cardiac event reduction. New strategies to improve adherence to exCR programs are now being tested using non-hospital solutions that relies on VR gaming technologies. This paper presents such a system called MedBike which allows patients to perform an exCR program at home while being monitored in real-time by a remote clinician. The paper describes the technical aspects of the system, its pros and cons, various gamification strategies, and a recent usability study.


Introduction
Exercise-based cardiac rehabilitation (exCR) is a key component of a multidisciplinary cardiac rehabilitation program. Advances in medical and surgical cardiac treatments have improved the outcome for patients with acute or chronic cardiac diseases. In addition to those treatments, cardiac rehabilitation can provide great improvements to patient's outcome by reducing cardiovascular mortality, rehospitalization, and improving patient's quality of life [1]. Patient's adherence to these programs is low despite evidence that such programs can improve outcomes and reduce critical cardiac events. These low adherence rates have been shown to be between 15 and 30% [2][3][4]. A recent analysis of a large United States study (n = 74, 798) have shown that only 5.4% of eligible patients finished an exCR program [5]. Adherence to an exCR is critical as non-participants exhibit a 30% lower survival rate compare to patient's following a complete rehabilitation program [6].
Many factors improving the adherence to an exCR program have been identified. These factors include lack of physician endorsement, traveling distance from the patient's home to the hospital, lack of transportation, cost (e.g., parking fees), low self-motivation, poor social support, low self-esteem, fear of precipitating a cardiac event, and lack of enjoyment [4][5][6][7][8][9]. If one could improve the enjoyment of exCR activities using VR gaming technologies, one could increase program adherence as patients who have a positive view of exercise are more likely to continue [10,11]. A recent study by Taylor et al. [12] reported that simply placing exCR in a home was not enough to improve program compliance. There are increasing interests in MedBike: Virtual Reality for Remote Cardiac Rehabilitation DOI: http://dx.doi.org /10.5772/intechopen.85651 juniors using such systems. A review on how VR system can help enhance exercise performance, enjoyment, and dissociation can be found in [24]. This paper describes the MedBike cardiac rehabilitation system (see Figure 1) which consists of a mountain bike mounted on a wirelessly controlled programmable resistance machine connected to a Unity 3D based VR game engine. Using this system patients can cycle through a virtual landscape where the bicycle resistance is modulated by the virtual world terrain and maximum/minimum forces set by a clinician. During the exercise program, the patients are monitored remotely by an exCR clinician in real-time using wireless biometric sensors (ECG, blood pressure, and pulse oximetry) and a bidirectional audio-video Internet connection. Section 2 describes the basic element of the MedBike system design specifications and implementation. Section 3 describes our current attempt to improve adherence to exCR programs through VR gamification. Section 4 describes MedBike effectiveness to improve exCR from a usability, adherence, and fitness point-of-view. We then conclude by discussing the pros and cons of the system.

MedBike system overview
Numerous designs for instrumented bikes have been proposed in the literature and in industry; additionally, a number of patents have also been awarded. The closest to our system, in which a VR controllable resistance system was developed for a cardio fitness application was proposed in [25,26]. Commercial virtual reality cycling systems that use VR and instrumented bicycles have appeared on the market. The Italian company Widerun [27] offers clients to connect a normal bike to their resistance device, put on a VR headset, and cycle across a virtual terrain representing world-class cycling circuits. Their system can provide variable resistance based on the in-game environment. The overall visual quality is good but is not equal to the image quality produced by Unity 3D game engine. Their system uses a Head Mounted Displays (HMD) for immersion but as demonstrated in our lab, HMD are highly disorientating which may result in falls. Their system also does not provide free steering/breaking capabilities. The American company Zwift [28] is the one that closely resembles the VR aspects of MedBike. Contrary to our system, Zwift's worlds are static and not very engaging and cannot be modified easily for gamification. Zwift's graphics rendering suffers from many visual anomalies like aliasing and poor level of details via pop-up. Most of these commercial systems target the pro-cycling niche market focusing mainly on exercise performance and training, not medical applications. Most are them are dedicated cycling systems and cannot be easily modified for gamification. None of these systems offers patient sensor-based telemonitoring.
Following numerous discussions with CR clinicians, we came up with design specifications for the system that are as follows: • Privacy and data transmission integrity are critical; • VR experience does not need to be stereo or use HMDs because of concerns for patient's balance and the loss of awareness of his/her environment; • All patient's telemetry sensors should be medical grade; • Telemetry sensors must be easy to install by the patient; • Patient's interface must be intuitive and must be easy to use and should not necessitate computer technical knowledge; • The patient system must be able to work on public internet services with bandwidth not exceeding 5 Mbps; • A patient should be able to see animated avatars of other patients connected to the system; • Clinician should be able to monitor six patients at a time which include: ○ Real-time access to patient's vital signs, current power produced, cadence, etc.; ○ Access to data from previous MedBike sessions, including from player sessions (sessions completed individually without clinician); ○ Patient's medical records; ○ Secure video conferencing with each patient; ○ Ability to specify exercise parameters such as target power and cadence ranges that must be achieved; ○ Ability to record medical notes and performance of the patient during a session.

Patient's VR system
One can see in Figure 2 the patient's MedBike hardware configuration. The system consists of a mountain bike mounted on a wirelessly controlled resistance machine (KICKR) from Wahoo Inc. The resistance machine is connected to the patient's PC using an ANT+ interface. The bike is also instrumented with a professional wireless (ANT+) cadence sensor. In addition, a steering sensor composed of a rotary encoder is mounted on the handle bar, digitized by a Phidgets board and connected by USB to the graphic PC. The bike is also instrumented by an Android tablet mounted on the handle bar which is responsible for collecting the vital sign sensors (ECG, Oximeter, Blood Pressure meter) using Bluetooth (Figure 3). The tablet is also used as the main interface for the patient initiating authentication, selecting and modifying menu items, and controlling bike system states. The high-end graphic control PC is a machine that renders Unity 3D world which is  synchronized with the bike sensors and the training parameters specified by the clinician. This computer system is used as a data transmission HUB (See Figure 4) and is responsible to: • Render the Unity 3D world based on bike sensor data (see Figure 5); • Control the bike programmable resistance machine using the virtual world terrain and resistance limits specified by the clinician; • Establish encrypted audio/video connection between the clinician and the patient using WebRTC; • Perform medical data transmission to the patient's data using standard encryption algorithm; • Save patient information to a cloud-based server using Django application and a MySQL database; • Receive encrypted clinician information that set the minimum and maximum cadence as well as the power ranges a patient should achieve during his/her training; • Update, using the internet, other cyclist avatar locations and status if the system is in multi-player mode.

Clinician's telemonitoring system
On the clinician side, the system is based on a high-end PC where all the information from up to six patients can be displayed and analyzed (see Figures 6 and 7). The session starts by first establishing patient and clinician authentication credentials with the MedBike server. Once established, each patient is attributed an encryption key to encode the information transmitted during the session.
For each patient, the clinician set a unique exercise program using an exercise program editor. Each patient-specific exercise program can have an arbitrary number of stages with different lengths and target power outputs. Typically, these exercise programs include a warm-up, exercise, and cool-down stages. Other programs can also be specified such as high-intensity interval training (HIIT) parameters. These exercise programs include: • Target resistances: It is specified by the minimum and maximum resistance allowed for the bike trainer to use. These values range from 0 (no resistance) to 100 (full resistance).
• Rate of perceived exertion (RPE) Scale and Target RPE: The RPE scale to use and the optimal range of RPE values. Optimal values specified here will appear in green on patient's tablets, except for the pediatric scale, which has its own color coding. Default optimal values for the adult scale are between 11 and 15.   • Weekly goal: This is the recommended number of single player exercise sessions per week.
• Target oxygen saturation: Optionally, a target minimum oxygen saturation value can be specified.
Per-Stage Values: These values define the various exercise stages in the prescription. Stages can be added, removed, and their position adjusted. Each stage includes the following values: • Stage Name: the name of the stage (e.g., warm-up, exercise, etc.).
• Stage Duration: the length of the stage, in minutes and seconds.
• Target Power: the target power in Watts for this stage. These values are used to adjust the difficulty of the bicycling experience for the patient. If the power requirements input here are high, then the patient will be given a higher resistance to work against to increase their power output.
• Target Cadence: optionally, a target cadence in RPM.
• Target Heart Rate: specify minimum and maximum heart rate targets for the patient.
• RPE Prompts: specified, the system can automatically prompt patients for RPE at predetermined times.
• Blood pressure (BP) measurements: if specified, the system can automatically initiate a blood pressure measurement after a certain percentage of the stage is completed.
The system generates a post session report which was developed in partnership with cardiac rehabilitation clinicians, to best meet there clinical reporting requirements. The system also allows the clinician access to past session reports. A typical session report (which are stored on the MedBike server) include: ○ Annotated ECG recording; • Clinician session notes

Patient privacy and data integrity
MedBike system was designed to guarantee patient's privacy and data integrity. This is critical as MedBike runs on public networks. MedBike preserves patient's data   privacy in two ways (see Figure 8). MedBike data are transmitted to a cloud-based data server, located in a secure location near the hospital, using a HTTPS encryption scheme. Using this scheme, the clinician and patient can exchange a new encryption key every session. The communication between MedBike and the cloud-based data server is hidden to port scanning using a virtual peripheral network (VPN). Once the encrypted connections are established with each patient, the clinician can then monitor them in full confidence. Because the clinician operates the system from within the hospital intranet, it is also possible to access the patient medical records in full security. Access to the patient medical records is critical to the rehabilitation process as it will allow the clinician to define specific exercise programs for each patient based on their physical condition. To validate data integrity, during a session, the clinician can observe the values of the bio-sensors and determine if they are in acceptable ranges. In addition, transmission errors of the data sent from patient to clinician can be detected using the integrity mechanisms built into the AES-GCM cipher used for encryption. As for the data integrity uploaded to the cloud-based server the system rely on the inherent validation process of the HTTPS services.

MedBike bandwidth requirement
As part of our initial design, we had to guarantee that MedBike could operate on the average home networking environments (~5 Mbps). In MedBike most of this bandwidth is used by WebRTC at a video resolution of 640 × 480 pixels. Additional bandwidth is required to upload files to the cloud-based server every 2 min. The largest file is for the ECG data with a size of 500 kB per file (with an ECG sampling rate of 100 Hz). If one counts all data transfers, MedBike requires a total bandwidth of 2.5 Mbps up/down which is well in the range of home networking.

Virtual reality rendering using MedBike data
In this project, we have used Unity 3D version 5.3 game engine to display to the patient a virtual world composed of trees, terrains, roads, and avatars representing other patients. One can see in Figure 5 a typical patient's display with the virtual world rendering and session information. To integrate the MedBike data (resistance, cadence, and steering) into the Unity 3D environment, we created new classes of objects that control the virtual camera in accordance to the avatar representing the patient.
Virtual Camera Update: By using bike speed and steering sensor measurements, one can change the new virtual camera position and direction to reflect the motion of the patient. The new position p → (u (t + ∆ t) , v (t + ∆ t) ) of the virtual camera is defined by: where p → (u (t) , v (t) ) is the current position of the virtual camera relative to the digital terrain defined by a parametric surface t → (u, v) where (u, v) are the parametric coordinates of the surface. The variables c (t) is the bike speed as measured by the sensor and ( d u (t) , d v (t) ) is the change in direction as measured by the rotary encoder. The rotary encoder has a resolution 1440 data points per revolution, which allows for an accuracy of 0.25 degrees. The rotary encoder is connected to a high-speed Phidgets encoder interface board connects directly to the PC via USB. A Phidgets API is used to read data from the encoder. The encoder is coupled to the steering column to detect rotation. One can see in Figure 9 a close look at the rotary encoder setup.
Computing resistance: To compute the resistance that the KICKR must apply to the bicycle back wheel, a complex haptic rendering algorithm must be used (see Figure 10). The algorithm is initialized with a target power specified by the clinician, the minimum allowable resistance, the speed as measured by the KICKR, the current power produced by the patient, and the back wheel circumference. The resistance applied to the bicycle back wheel is continually adjusted to help the rider achieve a target power output. This allows workloads to be specified in Watts instead of arbitrary resistance values.
The resistance applied is calculated as follows. If linear speed is ≤ 0.025 m/s the resistance is held at the minimum allowed resistance. Otherwise, the target resistance value (R target ) is updated to the resistance value delayed by 1 second (R delayed ) plus or minus a small increment depending on the different between the power reported by the trainer and the target power output. The current resistance value applied by the bike trainer is then linearly interpolated toward the target resistance by 5%.

Multiplayers capability
In addition to the audio-visual connection (using WebRTC) between the clinician and each patient, each patient can see the avatars of the other patients using the  multiplayer capabilities of Unity 3D. At each patient's location, the avatars are fully animated and allow each patient to cycle and communicate with the other patients as a group. One can see at Figure 11 a typical avatar representation. Each patient is personalized by changing the avatar's bike and cycling garment colors.

VR gamification to encourage adherence
Gamification has already been used in other telerehab programs for improving motor movement following surgical intervention [28,29] and have shown to improve greatly adherence.
The first version of the VR simulation was built to represent a real-world outdoor biking experience. This virtual world consisted of beautiful trees, lakes, and mountains (see Figure 5) that the patient could explore at their own leisure alone or with another participant represented as a virtual avatar. No gaming aspect was added to this first version. Extremely positive feedback was received toward the experience, particularly being connected with a guiding clinician during weekly sessions. However, this VR world was limited in its ability to provide entertainment to the patient, an element we believe is truly important for establishing ongoing compliance to exercise CR programs. Two new VR worlds were developed to leverage the advantages of gamification.
Game for Pediatric Cardiac Patients: A VR world was developed for a pediatric cardiac rehabilitation program with a gaming environment specifically designed to engage child users into following a rehabilitation program (see Figure 12). The new game was designed for children with single heart ventricles who have undergone a corrective Fontan procedure and are severely deconditioned. Because of the high intensity interval training required for those patients, the game has two modes that alternate from a rest period to high-intensity exercise period. During the rest periods, the game requires that the patient explore the virtual world and collect strange roaming animals in order to acquire points. During the high intensity exercise periods, the patient must chase an animal into a wormhole by increasing their cadence to a specific level that if reached will eventually transport the user to a new world. The game for this project was created to integrate flawlessly into an exercise program designed specifically to train individuals with this condition. Furthermore, with the other inclusive features, such as remote monitoring (ECG and SpO 2 ), one can suggest the safety of higher exercise exertion in these children, which may convince parents to encourage more aggressive uptake of daily physical activity for their children. Exercise tolerance is strongly correlated with long term health outcomes; thus, individuals with significantly reduced capabilities such as Fontan patients, should be directed to improve their baseline exercise levels [30]. This project is of particular importance, as there is currently no cardiac rehabilitation standard protocol for pediatric patients, particular those with a history of a Fontan procedure. Thus, this project will assist in providing an evidence base for pediatric cardiac rehabilitation programs.
Virtual Spin-Class: With the great ability of Unity 3D to develop rapidly various game scenarios, a third application of MedBike was developed for encouraging exercise for mild cardiac disease and others who would benefit from exercise participation. Using the multiplayer capability of Unity 3D, a spin-class version of the system was developed. The game consists of numerous bikes (currently max six bikes) to be connected via the internet to a central cloud-based game engine that allows registered participants to chase moving targets, or each other, and to score points depending on their physical performance measured by wireless ECG sensors. Each participant is represented by an avatar (like Figure 11) that can be DOI: http://dx.doi.org /10.5772/intechopen.85651 personalized at the beginning of the game. The virtual landscape is an island where participants must discover special targets that if collided with will cumulate points. The spin-class instructor can change the island level of difficulties by increasing the programmable bike resistance. The winner of the game will be the participant with the most points and with the best physical condition as measured by the sensors. In this version there is no clinician online. Instead, the sensor data is automatically analyzed by an advanced machine learning algorithm to determine exercise level performance and to detect from the ECG any abnormal condition that should be reported to the spin-class instructor and the participant. This version of MedBike will be deployed this summer at a local sports facility at the University of Alberta where it will be tested for usability and how it improves adherence to an exercise program.

A randomized pilot feasibility study
In 2017-2018, we conducted a small medical pilot project to assess: 1. The feasibility to perform home-based CR exercise using the MedBike system; 2. How MedBike can improve patient compliance to CR (frequency of exercise sessions and number of total hours spent exercising); 3. The effectiveness of MedBike at improving fitness levels (quantified using a standardized exercise tolerance test via a bicycle ergometer) and reduce cardiovascular risk (as determined by measuring BP, A1c, smoking status, and lipids).
We hypothesized that home-based CR using the MedBike system is feasible and will effectively improve program compliance using VR gamification and patient risk factor reduction by real-time monitoring. To prove this hypothesis 11 subjects (5 controls) were recruited into a feasibility randomized pilot control trial. Inclusion criteria was: • Recent percutaneous cardiac intervention (PCI) or coronary artery bypass grafting (CABG); • A left ventricular ejection fraction (LVEF) ≥45%; • Internet connection (~5 mb/s download).

Feasibility study method
Each qualifying and consenting patient was enrolled in a standardized cardiac rehab program (based on the University of Alberta's Jim Pattison Centre for Heart Health protocol) consisting of 8 weeks of personalized exercise prescription. At the beginning of the study, patients were enrolled and randomized into the MedBike group, or standard of care group (control). Those randomized into the MedBike arm of the study were provided with the custom built MedBike VR exercise biking system with remote patient monitoring and clinical video conferencing; the standard of care group participated in a standard supervised exercise program carried out at the Jim Pattison Centre for Heart Health. In the MedBike group, the system was delivered to patient homes prior to the beginning of their first connected exercise session with the clinician. The control group received a standard exercise program which included one supervised in-hospital session per week, with a recommended additional four unsupervised exercise sessions, outside of the hospital. The additional four sessions were also recommended to the MedBike group with the option of using the MedBike system in the offline unsupervised mode (exercise data was still stored and sent to the MedBike server). Before beginning the exercise program, each patient was consulted with to design an exercise program that best allows for their clinical and physical development. Effort tolerance was largely based on an initial exercise tolerance test (ETT), which is used to direct the level to which the patient can begin their physical exercise regime. The ETT was also used to gauge exercise improvement during the study by performing a baseline and post-test at 8 weeks. During supervised sessions, the MedBike group used only the exercise bike. The control group were encouraged to only use cycling as their form of cardiorespiratory training during their hospital sessions, however, they were also given the option to perform, in addition, strength training and additional cardio exercises. This may have biased the comparison results of the ETT, but not the quantity or duration of total exercise performed over the 8 weeks. The MedBike platform was set up with the ability of the clinician to modify the exercise program and cycling resistance in real time, allowing for personalized program progression. Clinical communication was allowable through bi-directional video/audio feeds, DOI: http://dx.doi.org /10.5772/intechopen.85651 whereby the clinical could communicate with one single patient individually or the group of patients collectively. The remote monitoring medical grade sensors of the system allowed for ongoing heart rhythm, blood pressure and oxygen saturation assessment; relevant data was selected from the session recordings and included in the custom report.

Feasibility study results
No difference in ETT improvement (1.69 vs. 1.57 min) was observed. On the other hand, MedBike patients exercise adherence and participation was higher: • total number of hours exercised (318 vs. 239 hours); • total number of exercise sessions (315 vs. 246); • average sessions per subject (63 vs. 49.2); • average number of sessions per week (7.88 vs. 6.15).
Since this was a small feasibility trial, it was not fully powered, nor was it reliable to calculate the statistical significance of our findings, but it did allow us to gain some preliminary information on efficacy trends. Our work suggested that: • Using VR gamification MedBike system can increase individual exercise session adherence within the rehab program; • The installation of MedBike in each home was relatively easy but better system diagnostic tools are needed to perform better on-site remote testing; • We were able to demonstrate that MedBike can indeed be used by nontechnical patients. Most patients had no problem starting the system and communicating with the clinician; • Despite a few issues with unreliable home internet connections, the bandwidth of the average home internet services was enough to allow the clinician to perform rehabilitation sessions; • The clinician interface and data display were sufficiently good to be useful during a session; • Most of the patients enjoyed doing exercise using the virtual game.
• Many patients also greatly appreciated not having to go to the hospital to do the exercise program. They also appreciate not having to pay for parking and the system ability to integrate their rehab program into their lifestyle.

Conclusion
We presented in this paper the technical aspects and the measured performance of MedBike. Developing MedBike around Unity 3D has been an excellent design choice because of its flexibility and ease of programming new functions. In addition, Unity 3D is one of the video game industry standards and the development of additional games is relatively easy. During the pilot project in the patient's home, we were able to demonstrate that the system can work on a standard home internet connection. Before the medical pilot study, we performed numerous (40 persons) usability studies in our laboratory to optimize the interface design. Over 90% of the users of MedBike were very impressed by its performance and would certainly like to use it capabilities for their home exercise program if the system was not so expensive. The main reason for MedBike high-cost is because we use the KICKR from Wahoo and a relatively high-end mountain bike making the average price of the bike to be around $5 K CAN. By using low-cost stationary bikes ($265), a new low-cost ($300) resistance control system based on stepper motor controlling a simple bike, and a SONY Play station 4 ($350) instead of a graphic PC, we were able to design a low-cost system that will be below $1500.
The current version of MedBike has shown to be effective for delivering exercise programs to post procedural and event cardiac patients, saving time, encouraging adherence to the exercise program, and ensuring patient safety by direct clinician monitoring. We also believe that by adding a machine learning functionality that will analyze the MedBike biometric data in real-time to determine if the exercise level fits in the bounds of the prescribed exercise program safely, the system can be extensively used in sports facilities or at home to encourage higher activity levels in an older and detrained population.