Method Article

Radiomic Feature Selection Using Gradient Loss of Deep Neural Network for Lung Cancer Stage Detection

DOI:

10.3791/70181

April 30th, 2026

In This Article

Summary

Loading...
$$\rightleftharpoonup{xx}$$ $$\longleftharp{xx}$$, $$\longrightharp{xx}$$,

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.

Abstract

Loading...
$$\rightleftharpoonup{xx}$$ $$\longleftharp{xx}$$, $$\longrightharp{xx}$$,

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.

Introduction

Loading...
$$\rightleftharpoonup{xx}$$ $$\longleftharp{xx}$$, $$\longrightharp{xx}$$,

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 methodwas 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:

Mathematical formula for information theory; diagram of partial derivative summation calculation.   (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. Partial derivative mathematical expression, ∂Lj/∂xij, formula, differentiation process. 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.

Protocol

Loading...
$$\rightleftharpoonup{xx}$$ $$\longleftharp{xx}$$, $$\longrightharp{xx}$$,

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.

  1. Install and open 3D Slicer (use the latest stable release from https://download.slicer.org/.
  2. Install the PyRadiomics Extension and RT Slicer.
    1. In the menu bar, go to View > Extensions Manager. Then, search for Radiomics or SlicerRadiomics and RT Slicer.
    2. Click Install to install the RT Slicer and PyRadiomics libraries. Restart 3D Slicer after installation.
  3. Download NSCLC RADIOMICS.
    1. Download the CT lung DICOM datasets along with SEG, RTSTRUCT files of 422 patients from https://www.cancerimagingarchive.net/collection/nsclc-radiomics/
  4. Load lung CT DICOM data.
    1. Go to the DICOM module. Click Import and select the folder containing DICOM CT slices and their SEG file in RTSTRUCT modality.
    2. After import, double-click the patient/study/series to load it into the Slicer scene. The 3D CT volume should be visible in the viewer panel as shown in Figure 2.
  5. Check geometry alignment.
    1. In the Data module, expand both CT volume and segmentation. Ensure that the segmentation sits exactly over the CT (no misalignment).
  6. Open the Radiomics module.
    1. Select the Radiomics module from the module section (or search for it in the module search bar). In the Input Image Volume, select the desired CT volume.
    2. In Input Label/Segmentation, select the segmentation node (the ROI).
  7. Adjust extraction customization parameters.
    1. Set Resampled pixel spacing = [1,1,1] (ensures isotropic voxels) and Bin width = 25 (standard for CT). Set LoG Kernel size =2.0, 3.0, 4.0, 5.0.
  8. Run feature extraction.
    1. Click Apply. Software will now compute 3D first-order, shape, and texture features (GLCM, GLRLM, GLSZM, GLDM, and NGTDM). Display the table to verify the computed tables as shown in Figure 3. Output a csv file with all extracted features.
    2. Repeat the above process for all DICOM volumes downloaded from the NSCLC RADIOMICS dataset and save it as a single file “radiomics.csv”.

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.

  1. Format the radiomics dataset saved in csv format such that each row represents one patient/sample, and each column represents a feature. Include one label column for class labels.
  2. Open a new Jupyter notebook in Colab environment and start writing code by declaring the given below function definitions and built-in Python functions in step 2.3.
  3. Give command to install Pytorch, torchvision, scikit-learn, numpy, pandas matplotlib, and imbalanced-learn on top of the Jupyter notebook.
  4. Write a function files.upload() to take an input csv file from the user and store it in x and y variables.
  5. Normalize the stored data using the function scaler = StandardScaler() and scaler.fit_transform().
  6. Define a Multi-Layer Perceptron function MLP(nn.Module()) with configurable hidden layers.
  7. Define a training function def train_epoch() to compute back propagation loss from the MLP model with inputs.
  8. For a number of epochs, define a function def compute_input_gradients() to compute mean gradients of the loss with respect to input features and iteratively drop the feature with the lowest gradient, i.e., having less importance, till 15 features are left.
  9. Split the data in the ratio of 80% 20% using train_test_split() function with selected 15 features. Apply a 5-fold cross-validation using StratifiedKFold(n_splits=5) on the training data to ensure robustness.
  10. Create a large MLP neural network final_model = DNN().
  11. Evaluate the performance of the trained model using test data with the following functions: def plot_confusion_matrix(), accuracy_score(), precision_score(), recall_score(), f1_score(), heatmap().

3. Running the Jupyter notebook to build and test model

  1. Run the Python code in a Jupyter notebook. A prompt is received to upload the radiomics csv file, as shown in Figure 4.
  2. Upload the radiomics.csv.
  3. Save the classification results and generated graphs.

Access restricted. Please log in or start a trial to view this content.

Results

Loading...
$$\rightleftharpoonup{xx}$$ $$\longleftharp{xx}$$, $$\longrightharp{xx}$$,

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.

Discussion

Loading...
$$\rightleftharpoonup{xx}$$ $$\longleftharp{xx}$$, $$\longrightharp{xx}$$,

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.

Disclosures

Loading...
$$\rightleftharpoonup{xx}$$ $$\longleftharp{xx}$$, $$\longrightharp{xx}$$,

The authors declare that they have no competing financial interests.

Acknowledgements

Loading...
$$\rightleftharpoonup{xx}$$ $$\longleftharp{xx}$$, $$\longrightharp{xx}$$,

Not Applicable

Access restricted. Please log in or start a trial to view this content.

Materials

List of materials used in this article
NameCompanyCatalog NumberComments
3D Slicer SoftwareOfficial Website5.xMedical image visualization, segmentation, and ROI extraction for radiomics analysis
Imbalanced-learn PackagePyPI0.11+Handling class imbalance (e.g., SMOTE)
Matplotlib  PackagePyPI3.xPlotting training curves and feature importance
NumPy PackagePyPI1.26.xNumerical operations and feature matrix handling
Pandas PackagePyPI2.xData preprocessing and structured dataset management
PyRadiomics PackagePyPI3.xExtraction of radiomic features from CT images
PyTorch  PackagePyPI2.xDeep learning framework for MLP and gradient computation
Scikit-learn PackagePyPI1.3.xModel evaluation (accuracy, precision, recall, F1-score)
SciPy  PackagePyPI1.11+Statistical analysis and validation
Seaborn  PackagePyPI0.13.xHeatmaps for feature correlation analysis
Torch.nn Module PyPI2.xNeural network architecture (layers, activations)
Torch.optim ModulePyPI2.xOptimization algorithms (e.g., Adam)

Reprints and Permissions

Request permission to reuse the text or figures of this JoVE article

Request Permission

Tags

Radiomic Feature SelectionGradient LossDeep Neural NetworkLung Cancer DetectionCancer Stage DetectionRecursive Feature EliminationQuantitative Imaging BiomarkersComputed TomographyFeature ImportanceModel Generalization

Related Articles