# An Automatic Analysis System for High-Throughput _Clostridium Diffic_ Toxin Activity Screening
## 2 Methods
### Classification  
The classifier generates a classification rule using information gathered based on 50 \(\times\) 50 pixel segments cut from GFP images (corresponding to 50 \(\times\) 50 pixel DAPI segments), divided into two groups: adherent and rounded cells. This procedure required the preparation of learning data. In particular, many cells were first manually defined as adherent or rounded by an expert. The dataset was divided into training and test sets based on the \(k\)-fold cross-validation method [32; 33] with \(k=10\). In \(k\)-fold cross-validation, the original sample is randomly partitioned into \(k\) equal-sized subsamples. The \(k\)-fold cross-validation method uses all observations for both training and validation, with each of the \(k\) subsamples used exactly once as the validation data. Then, the classifier learns (parameter adjustment) based on the positive and negative control images and runs using new images, without any external help. Each square GFP image segment produced in the previous step, with one cell in the center, is classified. The distinction between adherent and rounded cells is made based on probability density functions (PDFs) of gray-scale levels. The main difference in PDF shapes leads to a compact thresholding method. The classifier indicates whether the cell contained in a segment is adherent or rounded.  
The proposed method is based on a naive Bayes classifier, a classical well-known algorithm [34; 35; 36; 37; 38] that is still widely applied, with satisfactory results in various applications [39; 40; 41; 42; 43; 44]. The naive Bayes classifier assumes that boundary distributions are independent and in general multidimensional cases (for \(D\) dimensions, feature vector is \(\mathbf{x}=(x_{1},\dots,x_{D})\)) can be defined as the following classification rule:  
\[\Psi(\mathbf{x})=\arg\max_{c\in\{1,2\}}p(c)\,\prod_{d=1}^{D}\,p_{c}(x_{d}), \tag{2}\]  
where \(p(c)\) is the prior probability of occurrence of class \(c\), and \(p_{c}(x)\) is a probability density function (PDF) in class \(c\). The notation \(c\in\{1,\,2\}\) results from the fact that we consider a two-class problem. In our case, the classification problem was transformed to a one-dimensional task (\(D=1\)), because of the use of grayscale distributions for the horizontal axis. The distributions for horizontal and vertical axes were very similar, and this kind of symmetry can result from the huge freedom of cell rotation, shown in the images (see Figure 6). The simplification leads to the following classifier form:  
\[\Psi(\mathbf{x})=\left\{\begin{array}{ll}1,&\text{if }p_{1}(x_{1})>p_{2}(x_{1}),\\ 2,&\text{if }p_{1}(x_{1})<p_{2}(x_{1}),\end{array}\right. \tag{3}\]  
where we assumed that rounded and adherent cell classes are equiprobable (i.e., \(p(1)=p(2)=0.5\)). The one-dimensional naive Bayes classifier is in fact the optimal Bayes classifier, in terms of the lowest classification risk [35]. The probability distributions of gray-scale illumination in both classes were estimated in previously cut squares containing cells (for details of cell segmentation, see Section 2.4).  
Figure 7: Outcome of the cell segmentation step. Detected cells are outlined in square segments of 50 \(\times\) 50 pixels.  
The probability density functions in classes were estimated non-parametrically by histograms (see Figure 8). In the presented case, the separation point between classes in the horizontal axis was achieved by a naive Bayes classifier for 69.4% of brightness.  
The final classification result is shown in Figure 9. The rounded cells are marked with red while adherent cells are outlined in blue.