# Colorectal Cancer Detection Tool Developed with Neural Networks
## 2 Materials and Methods
### The Datasets  
The first step in training any type of network is to search and declare the dataset in the chosen software. For CRC, usually three main diagnosis methods are used: blood and stool testing, colonoscopy imaging, and histopathology imaging. In the current paper, colonoscopy and the data from blood and stool testing are considered. Firstly, the numerical dataset has 36 input parameters, out of which 34 are from stool and blood sampling. The other two input parameters are age and medical history. A similar dataset from study [34] is used. The initial dataset for this study contains data from 300 patients. Out of this dataset, 100 patients are reserved for further testing, and the rest are augmented to 600 with the random feature perturbation method. The augmented dataset has been checked for clustering, data redundancy, and class imbalance, ensuring an appropriate number of patients with higher or lower cancer probability scores. In Table 1 a class distribution table is presented. The data are distributed into 66% for training and validation and 33% for testing. The 200 data used for training is augmented to 600, which is three times the data used for training. This value is chosen to avoid overfitting synthetic patterns and to maintain biological plausibility. The ADASYN and SMOTE methods are not considered due to having a balanced dataset. Before creating and training the neural network, these parameters need to be mathematically interpreted; thus, Table 2 is created. Table 2 helps visualize the analyzed parameters better and contains the minimum and maximum possible values as well as the healthy lower and upper values for each of the parameters. In addition, a grade of importance is explained below. For most of the parameters, there is a minimum and maximum possible and healthy value. The two exceptions are age and medical history. For age, an argument could be made for minimum and maximum values, since there are average values for the youngest and oldest patients with CRC diagnoses. However, these values are highly variable based on many factors, and a non-applicable (noted as Nan in the table) value is considered more suitable for this research. The same goes for medical history since it can only be assigned the value of 1 or 0. For each of the input variables, the importance level is granted depending on how much more importance is held by the variable. Moreover, there is a degree of severity for each variable, which is graded from 0 to 3 and is as follows:  
1. Means that the parameter is the healthy interval. 2. Means that the parameter is slightly outside the interval 1.3 if above and 0.7 if below. 3. Means that the parameter is outside the interval by 1.3-1.6 if above or 0.7-0.4 if below. 4. Means the parameter is outside the interval by a larger than 1.6 if above or smaller than 0.4 if below. After the matrix is built, an output is computed using the following rule. Depending on the matrix and how relevant that parameter is. To determine this, an experienced gastroenterologist gave his insights, and with the help of his expertise, the values were chosen. There are three stages of importance for these variables. There are 5 inputs for the first one, 9 for the second, and 19 for the third. The output percentage is computed by considering the value from the matrix and in which of these 3 categories the parameter is. The intent is to create an assistive tool to replicate and perhaps scale expert judgment, rather than as a predictive model for direct clinical diagnosis; as such, the output is set to values from 0 to 90% (a small chance is considered if some type of mistake is made or there is an off chance that some other disease causes the symptoms). Depending on the age and if the patient has had a member of their family with CRC, the sum of the 34 test result variables is modified depending on the case. It is multiplied by 1.5 if there are reports of the disease in the family. Depending on the age of the patient, the value is multiplied by 0.5-1.5 from young to old.