Documentation  ›  Documentation Library  ›  Region Growing Studio
AI & Machine Learning

Region Growing Studio

Region Growing Studio creates connected image regions from user-selected seed locations. Neighboring pixels are added when they satisfy the selected similarity criterion.

Overview

Region Growing Studio creates connected image regions from user-selected seed locations. Neighboring pixels are added when they satisfy the selected similarity criterion.

Each completed region is stored as an ROI object. ROI objects can be inspected, recolored, merged, deleted, exported, and assigned to supervised training classes.

Multiple spatially separate ROIs can belong to the same training class.

Basic Region-growing Workflow

3. Review the automatically estimated Threshold and adjust it if needed.

5. Click Start Segmentation.

6. Click the image to place a seed. A connected region is generated immediately.

7. Repeat to create additional ROI objects.

8. Press Stop Segmentation, Esc, Enter, right-click, or double-click when finished.

Intensity - compares the 2-D guide-image intensity with the seed intensity.

RGB distance - compares RGB vectors using Euclidean distance. Intended primarily for RGB data.

Spectral L1 - compares full hyperspectral vectors using the sum of absolute spectral differences.

Spectral angle - compares spectral shape using the spectral angle in radians. Smaller angles indicate more similar spectral shape.

Texture (Std) - compares local standard-deviation texture.

Texture (Entropy) - compares local entropy texture.

Disk seeds average a circular neighborhood around the clicked position. Larger seeds can be more robust in noisy images but may mix different materials when placed near boundaries.

The threshold controls how different a neighboring pixel may be from the seed reference and still join the region.

Lower values are more selective and usually produce smaller regions.

Higher values are more permissive and usually produce larger regions.

The numerical scale depends on the selected method, so threshold values should not be compared directly between different methods.

Texture methods use an odd-sized local neighborhood.

Larger windows measure texture over a broader area but reduce sensitivity to fine spatial detail.

Each segmented ROI is listed in the Objects table.

Select one or more rows to highlight ROI objects and display their mean spectra.

The Class column in the Objects table is editable.

Edit the Class value to assign each ROI to a biological, material, tissue, or other user-defined training class.

ROI 1, ROI 2, and ROI 3 are separate spatial regions, but they all belong to the same Tumor training class.

ROI 4 and ROI 5 belong to the Normal class.

Regions with the same Class name are grouped together during model training.

Class names are case-insensitive for grouping. For example, Tumor and tumor are treated as the same class by the class-assignment logic.

Color is used as a visual representation of class membership.

When an ROI is renamed to an existing Class name, IDCubePro assigns it the same color as the other ROIs in that class.

The Class name is the actual classifier label.

Color alone does not define the training class.

This distinction is important: two ROIs should be considered the same training class because they share the same Class name, not simply because they happen to have similar colors.

Delete - removes the selected ROI object or objects.

Recolor - changes the display color of selected objects.

Merge - combines exactly two selected ROI objects into one spatial region.

Undo - removes the most recently created ROI object.

Reset - clears all ROI objects, class assignments, overlays, prediction maps, and the trained classifier.

Eraser - interactively removes pixels from ROI objects. Drag over the image while Eraser is active.

For hyperspectral data, the lower panel displays the mean spectrum of each selected ROI.

When a wavelength vector is available in the loaded IDCube dataset, wavelength values are used on the x-axis.

Otherwise, spectral channel numbers are displayed.

Selecting several ROIs allows their mean spectra to be compared directly.

The supervised classification workflow is:

1. Create several representative ROI objects using region growing.

2. Edit the Class column in the Objects table.

3. Assign multiple representative ROIs to each class.

4. Create at least two different class names.

5. Select SVM or Random Forest.

7. Review the Model Training Results window.

8. Click Predict to classify the entire image.

Example Classification Workflow

Suppose the goal is to classify Tumor and Normal tissue.

Create several ROIs from different Tumor locations and several ROIs from different Normal locations.

When Train Model is pressed, all pixels from ROI 1-3 are labeled as Tumor and all pixels from ROI 4-6 are labeled as Normal.

The model therefore learns two classes, not six classes.

WHY USE MULTIPLE ROIS PER CLASS?

Using several spatially separated ROIs helps capture natural within-class variability.

For example, different Tumor regions may vary in intensity, local tissue environment, or spectral response while still belonging to the same biological class.

Training from only one small ROI may cause the model to learn characteristics that are specific to that location rather than representative of the full class.

Whenever practical, use several clean and representative ROIs for each class.

SVM - trains a multiclass error-correcting output-code classifier using the ROI spectra.

Five-fold cross-validation is used to estimate validation accuracy.

Random Forest - trains a 50-tree TreeBagger classifier.

Out-of-bag error is used to estimate validation accuracy.

Train Model collects spectra from all ROI objects and groups them according to their Class names.

ROIs sharing the same Class name receive the same numeric training label.

Very large ROIs are limited to a maximum number of randomly sampled pixels per ROI to control training size.

Each spectral band is standardized before model fitting.

The selected classifier is then trained and model-performance statistics are calculated.

After training, IDCubePro opens the Model Training Results window.

  • Number of ROI regions assigned to each class

Training Accuracy measures how accurately the trained model predicts the same training pixels used to fit the classifier.

A high training accuracy means the model fits the training data well.

Training accuracy alone does not demonstrate that the classifier will generalize to new pixels or new datasets.

Validation Accuracy provides an estimate of performance on data withheld during internal model validation.

For SVM, IDCubePro uses five-fold cross-validation.

For Random Forest, out-of-bag prediction error is used.

Validation accuracy is generally more informative than training accuracy when evaluating model performance.

Important Note About Very High Accuracy

It is possible to obtain very high or even 100% training and validation accuracy.

This should not automatically be interpreted as perfect classification performance.

Pixels within the same hyperspectral ROI are spatially and spectrally related. Randomly partitioning pixels from the same ROI across training and validation subsets can therefore make the validation task easier than classifying a completely independent region or dataset.

For rigorous performance evaluation, test the trained approach on independent ROIs, independent images, or independent experimental samples whenever possible.

The confusion matrix summarizes classifier performance by class.

Rows represent the known training classes.

Columns represent the classes predicted by the model.

Diagonal values are correctly classified pixels.

Off-diagonal values represent pixels assigned to the wrong class.

For example, if the Tumor row contains:

then 4,520 Tumor training pixels were classified as Tumor and none were classified as Normal.

A confusion matrix with large diagonal values and small off-diagonal values indicates good class separation in the evaluated data.

After a model has been trained, click Predict.

IDCubePro standardizes every pixel spectrum using the same normalization parameters used during training.

The trained classifier then assigns every image pixel to one of the defined training classes.

The resulting prediction map is displayed using the class colors.

For example, all pixels predicted as Tumor use the Tumor class color, while Normal pixels use the Normal class color.

Important Classification Notes

  • Create representative ROIs for every class you want the model to recognize.
  • At least two different Class names are required for classification.
  • Use several ROIs per class when possible.
  • Avoid mixed pixels and uncertain boundaries when defining training regions.
  • Avoid using background pixels inside tissue/material classes unless background is intentionally defined as its own class.
  • Similar numbers of representative training pixels per class are preferable when practical.
  • Inspect the mean spectra of selected ROIs to confirm that the training regions are sensible.
  • High training accuracy alone does not prove that the classifier generalizes.
  • Validation accuracy should also be interpreted cautiously when pixels from the same ROI contribute to multiple validation folds.
  • Independent-image or independent-sample validation provides stronger evidence of generalization.
  • The model is trained using the current spectral band structure.
  • Applying a model conceptually to another dataset requires compatible wavelengths, preprocessing, calibration, and band ordering.

Region Growing Vs Classification

Region growing and supervised classification serve different purposes.

Region growing creates connected ROI objects from local seed-based similarity.

Classification uses those ROI objects as labeled examples and then predicts class membership across the complete image.

Therefore, a region-growing result is not automatically a final classification.

The region-growing ROIs define the training information; Predict performs the full-image classification.

Export Results creates an analysis folder containing:

  • class_map.mat and class_map.csv
  • mean_spectra.csv when multi-band data are available

The exported class map contains the predicted numeric class labels when prediction has been performed.

Right-click the segmentation overlay and choose Save as a Label File to save the combined region mask, ROI objects, and current class map to a MAT-file.

Esc - exits segmentation or eraser mode.

Enter - stops active segmentation mode.

Right-click or double-click while segmenting - stops segmentation mode.

Recommended Training Practice

1. Choose representative regions away from uncertain boundaries.

2. Use multiple spatial locations when possible.

3. Inspect the mean spectra.

4. Assign all representative ROIs the same Class name.

7. Inspect validation accuracy and the confusion matrix.

8. Predict the complete image.

9. Visually inspect whether the prediction is scientifically plausible.

10. Validate on independent data whenever quantitative performance matters.

Region growing is a local connected segmentation method.

Its result depends on the seed, threshold, similarity metric, image preprocessing, noise, and spectral/spatial heterogeneity.

A segmented ROI should therefore be interpreted as pixels satisfying the selected computational criterion, not automatically as a validated biological or material class.

Likewise, a predicted class represents the output of the trained statistical model and should be validated against appropriate ground truth before strong scientific conclusions are made.