govaccinate
Description
An artificial intelligence model to determine a person's eligibility to receive a COVID-19 vaccination based on symptoms diagnosis against current health conditions using fuzzy logic written in Go.
Design
This is a project of my Artificial Intelligence learning exercise. The model built based on fuzzy logic method. Fuzzy logic itself is a union of fuzzification, inference and defuzzification.
Fuzzification
In fuzzification phase, the model converts 3 input variables (which are: age, systolic blood pressure and symptoms weight) into their corresponding fuzzy values. The model give weight for each COVID-19 symptom declared by WHO (World Health Organization), diagnose the user, summed all the weights and stored as symptoms weight variable. Each input variable will be broken down into 3 kinds of fuzzy values quantity, which means we got 9 fuzzy values in total. These are the images to illustrate the variables and their fuzzy chart:
Symptomps |
Classification |
Weight |
Sore throat |
Less Common |
5 |
Headache |
Less Common |
3 |
Aches and pains |
Less Common |
5 |
Diarrhea |
Less Common |
3 |
Skin rash |
Less Common |
3 |
Irritated eyes |
Less Common |
3 |
Fever |
Common |
20 |
Cough |
Common |
25 |
Tiredness |
Common |
20 |
Loss of taste or smell |
Common |
20 |
Shortness of breath |
Priority |
45 |
Loss of speech or mobility |
Priority |
40 |
Chest pain |
Priority |
50 |
Total |
-----------------> |
242 |
Inference
Then, the fuzzy values will be inferenced using 27 rules (3 x 3 x 3 possibilities) based on Mamdani method resulting a minima output for each rules and maxima output for each rule result. These are the rules applied to the model:
Age |
Systolic Blood Pressure |
Symptoms Weight |
Urgency Level |
Young |
Low |
Less |
Low |
Young |
Low |
Common |
Low |
Young |
Low |
Priority |
Low |
Young |
Normal |
Less |
Medium |
Young |
Normal |
Common |
Medium |
Young |
Normal |
Priority |
Medium |
Young |
High |
Less |
Medium |
Young |
High |
Common |
Medium |
Young |
High |
Priority |
Medium |
Mature |
Low |
Less |
Low |
Mature |
Low |
Common |
Low |
Mature |
Low |
Priority |
Medium |
Mature |
Normal |
Less |
Low |
Mature |
Normal |
Common |
Medium |
Mature |
Normal |
Priority |
Emergency |
Mature |
High |
Less |
Low |
Mature |
High |
Common |
Low |
Mature |
High |
Priority |
Medium |
Old |
Low |
Less |
Low |
Old |
Low |
Common |
Low |
Old |
Low |
Priority |
Medium |
Old |
Normal |
Less |
Medium |
Old |
Normal |
Common |
Emergency |
Old |
Normal |
Priority |
Emergency |
Old |
High |
Less |
Medium |
Old |
High |
Common |
Low |
Old |
High |
Priority |
Low |
The urgency level is not only determined by the symptoms felt but also determined by age and blood pressure. For example, if there is a 2 years old baby and has various symptoms, then they will not receive the vaccine because their body's immunity has not been able to adapt to the dose and chemical compounds contained in the vaccine. On the other hand, the same applies to people who have blood pressure that is too low or too high, they will not be prioritized until their blood pressure returns to normal.
Defuzzification
Lastly, the model perform a defuzzification based on centroid method to determine a crisp value as the end result of the whole program.
Development
The model developed using Go language. Code written in a very WET (write-everything-twice) way to point out clear rules definitions implemented in the model. The model implemented in real life scenario. There are some standard input checks implemented to avoid errors. Also note that the code is far from perfect, the author (well... me) is not an experienced software engineer... but I wrote all of this myself and I am pretty proud of it \m/.
Installation
▶ GO111MODULE=on go get -u -v github.com/gasfad01/govaccinate
Usage
▶ govaccinate
Copyright
Tugas Besar Kecerdasan Buatan - S1 Teknik Komputer Semester Genap 2020/2021
© Copyright All Rights Reserved - Bagas Fadillah Islamay (2021)