How to enter HOG features as an input to a neural network?

7 views (last 30 days)
Hi,
I extracted the features by using HOG algorithm, I need to feed patterned with the extracted features. Could you please guide me?
This is my features, it's a vector of 150x324:
trainingFeatures = [trainingFeatures; features];
Thanks.
  2 Comments
swarmer
swarmer on 13 Feb 2017
I am having the same issue. I am doing this as the images I am putting into my convolutional neural network(CNN) are too large for my GPUs memory. I am then just breaking to down each image into several features and puting them into my CNN. However I am not sure how to do this either. Mariam, have you figured out how to do this yet?

Sign in to comment.

Answers (1)

laury
laury on 7 Aug 2023
Edited: laury on 7 Aug 2023
When using Histogram of Oriented Gradients (HOG) features as an input to a neural network, you typically follow these steps:
1. Preprocess the Image: Initially, you need to preprocess the image or input data on which you want to extract HOG features. Common preprocessing steps include resizing the image to a fixed size, converting it to grayscale, and applying any necessary normalization or enhancement techniques.
2. Compute HOG Features: Apply the HOG algorithm to the preprocessed image to extract the HOG features. The HOG algorithm calculates the gradient magnitude and orientation for various image patches and constructs a histogram of gradient orientations. Candy Crush
3. Feature Vector Representation: Convert the extracted HOG features into a feature vector representation. This involves flattening or concatenating the extracted HOG features to create a one-dimensional array or vector.
4. Scaling and Normalization: Perform scaling and normalization on the feature vector to ensure that the values fall within a desired range or have a specific distribution. Common techniques include min-max scaling, z-score normalization, or scaling to unit length.
5. Input Representation: Depending on the neural network architecture and framework you are using, you may need to reshape or reformat the feature vector to match the required input shape of the neural network. This could involve reshaping the feature vector into a suitable matrix or tensor representation.
6. Train or Utilize the Neural Network: Once the HOG features are appropriately prepared as input, you can train a neural network using labeled data or utilize a pre-trained neural network for various tasks such as classification, object detection, or image recognition.
It's important to note that the specific implementation details may vary depending on the programming language, libraries, and frameworks you are using. There are also pre-existing libraries like scikit-image or OpenCV that provide functions for extracting HOG features, which can simplify the process.

Categories

Find more on Recognition, Object Detection, and Semantic Segmentation in Help Center and File Exchange

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!