Skip to content

Latest commit

 

History

24 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

This repository contains code and resources that were utilized in the following paper:

Lung Cancer Identification from CT Scans using a Soft-attention enabled Deep Transfer Learning Model
S. Dev, P. S. Roy, N. Chakraborty and R. Sarkar
Published in: IEEE ISACC 2025
Paper: https://doi.org/10.1109/ISACC65211.2025.10969319

If you use this code or find it helpful, please consider citing the paper.

@inproceedings{10969319,
  author    = {S. Dev, P. S. Roy, N. Chakraborty and R. Sarkar},
  title     = {Lung Cancer Identification from CT Scans using a Soft-attention enabled Deep Transfer Learning Model},
  booktitle = {2025 3rd International Conference on Intelligent Systems, Advanced Computing and Communication (ISACC)},
  pages     = {254-259},
  year      = {2025},
  doi       = {10.1109/ISACC65211.2025.10969319}
}

You can download the paper here as well IEEE ISACC 2025 10969319


Sample images from datasets, diagnosed as either lung cancer or healthy.

image

Datasets used

In this research, three popular datasets which are publicly available, are considered for training and evaluating the proposed system. These datasets are relatively small and provide the necessary challenges that tend to pose limitations of the DL models. The details of the considered datasets are provided in the following sub-sections:

IQ-OTH/NCCD

The dataset comprises CT scans of patients at various stages of lung cancer and healthy subjects, marked by oncologists and radiologists. The dataset consists of 1190 CT scan images from 110 cases, categorized into three classes: normal (55 cases), benign (15 cases), and malignant (40 cases). Table 1 shows the organization of the IQ-OTH/NCCD dataset.

Screenshot 2024-11-09 040000

LC25000

This dataset consists of 25,000 histopathological images, divided into five distinct classes. We consider only three classes namely, Lung Benign tissue, Lung Adenocarcinoma and Lung Squamous cell carcinoma. As depicted in Table 2, each class contains ≈ 5000 images divided into 80% training set while validation and test sets having 10% images each. All images are 768×768 pixels in size and are in jpeg file format. The dataset contains histopathological images of lung and colon tissues. Since our work is centered around lung cancer, we would only be considering the lung image set comprising 15000 images.

Screenshot 2024-11-09 040304

LIDC-IDRI

This dataset consists of diagnostic and lung cancer screening thoracic CT scans with marked-up annotated lesions. It is a web-accessible international resource for development, training, and evaluation of CAD methods for lung cancer detection and diagnosis.The dataset consists of 2066 images distributed across a train set of 1323 images, a test set of 413 images and a validation set of 330 images. Each set further has data distributed across 3 subclasses viz., benign and malignant. This dataset comprises diagnostic and lung cancer screening thoracic CT scans with annotated lesions.

image

Pre-trained DL Models

Here, two base models called MobileNetV2 and DenseNet121 are explored for understanding the efficiency in lung cancer identification. In both the cases, an input image of size 224×224×3 from the lung cancer image dataset

MobilenetV2

In MobileNetV2, there are two types of blocks. As shown in Fig. 3, one is residual block with stride of and Another one is block with stride of 2 for downsizing. There are 3 layers for both types of blocks. This time, the first layer is 1×1 convolution with ReLU6. The second layer is the depthwise convolution. The third layer is another 1×1 convolution but without any non-linearity. It is claimed that if ReLU is used again, the deep networks only have the power of a linear classifier on the non-zero volume part of the output domain. And there is an expansion factor t. And t=6 for all main experiments. If the input got 64 channels, the internal output would get 64×t=64×6=384 channels where t: expansion factor, c: number of output channels, n: repeating number, s: stride. 3×3 kernels are used for spatial convolution. In typical use, the primary network (width multiplier 1, 224×224), has a computational cost of 300 million multiply-adds and uses 3.4 million parameters. The performance tradeoffs are further explored, for input resolutions from 96 to 224, and width multipliers of 0.35 to 1.4. The network computational cost up to 585M MAdds, while the model size varies between 1.7M and 6.9M parameters. To train the network, 16 GPUs are used with a batch size of 96.

image

DenseNet121

In DenseNet121, there are two types of layers: convolutional layers within dense blocks and transition layers for down-sampling as depicted in Fig. 4. Each dense block consists of multiple layers where each layer receives input from all preceding layers. There are 3 key operations in each dense block layer. The first is a 1×1 convolution followed by ReLU. The second is a 3×3 convolution, and the third operation is concatenation of the input with its preceding layers’ outputs, promoting feature reuse. There is a growth rate k that determines the number of output channels per layer. For all main experiments, k is typically set to 32. If the input has 64 channels, after one layer, the output would have 64 + k = 64 + 32 = 96 channels. Transition layers, which include a 1×1 convolution followed by 2×2 average pooling, are used for down-sampling between dense blocks. These layers help control the complexity of the network and manage the size of the feature maps. image

Soft Attention Scheme

As the primary aim of our experiment was to develop a lightweight model we have implemented a soft attention [28] in our model. Soft attention is an attention mechanism where the model calculates a weighted sum of all the elements in the input image. The "soft" aspect refers to the fact that the attention distribution is continuous and differentiable, meaning the model can focus on multiple parts of the input to varying degrees rather than selecting just one part. Here the soft attention unit accepts a feature tensor T of size rcd generated by the output Om from Eqn. (1) and applies convolution on T by employing a 3D kernel of size 3×3×d which produces a feature map Fatt of size rc×1. Thus for n such kernels, feature maps of size rcn get generated. These feature maps undergo normalization using the softmax function and merging to determine a soft attention score image given by

Screenshot 2024-11-09 045503

The final weighted feature outcome is given by image in Eqn. (3) where the features in Fatt is multiplied with image to enhance the significance of the relevant feature values. This product is re-scaled by a learning weight . Finally, the re-scaled weighted features are added with the original feature of image to aid in performing optimal selection of feature map regions that are more relevant in the identification of a lung cancer class.

image

An overview of the proposed system.

image

Experimental Setup

All the experimentation has been performed on Kaggle Notebook editor. We have utilized Kaggle’s GPU T4-X2 as an accelerator. Additionally for all the datasets we have ensured the same hyperparameters values as listed in Table 4. We preprocess lung cancer images from each dataset.

image

Result

For IQOTH

For Densenet121

Screenshot 2024-11-09 044155

Test Loss: 0.03285326808691025

Test Accuracy: 0.9954545497894287

Confusion Matrix

f89598ae-09b4-4abc-9c12-18ed119d1596

Test Accuracy vs Epochs

bbefaf63-22f0-4e3f-ae1e-29d53d1dd8c8

Loss Curve

4e0e7d81-5238-4640-aed4-93af842cc040

For MobileNetv2

Screenshot 2024-11-09 044304

Test Loss: 0.06389608979225159

Test Accuracy: 0.9863636493682861

Confusion Matrix

305119ce-0fa6-4e19-ab71-dca2dff8c90d

Test Accuracy vs Epochs

3cb91f12-4b81-40f5-8bd4-4eea12f4f978

Loss Curve

4ad23f52-b902-4ba4-9f83-a3834fe0cd37

For LC25000

For DenseNet121

Screenshot 2024-11-09 043633

Test Loss: 0.2601519525051117

Test Accuracy: 0.9673333168029785

Confusion Matrix

6c7a7342-0362-4b1a-8bcc-50bf9fd33615

Test Accuracy vs Epochs

ec7fca03-f752-4c6a-9228-d9ac1d80727e

Loss Curve

95b36237-e8ea-42bf-b826-7a8532e93581

For MobileNetv2

Screenshot 2024-11-09 043525

Test Loss: 0.1851891279220581

Test Accuracy: 0.968666672706604

Confusion Matrix

bf547ed1-9b26-4340-b05f-0ae718d3176f

Test Accuracy vs Epochs

cf2c0010-f383-4035-9d56-0d41995703c5

Loss Curve

15d0027c-c414-4901-bab9-6b68a7c13648

For LIDC

For Densenet121

Screenshot 2024-11-09 043804

Test Loss: 0.11375235766172409

Test Accuracy: 0.9491525292396545

Confusion Matrix

eed2519d-482e-4e83-8d2d-aac23f0464cd

Test Accuracy vs Epochs

9063aee9-11d3-4a47-9963-d6eae9494b3b

Loss Curve

31af7817-79a9-491a-a83f-cc021ffd4f0b

For MobileNetv2

Screenshot 2024-11-09 043904

Test Loss: 0.28500422835350037

Test Accuracy: 0.9200968742370605

Confusion Matrix

a59614d6-98cd-4b58-9322-8625c9ad34ee

Test Accuracy vs Epochs

f497f662-4afb-4c79-9291-32dc1b242793

Loss Curve

794bfe62-e017-478a-8a2b-31ab50f9de05

About

Soft attention transfer learning for lung cancer identification on CT and histopathology scans. Datasets: IQ-OTH/NCCD, LC25000, LIDC-IDRI. Published at IEEE ISACC 2025.

Topics

Resources

Stars

5 stars

Watchers

1 watching

Forks

Releases

Packages

Used by

Contributors

Languages