# Fast Pre-Diagnosis of Neoplastic Changes in Cytology Images Using Machine Learning
## 2 Materials and Methods
### The Dataset  
For dataset creation, the cell samples were obtained by the fine needle aspiration (FNA) procedure performed on dogs with skin masses. A needle with a small gauge (23-25 G) is usually adequate and reduces the possibility of vessel rupture [10]. After sampling, cellular material was spread over a microscopic slide. The slides were prepared with Diff-Quik staining methods. Due to short staining time, Diff-Quik is commonly used in veterinary clinics.Next, the samples were evaluated under the Delta Optical 300 microscope. The 40\(\times\) lens has been chosen to obtain a total magnification power of 400\(\times\).  
A suitable area of the sample should be selected to make the correct diagnosis. In this work, the diagnostic area identification was made by a human expert, and it is the subject of future research to make this critical step to be done automatically. In the future, we plan to use sample scanning to achieve this.  
The analysis of several dozen images is needed to find a neoplasm, which will allow an expert to determine what type of cells is dominant in the collected sample and whether we are dealing with cancer. The sample belongs to a single patient.  
The selected areas were digitally acquired using the 5-megapixel camera (Delta Optical DLT-Cam PRO 5 MP) attached to a microscope.  
The prepared dataset aimed to detect three types of round cell tumors: lymphoma, histiocytoma, and mastocytoma (Figure 2). The dataset is available at [[https://git.plgrid.pl/projects/CYFROVET/repos/dataset-detection](https://git.plgrid.pl/projects/CYFROVET/repos/dataset-detection)]([https://git.plgrid.pl/projects/CYFROVET/repos/dataset-detection](https://git.plgrid.pl/projects/CYFROVET/repos/dataset-detection)), accessed on 10 July 2021.  
Lymphoma (Figure 3a). Cells are round or oval. Some lymphoma cells may have a shape of a hand-held mirror. They do not have cytoplasm granularity. The nucleus, often slightly indented, fills almost the entire cell. The cytoplasm is usually present in small amounts, and it shows varying shades of blue: from deep basophilic to pale [10; 12].  
Histiocytoma (Figure 3b). The shape of histiocytoma cells resembles fried eggs\"-cytoplasm is more abundant than lymphoma cells. Occasionally, tiny vacuoles can be observed inside the cytoplasm. The nucleus often resembles a characteristic kidney-shape [10; 12].  
Mastocytoma (Figure 3c). A mastocytoma may otherwise be called a mast cell tumor. Other cells (eosinophilis) and collagen fibers may appear in mastocytoma preparations. The most distinctive feature is the presence of granules in the cells, which stain purple-pink. The cell nuclei (if obscured by the granules) are hardly visible. During the preparation of the samples, degranulation sometimes occurs. The release of granularity from the cells can make diagnosis difficult [10; 12].  
The dataset is divided into two parts: detection and segmentation (Figure 4). The detection set is organized into four subsets: initial, divided, big, and balanced. The most important statistics of the dataset are presented in Figure 5.  
Figure 3: Example cancer cells. (**a**) Lymphoma. (**b**) Histiocytoma. (**c**) Mastocytoma.  
Figure 2: Round cell tumors classification based on [11]. Three classes represented in our dataset are highlighted.