Balance number of feature after adaptive k-means clustering

2 views (last 30 days)
Hi, I need to classify medical images into 2 different classes (images that contains bleeding and image that NOT contains a bleeding); at the end of my pipeline I have used adaptive k-means clustering in order to identify different colour clusters. Now I'm going to obtain the feature vector in order to train the data with SVM.
The features are the mean values R,G,B for each cluster,but the problem is that the length of feature vector varying for each image since adaptive k-means gives a different number of clusters.
In particular I have images with 12 features (4 clusters), images with 15 features (5 clusters) and images with 9 features (3 clusters).
Can you suggest me a metholodogy to balance the features in order to obtain a feature matrix for the training by SVM?
Here my code:
%%%%adaptive k-means clustering
[clusteredImage,center] = adaptcluster_kmeans(ImagetoSegment);
%%%save features into a matrix
featureMatrix = [featureMatrix; center(:)'];
and the error:
Error using vertcat
Dimensions of matrices being concatenated are not consistent.
Error in main (line 61)
featureMatrix = [featureMatrix; center(:)'];
Thanks in advance

Answers (0)

Categories

Find more on Statistics and Machine Learning Toolbox 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!