Module 8 — Multimodal AI
Same theory-first structure as Modules 1–7: for every technique below, what it is, why it exists — the specific problem it was invented to solve — what else you could use instead, and a real financial example. Every module so far has assumed RR Finance's input arrives as a table, text, or a retrieval index. Module 8 adds the input types a real lender actually deals with: phone calls, scanned documents, and photographs.
Recap — what RR Finance already has
Module 8 is not a fresh start. Here's exactly what it inherits before adding new input types.
RR Finance's first CNN, built for cheque digit recognition — the convolutional foundation this module extends to audio and document images.
Regex-based PII and field extraction from text — the same technique this module applies to OCR output from document images.
The governed classifier and its fairness audit — still the destination every new input type in this module has to feed into, not a replacement for it.
Why multimodal, why now
Real lending intake is multimodal by necessity, not by choice.
The channel reality
Applicants call in, upload scans, and submit photo ID — a real intake pipeline has to handle all three, not assume clean tabular input arrives by default.
The honest-testing constraint
Large pretrained multimodal models (Whisper, CLIP) need internet access this sandbox doesn't have — every attempt at the real path is shown failing honestly, with a real, smaller, fully local alternative built and tested in its place.
The integration requirement
None of these new capabilities matter unless they feed the SAME governed classifier from Modules 1 and 6 — Lesson 7 wires them back in directly.
Why Multimodal AI
Three new arrival formats, one system.
Multimodal AI handles input that arrives in more than one form -- audio, images, and text together -- rather than assuming everything is already a clean table or a clean string.
✓ Why this module treats each modality separately
- Audio, document images, and vision-language matching are three genuinely different problems with three different real techniques -- bundling them under one umbrella term would hide the actual work each one requires
✗ What this module is NOT claiming
- That one giant multimodal model replaces everything -- Lesson 7 shows a real vision-language model attempt failing honestly in this sandbox, with a smaller, real, working alternative built in its place
Audio Feature Extraction (MFCCs)
Turning a sound wave into numbers a neural network can use.
MFCCs (Mel-Frequency Cepstral Coefficients) compress a raw audio waveform into a small set of coefficients per time frame, designed to track how the human ear actually perceives pitch and timbre -- the standard feature representation for speech tasks for decades.
✓ What the notebook demonstrates
- Real MFCC extraction, via the real
librosalibrary, on real recordings from the Free Spoken Digit Dataset -- 3,000 genuine spoken-digit audio clips across 6 speakers
✗ What this is NOT
- A synthetic stand-in -- this course's discipline of using real data (RR Finance's real 800-row dataset since Module 1) extends here to a real, freely available audio dataset rather than generated tones
n_mfcc) per time frame.Speech Recognition: From Whisper to a From-Scratch CNN
Extending Module 2's own CNN to a genuinely new input shape.
Classifying WHICH digit was spoken, from its MFCC features -- the actual recognition task, built here two ways: attempting a large pretrained model (Whisper), then a small, real, from-scratch CNN when that model's weights aren't reachable.
✓ What the notebook demonstrates
- A REAL attempt to load Whisper, a genuine
HTTPError: 403 Forbiddenwhen its weights can't be reached in this sandbox, and a from-scratch CNN reaching over 95% test accuracy on real, unseen spoken digits
✗ When the small CNN is the RIGHT choice anyway
- For a narrow, closed-vocabulary task like digit entry, a small domain-specific model is often preferable to a giant general-purpose one in production -- faster, cheaper, and easier to audit, independent of what's reachable in any particular sandbox
Document Intelligence (OCR)
Turning a scanned form into the structured fields a model expects.
OCR (Optical Character Recognition) converts a document image into raw text; regex-based extraction then pulls specific fields (income, loan amount, credit score) out of that text -- the same field-extraction technique Module 3 used for PII, now applied to an image-derived input.
pytesseract, was originally developed at HP in the mid-1980s, then open-sourced and substantially improved by Google starting in 2006. It remains one of the most widely used open-source OCR engines in production document-processing systems today.
✓ What the notebook demonstrates
- The SAME extraction pipeline run on a low-resolution and a high-resolution rendering of an IDENTICAL document, with genuinely different, honestly reported results
✗ An honest limitation, not smoothed over
- The low-resolution version misreads a real digit (36 months read as 38) -- a genuine OCR error with real financial consequences if trusted blindly, exactly the kind of finding this course discloses rather than hides
Document Tampering Detection (Error Level Analysis)
A real image-forensics attack and a real, testable defence.
Error Level Analysis (ELA) re-saves an image at a known JPEG compression quality and measures the difference from the original -- regions edited AFTER the image was last fully saved compress differently from regions that were part of the original save, producing a detectable signal exactly where an edit happened.
✓ What the notebook demonstrates
- A real, working attack: a fraudulently edited loan amount on a real document image, followed by a real, measured ELA signal roughly 3.8x stronger inside the edited region than elsewhere in the same document
✗ An honest limitation, stated plainly
- ELA is not foolproof -- a careful forger who re-compresses the WHOLE image after editing can weaken this signal considerably, a real constraint worth naming rather than implying ELA is a complete solution
Vision-Language Models: From CLIP to a From-Scratch Joint Embedding
Matching an image to a caption, without ever typing in a label.
A vision-language model maps images and text captions into the SAME shared embedding space, trained so that matching image/caption pairs land close together and non-matching pairs land far apart -- enabling "zero-shot" classification by comparing a new image against a set of plain-text candidate captions.
✓ What the notebook demonstrates
- A REAL attempt to load CLIP, a genuine
OSErrorwhen huggingface.co isn't reachable in this sandbox, and a from-scratch contrastive model that correctly matches a brand-new, unseen document image to its plain-text caption
✗ What this is NOT
- A claim that this small model rivals real CLIP's actual visual understanding -- this lesson is explicitly about MECHANISM, not quality, the same framing Module 3 used for its own from-scratch Word2Vec on a tiny corpus
Multimodal Fusion
Wiring three new input types back into one governed system.
Multimodal fusion here means something specific and modest: taking fields extracted from a document image (Concept 4) and feeding them into Module 1's ACTUAL saved classifier pipeline -- no new model, no parallel system, just a new INPUT PATH into the one RR Finance has been building since Module 1.
✓ What the notebook demonstrates
- A real check of which of Module 1's
FEATURESdocument extraction CAN supply (income, loan amount, term, credit score) versus which ones genuinely cannot come from a document image alone (previous defaults, account age, existing debt)
✗ What this is NOT
- A claim that document intelligence alone can fully replace an application intake process -- naming the fields it CANNOT supply is as important as the ones it can
StandardScaler and LogisticRegression exactly as saved. The only computation is a set-membership check: which of Module 1's FEATURES a document image can and cannot supply.Module 8 hand-off
The notebook extracts real MFCC features from a real spoken-digit dataset, extends Module 2's own CNN architecture to recognise spoken digits at over 95% test accuracy, runs real OCR-based document field extraction with an honestly-measured resolution-quality effect, detects a real document tampering attack via Error Level Analysis, builds a real from-scratch vision-language joint embedding model where CLIP itself isn't reachable, and wires the whole result back into Module 1's actual saved classifier -- with a metrics summary saved as an artifact for the next module.