# Nodule Detection with Convolutional Neural Network Using Apache Spark and GPU Frameworks
## 3 Our Proposed Methodology
### Pre-Processing
The summation of extracted features from the lung nodule CT images is calculated as:  
Figure 2:5 Figure 2:6 Figure 2:7  
Based on the above-computed norm values, the reconstruction cost of the proposed feature learning and lung nodule detection has a maximum accuracy percentage. The computation complexity of the proposed deep NG-CNN model is \(O(d_{x}\times d_{h})\). The pseudo-code of our proposed NG-CNN algorithm for pre-processing step is given in Algorithm 1. ```
1:Input: \(\theta\), \(\lambda\), \(\lambda\), \(\lambda^{\primethe mathematical expressions are proved by implementing our proposed deep model in the various platforms. **INPUT:** Set of lung CT images \(X=(x_{1},x_{2},...,x_{N})\) with ground truth labels

\(Y=(y_{1},y_{2},...,y_{N})\)

**OUTPUT:** Binary classes 0 or 1 for cancerous and non-cancerous nodules. 1. Read the original images and Initialize the variables and parameters, \(W_{b}<\) hidden layer weights, \(W_{c}<\)- output layer weights, \(q_{b}\), \(q_{c}<\)- bias of hidden layer and output layer
2. Calculate the \(f(. )<\)- activation function, with respect to the noisy features. 3. Evaluate the kernel function based on positive and bounded value. 4. Calculate CIM between two variables \(P=(p_{1},p_{2},...,p_{N})^{T}\) and \(Q=(q_{1},q_{2},...,q_{N})^{T}\)
5. Calculate Error non-linearity that is asymptotically uncorrelated at steady state \(e_{i}=p_{i}-q_{i}\)
6. Calculate cost function as \(J_{cost}(\theta)=L(a,c)+\lambda||J_{f}(a)||_{F}^{2}\)
7. Compute the maximum correntropy measure value error before giving the features to the auto-encoder. **Algorithm 1** Pseudocode of pre-processing step in NG-CNN algorithm. ### Segmentation and Candidate Nodules

After pre-processing, the lung CT scans are segmented to exclude the irrelevant background. We applied the region seed growing method for segmenting the ROI from the CT scans. The greyscale image is transformed into a binary image using the threshold of \(-340\) HU. We employed morphological operations, like erosion and dilation. The erosion is applied with a disk radius of 2 mm to eliminate the tissues in the walls and parenchyma. Dilation is practised with a disk radius of 10 mm to retain the nodules that occur in the cavity. Finally, the original image is superimposed with the binary image to attain the segmented region of interest. Figure 3 shows the segmented results of the sample lung slices (a) shows the anatomy scan of a human body, (b) shows the pre-processed image, (c) shows the binary image based on the threshold. (d,e) shows the results of the CT after erosion and dilution respectively. Finally, 3(e) shows the superimposed image. Figure 2:8 Sample results of segmented results of a top slice, middle slice, and bottom slice of a lung image of a patient. ### Feature Extraction

After segmentation, the features are extracted based on geometric, intensity, and contrast. We extracted more than 240 features during the initial phase for all the potential nodule candidates. The 240 [38] features were shortlisted to 14 classes based on linear independence and ROC curve criterion. Features classes are based on geometric shapes, texture, intensity, gradient, spatial context, blobness, Eigen values, border, Radiomic features, kurtosis, skewness, graylevel, contrast, and Hessian. The intensity features are extracted based on the histogram values of the CT scan. The geometric features contains information about size and shape of the nodule. Features, such as radius, area, perimeter, compactness, roundness, and smoothness, are included as candidate nodular region. The texture features provide information on the variation of intensity by analyzing the characteristics, such as roughness and regularity. The selected candidate nodules are shown in Figure 4, which contains many false positives and false negatives. A deep model is applied in the section to reduce false positives. ### Training the Neural Net

This subsection details the working of CNN and the number of layers of our neural network.