Gis, Qgis, ArcGis  Experts Just a Click Away

Satellite Imagery Classification in QGIS

How to Classify Satellite Imagery in QGIS

Satellite imagery classification is a fundamental technique in remote sensing that allows you to categorize pixels in satellite images into meaningful land cover classes such as water, vegetation, urban areas, and bare soil. QGIS, as a powerful open-source GIS software, provides robust tools for performing both supervised and unsupervised classification of satellite imagery.

This comprehensive guide will walk you through the entire process of classifying satellite imagery in QGIS, from data preparation to accuracy assessment.

Prerequisites

Software Requirements

  • QGIS 3.16 or later (Long Term Release recommended)
  • Semi-Automatic Classification Plugin (SCP) – Essential for classification workflows
  • GDAL tools (typically included with QGIS installation)

Data Requirements

  • Satellite imagery (Landsat, Sentinel-2, or other multispectral data)
  • Training data (vector polygons or points for supervised classification)
  • Reference data for accuracy assessment (optional but recommended)

Basic Knowledge

  • Familiarity with QGIS interface and basic operations
  • Understanding of remote sensing principles
  • Basic knowledge of raster data formats

Step 1: Data Preparation

Importing Satellite Imagery

  1. Open QGIS and create a new project
  2. Add raster layers by going to Layer → Add Layer → Add Raster Layer
  3. Select your satellite imagery files (typically .tif or .img format)
  4. If working with multiple bands, create a virtual raster to combine them:
    • Go to Raster → Miscellaneous → Build Virtual Raster
    • Select all relevant spectral bands
    • Choose appropriate output location and filename

Data Preprocessing

Before classification, ensure your imagery is properly prepared:

Atmospheric Correction

  • Convert Digital Numbers (DN) to surface reflectance values
  • Use the Semi-Automatic Classification Plugin’s preprocessing tools
  • Go to SCP → Preprocessing → Landsat (or respective satellite platform)

Band Combination and Composite Creation

  • Create false color composites for better visualization
  • Common combinations:
    • Natural Color: Red-Green-Blue (RGB)
    • False Color Infrared: Near-Infrared-Red-Green (NIR-R-G)
    • Urban: SWIR2-SWIR1-Red for urban area analysis

Step 2: Installing and Setting Up Semi-Automatic Classification Plugin

Plugin Installation

  1. Go to Plugins → Manage and Install Plugins
  2. Search for “Semi-Automatic Classification Plugin”
  3. Click Install Plugin
  4. Restart QGIS if required

Initial Setup

  1. Access SCP through the SCP toolbar or Plugins menu
  2. Open the SCP dock for easy access to tools
  3. Configure the Band set by adding your satellite imagery bands
  4. Set up the working directory for temporary files

Step 3: Supervised Classification

Supervised classification requires training samples that represent different land cover classes.

Creating Training Data

Method 1: Manual Digitization

  1. Create a new vector layer: Layer → Create Layer → New Shapefile Layer
  2. Set geometry type to Polygon
  3. Add fields for class ID and class name
  4. Start editing and digitize training polygons for each land cover class
  5. Assign class IDs (e.g., 1=Water, 2=Vegetation, 3=Urban, 4=Bare Soil)

Method 2: Using SCP Training Input

  1. Open SCP → Training input
  2. Create new training input file
  3. Use the ROI pointer tool to create Regions of Interest (ROI)
  4. Assign macroclass and class IDs for each ROI
  5. Save training signatures for use in classification

Defining Land Cover Classes

Establish clear class definitions:

  • Water: Rivers, lakes, reservoirs, coastal waters
  • Vegetation: Forests, grasslands, agricultural crops
  • Urban/Built-up: Buildings, roads, industrial areas
  • Bare Soil: Exposed earth, construction sites, beaches
  • Additional classes as needed for your study area

Running Supervised Classification

Using Maximum Likelihood Algorithm

  1. Go to SCP → Classification → Classification
  2. Select Maximum Likelihood algorithm
  3. Choose your training input file
  4. Set output classification path and filename
  5. Configure advanced parameters if needed
  6. Click Run to execute classification

Alternative Algorithms

  • Minimum Distance: Faster but less accurate
  • Spectral Angle Mapping: Good for distinguishing similar materials
  • Random Forest: Machine learning approach (requires additional setup)

Step 4: Unsupervised Classification

Unsupervised classification automatically groups pixels based on spectral similarity without prior training data.

K-Means Clustering

  1. Go to Processing Toolbox → SAGA → Imagery – Classification
  2. Select K-Means Clustering for Grids
  3. Input: Your satellite imagery raster
  4. Set number of clusters (typically 5-10 for initial analysis)
  5. Run the algorithm
  6. Interpret and label the resulting clusters based on visual inspection

ISO Cluster Analysis

  1. Access through SCP → Classification → Classification
  2. Select ISO Data algorithm
  3. Set number of classes and iterations
  4. Run classification
  5. Post-process to assign meaningful class labels

Step 5: Post-Processing and Refinement

Filtering and Smoothing

Remove isolated pixels and smooth classification results:

  1. Majority Filter: Processing → GDAL → Raster Analysis → Sieve
  2. Morphological operations: Use SAGA or GRASS tools
  3. Manual editing: Create vector polygons to correct obvious errors

Class Aggregation

Combine similar classes or reassign misclassified pixels:

  1. Use Raster Calculator for class recoding
  2. Reclassify tool: Processing → GDAL → Raster Analysis → Reclassify by table
  3. Manual reclassification using SCP reclassification tools

Step 6: Accuracy Assessment

Collecting Reference Data

  1. Generate random points: Vector → Research Tools → Random Points Inside Polygons
  2. Visual interpretation using high-resolution imagery
  3. Field verification (if possible and practical)
  4. Create reference classification map

Confusion Matrix Analysis

  1. Go to SCP → Post-processing → Accuracy
  2. Load classification and reference data
  3. Generate confusion matrix
  4. Calculate accuracy metrics:
    • Overall Accuracy: Percentage of correctly classified pixels
    • Producer’s Accuracy: Accuracy for each reference class
    • User’s Accuracy: Reliability of each classified class
    • Kappa Coefficient: Statistical measure of agreement

Error Analysis

  • Identify problematic classes with low accuracy
  • Analyze confusion patterns between similar classes
  • Plan improvements for future classifications

Step 7: Visualization and Output

Styling Classification Results

  1. Right-click on classification layer → Properties
  2. Go to Symbology tab
  3. Set Render type to Paletted/Unique values
  4. Assign colors and labels to each class
  5. Create legend with meaningful class names

Creating Maps and Reports

  1. Use Print Layout to create professional maps
  2. Add essential elements:

Exporting Results

  • GeoTIFF format: Maintains georeferencing and can be used in other GIS software
  • Shapefile: Convert to vector format using Polygonize tool
  • PDF maps: High-quality output for presentations and reports

Best Practices and Tips

Data Quality

  • Use cloud-free imagery or apply cloud masking
  • Ensure consistent seasonal conditions across your study area
  • Consider atmospheric conditions and apply appropriate corrections

Training Data Quality

  • Collect representative samples for each land cover class
  • Ensure spatial distribution across the entire study area
  • Use adequate sample sizes (minimum 30 pixels per class recommended)
  • Verify training data accuracy through field validation or high-resolution imagery

Classification Strategy

  • Start with broad classes and refine as needed
  • Consider hierarchical classification for complex landscapes
  • Use multiple dates for improved accuracy in dynamic environments
  • Combine spectral and spatial information when possible

Common Challenges and Solutions

Mixed Pixels

  • Problem: Pixels containing multiple land cover types
  • Solution: Use sub-pixel classification techniques or higher resolution imagery

Spectral Confusion

  • Problem: Different classes with similar spectral signatures
  • Solution: Incorporate additional bands, indices, or temporal information

Shadow and Topographic Effects

  • Problem: Terrain shadows affecting classification accuracy
  • Solution: Apply topographic correction or use normalized indices

Advanced Techniques

Spectral Indices Integration

Enhance classification by incorporating vegetation and water indices:

  • NDVI (Normalized Difference Vegetation Index)
  • NDWI (Normalized Difference Water Index)
  • Built-up indices for urban mapping

Multi-temporal Classification

Use time-series data for improved accuracy:

  • Stack multiple dates as additional bands
  • Apply change detection techniques
  • Use phenological information for vegetation mapping

Object-Based Classification

For higher resolution imagery:

  • Segment imagery using mean-shift or watershed algorithms
  • Extract object features (spectral, spatial, textural)
  • Apply machine learning classifiers to objects

Satellite imagery classification in QGIS provides a powerful and accessible approach to land cover mapping and environmental monitoring. The combination of QGIS’s core functionality with the Semi-Automatic Classification Plugin offers comprehensive tools for both supervised and unsupervised classification workflows.

Success in satellite imagery classification depends on careful attention to data quality, appropriate algorithm selection, thorough accuracy assessment, and iterative refinement of results. With practice and attention to best practices, QGIS can produce high-quality land cover classifications suitable for scientific research, environmental management, and policy decision-making.

Remember that classification is often an iterative process requiring multiple rounds of refinement, validation, and improvement. Start with simple classifications and gradually increase complexity as you gain experience with the tools and techniques available in QGIS.

Leave a Reply

Gabby Jones

Typically replies within a minute

Hello, Welcome to the site. Please click below button for chating me throught WhatsApp.