Published December 8, 2024 | Version v2

Dataset and software for processing of hyperspectral images of different CDW materials

  • 1. ROR icon Czech Technical University in Prague

Description

Overview

The provided scripts are designed to process hyperspectral images of construction and demolition waste (CDW) materials, extract relevant features, and train a machine-learning model for material classification. The scripts perform the following tasks:

  1. Feature Extraction: Extract spectral features from hyperspectral data.
  2. Background Removal and Subset Extraction: Remove backgrounds from images and extract subsets for analysis.
  3. Data Visualization: Generate plots to visualize the extracted features and reflectance curves.
  4. Machine Learning Model Training: Using the extracted features, train and evaluate a multilayer perceptron (MLP) classifier.

Prerequisites

Before running the scripts, ensure that you have the following:

  • Python 3.x installed on your system.
  • Required Python packages:
    • numpy
    • matplotlib
    • scipy
    • pandas
    • scikit-learn
    • seaborn
    • rembg (for background removal)
    • Pillow (PIL)
  • Hyperspectral data files in .mat format containing calibrated hyperspectral cubes and wavelength information.
  • A directory structure to organize input and output files as described in each script.

Scripts Description

1. hyperspectral_features_v2.py

Purpose

This script processes individual hyperspectral image files to extract spectral features from a central subset of the image. It generates RGB images from the hyperspectral data, plots the mean reflectance spectra, and outputs a LaTeX-formatted table containing the extracted features.

Functionality

  • Loading Data: Reads .mat files containing hyperspectral data from a specified input directory.
  • Feature Calculation:
    • Calculates mean reflectance within a central window of the image.
    • Extracts spectral features such as peak wavelength and area under the reflectance curve.
    • Records reflectance values at selected wavelengths, including standard RGB channels and additional wavelengths.
  • RGB Image Generation: Creates RGB images using specific wavelengths corresponding to the red, green, and blue channels.
  • Spectra Plotting: Plots the mean reflectance spectra for each sample.
  • LaTeX Table Generation: Produces a LaTeX-formatted table of the extracted features for inclusion in a report or paper.

Usage Instructions

  1. Prepare Input Data:

    • Place your .mat files containing the hyperspectral data in the appropriate input directory (e.g., input/mortar).
  2. Run the Script:

    • Modify the materials list at the end of the script to include the materials you want to process (e.g., materials = ['mortar']).
    • Execute the script:
      bash
       

Files

CDW_recognition_hyperspectral.zip

Files (14.4 GB)

Name Size
md5:eefe1bf7bd42e346018ab5b0821a2518
14.4 GB Preview Download

Additional details

Funding

European Commission
RECONMATIC - Automated solutions for sustainable and circular construction and demolition waste management 101058580

Dates

Available
2024-09-25

Software

Programming language
Python