# Early Detection of Residual/Recurrent Lung Malignancies on Post-Radiation FDG PET/CT
## 2 Materials and Methods
### Radiomics Model  
In the radiomics model, a total of 106 handcrafted features, encompassing intensity, geometry, and texture properties of the regions of interest, were extracted from CT and PET images. Nine intensity features, including minimum, maximum, mean, median, standard deviation, sum, skewness, kurtosis, and variance, were initially calculated for each imaging modality (CT or PET). Subsequently, eight geometry features were derived from the mask of the regions of interest in the paired PET and CT images. Additionally, forty texture features were calculated for each imaging modality. In contrast to most commonly used radiomics models, which typically extract texture features purely based on the Gray Level Co-occurrence Matrix (GLCM) calculated from imaging data, in our study, we employed a more comprehensive approach to texture extraction by utilizing four gray level-based matrices including the Gray Level Run Length Matrix (GLRLM), Gray Level Size Zone Matrix (GLSZM), Neighboring Gray Tone Difference Matrix (NGTDM), and GLCM. GLCM focuses on spatial relationships and texture patterns [15], while GLRLM assesses the length of homogeneous pixel runs, capturing texture roughness [16]. GLSZM evaluates the size distribution of homogeneous zones, providing insight into texture zone uniformity [17]. NGTDM examines local intensity variations, highlighting subtle texture changes [18]. This multi-faceted methodology provides a more robust and detailed characterization of tissue heterogeneity compared to the exclusive use of GLCM. Each matrix captures distinct aspects of texture information from medical images, thereby enhancing the overall predictive capability of our radiomics model. Detailed features for each category are listed in Table 3.  
A predictive model was then constructed using the Gaussian kernel-based support vector machine (SVM) algorithm. The Gaussian kernel was selected due to its capability to model the non-linear relationships inherent in the radiomics features. Given that \(x_{i}\) represents the feature vector for each sample \(i\), consisting of the 106 radiomics features extracted from the images, and \(y_{i}\) is the class label (malignant: 2 and benign: 1), the optimization problem is formulated as:  
\[\min_{w,b,\xi}\frac{1}{2}\|w\|^{2}+C{\sum_{i~{}=~{}1}^{n}}\xi_{i},~{}~{}~{}~{} \textit{subject to}~{}y_{i}(w\cdot\phi(x_{i})+b)\geq 1-\xi_{i}~{}~{}~{}~{} \textit{and}~{}~{}~{}\xi_{i}\geq 0,~{}~{}~{}~{}i~{}=~{}~{}1,\ldots n \tag{1}\]  
Figure 2: A flow diagram of the proposed method. The pink contour is the contour provided by the nuclear medicine physician on the slice with the largest area of the region of interest. The orange contours are the 3D contours derived from the similarity variation model. where:  
* \(\phi(x)\) is the feature mapping induced by the Gaussian kernel;
* \(w\) is the weight vector, which determines the orientation of the hyperplane in the feature space, and b is the bias term, which shifts the hyperplane;
* \(\xi_{i}\) are the slack variables that allow some flexibility in the classification for non-linearly separable data;
* \(C\) is the box constraint that controls the trade-off between maximizing the margin and minimizing the classification error. To solve the above optimization problem, we utilized the method of Lagrange multipliers, transforming the primal problem into its dual form, which is as follows:  
\[\max_{\alpha}\sum\
olimits_{i=1}^{n}\alpha_{i}-\frac{1}{2}\sum\
olimits_{i=1 }^{n}\sum\
olimits_{j=1}^{n}\alpha_{i}\alpha_{j}y_{i}y_{j}K\big{(}x_{i},x_{j} \big{)}\ \textit{subject to}\ 0\leq\alpha_{i}\leq C,\ \sum\
olimits_{i=1}^{n}\alpha_{i}y_{i}\ =\ 0 \tag{2}\]  
where:  
* \(\alpha_{i}\) are the Lagrange multipliers, and \(K\big{(}x_{i},\ x_{j}\big{)}\ =\ \exp\biggl{(}-\frac{\|x_{i}-x_{j}\|^{2}}{2 \sigma^{2}}\biggr{)}\) is the Gaussian kernel function. Then, Sequential Minimal Optimization (SMO), an iterative algorithm, was used to find the optimal values of \(\alpha_{i}\), and finally w and b can be calculated.