← Latest papers
💻 computer science

Bag of Bags: Adaptive Visual Vocabularies for Genizah Join Image Retrieval

This paper introduces Bag of Bags (BoB), an adaptive visual vocabulary method that replaces global codebooks with fragment-specific local vocabularies to significantly improve the retrieval of Cairo Genizah manuscript fragments by achieving a 6.1% relative increase in top-1 accuracy over state-of-the-art Bag of Words baselines.

Original authors: Sharva Gogawale, Gal Grudka, Daria Vasyutinsky-Shapira, Omer Ventura, Berat Kurar-Barakat, Nachum Dershowitz

Published 2026-04-10
📖 5 min read🧠 Deep dive

Original authors: Sharva Gogawale, Gal Grudka, Daria Vasyutinsky-Shapira, Omer Ventura, Berat Kurar-Barakat, Nachum Dershowitz

Original paper licensed under CC BY 4.0 (http://creativecommons.org/licenses/by/4.0/). This is an AI-generated explanation of the paper below. It is not written or endorsed by the authors. For technical accuracy, refer to the original paper. Read full disclaimer

Imagine you are a detective trying to solve a massive, centuries-old puzzle. The pieces aren't cardboard; they are ancient, torn, stained, and scattered fragments of handwritten manuscripts from the Cairo Genizah (a historic storage room for Jewish texts).

Your job is Manuscript Join Retrieval: You pick up one torn piece of paper and ask, "Which other pieces in the world's libraries originally came from the same book?"

This is incredibly hard because:

  1. The pieces are damaged: Some are missing corners, some are faded, and some are just smudges.
  2. The handwriting is subtle: Two pieces might look similar because they are both old and yellowed, but they were written by different people. Conversely, two pieces from the same book might look different because one was written in bright light and the other in the dark, or because the ink faded differently.

The Old Way: The "Global Dictionary" (Bag of Words)

For a long time, computer scientists tried to solve this using a method called Bag of Words (BoW).

The Analogy: Imagine every manuscript fragment is a bag of marbles. In the old method, everyone agrees on one giant, global dictionary of marble colors (e.g., "Red," "Blue," "Green," "Speckled").

  • You dump your fragment's marbles into the bag.
  • You count how many "Red" marbles you have, how many "Blue," etc.
  • You compare your count to everyone else's.

The Problem: This is too blunt.

  • If two fragments have the same number of "Red" marbles, the computer thinks they are identical. But maybe one fragment has "Red" marbles arranged in a perfect circle, and the other has them scattered randomly. The pattern matters, not just the count.
  • If a fragment is damaged and missing its "Blue" marbles, the computer might think it's a totally different book, even if the remaining "Red" marbles match perfectly.
  • It forces every unique, messy manuscript to fit into the same rigid box, losing the specific "fingerprint" of the writer.

The New Way: "Bag of Bags" (BoB)

The authors of this paper propose a smarter, more flexible approach called Bag of Bags (BoB).

The Analogy: Instead of using one giant dictionary for everyone, every single fragment gets its own custom dictionary.

Here is how the system works, step-by-step:

  1. The Microscope (Connected Components):
    First, the computer zooms in on the fragment and cuts out every single letter or ink blot it can find. Think of these as individual "character patches."

  2. The Translator (Sparse Autoencoder):
    The computer looks at each patch and translates it into a mathematical "fingerprint" (an embedding). It's like turning a handwritten letter into a unique code that captures its shape, slant, and texture.

  3. The Custom Dictionary (Local Vocabulary):
    This is the magic step. Instead of forcing these fingerprints into a global list, the computer looks at just this one page and groups similar fingerprints together.

    • Example: On this specific page, it might find that the writer has a unique way of writing the letter "A" that looks like a triangle, and another way that looks like a circle.
    • It creates a mini-dictionary just for this page: "Triangle-A" and "Circle-A."
    • It also counts how many of each there are (the "mass").
  4. The Matchmaker (Set-to-Set Distance):
    Now, to see if two fragments belong together, the computer doesn't just compare counts. It compares the custom dictionaries.

    • It asks: "Does Fragment A's 'Triangle-A' match Fragment B's 'Triangle-A'?"
    • It uses a clever math trick called Chamfer Distance. Think of it like a game of "closest match." If Fragment A has a "Triangle-A" and Fragment B has a "Triangle-A," they get a point. If Fragment A has a "Circle-A" but Fragment B is missing it (because it's torn), the computer doesn't punish them too hard. It just says, "Okay, we found a match for the triangle, that's good enough."

Why is this better?

  • It handles damage: If a piece is torn and missing half its letters, the old method panics. The new method says, "No problem, we still have the letters we do have, and they match perfectly."
  • It catches the "Hand": It focuses on the specific style of the writer on that specific page, rather than just generic features shared by all old papers.
  • It's efficient: The authors built a two-stage system. First, it quickly scans the whole library with the "old method" to find a shortlist of 30 candidates. Then, it uses the super-smart "Bag of Bags" method to rank those 30 and pick the winner. This makes it fast enough to use on huge collections.

The Results

When they tested this on the Cairo Genizah fragments:

  • The old method (BoW) got the right answer about 74% of the time.
  • The new method (BoB-Chamfer) got the right answer 78.4% of the time.

That might sound like a small number, but in the world of ancient manuscripts, where every piece is unique and damaged, that is a huge leap forward. It means scholars can now automatically reconnect fragments that were separated for centuries, helping to reconstruct lost history much faster than human experts could do alone.

In a nutshell: Instead of forcing every ancient page to speak the same language, the "Bag of Bags" method learns the unique dialect of each page and then finds the other pages that speak the same dialect.

Drowning in papers in your field?

Get daily digests of the most novel papers matching your research keywords — with technical summaries, in your language.

Try Digest →