Skip to main content
. 2025 Feb 11;25(4):1086. doi: 10.3390/s25041086
Algorithm 1 Object Classification and Localization Using Processed Image Data.
  • Require: 

    Zipped image dataset Dzip

  • Ensure: 

    Trained multi-output CNN model

  •   1:

    Extract images from Dzip and load as dataset D

  •   2:

    Parse filenames to extract object types and coordinates, storing in DataFrame df

  •   3:

    Preprocess images in D and extract labels, resulting in feature array X, type labels ytype, and coordinate labels ycoords

  •   4:

    Split X, ytype, and ycoords into training and testing sets

  •   5:

    Convert ytype to one-hot encoded labels for each object type

  •   6:

    Define CNN model with convolutional layers for feature extraction

  •   7:

    Add classification and coordinate output layers

  •   8:

    Compile model with loss functions for classification and coordinate regression

  •   9:

    Train model on training data, using testing data for validation

  • 10:

    Return trained model