# Application of Artificial Intelligence in Support of NAFLD Diagnosis
## 2 Materials and Methods  
### Methodology  
As a solution to the problems described earlier, the authors propose to use the system developed in this study to support the diagnosis of NAFLD disease equipped with artificial intelligence algorithms. It consists of multiple scripts that define data pipelines. They are connected so that they continuously and automatically test and improve the software, according to CI/CD practice [6]. The system was written in Python and developed using Docker technology to create an isolated and repeatable development environment using containers. Developer containers were used to manage dependencies and environment configuration during the development process easily. This made it possible to avoid problems related to differences in environment configuration on different development machines, which often leads to errors that are difficult to diagnose. In addition, the project uses the Poetry tool to manage dependencies and packages. Poetry offers several advantages, such as simplifying dependency management with a declarative configuration file that allows precise control of package versions. The use of Poetry has contributed to better management of the virtual environment, automatic resolution of dependency conflicts, and simplification of the package publishing process. The use of Docker, dev containers, and Poetry has significantly contributed to the efficiency of the development process. Containerization provided ease of software version management and the ability to quickly reconfigure the environment in response to changing project requirements. The Poetry tool enabled precise management of dependencies and packages. Using single machine learning models can come with some potential drawbacks. First, a single model can be prone to overfitting the training data, especially for highly complex models, which can lead to poor generalization of new data. In addition, selecting an appropriate model and its hyperparameters can be difficult and time-consuming, and predictive performance can be degraded by its limited ability to capture complex relationships in the data. For this reason, in this system, an ensemble that consists of many machine learning models was used. Those components are a diverse group of machine learning algorithms described in Table 1. This solution generates many positive effects. First, the ensemble model can provide excellent stability and robustness to overfitting by majority voting the results from multiple models, which can help reduce prediction errors. In addition, each model in the ensemble can approach the problem from a different angle and detect different relationships in the data, which can lead to a better ability of the model to capture the diversity of patterns in the data [7]. Calling each machine learning model in the ensemble model and then performing a majority vote is a simple but effective approach to aid diagnosis. Each of these models is trained using different machine learning algorithms and sets of hyperparameters, leading to greater prediction diversity. Combining the results from these models through majority voting allows different perspectives and approaches to be incorporated into the diagnosis process, leading to more confident and accurate results [8]. The entire system can be divided into the following three main modules:  
1. A module dealing with data aggregation;
2. A module dealing with AI models;
3. A module dealing with model explainability. For each module, several scripts perform individual tasks. Apache Airflow was used to connect them, allowing for the definition, scheduling, and monitoring of tasks as data pipelines. Several different directed acyclic graphs (DAGs) were created to integrate individual scripts' work and define the information flow between them. Three main paths of program operation were defined as follows:  
* Aggregation of new data (raw or processed);
* Fine tuning AI models based on new data;
* Diagnosing the patient. A general architecture of the system is provided in Figure 1.