# Deep Learning Classification of Colorectal Lesions Based on Whole Slide Images
## 1 Introduction  
Colorectal cancer is the third most frequently detected type of cancer among men and the second among women [1, 2]. According to WHO data, around 1.8 million new cases and more than 800,000 deaths are detected annually [3]. Moreover, colorectal cancer is one of the most common causes of mortality [4, 5]. Currently, histological image analysis is the standard for the clinical diagnosis of cancer [6, 7].  
The basis for cancer treatment is the morphological verification of the tumor process, based mainly on the material of an endoscopic biopsy of the colon. Pathoanatomic examination is a subjective process based on the recognition of various morphological structures on histological slides, and only specialists can deal with the problem. The limited number of available pathologists make it difficult to establish a system of reference studies of all biopsies. The problem can be substantially facilitated with computer technologies.  
In recent years, artificial intelligence and deep learning [8, 9, 10], in particular, have found wide application in different areas of medical research and medical imaging. Many studies are devoted to the X-ray [11, 12] and MRI [13, 14, 15, 16] image processing. Machine learning methods are used to analyze different types of data obtained with a colonoscopy,CT colonography, colon capsule endoscopy, endocytoscopy, and other techniques. The increasing amount of available digital histological images makes it possible to use machine learning methods to segment and classify cancer types [17; 18].  
Whole-slide imaging (WSI) provides extensive opportunities in this area using deep learning. This is a segmentation task, and WSIs have been shown to be segmented into the areas of healthy tissues and those containing cancer with high accuracy using convolutional neural networks (CNN) [19] or autoencoders that include various CNNs [20]. The scientists often consider the classification problem with only two classes--detection of malignant tissue in a given WSI fragment [21]. [PERSON] et. al. showed that neural networks trained on images of some tissues are able to classify other tissues with high accuracy [22]. To diagnose lymphoma, Bayesian neural networks achieved a quality of AUC = 0.99 [23]. [PERSON], et. al. compared the prediction quality of neural networks trained on PNG and JPG images for breast, colon, and prostate tissues and found that there were no statistically significant differences; therefore, it is possible to use JPG to reduce the training time and memory used [24].  
In [25; 26], multi-class classification was performed with CNN, and cancerous tissues were detected and differentiated. For the same purposes, [PERSON] et. al. [27] used the fully convolutional network [28]. In [29], the network trained on WSI data was transferred for the analysis of MSI, and [PERSON] et al. [30] proposed a new loss function that allowed more efficient CNN training of CNN on WSI data.  
Most works devoted to the use of neural networks for cancer diagnostics address the problem of binary classification between malignant and benign tissues. The use of neural networks to diagnose colorectal cancer is not so popular for other organs, such as the breast. For example, in the Scopus research database, there are 2850 studies for the query \"deep learning\" AND \"Breast cancer\", while only 628 studies for the query \"Deep learning\" AND \"colorectal cancer\".  
In this work, we collected WSIs of colon tissue samples and trained CNN to classify them into six classes. To deal with WSI data, a training sample caching system was designed and implemented. Several classification approaches were compared: multi-class classification and one-vs-rest classification, and the one-cycle policy method was also used [31] to configure training hyper-parameters.