Dataset Viewer
The dataset viewer is not available for this subset.
Cannot get the split names for the config 'default' of the dataset.
Exception:    SplitsNotFoundError
Message:      The split names could not be parsed from the dataset config.
Traceback:    Traceback (most recent call last):
                File "/usr/local/lib/python3.12/site-packages/datasets/inspect.py", line 289, in get_dataset_config_info
                  for split_generator in builder._split_generators(
                                         ^^^^^^^^^^^^^^^^^^^^^^^^^^
                File "/usr/local/lib/python3.12/site-packages/datasets/packaged_modules/folder_based_builder/folder_based_builder.py", line 237, in _split_generators
                  raise ValueError(
              ValueError: `file_name` or `*_file_name` must be present as dictionary key (with type string) in metadata files
              
              The above exception was the direct cause of the following exception:
              
              Traceback (most recent call last):
                File "/src/services/worker/src/worker/job_runners/config/split_names.py", line 65, in compute_split_names_from_streaming_response
                  for split in get_dataset_split_names(
                               ^^^^^^^^^^^^^^^^^^^^^^^^
                File "/usr/local/lib/python3.12/site-packages/datasets/inspect.py", line 343, in get_dataset_split_names
                  info = get_dataset_config_info(
                         ^^^^^^^^^^^^^^^^^^^^^^^^
                File "/usr/local/lib/python3.12/site-packages/datasets/inspect.py", line 294, in get_dataset_config_info
                  raise SplitsNotFoundError("The split names could not be parsed from the dataset config.") from err
              datasets.inspect.SplitsNotFoundError: The split names could not be parsed from the dataset config.

Need help to make the dataset viewer work? Make sure to review how to configure the dataset viewer, and open a discussion for direct support.

Dataset Card for Liver Tumor Classification (from LiTS)

Dataset Summary

This dataset contains processed instances derived from the Liver Tumor Segmentation Challenge (LiTS) dataset, adapted for a binary liver tumor classification task. The original 3D CT scans and segmentation masks have been processed into individual 2D slices.

Each data instance includes:

  • sample: The original CT slice obtained directly from the 3D scan.
  • w_sample: The windowed CT slice, processed from sample to enhance contrast for features relevant to liver tumors. This is the actual input typically used for neural network training/inference.
  • label: A binary label (Normal / Tumor present) assigned based on the segmentation mask.
  • mask: The original segmentation mask corresponding to the slice.

Image data (sample, w_sample, mask) is stored as individual .png files, and the corresponding classification label (label) along with image paths are stored in a central metadata.jsonl file.

Example Instance (ID: 960)

Below is a visual example of the data provided for a single instance:

Original Slice (sample) Windowed Slice (w_sample) Segmentation Mask (mask)
sample w_sample mask
images/sample/960.png images/w_sample/960.png images/mask/960.png

(Note: Mask values in the PNG are scaled for visualization: 0=Background, 127=Liver, 255=Tumor)


Dataset Structure

Data Organization

The dataset follows a structure optimized for use with the Hugging Face datasets library using image files and a metadata file:

  • metadata.jsonl: A JSON Lines file where each line is a JSON object representing one data instance. Each object contains paths to the image files and the classification label.
  • images/: A directory containing subdirectories for each image type.
    • images/sample/: Contains the original CT slice images (e.g., 0.png, 1.png, ...).
    • images/w_sample/: Contains the windowed CT slice images.
    • images/mask/: Contains the segmentation mask images. Note: Mask images store pixel values scaled for visualization (0 for Background, 127 for Liver, 255 for Tumor).

Example metadata.jsonl entry:

{"sample_path": "images/sample/0.png", "w_sample_path": "images/w_sample/0.png", "mask_path": "images/mask/0.png", "label": 0}

Loading with datasets library:

from datasets import load_dataset, Features, Image, Value
import os

# Define features to help the library interpret the data
features = Features({
    'sample_path': Image(decode=True),  # Load as PIL Image
    'w_sample_path': Image(decode=True), # Load as PIL Image
    'mask_path': Image(decode=False), # Load mask path as string or raw PIL without decoding colors
    'label': Value(dtype='int64')    # Label is integer
})

# Load from Hugging Face Hub
dataset_dict = load_dataset("seongun/liver-tumor-classification", features=features)

# Or load from a local directory containing metadata.jsonl and images/
local_data_path = './data/LiverTumor' # Adjust path as needed
dataset_dict = load_dataset('json', data_files={'train': os.path.join(local_data_path, 'metadata.jsonl')}, features=features)

dataset = dataset_dict['train']
print(dataset[0])
# Example Output (values depend on feature definition):
# {'sample_path': <PIL.PngImagePlugin.PngImageFile image mode=L size=512x512>,
#  'w_sample_path': <PIL.PngImagePlugin.PngImageFile image mode=L size=512x512>,
#  'mask_path': <PIL.PngImagePlugin.PngImageFile image mode=L size=512x512>,
#  'label': 0}

Data Fields

Field Name Description Data Type (Loaded) Original Meaning / Notes
sample_path Path to the original CT slice image PIL.Image Grayscale image (originally float64 [0,1], saved as uint8 [0,255])
w_sample_path Path to the windowed CT slice image PIL.Image Grayscale image (originally float64 [0,1], saved as uint8 [0,255])
mask_path Path to the segmentation mask image PIL.Image or str Grayscale image. Saved values: 0, 127, 255. Original labels: 0, 1, 2.
label Binary classification label for the slice int64 0: Normal, 1: Tumor

Note on Masks: The mask PNG files store scaled values (0, 127, 255) for easier visualization. When loading these masks for training or evaluation, the pixel values need to be mapped back to the original class labels (0, 1, 2). The provided PyTorch LiverTumorDataset class handles this conversion.


Additional Information

Dataset Curators

Seongun Kim (KAIST)

Licensing Information

The original LiTS dataset is licensed under CC-BY-NC-SA-4.0. As this dataset is a derivative work, it is released under the same CC-BY-NC-SA-4.0 license. You must give appropriate credit to the original LiTS creators (see Citation section), provide a link to the license, and indicate if changes were made. If you remix, transform, or build upon the material, you must distribute your contributions under the same license as the original. This dataset is intended for non-commercial research purposes.

License Deed: https://creativecommons.org/licenses/by-nc-sa/4.0/

Citation Information

If you use this dataset in your research, please consider citing the original LiTS publication and this dataset repository:

Original LiTS Publication:

@article{bilic2023liver,
  title={The liver tumor segmentation benchmark (lits)},
  author={Bilic, Patrick and Christ, Patrick and Li, Hongwei Bran and Vorontsov, Eugene and Ben-Cohen, Avi and Kaissis, Georgios and Szeskin, Adi and Jacobs, Colin and Mamani, Gabriel Efrain Humpire and Chartrand, Gabriel and others},
  journal={Medical image analysis},
  volume={84},
  pages={102680},
  year={2023},
  publisher={Elsevier}
}

This Dataset Repository:

@misc{seongun_liver_2025,
  author={Kim, Seongun},
  title={Liver Tumor Classification derived from LiTS},
  year={2025},
  publisher={Hugging Face},
  journal={Hugging Face Hub},
  howpublished = {\url{https://huggingface.co/datasets/seongun/liver-tumor-classification}}
}
Downloads last month
188

Models trained or fine-tuned on seongun/liver-tumor-classification