Efficient Multi-Model Fusion with Adversarial Complementary Representation Learning
Zuheng Kang Yayun He Jianzong Wang Junqing Peng Jing Xiao


























































Efficient Multi-Model Fusion with Adversarial Complementary Representation Learning
    Zuheng Kang^† Corresponding author: Zuheng Kang, bob.kang@qq.com, Yayun He^†^† Both authors have equal contributions., Jianzong Wang, Junqing Peng, Jing Xiao
    Ping An Technology (Shenzhen) Co., Ltd., Shenzhen, China.
    April 29, 2024
===============================================================================================================================================================================================================================





    Single-model systems often suffer from deficiencies in tasks such as speaker verification (SV) and image classification, relying heavily on partial prior knowledge during decision-making, resulting in suboptimal performance.
    Although multi-model fusion (MMF) can mitigate some of these issues, redundancy in learned representations may limits improvements.
    To this end, we propose an adversarial complementary representation learning (ACoRL) framework that enables newly trained models to avoid previously acquired knowledge, allowing each individual component model to learn maximally distinct, complementary representations.
    We make three detailed explanations of why this works and experimental results demonstrate that our method more efficiently improves performance compared to traditional MMF.
    Furthermore, attribution analysis validates the model trained under ACoRL acquires more complementary knowledge, highlighting the efficacy of our approach in enhancing efficiency and robustness across tasks.




    model fusion, ensemble learning, alliance learning, speaker verification, complementary representations






§ INTRODUCTION



Multi-model fusion (MMF) has demonstrated great potential
to achieve superior overall performance compared to individual, as distinct component models may contain complementary capabilities to avoid their limitations.

Despite various applications and tasks using quite different architectures and processing methods, there are commonalities exist in the core logic – MMF for the model exists throughout the model inference pipeline, including input data_a, early, mid, and late stages of the model_b, and final inference output_c <cit.>.
(a) Data-level fusion can merge datasets with fully or partially overlapping labels at the label level to incorporate more training data <cit.>.
Additionally, multi-task learning enables joint training on datasets with disparate labels using different optimization objectives <cit.>.
Data augmentation via generative models like generative adversarial networks (GANs) also enables the fusion of real and synthetic data <cit.>.
(b) Model-level fusion utilizes intermediate representations for fusion.
Early fusion leverages multiple engineered features to allow models to fully exploit information in the data <cit.>.
Mid-term fusion means that each type of data is first processed through its own network and then fused at some intermediate modeling layer.
Late fusion is more flexible to aggregate high-level features of individually trained models optimized under different conditions.
Varying training induces slightly different model specializations, so integrating them may improve overall performance <cit.>.
These models are typically fused by concatenation, addition, multiplication, or attention mechanism.
(c) Output-level fusion commonly integrates the predictions of multiple pre-trained models to achieve improved performance <cit.>.
This technique is frequently employed in various competitions.
For example, in speaker verification (SV) challenges, fusion of scoring results is often used in the optimization pipeline <cit.>, deepfake detection <cit.>, and many other challenges <cit.>.
However, although MMF is effective in improving overall system performance, it has some limitations.
The constituent models used in MMF are often very similar in nature, which limits the effectiveness of model integration.
Also, integrating too many models significantly increases computational costs, making it infeasible in resource-constrained environments.

There are a number of similar methods that attempt to train a new model that avoid previously learned knowledge, but they vary in their approach, and purpose.
Shen et al. <cit.> proposed an adversarial learning based model distillation method, which aims to incorporate the student model to learn the knowledge of the teacher's network, but not to learn its similar knowledge from the corresponding layers in the teacher's model.
However, the problem with this framework is that the student model is only learning the teacher's network, and the incorrect knowledge learned from the teacher's network is not modified by correct labeling, which may lead to the magnifying the incorrect knowledge.
Nam et al. <cit.> attempted to utilize the perturbation method so that the student model would absorb as much knowledge as possible from the individual teacher models, thereby distilling a single model that would perform as a complete set.
Although this work distills a model of learning knowledge that is as different as possible from the teacher's knowledge, the model's performance is only close to that of the previous ensembled model, but does not surpass it.
Zhang et al. <cit.>, most similar to our idea, proposed an adversarial based object localization framework that avoid area that the previous models had learned.
However, this method only apply to the object detection task, and it cannot apply to other tasks.
Most similar to our idea, Zhang et al. <cit.> proposed an adversarial-based object localization framework which avoids regions learned by previous models.
However, this approach is only applicable to the object localization task and can not be generalized, and cannot apply to the models more than two.
There are many other researches about ensemble learning that are meaningful to the form of our idea <cit.>.



Also, in machine learning, bagging and boosting are popular ensemble methods that improve system performance.
Bagging trains multiple models on different bootstrap samples of the training data to reduce variance.
Boosting sequentially fits models to emphasize previously misclassified instances, thereby reducing bias.
However, random sampling of bagging data still does not solve the training redundancy problem.
Boosting uses a sequential approach that limits parallelization and reduces efficiency.
Additionally, some tasks are not amenable to boosting's error-focused learning.

To fully address the challenges of MMF, the analytical lens cannot be narrowly confined.
Let's start with a story:
When a person or group seeks allies to maximize their benefits, they tend to ally with someone who is as different as possible from themselves in terms of knowledge, vision, and ability.
However, if they are free to acquire knowledge from a single source, their acquired knowledge tends to closely resemble that of others.
Allying among them may risk substantial redundancy.
Furthermore, too many models require much more computational resources.



Therefore, we have made the following contributions:

    
  * We propose an adversarial complementary representation learning (ACoRL) framework that promotes diversity during multi-model fusion by enabling models to avoid previously acquired knowledge and learn distinct representations.
    
  * We theoretically prove and explain how ACoRL can improve the performance of multi-model fusion (MMF) by extending the range of representations in the latent space.
    
  * Experimental results and attribution analysis validate that ACoRL can leverage more complementary knowledge, strengthening its ability to improve model performance across tasks.




§ METHODOLOGY





 §.§ The Need for Complementary Representations


In supervised learning frameworks, source data is generally transformed by the model into a progression of shallow to deep latent representations, which are eventually mapped to downstream tasks.
For a specific task, when training a single model multiple times, variance in model performance is primarily attributable to data quality and differences in the models.
However, for the same data, since the training of a single model is heavily constrained by the optimization objective, newly trained models tend to focus on the most readily learnable and salient aspects of the training data, while neglecting other potentially useful information.
This likely results in a high degree of consistency in the knowledge acquired across models.
In other words, representations are highly similar from the model perspective.
This phenomenon has been widely observed by many other researchers <cit.>.
Therefore, it is necessary to ensure that these representations are as complementary as possible so that the individual models can extract the potential knowledge from the training data as comprehensively as possible.
Meanwhile, downstream tasks can still be accomplished with these alternative representations.



 §.§ Adversarial Complementary Representation Learning


To obtain efficient fusion system capability, we need to supplement the newly allied models with the strengths and weaknesses of the existing models.
To this end, we propose an adversarial complementary representation learning (ACoRL; alias Alliance Learning), which allows the newly allied model to avoid learning previously acquired knowledge as much as possible.
Note:
(1) alliance learning in this paper is the same as adversarial complementary representation learning (ACoRL) framework.
(2) alliance model is the newly trained model that avoid previously learned knowledge.
Seen from Figure <ref> upper part, the ACoRL framework consists of 2 main branches: the branch with K pre-trained models m_k(·) (discussed in  <ref>), where k is the index, and the branch with trainable alliance model g(·) with model parameters θ_g (in  <ref>).





  §.§.§ Pre-trained Models Knowledge Avoidance



The input data x is first transformed into a set of intermediate representations v_k by its corresponding pre-trained models m_k(·), shown as the green and red branches in Figure <ref>.
These representations v_k will be used to represent the knowledge known by the corresponding pre-trained model m_k to avoid learning by the newly allied model.





  §.§.§ Alliance Model Training with ACoRL



The input data x is then converted to the representations z' via the alliance model g(·), as shown in the orange branch in Figure <ref>.
Then, z' is sent to 2 sub-branches:




    
  * Task branch: z' accomplishes the task training through the downstream task model h(·) with parameters θ_h, as shown in the light blue branch.
    The task branch loss and its function are denoted as ℒ_t and ℓ_t, in Equation <ref>, which depends on the specific task, where y is the label.
    
    ℒ _t =ℓ _t(h∘g( x ), y ).

    
  * ACoRL branch: As shown in light brown background area in Figure <ref>. To compare between the representations of the alliance model z' and the pre-trained model v_k, they should be dimensionally consistent.
    For this, the projection model d_k(·) implemented as a multi-layer perceptron (MLP) with parameters θ_d_k is used to project z' onto z_k with the same dimensions as v_k.
    To ensure that the alliance model avoids learning the knowledge in each pre-trained model, an adversarial approach is well-suited.
    Specifically, the projection model aims to ensure the alliance model representation z_k to match the pre-trained model representation v_k as similarly as possible.
    In contrast, the alliance model will produce representations that are as complementary as possible.
    To achieve this, the gradient reversal layer (GRL) <cit.> can invert the gradient, which enables the projection model to maximize knowledge similarity with the pre-trained model, while the alliance model minimizes it.
    The ACoRL branch loss and its function corresponding to model m_k are denoted as ℒ_adv(k) and ℓ _adv(k), in Equation <ref>.
    Where ∘ denotes the mapping function.
    
    ℒ _adv( k ) =ℓ _adv( k )(d_k ∘g( x ),m_k( x ) ).





  §.§.§ Overall Loss


The hyper-parameter λ is introduced to balance the training of the two task branches, and then the overall loss ℒ is shown in Equation <ref>.
In this way, the alliance model receives both the gradient of the task branch ∂ℒ _t/∂θ _g for task learning, and the reversed gradient of ACoRL branch -λ·∂ℒ _adv/∂θ _g for complementary knowledge acquiring.
The downstream task model recieves the gradient ∂ℒ _t/∂θ _h for task training.
The projection models recieve the gradient λ·∂ℒ _adv/∂θ _d for representation learning, shown in Figure <ref>.

    ℒ =max_θ _dmin_θ _g,θ _h( ℒ _t -λ/K∑_k=1^Kℒ _adv( k )).






 §.§ Motivation for ACoRL and Explanations


In order to justify our approach, we identified three explanations, which are the main motivations for proposing the ACoRL framework.
In the end, we proved experimentally that our proposed ACoRL are correct.



Explain 1:
Fundamentally, the mechanism of multi-modal and multi-model fusion for improving the system performance are intrinsically the same.



Multimodality leverages naturally complementary information from distinct physical modalities, such as audio and visual, to improve system performance.
In contrast, unimodal MMF jointly optimizes multiple models from the same data source to learn slightly different but complementary knowledge, thus making the system more robust.
Both approaches attempt to learn a more comprehensive knowledge to improve the overall performance of the system.
However, knowledge learned by multi-model is more distinct than that learned from multi-modal.



Explain 2:
If the sample size is large enough, models that cover a larger and more complete latent representation will have better performance.



According to Explain 1, the explain of multi-modal fusion also applies to MMF.
Yu H. et al. <cit.> theoretically proved that with sufficient data, the use of more modalities can effectively improve the quality of the latent representation by covering larger latent space, thereby improving the overall system performance.
Similarly, it can be hypothesized that the MMF system could perform better if it is able to obtain a more expansive and comprehensive representation in the latent space.



Explain 3:
ACoRL framework has the potential for larger, higher quality latent representations.



The upper part of Figure <ref> and the lower part of Figure <ref> are the same.
The large background rectangle represents the ideal maximum boundary of the latent space for accomplishing a given task.
There are three spaces, the input space 𝒳, intermediate latent space 𝒵' and model specific latent space 𝒵_(k).
There exists subspace of representations (SoR) 𝒵'_k in the latent space 𝒵' with its data z', SoR 𝒵_k and 𝒱_k in the latent space 𝒵_(k) with its data z_k and v_k.
There are two mappings by g:𝒳_k↦𝒵'_k and  d_k:𝒵'_k↦𝒵_k.



The back-propagation of ACoRL has 3 processes:


    
  * Projection model d_k tries to modify SoR 𝒵_k to be highly coincident with 𝒱_k, where 𝒱_k is the SoR for pre-trained model m_k.
          Then 𝒵_k can fully represent 𝒱_k.
    
  * Assuming at this training state, the latent space where the representation of the Alliance Model can maximally reach in 𝒵' is denoted as 𝒵'_𝒜.
          To ensure the mapping from 𝒵'_k to 𝒵_k, the model d_k will have a positive gradient λ·∂ℒ _adv/∂θ _d.
          However, due to GRL, in the mapping from 𝒳_k to 𝒵_k, the gradient is inverted to be -λ·∂ℒ _adv/∂θ _g.
          Since 𝒵'_𝒜 originally had a negative gradient, it is now positive.
          Similarly, 𝒵'_k becomes negative.
          This indicates that model g will actively search for more complementary representations in the latent space under ACoRL.
          Due to the SoR of the newly trained model 𝒵'_k+1 is highly consistent with the original 𝒵'_k, and yet ACoRL can greatly enlarge this SoR.
          According to Explain 2, since 𝒵'_𝒜∪𝒵'_k ≫𝒵'_k+1∪𝒵'_k, the ACoRL is theoretically proved to have much superior performance.
    
  * The task branch has a mapping by h:𝒵'↦𝒴 to the task space 𝒴 by alternative SoR of 𝒵'_𝒜.




§ EXPERIMENT





 §.§ Experimental Setup




  §.§.§ Experiment 1 (image classification; IC)

The task is trained and tested on ImageNet-100 <cit.> train and validation set.
Function ℓ_t is softmax for classification.
The models are ResNet-34 (A), MobileNet-V2 (B) and ResNet-18 (C).
The test metrics are reported using top-1 accuracy (Acc) in percentage (%).





  §.§.§ Experiment 2 (speaker verification; SV)

This task is trained on VoxCeleb1+2 <cit.> and tested on VoxCeleb1-O.
Function ℓ_t is AAM-Softmax <cit.> for speaker embedding (SE) training.
The models are ECAPA-TDNN <cit.> (A), x-vector <cit.> (B) and ResNet-34 <cit.> (C).
Models A, B, and C use log mel-spectrograms with 80, 24, and 80 dimensions, respectively.
The test metrics are presented using the equal error rate (EER) in percentage (%).





  §.§.§ Training Details

For IC, the second last layer features are flattened and used as the representation.
For SV, the SE is used as the representation.
The AAM-Softmax margin is 0.2 with the scale of 32.
We consider two fusion methods – late fusion (L.F.) and output fusion (O.F.).
For L.F., the MMF is implemented by concatenating the representations and passing them through a 3-layer MLP with 512 nodes in the hidden layer.
For O.F., the IC task uses a weighted sum of classifier outputs while the SV task uses logistic regression on the score outputs.
Similar to the knowledge distillation framework <cit.> for knowledge learning, the ACoRL task function ℓ_adv is implemented with Kullback-Leibler Divergence (KL) as the objective.

The value of the hyperparameter λ=1.
As the ACoRL training is performed sequentially, model B is trained on top of model A, and model C on top of models A and B
We then evaluate the fusion of A+B and A+B+C models.



 §.§ Evaluation Results




  §.§.§ Experiment 1

Four conclusions can be drawn from the Table <ref>:

    
  * Although newly trained individual models exhibit slightly better performance than their ACoRL-trained counterparts, fusing ACoRL-trained models leads to much superior overall performance.
          We hypothesize that each individually trained model may over-focus on similar, redundant features, whereas ACoRL diversifies this focus.
    
  * L.F. outperforms the O.F.
          In our analysis, in O.F., only a single weight per output is excessively less accurate when fusing diverse models.
          In contrast, L.F. more carefully integrates and learns from more primitive information, thereby leveraging complementary information to improve the system performance.
    
  * Incrementally aggregating models can improve performance, but the gains diminish as more models are added.
          Nevertheless, the ACoRL framework exhibits considerably greater performance improvement over traditional MMF.
    
  * Interestingly, the fusion of 2 models A+B under ACoRL is even better than that of A+B+C under MMF.
          This indicates that ACoRL is more efficient in MMF, i.e., fusing only a few models with a small amount of computation makes a big difference.











  §.§.§ Experiment 2

Table <ref> could also show the 4 conclusions from experiment 1.
However, the performance gains conferred by L.F. over O.F. are limited for SV, compared to IC.
This may be attributed to two factors:

    
  * SV in this experiment employs cosine similarity for scoring, which is a parameter-free process.
          Thus, the information contained in the SV scoring results is highly consistent with the SEs.
    
  * The strong correlation between SV scores and SEs limits the potential for L.F. to outperform over O.F.
          Moreover, L.F. requires more sophisticated training and inference procedures than O.F., with greater computational cost.
          This is why SV typically uses O.F. instead of L.F. in MMF.
          In comparison, in IC, there is a complex mapping relationship between representations and output predictions.
          Generally, lower-level representations generally encapsulate richer information.
          Therefore, L.F. can improve performance more notably than O.F. for IC.











  §.§.§ Attribution Analysis

The visualization in Figure <ref> (with grad-CAM <cit.> method) shows that before the addition of ACoRL, models A and B focused on similar regions.
ACoRL diminishes the current attention and increases focus on complementary, task-relevant aspects, implying that this newly trained alliance model leverages previously unfocused information to accomplish the task in an alternative way.
Similar to the attribution analysis of SV by J. Zhang et al. <cit.>, Figure <ref> (with integrated gradient <cit.> method) indicates SV focuses on a more fine-grained, abstract region, but reaches the same conclusion.
Compared with the second row (newly trained model B) in Figure <ref>, the most notable regions on the third row (model B under ACoRL) are diminished, but instead, many other interesting small regions appear.
These newly added regions contain complementary knowledge, which is essential for improving the performance of the MMF.





§ CONCLUSIONS



This paper proposed an adversarial complementary representation learning framework (ACoRL) that enables component models to learn maximally distinct but complementary representations, which is further confirmed by later attribution analysis.
Both explains and experimental results demonstrate that our method is more efficient and outperforms conventional methods.
ACoRL provides a generalizable method for improving the efficiency and robustness of multi-model fusion (MMF), offering a new avenue for future research.



§ ACKNOWLEDGEMENT


Supported by the Key Research and Development Program of Guangdong Province (grant No. 2021B0101400003) and the Corresponding author is Zuheng Kang (bob.kang@qq.com).


IEEEbib


