Repository of the software for the project FIS PI19/00670 "Feasibility and cost-effectiveness study of the use of telemedicine is being developed with a multidisciplinary team for the prevention of falls in Parkinson's disease" of the Spanish Government.
Developed by José Luis Garrido-Labrador and José Miguel Ramírez-Sanz, supervised by Dr. Álvar Arnaiz-González and Dr. José-Francisco Díez-Pastor. Project PI: M.D. Esther Cubo.
During the last decades tele-rehabilitation has been consolidated as a solution for many diseases because of, mainly, its good results, its reduction of costs, and the possibility of reaching remote places. In addition, the intrinsic distance of tele-medicine eliminates the exposure of vulnerable patients to unnecessary risks. One of the problems of tele-rehabilitation is the need of a professional for assessing the proper performance of the exercises, which reduces one of its advantages, that is, the cost cutting. This paper focuses on a low-cost tele-rehabilitation system for patients that suffer from Parkinson disease in remote villages or inaccessible places. The paper presents a full-stack, using Big Data frameworks, that makes possible the communication between the patient and the occupational therapist, the recording of the sessions, and seeks the automatic evaluation of the exercises by using Artificial Intelligence techniques. To ingest the huge amount of videos that simultaneous patients could produce, Big Data technologies were used. Moreover, the use of deep neural networks makes possible the proper identification of the patients' skeleton which would allow automatic evaluation of the exercises helping to the therapist in his or her tasks. The system is being currently applied in Spain, more specifically in the province of Burgos, in the framework of a national project for evaluating the use of a multidisciplinary tele-rehabilitation fall prevention program.
@article{ramirez2023low-cost,
title={A Low-Cost System Using a Big-Data Deep-Learning Framework for Assessing Physical Telerehabilitation: A Proof-of-Concept},
volume={11},
ISSN={2227-9032},
url={http://dx.doi.org/10.3390/healthcare11040507},
DOI={10.3390/healthcare11040507},
number={4},
journal={Healthcare},
publisher={MDPI AG},
author={Ramírez-Sanz, José and Garrido-Labrador, José and Olivares-Gil, Alicia
and García-Bustillo, Álvaro and Arnaiz-González, Álvar and Díez-Pastor, José-Francisco
and Jahouh, Maha and González-Santos, Josefa and González-Bernal, Jerónimo
and Allende-Río, Marta and Valiñas-Sieiro, Florita and Trejo-Gabriel-Galan, Jose
and Cubo, Esther},
year={2023},
month={Feb},
pages={507} }
All commands must be executed in folder "src/scripts/deploy/"
.
- Build docker images
First it is necessary to build the docker images.
$ docker build -f ../../dockers/fishubu/base/Dockerfile -t fishubu-base:1.0.0 ../../
$ docker build -f../../dockers/fishubu/enviroment/Dockerfile -t fishubu-env:1.0.0 ../../
$ docker build ../../dockers/spark/base -t spark-base-fis:2.4.5
$ docker build ../../dockers/spark/master -t spark-master-fis:2.4.5
$ docker build ../../dockers/spark/worker -tspark-worker-fis:2.4.5
- Start the server
To support the tele-rehabilitation system it is necessary to start the service of Kafka and Spark.
$ ./start-server <output> <n. of cpu for master> <n. of workers > <n. of cpu for workers> <memory per workers>
- Create a new stream
For each tele-rehabilitation a new stream has to be created.
$ ./new-stream "parameters to emitter.py (keep blank in explotation)" "parameters to consumer.py"
This command returns by STDOUT
the identifier of the stream. It is necessary to save it to close the stream.
See Manual creation for parameters of emitter.py
and for consumer.py
.
- Close a stream
When tele-rehabilitation has finished, the stream must be closed to release the machine's resources.
$ ./stop-stream ,stream identifier>
- Close the server
The server must be securely closed. The following command is used to ensure properly shutdown.
$ ./stop-server
The following Python scripts take care of the enqueue and processing of the video stream.
emitter.py
Script for sending frames to an UDP server. Necessary for pre-recorded videos.
Syntax:
emitter.py --ip=localhost --port=12345 --file=video.webm
-----------------------------------------------------------
Communication parameters
--ip=<Ip of UDP broadcast>
(Default: localhost)
--port=<Port of UDP broadcast>
--file=<Video source>
Stream management parameters
--resize=<Proportion>
(Default: 1.0)
-f <FPS> | --fps=<FPS>
(Default: 10) frame rate of the video to be broadcast
consumer.py
Script for parallel frame processing.
Syntax
consumer.py --ip=localhost --port=12345 --topic=queue
-----------------------------------------------------------
Communication parameters
--output==<Output folder or stream>
(Default: output)
--sparkhost=<Spark host>
(Default: local)
--kafkahost=<Kafka host>
(Default: localhost:9092)
--topic=<Kafka topic>
(Default: video-stream-event)
Stream management parameters
-a -> Anonymize faces, by default pixelated
-g <Factor> | --blur=<Factor>
(Default: 3) Blur anonymizing
-p <Factor> | --pixel=<Factor>
(Default: 15) Pixel anonymizing
-b -> Auto brightness adjustment
-c -> Auto contrast adjustment
-f <FPS> | --fps=<FPS>
(Default: 10) frame rate of the video to be broadcast
--no-save -> Don't save frames
producer.py
Script for the frame enqueue in Kafka.
Syntax
producer.py --ip=localhost --port=12345 --topic=queue
-----------------------------------------------------------
Communication parameters
--ip=<Ip of UDP broadcast>
(Default: localhost)
--port=<Port of UDP broadcast>
--kafkahost=<Kafka host>
(Default: localhost:9092)
--topic=<Kafka topic>
(Default: video-stream-event)
List of the libraries used grouped by licence.
- Apache Kafka from Apache Foundation
- Apache Zookeeper from Apache Foundation
- Apache Spark from Apache Foundation
- Docker CP from Confluentic
- Jitsi Meet, Jitsi Videobridge and Jibri from Jitsi
- Clúster Spark Docker from Mario Juez Gil
- Caffe from Berkeley Vision and Learning Center
- Flask from The Pallets Projects
- Jinja from The Pallets Projects
- OpenCV from Intel Corporation, Xperience AI
- Seaborn from Michael Waskom
- Bootstrap 4 from Twitter
- jQuery from JS Foundation