File Exchange

image thumbnail

Feature fusion using Discriminant Correlation Analysis (DCA)

version 1.0.1 (3.82 KB) by Mohammad Haghighat
Feature fusion using Discriminant Correlation Analysis (DCA)


Updated 31 Jan 2020

From GitHub

View Version History

View license on GitHub

Feature fusion is the process of combining two feature vectors to obtain a single feature vector, which is more discriminative than any of the input feature vectors.
DCAFUSE applies feature level fusion using a method based on Discriminant Correlation Analysis (DCA). It gets the train and test data matrices from two modalities X and Y, along with their corresponding class labels and consolidates them into a single feature set Z.

Details can be found in:

M. Haghighat, M. Abdel-Mottaleb, W. Alhalabi, "Discriminant Correlation Analysis: Real-Time Feature Level Fusion for Multimodal Biometric Recognition," IEEE Transactions on Information Forensics and Security, vol. 11, no. 9, pp. 1984-1996, Sept. 2016.


M. Haghighat, M. Abdel-Mottaleb W. Alhalabi, "Discriminant Correlation Analysis for Feature Level Fusion with application to multimodal biometrics," IEEE International Conference on Acoustics, Speech and Signal Processing (ICASSP), 2016, pp. 1866-1870.

(C) Mohammad Haghighat, University of Miami

Cite As

Haghighat, Mohammad, et al. “Discriminant Correlation Analysis: Real-Time Feature Level Fusion for Multimodal Biometric Recognition.” IEEE Transactions on Information Forensics and Security, vol. 11, no. 9, Institute of Electrical and Electronics Engineers (IEEE), Sept. 2016, pp. 1984–96, doi:10.1109/tifs.2016.2569061.

View more styles

Comments and Ratings (25)

Zahraa Al-mokhtar

hello i need some help to understand the DCA function what is the label represent please help me

Rani Koshy

Hello sir, any python code available for this feature fusion?


Greetings sir,
i am getting error while running your code.
" Error using dcaFuse (line 70) X and Y must have the same number of columns (samples)."
my dataset is like this trainx = 2500x59 and trainy = 25000x18. the trainx and trainy belong to different features.
Please can you explain why i am getting error.
Thanks in advance.

lili mao

Hello, thanks for your sharing. May I ask how to classify the training and test feature vectors after fusion

Joyraj Chakraborty

Hi Mohammad, I have question. I am sorry if i am asking silly question.
Actually, i did not understand about your training data set. Example i have features, which we can define as a binary classification. So in that case how can i create training data sets?
Thank you in advance.

Jyothi Alugolu

Can we get back the original two feature vectors from the obtained fused feature vector???What is the need to apply SVD at end??Please clarify my doubts

Mohammad Haghighat

Haider Mehraj:
The problem seems to be with your input data matrix. As the error says it contains NaN or Inf values. You'd better eliminate such features before moving forward with anything.

haider mehraj

I am getting this error while using your code.
I try to normalize before applying fusion and it is causing this error.

Error using eig
Input matrix contains NaN or Inf.

Error in dcaFuse (line 120)
[eigVecs,eigVals] = eig(artSbx);

Mohammad Haghighat

Chidiebere Ike:
You can either use two different feature extraction techniques to extract features from a single modality, or if you have a multimodal system, you can fuse the feature sets extracted from different modalities using the DCA.

Chidiebere Ike

Dear All,
It's my pleasure to contact you via this medium. I am a Research student and working on Low resolution images. I am new to coding via Matlab but find it interesting. I observed this work was rated 5 start.

I have the file but need some guide on how to use it.

Am I expected to use 2 feature extraction techniques first before applying it's output/result to the DCA code of Mohammad Haghighat ?

Please can you guide me or share similar examples ?

My email is



Mohammad Haghighat

I don't know what your feature sets look like. One case in which CCA will work better than DCA is when you have a small number of classes. As mentioned in the paper, the length of the DCA feature vectors is limited by the number of classes and also the rank of the feature matrices. So, for example, for a binary classification, you cannot use DCA or it will perform very poorly.

Nazeera Sheth

Hello Sir, I have implemeted both cca and dca for my project. It is said here that since dca is a supervised technique, it gives better results than cca. However, in my case dca gives poor result, and it even gives poor accuracy than the individual features.
In your example, this is shown
testXdca = Ax * testX;
But while implementing this gives error that matrix dimension mismatch. So I changed it to
testXdca = Ax' * testX;
Also, I use PCA to reduce the individual features before applying dca/cca to it. cca gives much better result but dca does not.
Can you please help me with this issue, as to why the accuracy is going wrong.

Islem Rekik

Berkay Selbes


what is label?

Mokni Raouia


HR Ramya

hello ...where can i find the code

Mohammad Haghighat

Mokni Raouia:

Please refer to the comment below (04 May 2016). For more detailed information, you can also read Section III of this paper:

M. Haghighat, M. Abdel-Mottaleb, W. Alhalabi, "Discriminant Correlation Analysis: Real-Time Feature Level Fusion for Multimodal Biometric Recognition," IEEE Transactions on Information Forensics and Security, vol. 11, no. 9, pp. 1984-1996, Sept. 2016.

Mokni Raouia

Dear Mohammad
Thank you for your codes
What is the difference between Discriminant Correlation Analysis (DCA) and the Canonical Correlation Analysis (CCA)?

Mokni Raouia

cuong ha

Mike Reno



Mohammad Haghighat

The feature fusion method based on Canonical Correlation Analysis (CCA) has two issues:

The first issue is encountered in the case of a small sample size (SSS) problem, where the number of samples is less than the number of features (n < p or n < q). This makes the covariance matrices singular and non-invertible.

The second and more important issue is the negligence of the class structure in CCA. Although it decorrelates the features, in pattern recognition problems, we are also interested in separating the classes.

Discriminant Correlation Analysis (DCA), on the other hand, considers the class associations in feature sets. It eliminates the between-class correlations and restricts the correlations to be within classes. DCA has the characteristics of the CCA- based methods in maximizing the correlation of corresponding features across the two feature sets and in addition decorrelates features that belong to different classes within each feature set.


How is this different than CCA?

MATLAB Release Compatibility
Created with R2016a
Compatible with any release
Platform Compatibility
Windows macOS Linux

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!