Frame-based System for Diagnosing Infertility in males and Females

: Diagnosis plays a crucial role in saving the life of a patient. However, due to the challenges faced by medical practitioners such as; few available resources, little amount of time dedicated to diagnose each patient, few numbers of specialists, emergence of new diseases and similarities of symptoms of diseases may hinder achieving accurate diagnosis. Infertility may be caused by a range of medical condition and abnormalities such as diseases, infections and hormonal imbalances in the reproductive system. The prevalence of infertility has negatively affected many couples globally especially in Africa where it is often linked with different traditional superstition in some societies. This led to the need for the development of systems capable of predicting and diagnosing diseases. In this research work, the expert System developed employs the frame-based approach to assess and predict the possible infertility problem that a patient may have based on the symptoms and patient information provided into the system. Outcomes of diagnosis presented to users solely depend on reasoning method implemented in the knowledge base of the system. The system showed an excellent predictive ability of 98% when scoring based on accuracy. It was evaluated on fifty (50) randomly selected infertility cases from the case file of patients. The system was able to effectively predict forty nine (49) infertility cases correctly and one (1) incorrectly. From the study, it is concluded that the frame-based system will assist not only medical practitioners but also individuals affected in achieving timely diagnosis since it can be accessed remotely. Furthermore, the system has the ability to store health records, diagnosis and generate statistical reports of patients.


Introduction
Now a days, societies neglect fertility test before marriage and emphasis more on taking medical test such as; blood group, genotype, hepatitis and a few other randomly selected tests to prevent the spread of sexually transmitted disease.In fact, no one may even imagine that couples may face any infertility problems after the marriage.Soon after the marriage, some couples begin to experience difficulty with conceiving and may face some complications like miscarriages as a result of infertility and other related diseases.
The World Health Organization [1] defines the term "infertility" as a disease of male or female reproductive system which leads to the inability to conceive a pregnancy after 12 months of regular unprotected sexual intercourse.Global estimates suggest that 48.5 million couples experience different cases of infertility every year [2].Studies conducted on infertility show that the prevalence of infertility is higher in sub-Saharan Africa, with Nigeria having about 10-30% of couples affected [3,4].In African cultural context, especially in some parts of Nigeria where child bearing is seen as an identity of the couples, infertility is often linked with different traditional superstitions [5].It has become common major issue in marriages these days and it is one of the primary reasons for divorce among couples [6].Generally, infertility in males are due to the problems in the ejection of semen, absence or low levels of sperm count while infertility in females may be caused by a range of abnormalities associated to the fallopian tubes, endocrine system, uterus, ovaries, diseases, infections and other hormonal imbalances [7].
The world today is progressively advancing and transforming in to a digital era with more innovations coming from different domain especially from the field of Artificial Intelligence.Artificial Intelligence (AI) which is known to be machine-displayed intelligence that stimulates human behavior has paved ways for the development of many applications in the research community today.Over the years, AI approaches and techniques have been applied in various aspects of human activities including areas where critical decisions are being made in order to improve the efficiency and reduce errors made by humans in complex situations.In the healthcare sector, AI has made significant strides in the development of wide varieties of applications, machines and expert systems used for the detection and identification of diseases.The availability of different techniques used for developing expert systems has shown the progress of modern technology in solving health related problems [8].Thus, this has captured the imagination of the public and also that of the research community [9].
To address the aforementioned problems of infertility, this research aimed to develop an expert system for diagnosing infertility in both men and women.An expert system is a computer program designed to emulate human decision or thinking ability by learning automatically from given data to produce accurate outcome [10].Looking at the stressful and time consuming manual processes faced by medical practitioners to diagnose patients, especially with the numerous challenges surrounding their line of work such as; similarities of symptoms shared among diseases, emergence of new diseases, little amount of time to diagnose each patient, few number of specialist available and the lack of interoperability between primary and specialty health care are factors that may contribute to medical errors [11].As such, expert systems could help medical practitioners with timely diagnosis and identification of diseases in patients.This makes a better and faster way of diagnosis compared to the manual process which is tedious, time consuming and more prone to error.

Related Work
In the last few years several languages (e.g., LISP, OWL, MySQL, e.t.c) and new tools have been developed and are currently being used for various studies and research in different fields.The emergence of artificial intelligence (AI) with an aim to bring disciplines together a term known as interdisciplinary has been successful.With the aforementioned approaches available, some researchers dedicated time to develop systems used for medical diagnosis.
Abu Naser and Al-Hanjori [12] applied SL5 Object expert system language to develop an expert system for diagnosing genital problems of men.The researcher presented the expert system to help in diagnosing genital problems and injuries which occurs accidentally during sports activities such as; Basketball, Biking, Football and work-related tasks i.e. contact with chemicals etc.After the diagnosis, the system provides the user with suitable treatment.
In [13], authors developed male infertility expert system for diagnoses and treatment.The design and development of the expert system was carried using the SL5 Object language.The system was aimed to explore infertility related problems and infertility diseases in men.Diseases such as: Aspermia, Azoospermia, oligo-terato-astheno spermia and Sexual transmitted disease were all included in the system for the diagnosing male infertility.Evaluation of the system was done by a number of specialists which at the end found to be promising.
Mrouf et al [14] proposed a knowledge based system for long-term abdominal pain (stomach pain) diagnosis and treatment.The system was developed using clips expert system language to diagnose numerous of the abdomen diseases such as: gastritis, hiatal hernia, and heartburn.The system operates by giving the summary of different abdominal diseases, outlining possible causes and offering the cure of the diseases shown.
The research work in [15], authors applied rule-based approach to develop an expert system for diagnosing infertility in women.The user interface was designed using Java, the database using SQL, and the knowledge base using Java Expert System Shell (JESS).The rules are contained in the knowledge base of the system of the system was implemented using Java Expert System Shell (JESS).
In [16], Lawal et al developed an ontology based expert system the using the Web Ontology Language (OWL).The study achieved a high accuracy in diagnosing and predicting three related hormones (Testosterone, Thyroid Hormone, and Cortisol Hormone).
Olanrewaju et al [17] developed an expert system for diagnosing hormone imbalance in women using Bayesian network approach.Modules in the system were divided in to two sub modules.In the first sub module, users are required to answer questions in the sign and symptoms sub module for the system to diagnose and present result.The system was able to predict nine (9) different hormone imbalances with a satisfactory prediction potential.
Despite the significant and valuable contributions made by researchers in previous studies, interpretability and transparency of most of the techniques applied remain a challenge.Again, most researchers carried out their research works on a particular gender and leaving the opposite gender out.This research aims to bridge some of the gaps by developing a knowledge-based system that will diagnose various infertility diseases in both male and females.Knowledge-based system will offer the advantage of transparent reasoning and the ability to capture domain knowledge.

Knowledge Acquisition
The purpose of knowledge acquisition is to elaborate the system's capability towards the diagnosis, prediction and the overall performance consisting of concepts, facts, rules, relationships and other useful information applied.Knowledge acquisition is commonly seen as a serious impediment in the development of inference system.This is because the result that comes from systems solely depends on the quality of the underlying representation of domain expert knowledge.This process involves extracting knowledge from available sources i.e. domain experts/records.The knowledge used for this study was acquired from records of patients with the collaboration of experts in the field of reproductive endocrinology and infertility.The knowledge about infertility acquired, was analyzed, processed and then converted in to a form of rules (knowledge base) to derive at the best conclusion for the problem.

Materials and Research Tools
The sources of knowledge of infertility diseases, signs and symptoms used for the expert system were primarily obtained from records of patients.The research covers a reference period from January, 2017 to July, 2023 records of married patients of child bearing age (20-40) that have attended the subspecialty unit (Reproductive Endocrinology and Infertility) under the department of Obstetrics and Gynaecology in Federal Teaching Hospital, Katsina State.A total number of one thousand, one hundred and sixteen (1116) cases were obtained with the help of medical experts from the record of patients diagnosed with infertility (See Table 1).The study essentially focused on the following classified infertility diseases and hormone imbalances; Azoospermia, Fallopian Tube Anomalies, Endometriosis, Hashimoto's Disease, Graves's Disease, Klinefelter syndrome, Pelvic Inflammatory Disease (PID), Pituitary Disorder, Polycystic Ovary Syndrome (PCOS), Oligospermia, Ovarian Cysts, Postpartum Thyroiditis, Uterine Myoma (Fibroid).All others sources of knowledge related to infertility used in the system were solicited from external medical expert duly acknowledged.

Clinical Presentation and Confirmation of Infertility
The diagnosis of infertility was established based on diagnosis, findings and outcome from patient's medical record during the past clinical diagnosis i.e.If symptoms recorded from findings of patient "A" were as follows; pain in lower abdomen, pain during sex, pain in lower back and pelvis or vagina, abnormal menstruation, nausea, outcome of diagnosis shows that patients has "Endometriosis".And if symptoms recorded from findings of patient "B" were as follows; pain in lower abdomen, pain during sex, pain in lower back and pelvis or vagina, vaginal discharge and odour, cervical motion tenderness, outcome of diagnosis shows that patients has "Pelvic Inflammatory Disease (PID)".Many among female infertility diseases share common signs and symptoms.

Knowledge Base Development of the System
The development of an expert system comprises of several steps that serve as guide for the successful completion of the system.One of the most important steps is the knowledge representation.In this step, the knowledge engineer captures what the expert system should have to be able to predict outcomes.The overall success of the expert system depends on an excellent inferencing technique which has to do with choosing the right knowledge representation procedure.The emergence of several techniques available such as Sematic networks, First-order logic, Production rules and Frame-based makes it more flexible and easier to choose the most suitable knowledge representation scheme for the development of expert system.
In this paper, frame-based technique will be applied for the knowledge representation.The frame-based technique have a unique features designed to capture and store relevant information efficiently in an organized manner.Also, system developed using the frame-based approach is known for its ability to connect to external databases and also accommodate large knowledge base.In the proposed system, users are provided with signs and symptoms of infertility randomly displayed within the interface in form of list to select.Once the user selects from the provided sign and symptoms, the system automatically search for a matching rule stored in the knowledge base and then present the outcome of diagnosis to the user.The rules play an auxiliary role while frames represent a major source of knowledge, and both method and demons are used to add actions to the frames.Rules are formed by applying demons and methods procedures represented in a logical format of "IF-THEN" statements.For example, "if a patient is a male and has low sex drive, erectile dysfunction, swelling around the testicles, then he may have Azoospermia" and "if a patient is a male and has low sex drive, erectile dysfunction, swelling around the testicles, with an additional symptom "thick discharge" then he may have Oligospermia".Figure 1 shows an example of how the rules are encoded in to the knowledge base of the system about infertility problems Azoospermia, Oligospermia, and Fallopian Tube Anomalies:

Proposed System Architectural Design
The system to be developed in this research consists of several components, each structured with a vital role to play in the development process of female infertility diagnosis expert system (see figure 2).First, facts (diseases, symptoms and conclusions) from records of patients and knowledge acquired from medical experts will be converted to set of rules and then stored in the database.The user interface serves as an intermediary between the system and the user.The user after registration would be granted access to the application.Symptoms with checkboxes from the explanation facilities module are fetched and presented within the interface for the user to select and submit it to the inference engine where reasoning takes place.The inference engine, then compare the submitted symptoms with the ones available in the knowledge base and select the possible result (outcome).Finally, the system returns the final result to the user via same user interface.

Implementation of the System
The expert system developed in this study is a web-based interactive diagnosis system, and therefore users can only access the system when connected to the internet.The user after initial registration is given access to begin the diagnosis process through a simple user interface.The system randomly fetches signs and symptoms from the knowledge base and displays it to the user with the help of rules provided at explanation facilities.Users select appropriate options based on bodily changes noticed and submit.The system uses the inference mechanism to make conclusion.The outcome of the diagnosis is then presented to the user.

The User Interface
The user interface is a graphical medium developed to allow access and interaction between the users and the system.The system conducts the diagnosis process by interacting with the user.The system is made up of modules and essential elements such as; button, images, and texts designed using JavaScript, PHP programming language and MySQL.On the user interface, pages are linked to each showing a well-structured process.The user may start by registering to be granted access.Every user is required to register by providing necessary information before granted access to the next step.After the registration, the system automatically navigates to the symptom selection page.The symptom selection page is one of the most important steps in the operation of the system.Here, the system automatically calculates the age of the patient and fetch symptoms that may be seen in the patient of that particular age based on the information earlier provided by the user (see Figure 3).After the user selects and submits the sign and symptoms noticed, the outcome of the diagnosis is then provided at the user's result page as shown in Figure 4.

System Evaluation
The expert system developed in this study was evaluated in two phases; evaluation after the implementation and evaluation by medical experts.
Evaluation after Implementation: Immediately after the execution of the program, the rules applied where inspected line by line to make sure that all rules are correctly implemented and no rule is omitted.The program was tested repeatedly to ensure that the program was effectively and efficiently implemented with no glitches.
Evaluation by Domain Expert: This phase of evaluation was carried by the medical experts.A number of medical professionals evaluated the system by carefully following the diagnosis on case files of patients and comparing it with the predicted outcomes.A total of fifty infertility cases where randomly selected for this phase of evaluation.The system was able to predict forty nine (49) cases corrected and one (1) incorrectly corresponding to 98% accuracy rate.

Conclusion
In the research work presented, problems of infertility are being diagnosed using a frame-based inference approach.Outcome of diagnosis presented to the user solely depends on reasoning method implemented in the knowledge base of the system.The expert system developed in this study showed an excellent predictive ability when scoring based on performance metrics such as speed and accuracy.It was evaluated by the medical expert.This was done by comparing the predicted diagnosis to the actual diagnosis.From the study, it is concluded that the frame-based system will assist not only medical practitioners but also individuals affected in achieving timely diagnosis since it can be accessed remotely.Furthermore, the system has the ability to store health records, diagnosis and generate statistical reports of patients.

Figure 1 .
Figure 1.An example of how the rules are encoded in to the knowledge base of the system.

Figure 3 .
Figure 3. Sign and symptoms selection interface

Table 1 .
Records of Disease Based on Infertility