Pneumonia is an inflammatory condition of the lung primarily affecting the small air sacs known as alveoli. Symptoms typically include some combination of productive or dry cough, chest pain, fever and difficulty breathing. The severity of the condition is variable. Pneumonia is usually caused by infection with viruses or bacteria, and less commonly by other microorganisms. Identifying the responsible pathogen can be difficult. Diagnosis is often based on symptoms and physical examination. Chest X-rays, blood tests, and culture of the sputum may help confirm the diagnosis. The disease may be classified by where it was acquired, such as community- or hospital-acquired or healthcare-associated pneumonia.
Risk factors for pneumonia include cystic fibrosis, chronic obstructive pulmonary disease (COPD), sickle cell disease, asthma, diabetes, heart failure, a history of smoking, a poor ability to cough (such as following a stroke), and a weak immune system. Vaccines to prevent certain types of pneumonia (such as those caused by Streptococcus pneumoniae bacteria or that linked to influenza) are available. Other methods of prevention include hand washing to prevent infection, and not smoking. Treatment depends on the underlying cause. Pneumonia believed to be due to bacteria is treated with antibiotics. If the pneumonia is severe, the affected person is generally hospitalized. Oxygen therapy may be used if oxygen levels are low.
Have a look for a detailed info about Pneumonia in this video below 👇
Each year, pneumonia affects about 450 million people globally (7% of the population) and results in about 4 million deaths. With the introduction of antibiotics and vaccines in the 20th century, survival has greatly improved. Nevertheless, pneumonia remains a leading cause of death in developing countries, and also among the very old, the very young, and the chronically ill. Pneumonia often shortens the period of suffering among those already close to death and has thus been called "the old man's friend".
The World Health Organization has defined pneumonia in children clinically based on either a cough or difficulty breathing and a rapid respiratory rate, chest indrawing, or a decreased level of consciousness. A rapid respiratory rate is defined as greater than 60 breaths per minute in children under 2 months old, greater than 50 breaths per minute in children 2 months to 1 year old, or greater than 40 breaths per minute in children 1 to 5 years old.
The common solutionA chest radio-graph is frequently used in diagnosis. In people with mild disease, imaging is needed only in those with potential complications, those not having improved with treatment, or those in which the cause is uncertain.
If a person is sufficiently sick to require hospitalization, a chest radio-graph is recommended.
Findings do not always match the severity of disease and do not reliably separate between bacterial and viral infection.
So what's the problem ?For doing radio-graph diagnosis you would probably need a doctor and/or a medic whose expertise in doing radiography. BUT what if you're in the middle of a rural place with less/no bandwidth connectivity ?
Have a look at a probable situation below 👇
The probable answer to that is to use this project! Cheap, Low-Power, Open-Source but truly reliable.
Deploying and running the modelThis part has been divided into two parts -
1) When there is presence of bandwidth/internet
2) When you are in the middle of nowhere without any bandwidth
Now, for case 1, you can easily run the model on a Raspberry Pi by deploying it using balenaCloud and the visualizing the live camera feed through your phone/laptop.
For case 2, you will have to run the model/inference locally on your Himax WE-1 Dev Board/OpenMV Cam.
DisclaimerThis application is intended for informational, educational and research purposes only. It is not, and it is not intended, for use in the diagnosis of disease or other conditions, or in the cure, mitigation, treatment or prevention of pneumonia. Health care providers should exercise their own independent clinical judgment when using this application in conjunction with patient care.
Deploying on a Raspberry Pi using balenaCloudFirst of all a big thanks to Aurelien and Marc for helping me out in developing the project to run on a Raspberry Pi.
Update as of 16.03.2021 - We have now released an entire new Hackster project related to how you will be able to run our model on your Raspberry Pi using balena. Have a look here to know more!Deploying to a Himax WE-1 Dev Board
First download the himax_library_package
Then extract the.zip file and click on any of the flashable binaries as per your OS (supports Mac, Linux and Windows).
Then open Terminal/Command Prompt and type edge-impulse-run-impulse
and wait for a couple of seconds for the CLI to connect with the board via serial.
The move the board to any X-Ray or download our dataset images from here and that's it you're done! :)
Deploying to an OpenMV Cam H7/H7 Plus Dev BoardFirst you will have to clone our repository using the following command
$ git clone https://github.com/arijitdas123student/pneumonia-detection-edgeml.git
Next open up the openmv_library file from the folder created in your machine using the command laid below
$ cd pneumonia-detection-edgeml
$ cd openmv_library
After doing a $ls
you will get to see 4 different files inside the sub-folder such as here
Now to add the model to your OpenMV camera copy the trained.tflite and labels.txt files to the 'OpenMV Cam' volume (like a USB drive).
Next, open the ei_image_classification.py file in the OpenMV IDE, and press the 'Play' icon to run the script.
You will get to see outputs such as this 👇
That's it! You're done! :D
POC Videos and ImagesHaving issues with deploying this on a Raspberry Pi ?
Then check this video below 👇
Having issues running this code locally ?
Check this video below 👇
That's it you're done!Congratulations!
You're now running an ML model which can classify Pneumonia under 1 milliwatt! :D
Keep this in mind that as of now this can be considered as only a POC (Proof Of Concept), it hasn't been deployed in any field use case so not a medical device YET!
Comments