Available online at https://icsejournal. com/index. php/JCSE Journal of Computer Science an Engineering (JCSE) e-ISSN 2721-0251 Vol. No. February 2025, pp. Expert System for Early Detection of High-Risk Pregnancy Conditions Using Certainty Factor and Forward Chaining Methods Febria Dwi Vadlisky1. Hamdani Hamdani2. Fahrul Agus3* 1,2,3Informatics Department. Engineering Faculty of Mulawarman University. Samarinda. Indonesia 1fbriadwi2@gmail. 2hamdani@unmul. 3fahrulagus@unmul. *corresponding author ARTICLE INFO ABSTRACT Article History: Received June 9, 2024 Revised August 23, 2024 Accepted August 30, 2024 The maternal mortality rate is the proportion of deaths that occur during pregnancy due to disorders that specifically impact the uterus. Experts attribute the high number to a lack of knowledge and delays in its management. Samarinda, located in East Kalimantan, has the second highest mortality rate, following Kutai Kartanegara. Hence, the implementation of an early detection system is important to effectively address this issue. The objective of this study is to develop an expert system that utilizes the certainty factor technique to identify high-risk factors in pregnant women before delivery. This study identified three high-risk conditions in pregnant women: preeclampsia, gestational diabetes mellitus (GDM), and constipation. There are a total of 22 symptoms associated with each condition, and for each disease, there are three distinct treatment options available. An expert in the field of obstetrics and gynecology provided the research data. The research yields an expert system that demonstrates accuracy by comparing 10 test data sets from both human experts and computing systems. The system achieved a 90% accuracy rate. Through the use of an expert system methodology, we expect this system to be a valuable resource for pregnant women and healthcare professionals seeking early detection of high-risk diseases in pregnant women. Keywords: Natural Language Processing Question Answering. BERT Sequence to Sequence. GPT Correspondence: E-mail: fahrulagus@unmul. Introduction Maternal Mortality Rate (MMR), or in the Indonesian language. Angka Kematian Ibu (AKI), in Indonesia is still a serious public health problem. According to 2015 data. MMR in Indonesia reached 305 per 100,000 live births far from the Sustainable Development Goals (SDG. target of only 70 per 100,000 live births in 2030. A high MMR indicates inequality and injustice in maternal and neonatal health services, and has a negative impact on the welfare and development of infants and toddlers, both physically, psychologically and socially . Meanwhile in East Kalimantan, based on the data program report for the Province of East Kalimantan. MMR reached 113 based on live birth It's just that efforts and increased cross-sector collaboration are still needed to achieve the 2030 SDG . Associated with high MMR, the disease that affects high MMR is preeclampsia. Preeclampsia is a serious postpartum illness that affects most organ systems and has long-term effects because of its vascular alterations and poorly understood pathophysiology . In addition to preeclampsia, many pregnant women have a history of diabetes. Indonesian culture always consumes rice and meat, this is also one of the causes of the high number of diabetes sufferers in Indonesia. Glucose intolerance of varying degrees that begins or is initially detected during pregnancy is known as gestational diabetes mellitus, or GDM. Preterm birth, macrosomia, shoulder dystocia, birth trauma, prematurity, perinatal death, and the need for a Caesarean section are among the more serious obstetrical outcomes that are thought to be associated with this medical complication of pregnancy . Also associated with a lack of fiber consumption, body fluid and physical activity it also causes several diseases, one of which is constipation. Journal of Computer Science an Engineering (JCSE) Vol. No. February 2025, pp. e-ISSN 2721-0251 Pregnant women only experience functional constipation in pregnancy (FCP), a common gastrointestinal disorder . Constipation is a sign of difficult bowel movements, which are defined by large stools, decreased frequency of bowel movements, and a hard consistency . Therefore, pregnant women should receive at least four antenatal check-ups according to existing standards. An expert system is a computer program that attempts to incorporate human knowledge in order to simulate an expert's ability to solve problems . Expert System (ES) technology has been developed to address issues in business, education, healthcare, and agriculture. Expert systems are often created with a particular situation in mind . When gestational diabetes is treated promptly before 20 weeks of gestation, the incidence of combined adverse neonatal outcomes is lower than when treatment is delayed . As with other diseases, if it is treated too late it can affect the health of the mother and baby, so a system is needed that makes it easier for health workers and pregnant women to treat illnesses during pregnancy. This study will detect 3 diseases, namely preeclampsia, constipation and GDM with Certainty Factor method, based on research . Certainty Factor was successfully used to detect kidney disease with an accuracy of 85. 7% and to achieve diagnostic results using the forward chaining method. Certainty Factor works well for expert systems that make uncertain In the research . with an accuracy of 96% in detecting abdominal colic using the Forward Chaining and Certainty Factor methods, and from the research . said the use of Certainty Factor with Forward Chaining is most appropriate method. Based on research . comparing the Certainty Factor and Dempster Shafer Methods, it was found that the system's accuracy using the Certainty Factor method was 90%, and the Dempster-Shafer method was 87%. It means the expert system using the Certainty Factor method is more accurate than the Dempster method. This is what supports the use of Certainty Factor and Forward Chaining in this study. Method Research stages are the methods used to obtain various data to be processed into more accurate information according to the problem being studied. The research stages used in this research are seen in Figure 1. Figure 1. Research Stages The initial stage is reviewing and limiting the problems implemented in the system. For each problem identified, a solution must be sought, facilities developed, the type of programming language determined and the goals to be achieved from the development process. If the problem identification process is carried out correctly, optimal results will be achieved. The highest Journal of Computer Science an Engineering (JCSE) Vol. No. February 2025, pp. e-ISSN 2721-0251 maternal and infant mortality rate in East Kalimantan is Kutai Kartanegara Regency with 24 cases, then the second highest is Samarinda with 20 cases. According to the Head of the East Kalimantan Health Office. Dr. Jaya Mualimin, many maternal and infant deaths are due to late treatment and also late diagnosis of pregnant women . This is what causes the need for an expert system for early detection of high risk. In the second stage, knowledge acquisition is carried out in the form of data collection including primary and secondary data sourced from experts, books, journals and specific information related to problems or the problem-solving process for high-risk diseases in pregnant women that have been previously identified. Symptom data, the weight value of each symptom and the disease to be detected are obtained from Obstetrics and Gynecology (Obgy. The third stage is determining the knowledge base that has been obtained by coding knowledge. In this study, coding was made for the type of disease, a list of symptoms, as well as solutions or treatments for high risk diseases in pregnant women. The next stage is to create an inference engine or carry out a process to process information from the previous knowledge base by looking for relationships with existing information and translating it into a decision table and rule based. The next stage is to carry out calculations using the Certainty Factor method to obtain correct diagnostic results with tracking strategy using Forward Chaining Method. In the final stage, namely testing the system by comparing the results of the expert diagnosis and the system diagnosis and then calculating what percentage of the data agrees with the expert. testing in the study using 10 pregnant women's data at a public hospital in Kalimantan. The research methodology is explained in this section. Two techniques are employed, specifically: 1 Certainty Factor Expert systems typically use the Certainty Factor, a technique for demonstrating whether a fact is certain or uncertain in the form of a metric. The Certainty Factor, a metric typically utilized in expert systems, is a way to demonstrate whether a fact is definite or uncertain. Expert systems that diagnose uncertain conditions are ideal for this approach . Based on data or professional opinion, the Certainty Factor indicates confidence in an event . act or hypothesi. The method known as the Certainty Factor (CF) was developed in 1975 by Shortliffe and Buchanan to account for the uncertainty of an expert's judgment . nexact reasonin. An expert, for example a doctor, often analyzes information with the expressions "not sure", "quite sure", "very sure". So with the Certainty Factor method, it can describe the level of confidence of an expert regarding the problem being faced . The first stage of using the Certainty Factor method is stated in equation . CF. = CF. * CF. Information: CF. = evidence value / user weight value CF. = hypothesis value / weight value from experts After getting the CF. value, then calculate the CF as in equation . CF = CF. 1 CF. 2 * . - CF. Information: CF. 1 = The product of the evidence value 1 with the hypothesis value 1 or CF. 1 CF. 2 = The product of the evidence value 2 with the hypothesis value 2 or CF. 2 Journal of Computer Science an Engineering (JCSE) Vol. No. February 2025, pp. e-ISSN 2721-0251 2 Forward Chaining One popular decision-making technique in expert systems is the Forward Chaining approach. Tracking that begins with expert information and incorporates it into a rule to arrive at a conclusion or objective is known as forward chaining . Using the Forward Chaining method, the search proceeds from the premise to the final conclusion, or left to right. This approach is frequently referred to as "data driven," since the supplied data directs the search. Because reasoning is founded on facts at the lower level that lead to conclusions at the upper level that are also based on facts, forward chaining is also known as reasoning that proceeds from the bottom up. An approach to searching that begins with known facts, compares those facts to the IF from the IF-THEN rule, and executes the rule if there are facts that match the IF. When a rule is executed, a new fact (THEN) is entered into the database . An expert system for detecting certain or uncertain diseases is suitable for use in this research. The calculation results are only valid for one calculation, in data processing you can only process two data so that accuracy in detection is better maintained . Result and Discussion The results and discussion in this research explain data processing, application of the Certainty Factor method and test results. 1 Data Processing This expert system is to detect high-risk diseases in pregnant women using the Certainty Factor Data is obtained from interviews with Obstetrics and Gynecology (Obgy. doctors which include 3 types of diseases, 22 symptoms and 3 treatments. This system is also based on literature studies of journals and theses and then applied in this study to provide output in the form of diagnosis of high-risk diseases in pregnant women using the Certainty Factor calculation method. Table 1 describes 3 types of diseases with disease codes, disease names and treatments. Table 1. Diseases and Treatment for High Risk Early Detection in Pregnant Women Diseases Code Name of Disease P001 Preeclampsia P002 Diabetus Mellitus Gestasional P003 Constipation Treatment Preeclampsia treatment can be done by taking low-dose aspirin and taking calcium supplements. However, before starting to take drugs and supplements pregnant women should consult directly with midwives or doctors, because taking these two things - cannot be given to anyone. Another way that can be done is to control weight, avoid smoking when planning Administration of antihypertensive drugs, antiseizure drugs if severe preeclampsia or eclampsia. The treatment that can be done is to make a good diet pattern by regulating diet, doing physical activities such as exercise regularly, checking blood sugar levels regularly, taking medication or insulin if needed. Handling if you experience constipation, among others, do exercise, drink more water at least 2 liters, eat more fiber foods such as fruits and vegetables, drink probiotics / microorganisms that live in digestion, for example yogurt, taking constipation medication can be done if you have changed your lifestyle or food has no effect. Some laxatives or laxatives for constipation are fiber supplements, stimulants and osmotic laxatives. Each disease has different symptoms, from interviews with experts it was found that there are 22 symptoms in high risk diseases. With disease and symptom data, rules will be obtained to find out what disease the patient is experiencing. These rules are obtained from facts based on the type of 22 symptom lists of 3 diseases can be seen in Table 2. Journal of Computer Science an Engineering (JCSE) Vol. No. February 2025, pp. e-ISSN 2721-0251 Table 2. List of Symptoms of High Risk Diseases in Pregnant Women Before Childbirth No. Symptom Code G001 Headache Symptoms G002 Visual disturbances G003 Heartburn stomach pain. G004 Nauseous G005 Urine production decreases G006 Pregnancy is more than equal to 20 weeks G007 Edema . welling of certain parts of the bod. G008 Hypertension . lood pressure more than equal to 190/90 mmH. G009 Elevated blood sugar at more than 24 weeks of pregnancy G010 Often feel hungry and thirsty G011 Frequent urination G012 Weight loss G013 Vaginal Infection G014 Feel tired easily G015 Frequent tingling in the feet G016 Longer wound healing G017 Difficulty defecating G018 Dry or hard stools G019 Defecate less than 3 times a week G020 Stomach feels tight, hard or full G021 Stomach ache G022 Feeling dissatisfied after defecating or feeling like something is blocked In detecting high risk diseases in pregnant women, a list of symptoms is needed based on facts that have been collected to form a knowledge base rule, then detection results can be obtained in the form of diseases suffered by pregnant women. Symptoms of this type of high-risk early detection system disease were obtained from interviews with obgyn doctors as follows: IF G001 AND G002 AND G003 AND G004 AND G005 AND G006 AND G007 AND G008 THEN P001. IF G009 AND G010 AND G011 AND G012 AND G013 AND G014AND G015 AND G016 THEN P002. IF G004 AND G017 AND G018 AND G019 AND G020 AND G021 AND G022 THEN P003. In this study. Breadth-First Search (BFS) was used to search for or search for graphs and trees of rules in forward chaining. Based on the rules that have been formed above, a rule table is created to group the rules from the facts obtained based on the name of the disease with the disease code and the name of the symptom with the symptom code displayed in Table 3 and the decision-making mechanism for naming a disease based on symptoms as visualized in Figure 2 below. Table 3. Disease and Symptoms Rules No. Symptom Code G001 Headache G002 Visual disturbances G003 Heartburn stomach pain. G004 Nauseous Preeclampsia Symptoms ue GDM Constipation ue Journal of Computer Science an Engineering (JCSE) Vol. No. February 2025, pp. e-ISSN 2721-0251 Preeclampsia No. Symptom Code G005 Urine production decreases Symptoms G006 Pregnancy is more than equal to 20 weeks G007 GDM Constipation ue G010 Edema . welling of certain parts of the Hypertension . lood pressure more than equal to 190/90 mmH. Elevated blood sugar at more than 24 weeks of pregnancy Often feel hungry and thirsty G011 Frequent urination G012 Weight loss G013 Vaginal Infection G014 Feel tired easily G015 Frequent tingling in the feet G016 Longer wound healing ue G017 Difficulty defecating G018 Dry or hard stools G019 Defecate less than 3 times a week G020 Stomach feels tight, hard or full G021 Stomach ache G022 Feeling dissatisfied after defecating or feeling like something is blocked G008 G009 Figure 2. Decision Tree Diagram for Expert System of Early Detection of High-Risk Pregnancy 2 Application of the Certainty Factor Method A situation of how to use the Certainty Factor method to diagnose high-risk diseases in pregnant women is as follows: Journal of Computer Science an Engineering (JCSE) Vol. No. February 2025, pp. e-ISSN 2721-0251 Inputting patient weight beliefs Patients will be asked to choose 1 answer from 5 answer choices, namely No . Not Sure . Slightly Sure . Quite Sure . Sure . and Very Sure . This choice will be defined as the patient's level of confidence regarding the symptoms experienced. The following is the application of the data entered by the patient shown in Table 4. Table 4. Application of Patient Symptoms and their Belief Levels Symptom Code Symptoms Weight of Patient Beliefs G001 Headache Quite Sure . G002 Visual disturbances Sure . G005 Urine production decreases Hypertension . lood pressure more than equal to 190/90 mmH. Often feel hungry and thirsty Not Sure . G008 G010 Sure . Quite Sure . Calculation of the first stage of Certainty Factor In the calculation of the Certainty Factor method, the first stage is to multiply the symptom weight determined by the expert by the symptom weight of the confidence level entered by the patient using the equation formula . Can be seen in Table 5 is the initial calculation result of the symptoms that have been selected by the patient. Table 5. The Result Expert Weight Value by the Patient Symptom Code Weight of Expert Beliefs Weight of Patient Beliefs CF. G001 G002 G005 G008 G010 Second Stage of Certainty Factor Method Calculation In the calculation of the Certainty Factor method, in the second stage as in equation . which is calculated according to the disease. CF Value of Preeclampsia (P. CF. 1, . 2 = CF. 1 CF. 2 * . Ae CF. CFold1 = 0. CFold1. CF. 3 = CF. 3 CFold1 . - CF. 3 ) CFold2 = 0. CFold2. CF. 4 = CF. 4 CFold2 . - CF. 4 ) CF = 0. CF Value for Gestational Diabetes Mellitus (P. Since the selected symptom of Gestational Diabetes Mellitus disease is only 1. CF. = CF Convert CF value to percent The final result in this research is in the form of a percentage, to change the CF value to a percentage, that is by multiplying the CF value by 100. Journal of Computer Science an Engineering (JCSE) Vol. No. February 2025, pp. e-ISSN 2721-0251 Preeclampsia percentage value: 862 * 100 = 86. Percentage value of Gestational Diabetes Mellitus: 36 * 100 = 36% The maximum value weighting in this study is 1. 0 or 100%, from the application of this calculation the largest value in each disease is preeclampsia, then the patient is detected to have preeclampsia disease with a confidence level of 86. Figure 3 below is a visualization of the display on the expert system application which illustrates the results of the consultation and displays the preferences of risk diseases for pregnant women. Figure 3. Expert System consultation results menu display 3 Test Results Comparing the data from the Certainty Factor method's calculation with ten test data sets is how this system is tested. Table 6 presents a comparison between the Certainty Factor method-based system diagnosis and expert diagnosis. Table 6. System Testing Results No. Symptoms Headache (Sur. Visual disturbances (Slightly Sur. Nauseous (Sur. Pregnancy is more than equal to 20 weeks (Sur. Headache (Very Sur. Heartburn stomach pain (Sur. Urine production decreases (Sur. Vaginal Infection (Slightly Sur. Feel tired easily (Very Sur. Frequent tingling in the feet (Sur. Difficulty defecating (Sur. Dry or hard stools (Very Sur. Stomach feels tight, hard or full (Very Sur. Elevated blood sugar at more than 24 weeks of pregnancy (Slightly Sur. Often feel hungry and thirsty (Sur. Frequent urination (Sur. Feel tired easily (Very Sur. Nauseous (Very Sur. Urine production decreases(Quite sur. Stomach ache (Quite sur. Expert Diagnosis System Diagnosis Description Preeclampsia Preeclampsia Match Preeclampsia Preeclampsia Match Gestational Diabetes Mellitus Gestational Diabetes Mellitus Match Constipation Constipation Match Gestational Diabetes Mellitus Gestational Diabetes Mellitus Match Constipation Preeclampsia No Match Journal of Computer Science an Engineering (JCSE) Vol. No. February 2025, pp. No. Expert Diagnosis System Diagnosis Description Gestational Diabetes Mellitus Gestational Diabetes Mellitus Match Gestational Diabetes Mellitus Gestatiofnal Diabetes Mellitus Match Constipation Constipation Match Preeclampsia Preeclampsia Match Symptoms Often feel hungry and thirsty (Quite sur. Frequent urination (Sur. Weight loss (Sur. Feel tired easily (Slightly Sur. Weight loss (Sur. Vaginal infection (Slightly Sur. Feel tired easily (Sur. Nauseous (Slightly Sur. Difficulty defecating (Quite sur. Defecate less than 3 times a week(Sur. Pregnancy is more than equal to 20 weeks (Sur. Edema (Very Sur. Hypertension (Quite sur. e-ISSN 2721-0251 Based on Table 3, it can be seen that the 10 data used successfully calculated 9 data matches, while there is 1 data that is not matched by the system. The accuracy value can be seen according to calculations with formula number 3. Accuracy Value = Correct amount of data ycNEayce ycaycoycuycycuyc ycuyce yccycaycyca ycyceycycyceycc * 100 = *100 = 90% Then, this high-risk early detection system has an accuracy value of 90%. Because of the high accuracy, the results of the high risk detection of the Certainty Factor method can be a consideration for pregnant women and health workers who want to know more about high risk diseases in pregnant women with an expert system approach. Conclusion Based on this research, early detection of high risk in pregnant women before delivery using the Certainty Factor method was successful using 22 symptom data with weight values taken by experts through interviews, resulting in a diagnosis of 3 diseases. The system testing results in this study used 10 test data, by comparing the diagnosis results with experts, there were 9 out of 10 data that The accuracy value obtained is 90%. References