Multi-Objective PSO Based Block Selection for Face Recognition
收藏DataCite Commons2026-05-05 更新2026-05-07 收录
下载链接:
https://zenodo.org/doi/10.5281/zenodo.20044137
下载链接
链接失效反馈官方服务:
资源简介:
# MOPSO-Based Block Selection for Face Recognition
## Overview
This project implements a **Multi-Objective Particle Swarm Optimization (MOPSO)** framework for selecting the most discriminative facial image blocks to improve face recognition accuracy. The system extracts local texture features from image sub-regions and uses MOPSO to find the optimal subset of blocks that simultaneously **maximizes recognition accuracy** and **minimizes the Equal Error Rate (EER)**.
The dataset used is the **Yale Face Database B (15-subject subset)**, and the local texture descriptor used is **BSIF (Binarized Statistical Image Features)**.
---
## Project Structure
```project/│├── database_create.m # Step 1 — Feature extraction from facial images├── mopso_main.m # Step 2 — MOPSO optimization for block selection├── objfun.m # Step 3 — Objective function (called by MOPSO)│├── texturefilters/│ └── ICAtextureFilters_17x17_12bit.mat # Pre-trained BSIF filter bank│├── 15YALE/│ └── S{i}/{j}.gif # Yale face dataset: 15 subjects × 11 images each│└── data15YALE.mat # Output of database_create.m (saved feature matrix)```
---
## Pipeline Description
### Step 1 — Feature Extraction (`database_create.m`)
- Loads the 15-class Yale face dataset (15 subjects × 11 images).- Splits each image into a **4×4 grid** (16 blocks total).- Applies **BSIF** texture descriptor to each block to produce a local feature histogram.- Concatenates all block features into a global feature vector per image.- Partitions the dataset: - **Training set**: images 1–5 per subject (5 × 15 = 75 images) - **Test set**: images 6–11 per subject (6 × 15 = 90 images)- Saves the resulting `train_data`, `test_data`, `ids_train`, `ids_test` into `data15YALE.mat`.
### Step 2 — MOPSO Optimization (`mopso_main.m`)
- Loads the pre-computed feature matrix from `data15YALE.mat`.- Initializes a swarm of particles where each **particle represents a candidate block combination** (e.g., `[1, 4, 6, 11, 13]` — a selection of 5 out of 16 blocks).- Evolves the swarm over multiple iterations to find the **Pareto-optimal front** of block combinations.- Uses a **sigmoid-based discrete velocity update** to handle the combinatorial nature of the problem.- Maintains a **repository** of non-dominated solutions (the Pareto front).- Two objectives are optimized simultaneously: - **Objective 1 (maximize)**: Rank-1 recognition rate (CMC curve) - **Objective 2 (minimize)**: Equal Error Rate (EER)
### Step 3 — Objective Function (`objfun.m`)
- Receives a particle's position (a vector of block indices, e.g., `[2, 7, 9, 14, 5]`).- Assembles the training and test feature matrices by concatenating only the selected blocks' feature vectors.- Applies **Linear Discriminant Analysis (LDA)** for dimensionality reduction.- Evaluates the resulting representation using a **nearest-neighbor classifier** with Mahalanobis cosine distance.- Returns two objective values: - `obj(1)` = Rank-1 recognition rate (%) - `obj(2)` = −EER (%) *(negated so that MOPSO minimization minimizes the EER)*
---
## System Workflow Diagram
```Yale Dataset (15 subjects × 11 images) │ ▼ ┌─────────────────────┐ │ database_create.m │ ← Split into 4×4 blocks, extract BSIF per block └─────────────────────┘ │ ▼ data15YALE.mat (train_data, test_data, ids_train, ids_test) │ ▼ ┌─────────────────────┐ │ mopso_main.m │ ← Initialize swarm; each particle = block subset └─────────────────────┘ │ (calls at each evaluation) ▼ ┌─────────────────────────────────────────────────────────┐ │ objfun.m │ │ 1. Assemble features for selected blocks │ │ 2. LDA projection │ │ 3. NN classification (Mahalanobis cosine distance) │ │ 4. Return [Rank-1 Accuracy, −EER] │ └─────────────────────────────────────────────────────────┘ │ ▼ Pareto Front: optimal block combinations (saved in mopso_test{N}.mat)```
---
## Dependencies & External Functions
| Function | Description ||---|---|| `bsif(img, filters, 'nh')` | Extracts normalized BSIF histogram from an image patch || `mat2tiles(X, [r, c])` | Splits a matrix into a cell array of tiles || `perform_lda_PhD(data, ids)` | Trains an LDA model on the feature matrix || `linear_subspace_projection_PhD(data, model)` | Projects data onto the LDA subspace || `nn_classification_PhD(train, ids_tr, test, ids_te, dim, metric)` | Nearest-neighbor classification || `evaluate_results_PhD(results, 'ID')` | Computes CMC curves, EER, and other metrics || `CreateEmptyParticle`, `DetermineDomination`, `GetNonDominatedParticles` | MOPSO utility functions || `CreateHypercubes`, `GetGridIndex`, `SelectLeader`, `DeleteFromRep` | MOPSO archive management || `Dominates`, `GetCosts`, `PlotCost` | MOPSO evaluation helpers |
---
## Parameters
### Image Partitioning (`database_create.m`)| Parameter | Value | Description ||---|---|---|| `rows` | 4 | Number of block rows || `cols` | 4 | Number of block cols || Total blocks | 16 | Total image sub-regions |
### MOPSO (`mopso_main.m`)| Parameter | Value | Description ||---|---|---|| `nVar` | 5 | Number of blocks per particle (subset size) || `nPop` | 50 | Swarm population size || `nRep` | 100 | Maximum Pareto repository size || `MaxIt` | 10 | Number of MOPSO iterations || `phi1` | 2.05 | Cognitive acceleration coefficient || `phi2` | 2.05 | Social acceleration coefficient || `alpha` | 0.1 | Hypercube grid inflation || `nGrid` | 10 | Grid divisions per objective dimension || `beta` | 4 | Leader selection pressure || `gamma` | 2 | Repository deletion pressure |
---
## Output
- **`data15YALE.mat`**: Pre-computed feature matrix for all images and splits.- **`mopso_test{N}.mat`**: Full workspace snapshot after optimization, including the Pareto-front repository (`rep`), particle states, and cost history.- **Console output**: Per-iteration repository size and recognition results.- **Figure 1**: Live Pareto front plot (Rank-1 Accuracy vs. EER) updated each iteration.
---
## How to Run
1. Ensure the `15YALE/` dataset directory and `texturefilters/` folder are present.2. Run `database_create.m` to extract and save features: ``` >> run('database_create.m') ```3. Run `mopso_main.m` to start optimization (requires `data15YALE.mat`): ``` >> run('mopso_main.m') ```4. After completion, inspect `rep` in the saved `.mat` file for Pareto-optimal block combinations.
---
## Reference
> C. A. Coello Coello, M. S. Lechuga,> *"MOPSO: A Proposal for Multiple Objective Particle Swarm Optimization,"*> Proceedings of the 2002 Congress on Evolutionary Computation, pp. 1051–1056, 2002.
> J. Kannala and E. Rahtu,> *"BSIF: Binarized Statistical Image Features,"*> ICPR 2012.
提供机构:
Zenodo
创建时间:
2026-05-05



