
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
- Open QGIS and create a new project
- Add raster layers by going to Layer → Add Layer → Add Raster Layer
- Select your satellite imagery files (typically .tif or .img format)
- 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
- Go to Plugins → Manage and Install Plugins
- Search for “Semi-Automatic Classification Plugin”
- Click Install Plugin
- Restart QGIS if required
Initial Setup
- Access SCP through the SCP toolbar or Plugins menu
- Open the SCP dock for easy access to tools
- Configure the Band set by adding your satellite imagery bands
- 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
- Create a new vector layer: Layer → Create Layer → New Shapefile Layer
- Set geometry type to Polygon
- Add fields for class ID and class name
- Start editing and digitize training polygons for each land cover class
- Assign class IDs (e.g., 1=Water, 2=Vegetation, 3=Urban, 4=Bare Soil)
Method 2: Using SCP Training Input
- Open SCP → Training input
- Create new training input file
- Use the ROI pointer tool to create Regions of Interest (ROI)
- Assign macroclass and class IDs for each ROI
- 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
- Go to SCP → Classification → Classification
- Select Maximum Likelihood algorithm
- Choose your training input file
- Set output classification path and filename
- Configure advanced parameters if needed
- 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
- Go to Processing Toolbox → SAGA → Imagery – Classification
- Select K-Means Clustering for Grids
- Input: Your satellite imagery raster
- Set number of clusters (typically 5-10 for initial analysis)
- Run the algorithm
- Interpret and label the resulting clusters based on visual inspection
ISO Cluster Analysis
- Access through SCP → Classification → Classification
- Select ISO Data algorithm
- Set number of classes and iterations
- Run classification
- Post-process to assign meaningful class labels
Step 5: Post-Processing and Refinement
Filtering and Smoothing
Remove isolated pixels and smooth classification results:
- Majority Filter: Processing → GDAL → Raster Analysis → Sieve
- Morphological operations: Use SAGA or GRASS tools
- Manual editing: Create vector polygons to correct obvious errors
Class Aggregation
Combine similar classes or reassign misclassified pixels:
- Use Raster Calculator for class recoding
- Reclassify tool: Processing → GDAL → Raster Analysis → Reclassify by table
- Manual reclassification using SCP reclassification tools
Step 6: Accuracy Assessment
Collecting Reference Data
- Generate random points: Vector → Research Tools → Random Points Inside Polygons
- Visual interpretation using high-resolution imagery
- Field verification (if possible and practical)
- Create reference classification map
Confusion Matrix Analysis
- Go to SCP → Post-processing → Accuracy
- Load classification and reference data
- Generate confusion matrix
- 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
- Right-click on classification layer → Properties
- Go to Symbology tab
- Set Render type to Paletted/Unique values
- Assign colors and labels to each class
- Create legend with meaningful class names
Creating Maps and Reports
- Use Print Layout to create professional maps
- Add essential elements:
- Title and subtitle
- Legend with class descriptions
- Scale bar and north arrow
- Data sources and projection information
- Accuracy statistics summary
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.