# Hospital Readmission and Length-of-Stay Prediction Using an Optimized Hybrid Deep Model
## 3 Methodology
### Gaocm  
We present a hybrid deep model called the Genetic Algorithm-Optimized Convolutional Neural Network (GAOCNN). In this model, the convolutional layers are used for feature extraction and the dense layers for classification, while the GA is applied to optimise the layers' parameters. The overall structure of the proposed model is shown in Figure 1. The GAOCNN has two convolutional layers. After the convolutional layers, there is a pooling layer that is specified as average pooling functions [37]. Furthermore, we use two fully connected layers with a dropout, which mitigates the risk of overfitting [38]. The convolutional layers employ local connections and weights to extract features from input data and build dense feature vectors. Since the data is two-dimensional (samples, attributes), we apply one-dimensional convolutional layers. The main algorithm is a simple CNN model. The proposed method is trained for numerical, categorical, and descriptive features such as age, gender, and symptoms. One-dimensional convolutional layers can extract hidden relations between co-occurring symptoms and comorbidities. Furthermore, extracting time-dependent information from descriptive (contextual) features is conducted more efficiently using one-dimensional convolutional layers [39]. The main drawback of deep neural network models is their vast space of hyperparameters, which makes the parameter selection tedious. Most researchers use techniques such as random search [40] and grid search [41]. When we use these searching techniques, there is a trade-off between increasing the layers and the run time to reach a proper solution. To overcome this challenge, we use GA to select parameters scientifically. Furthermore, the whole process can be completed without human intervention. This automation in the learning process will help healthcare systems reach the proper performance without expert supervision. \begin{table}
\begin{tabular}{c c c c c} \hline \hline
**Dataset Name** &
\begin{tabular}{c} **Number of** \\ **Instances** \\ \end{tabular} & **Number of Features** & **Gender** & **Collected Years** & **LOS Range** \\ \hline Diabetes & 101,766 & 50 (37 descriptive and 13 numerical features) & 53.8\% male, 46.2\% female & 1999–2008 & (0–14] \\ \hline COVID-19 & 1085 & 23 (17 descriptive and 6 numerical features) & 64.7\% male, 35.3\% female & 2020–2021 & (0–30] \\ \hline ICU & 58,976 & 28 (9 descriptive and 19 numerical features) & 59.1\% male, 41.9\% female & 2001–2012 & (0–294] \\ \hline \hline \end{tabular}
\end{table} 
Table 2: Details information of the Diabetes, MIMIC-III, and COVID-19 datasets. Figure 1: Structure of the proposed model. The GA has been used widely in artificial intelligence fields, such as medical image processing, ML, and DL hybrid models [42]. The most essential elements of the GA are the environment and the fitness function. By defining a proper fitness function, we can guide the model to improve performance. The GA uses the process of selection, crossover, and mutation to choose the number of convolution kernels, the number of convolution filters, and the number of epochs and neurons of the model. The GA's standard steps are the initialization of the population, selection between the created population, logical combination (crossover), randomness (mutation), and decoding. After making the first random generation of the population's data, according to the principle of'survival of the fittest', only the fittest generation of the population survives. In each generation, individuals are selected according to their fitness. The surviving populations will be the parents of the next generations. In the proposed algorithm, we use a maximum filter to choose the best hyperparameters according to the highest fitness function in every step. The flowchart of the applied GA has shown in Figure 2. At the beginning of the training phase, the number of filters, convolution kernels, and neurons in each layer are randomly initialized. Then, the fitness function is calculated for the first generation.