Experiments on future ways to search BHL

I have been experimenting with ways to search BHL, and wanted to share a small demo of image search. If you go to BHL image search you can enter a search term such as emu or map africa or people portrait and you’ll get pages in BHL that have images matching those queries. You can also upload an image to see if it matches anything.

The demo is limited to a small number of BHL pages (~500,000 from recently uploaded items), and the search is matching the whole page, not just any figure or photo on the page, but it seems to work reasonably well.

For the technically minded, this uses the OpenCLIP ViT-B-32 model to convert each BHL page image into a vector of numbers (the embedding), these are then stored in a Postgres database that supports querying by vectors. When you do a search the text query or uploaded image gets converted to a vector, and the database is queried for the most similar vectors to that query vector. Creating embeddings for BHL is made easier because the images are on AWS, so that we can run the code to make the embeddings on AWS as well, avoiding having to download all of BHL. Running the database that does the actual searching is a separate task, for this demo it’s quite a modest machine, for all of BHL it would need to have a lot more RAM.

Let me know what you think of the demo, do you think this something a future BHl should have?