Presented here is a deep learning-based feature selection method that leverages gradients of a neural network loss function with respect to input features to identify and prioritize those that most strongly influence lung cancer stage detection.
Method Article
Presented here is a deep learning-based feature selection method that leverages gradients of a neural network loss function with respect to input features to identify and prioritize those that most strongly influence lung cancer stage detection.
Radiomics enables the extraction of quantitative imaging biomarkers from medical images and has become an important tool for computer-aided cancer diagnosis. However, radiomics datasets are typically high-dimensional with limited sample sizes, making feature selection a critical step for building reliable predictive models. This study proposes a gradient-loss recursive feature elimination (GL-RFE) framework that integrates gradient sensitivity analysis from a deep neural network to identify the most influential radiomic features for lung cancer stage detection. A total of 106 radiomic features were extracted from chest computed tomography (CT) scans using the PyRadiomics extension of the 3D Slicer platform. The proposed method evaluates feature importance by computing gradients of the network loss with respect to input features and recursively eliminates features with minimal contribution. The resulting top 15 radiomic features are used to train a deep neural network classifier for distinguishing early-stage and advanced-stage lung cancer. The proposed framework achieves strong classification performance, with an accuracy of 90.22%, precision of 90.10%, recall of 90.24%, and F1-score of 90.16% on the test dataset. Visualization analyses, including correlation heat maps and distribution plots, further confirm reduced feature redundancy and improved class separability. Compared to conventional feature selection techniques, GL-RFE effectively captures nonlinear feature interactions and enhances model generalization. The presented protocol provides a reproducible and interpretable methodology for radiomics-based cancer stage detection. It is particularly suitable for high-dimensional, small-sample biomedical datasets and has potential applications in other domains, such as genomics and multimodal clinical analysis.
Lung cancer remains one of the major types of cancer, leading to serious health concerns, often leading to death1. Radiomics enables quantitative characterization of medical images by extracting large sets of features that describe tumor shape, texture, and intensity patterns2,3. These features, also termed handcrafted features, serve as potential biomarkers for diagnosis, prognosis, and treatment response of lung cancer. However, radiomics datasets are typically high-dimensional and sample-limited, leading to redundant and noisy features that degrade model performance4,5,6,7. Hence, efficient and explainable feature selection is crucial for developing robust radiomics-based predictive models.
Traditional feature selection approaches such as filter methods (e.g., correlation analysis, analysis of variance [ANOVA], mutual information) and wrapper methods (e.g., Sequential Feature Selection, Recursive Feature Elimination) are widely used for radiomics-based cancer detection models4,8,9. However, they often fail to capture nonlinear feature interactions and deep contextual dependencies inherent in radiomics data9,10,11. Ensemble feature learning techniques have been explored for medical image classification, but have achieved moderate accuracy, which could be further improved12.
Deep learning methods, particularly deep neural networks (DNNs), have demonstrated superior ability to model nonlinear and hierarchical relationships between features and outcomes, making them ideal for guiding feature selection and providing accurate cancer detection models13,14. In this context, the potential of using a convolutional neural network, multimodal AI techniques, and VCG-16, a pre-trained model for cancer diagnosis, is explored1,15,16. A hybrid deep learning model17, including the pre-trained VGG-19 model and long short-term memory networks (LSTMs), was proposed, trained, and tested on a large number of images, achieving over 99% accuracy.
Besides cancer detection, research has also been conducted on cancer staging. Hugo et al.18 designed a feed-forward neural network model on the NSCLC database of 300 patients to classify cancer stage I, II, and III with an accuracy of 74.52% in model testing. A radiomic-based Bayesian inversion method3 was presented for lung cancer stage detection using the NLST dataset on a sample size of 200. The proposed method achieved an accuracy of 86%. The literature review has revealed that most studies on cancer detection have focused solely on classifying benign and malignant tumors, and only a few have addressed cancer stage classification, with accuracies of less than 90% that can be further improved. This research paper addresses the aforementioned research gap and proposes a robust radiomic feature-based classification framework for accurate lung cancer stage detection.
A gradient-loss-based recursive feature elimination (GL-RFE) framework has been introduced in this study, integrating gradient backpropagation from neural networks into the RFE process. Unlike conventional RFE methods that rely on static feature importance metrics, GL-RFE leverages the gradients of the loss function with respect to each input feature to measure how strongly each feature influences model predictions. By iteratively removing features with minimal gradient contributions, the presented model performs feature selection of the top 15 diagnostic features optimized for lung cancer stage detection of 2 classes (stage I and stage II combined and stage IIIa and IIIb combined). The workflow diagram of the work carried out is given in Figure 1. The chosen lung cancer dataset for the presented model is NSCLC Radiomics19 having 411 volumes of format termed as digital imaging and communications in medicine (DICOM) with clinical cancer stage information. A total of 106 3D radiomics features of each lung cancer DICOM volume are extracted using PyRadiomics20, an extension of an open source software, 3D Slicer21. These features belong to seven feature classes22, including shape, gray level difference method (GLDM), gray-level co-occurrence matrix (GLCM), first order, gray level run length matrix (GLRLM), gray level size zone matrix (GLSZM), neighborhood gray-tone difference matrix (NGTDM). The radiomics data of the minority class (stage I and stage II) were oversampled using the synthetic minority over-sampling technique (SMOTE)23.
The novelty of the proposed GL-RFE framework lies in integrating gradient-based sensitivity analysis derived from neural network training into the recursive feature elimination process. Unlike conventional RFE approaches that rely on static importance measures, GL-RFE dynamically evaluates feature relevance through back-propagated gradients of the loss function. This enables the identification of features that directly influence model predictions for cancer stage while maintaining interpretability and computational feasibility for relatively small medical datasets.
The dataset employed for the training and testing of the proposed framework is a publicly available CT images dataset of 422 lung cancer patients known as NSCLC Radiomics17. For each patient, the data set includes a CT volume and a DICOM radiotherapy structure set (RTSTRUCT) and a DICOM segmentation (SEG) file. These files contain manual delineations performed by a radiation oncologist of the three-dimensional volume of the primary gross tumor volume (GTV-1), as well as the lung image. The data set is a pre-processed set, and the dimensions of the images are 512 x 512 pixels.
Due to the nonlinear nature of handcrafted radiomic features, these features cannot be directly used with deep learning models for cancer diagnosis, and their inherent data patterns must be captured using AI techniques. GL-RFE ranks features based on the magnitude of the gradient of the model loss L with respect to each input feature xi.
For each input feature xi, the average absolute gradient is calculated as follows:
(1)
Here, N is the total number of samples. Lj is the loss for jth sample. xij is the ith feature of the jth sample.
represents the sensitivity of the loss with respect to the input feature.
The features with low gradient magnitudes have minimal impact on model updates and are recursively eliminated. The proposed workflow for eliminating the low gradient radiomic features using a multi-layer perceptron (MLP) and training a deep learning neural network (DNN) on the top 15 features is shown in Figure 1. The performance of the GL-RFE method for feature selection is then evaluated.
The aforementioned deep learning model with the GL–RFE method is implemented in a Jupyter notebook on Google Colab, which allows writing and executing Python code in an online environment. Different packages, included in the protocol steps and the materials, need to be downloaded to compile the code. Using the method described in the Protocol section, the top 15 radiomic features for lung cancer detection are identified and used to achieve accurate cancer detection on test datasets.
Access restricted. Please log in or start a trial to view this content.
1. Extraction of radiomic features using 3D Slicer PyRadiomics extension
NOTE: The following steps are designed to compute radiomic features of a lung CT DICOM file using 3D Slicer PyRadiomics extension and to save in a file of comma separated value (csv) format.
2. Developing a radiomics-based cancer detection model using Python libraries
NOTE: The following steps are summarized for a user to develop, train, and test a cancer detection model using Python Libraries with radiomic features of CT datasets.
3. Running the Jupyter notebook to build and test model
Access restricted. Please log in or start a trial to view this content.
Dataset summary
The NSCLC Radiomics dataset comprises 422 CT volumes of lung cancer stage I, II, and III patients. While the number of CT datasets with early-stage cancer (I, II) is 134, the data samples with advanced-stage cancer (IIIa, IIIb) are 288. The dataset exhibited a significant class imbalance, with a higher number of advanced-stage (stage III) cases compared to early-stage (stage I and stage II) cases. To address this imbalance, oversampling was applied to the extracted radiomic features t...
Access restricted. Please log in or start a trial to view this content.
The robustness and reliability of the proposed framework are evident from the high values of evaluation metrics, including accuracy, recall, precision, and F-1 score24. All scores obtained over 90% performance on the test data with a 5-fold CV employed during MLP training.
The performance and validity of the proposed GL-RFE framework were further supported through visualization techniques. Correlation heatmaps25 in
Access restricted. Please log in or start a trial to view this content.
The authors declare that they have no competing financial interests.
Not Applicable
Access restricted. Please log in or start a trial to view this content.
| Name | Company | Catalog Number | Comments |
|---|---|---|---|
| 3D Slicer Software | Official Website | 5.x | Medical image visualization, segmentation, and ROI extraction for radiomics analysis |
| Imbalanced-learn Package | PyPI | 0.11+ | Handling class imbalance (e.g., SMOTE) |
| Matplotlib Package | PyPI | 3.x | Plotting training curves and feature importance |
| NumPy Package | PyPI | 1.26.x | Numerical operations and feature matrix handling |
| Pandas Package | PyPI | 2.x | Data preprocessing and structured dataset management |
| PyRadiomics Package | PyPI | 3.x | Extraction of radiomic features from CT images |
| PyTorch Package | PyPI | 2.x | Deep learning framework for MLP and gradient computation |
| Scikit-learn Package | PyPI | 1.3.x | Model evaluation (accuracy, precision, recall, F1-score) |
| SciPy Package | PyPI | 1.11+ | Statistical analysis and validation |
| Seaborn Package | PyPI | 0.13.x | Heatmaps for feature correlation analysis |
| Torch.nn Module | PyPI | 2.x | Neural network architecture (layers, activations) |
| Torch.optim Module | PyPI | 2.x | Optimization algorithms (e.g., Adam) |
Request permission to reuse the text or figures of this JoVE article
Request Permission