Skip to main content

Welcome to a Grasp lesson

Create a free account to keep studying and create your own study path.

Lesson 35

Justifying Late Fusion Architectures

Recommended resources

Hello! In our previous lessons, you've successfully built and fine-tuned separate models to extract meaningful feature vectors from your image and text data. You also learned how to convert categorical and temporal metadata into a numerical format. We now have three distinct, powerful representations of our data, one for each modality.

The natural next question is: how do we combine them? Today, we will bridge the gap between your separate baseline models and a unified multimodal system. Your learning outcome is to explain the rationale for using a late fusion architecture for this project. While this lesson is more conceptual than code-heavy, it is one of the most important architectural decisions you'll make. Understanding the why behind our choice will provide a clear roadmap for the implementation to follow and directly addresses the high-level pipeline integration you were concerned about.

What is Multimodal Fusion?

At its core, multimodal fusion is the process of combining information from different data sources (modalities) to achieve a more comprehensive understanding and make more robust predictions.

A great way to think about this comes from clinical practice, which is highly relevant to the medical context of many advanced multimodal systems. A doctor doesn't make a diagnosis based on a lab report alone; they integrate the patient's history, the physical exam, imaging results, and lab data to form a complete picture.

Multimodal Fusion With Deep Neural Networks For Leveraging CT Imaging And Electronic Health Record

This video from the American College of Radiology discusses multimodal fusion in a medical context. The analogy presented here provides an excellent intuition for why we want our AI models to mimic this integrative approach.

Please watch the segment from the beginning of the "Why consider fusion models?" discussion. The speaker explains how clinicians synthesize information from multiple sources, providing a strong parallel for our project's goal.

In machine learning, this "synthesis" is achieved through a fusion architecture. There are three primary strategies for when and how to fuse information: early, intermediate, and late fusion. Let's explore each one to understand why late fusion is the best fit for your project.


Early Fusion: Combining at the Start

Early fusion, or feature-level fusion, involves combining the raw data or very low-level features from all modalities at the very beginning of the pipeline.

In the context of your project, this would mean:

  1. Taking the raw pixel values from an image.
  2. Taking the raw token IDs from a text complaint.
  3. Taking the one-hot encoded metadata vectors.
  4. Concatenating all of these into a single, massive input vector.
  5. Feeding this giant vector into one monolithic neural network.
This diagram contrasts late fusion (left), where modalities are processed separately before being combined, with early fusion (right), where data is combined at the input stage before processing.

While this approach allows a model to learn intricate, low-level interactions between modalities from the start, it has several major drawbacks for our project:

  • Heterogeneous Data: It's very difficult to meaningfully combine raw pixels, text token IDs, and numerical metadata. They exist on completely different scales and have different structural properties.
  • Dimensionality: The resulting input vector would be enormous and sparse, making it very difficult for a model to train effectively, especially with a limited dataset.
  • Complexity: Designing a single network that can simultaneously make sense of visual patterns, linguistic structures, and tabular data is exceptionally challenging.
  • Lack of Robustness: The model would require all data modalities to be present for every single sample. If a complaint lacks an image, this architecture fails.

For these reasons, early fusion is impractical for your project.


Late Fusion: Combining at the End

Late fusion, also known as decision-level or output fusion, takes the opposite approach. Each modality is first processed independently by its own specialized model. The fusion happens only at the very end, by combining the high-level outputs of these individual models.

This is the architecture we will use. Here's how it maps directly to the work you've already done:

A diagram of a late fusion architecture. Each input modality is processed by its own unimodal model. The outputs (high-level feature vectors) are then combined in a fusion module before the final prediction is made.
  1. Image Stream: A meal photo is fed into your fine-tuned ResNet model to produce a fixed-size image feature vector (e.g., a 512-dimension vector).
  2. Text Stream: A parent's complaint is fed into your fine-tuned BERT model to produce a text feature vector (the [CLS] token embedding, e.g., a 768-dimension vector).
  3. Metadata Stream: The associated metadata (school type, season, etc.) is processed by your encoding function to produce a numerical metadata vector.
  4. Fusion: These three high-level feature vectors are concatenated.
  5. Classification: The final, concatenated vector is fed into a simple and shallow "fusion network" (e.g., a small Multi-Layer Perceptron) that makes the final prediction about violation severity.

The following resources provide a detailed breakdown of this architecture and its benefits.

Early fusion vs late fusion in multimodal data processing

This article provides an excellent, clear explanation of late fusion and its advantages. It will solidify your understanding of the rationale behind our architectural choice.

Please read the following sections to grasp the key concepts: The definition and mechanism of late fusion. The list of key advantages, which are all highly relevant to your project. The summary section on when this strategy is most appropriate. As you read, think about how each point applies to your specific project goals and data.

Stanford CS224N NLP with Deep Learning | 2023 | Lecture 16 - Multimodal Deep Learning, Douwe Kiela

This Stanford lecture on multimodal deep learning offers a concise academic perspective on the different fusion levels.

First, watch the brief segment explaining the different levels of fusion (early, middle, late). Then, jump to the Q&A segment where the lecturer explains the trade-off between early and late fusion. He notes that late fusion is very efficient to train, while early fusion can provide a "richer understanding" at the cost of complexity. This trade-off is central to our decision.


The Rationale for Using Late Fusion in Your Project

Based on the concepts we've just covered, late fusion is the most logical and pragmatic choice for the Midday Meal Quality Monitoring project. Here's a summary of the rationale, tailored to your specific situation:

  1. Modularity and Reusability: You have already built and trained powerful, specialized models for image (ResNet) and text (BERT). Late fusion allows you to treat these as "off-the-shelf" feature extractors. We don't need to retrain them from scratch; we simply use their high-level outputs. This modularity makes development faster and debugging easier.

  2. Handles Heterogeneous Data: Your project combines data of fundamentally different types: dense image data, sequential text data, and low-dimensional categorical/temporal metadata. Late fusion is the ideal architecture for combining such diverse sources, as each is handled by an appropriate model before their abstract representations are merged.

  3. Robustness to Missing Data: Your dataset is scraped from real-world sources and will inevitably be incomplete. Some complaints may have text and metadata but no image. A late fusion model can gracefully handle this: if the image vector is missing, it can still make a prediction based on the available text and metadata vectors. This is a critical advantage for building a practical, real-world system.

  4. Feasibility and Efficiency: Given your 4-week timeline and the size of your dataset, training a single, massive early or intermediate fusion model is not feasible. It would require more data and significantly more time for design and experimentation. Late fusion offers the most direct path to a high-performing multimodal model by leveraging the components you've already built. As noted in the video with medical experts, late fusion often performs best with smaller or sparser datasets.

  5. Interpretability: By combining the final outputs, it can be easier to probe which modality is most influential for a given prediction. For example, you could analyze the final classifier to see if it's relying more heavily on the image features, the text features, or the location metadata when flagging a severe violation.


What About Intermediate Fusion?

You may also hear about intermediate (or joint/middle) fusion, which represents a compromise. In this strategy, modalities are processed separately for a few layers, their intermediate representations are combined, and then they are processed jointly by the rest of the network. While this can capture more complex interactions than late fusion, it adds significant design complexity in deciding where and how to fuse the intermediate features. For your project's timeline and goals, the simplicity and effectiveness of late fusion make it the superior choice.


Conclusion

In this lesson, you've learned about the different strategies for multimodal fusion and, most importantly, the specific reasons why a late fusion architecture is the right choice for your project.

The key takeaways are:

  • Fusion Strategies: Models can be fused at the input level (early), decision level (late), or somewhere in between (intermediate).
  • Late Fusion Mechanism: Process each modality with a specialized model, extract high-level feature vectors, concatenate them, and feed them to a final, simple classifier.
  • Project Rationale: Late fusion is the best choice for your project due to its modularity, ability to handle heterogeneous data, robustness to missing inputs, and overall practicality for development within a tight schedule.

Now that we have a clear architectural plan, our next lesson will be very hands-on. We will take the feature vectors you've already learned to extract and build the fusion model in PyTorch that combines them to make a final, unified prediction.