A lung nodule is a small tumor in the lung. In a CT scan, it can be only a few millimeters wide and difficult to distinguish from blood vessels and other ordinary structures. Finding a nodule and deciding whether it is malignant are separate questions. section 11.4.1
A whole CT scan is a difficult starting point for a model: even when a nodule is present, nearly all voxels lie outside it. A practical first step is to examine one suspected location, or candidate, at a time. Some candidates are nodules; others are not. section 11.4.1 section 12.4.4
Figure 12.9 Cropping a candidate sample out of the larger CT voxel array using the candidate center’s array coordinate information (I,R,C)
The diagram shows how a candidate’s center is used to crop a small voxel array from the full CT scan. section 12.4.4
Turning candidate locations into model inputs involves three practical steps:
- Match annotations to candidates, allowing for small differences between recorded center coordinates. A roughly 5 mm nodule, for example, has centers listed about half a millimeter apart in two CSV files. section 12.2.1
- Convert the center from patient X, Y, Z coordinates to CT array coordinates, then crop a chunk around it. The example crop routine leaves out some boundary-handling complications. section 12.4.4
- Return the crop and its nodule-or-not label through a PyTorch Dataset. A dataset can collect samples from many CT scans without requiring the model to handle each scan separately. section 12.5
A candidate as a training sample
One LunaDataset sample contains a CT crop tensor, a label such as [0, 1] for a nodule, the scan identifier, and the candidate’s array-coordinate center. Sorting nodules by size and taking every Nth one for validation helps retain a spread of sizes in that set. section 12.5 section 12.2.1
To find suspected nodules across a scan, segmentation asks a different question: which pixels belong to an area of interest? CT data is three-dimensional, but the Segment Anything Model (SAM) accepts two-dimensional images, so individual CT slices are used. Point annotations must be turned into masks for training; this slice-based approach does not directly use the full 3D volume or exact slice thickness. section 15.6.1 section 15.6.2
A fine-tuned SegFormer can then segment nodule areas on unseen slices without the point prompt required by the initial SAM workflow. Those areas can be passed to a classification model. section 15.7.1
