Traditional databases are made up of structured tables containing symbolic information. For example, an image collection would be represented as a table with one row per indexed photo. Each row contains information such as an image identifier and descriptive text. Rows can be linked to entries from other tables as well, such as an image with people in it being linked to a table of names.
This is where similarity search kicks in. The vector representation for images is designed to produce similar vectors for similar images, where similar vectors are defined as those that are nearby in Euclidean space.
Precision is evaluated on Deep1B, a collection of 1 billion images. Each image has been processed by a convolutional neural net (CNN), and one of the activation maps of the CNN is kept as an image descriptor. These vectors can be compared with Euclidean distances to quantify how similar the images are.
Deep1B comes with a small collection of query images, and the ground-truth similarity search results are provided from a brute-force algorithm on these images. Therefore, if we run a search algorithm we can evaluate the 1-recall@1 of the result.
For the sake of evaluation, we limit the memory usage to 30 GB of RAM. This memory constraint guides our choice of an indexing method and parameters. In Faiss, indexing methods are represented as a string; in this case, OPQ20_80,IMI2x14,PQ20.
The string indicates a pre-processing step (OPQ20_80) to apply to the vectors, a selection mechanism (IMI2x14) indicating how the database should be partitioned, and an encoding component (PQ20) indicating that vectors are encoded with a product quantizer (PQ) that generates 20-byte codes. Therefore the memory usage, including overheads, is below 30 GB of RAM.
Once the index type is chosen, indexing can begin. The algorithm processes the 1 billion vectors and puts them into an index. The index can be stored on disk or used immediately, and searches and additions/removals to the index can be interleaved.
When the index is ready, a set of search-time parameters can be set to adjust the method. For the sake of evaluation, we perform searches in a single thread. Here, we need to optimize the trade-off between accuracy and search time, since memory usage is fixed. This means, for example, being able to set parameters that give a 1-recall@1 of 40 percent in the least possible search time.
Fortunately, Faiss comes with an automatic tuning mechanism that scans the space of parameters and collects the ones that provide the best operating points; that is, the best possible search time given some accuracy, and vice versa. On Deep1B, the operating points can be visualized as a plot:
On this plot, we can read that getting a 1-recall@1 of 40 percent has a query time of less than 2 ms per vector, or that with a time budget of 0.5 ms we can reach 30 percent. A 2 ms query time translates to 500 queries per second (QPS) on a single core.
We like to use the roofline model as a guide, which states that one should strive to saturate the memory bandwidth or the floating-point units. Faiss GPU is typically 5-10x faster on a single GPU than the corresponding Faiss CPU implementations. New Pascal-class hardware, like the P100, pushes this to 20x+.
The Facebook AI Research team started developing Faiss in 2015, based on research results and a substantial engineering effort. For this library, we chose to focus on properly optimized versions of a few fundamental techniques. In particular, on the CPU side we make heavy use of:
For previous GPU implementations of similarity search, k-selection (finding the k-minimum or maximum elements) has been a performance problem, as typical CPU algorithms (heap selection, for example) are not GPU friendly. For Faiss GPU, we designed the fastest small k-selection algorithm (k
Much attention was paid to efficient tiling strategies and implementation of kernels used for approximate search. Multi-GPU support is provided by either sharding or replicating data; one is not limited to the memory available on a single GPU. Half-precision floating-point support (float16) is provided as well, with full float16 compute on supporting GPUs and intermediate float16 storage provided on earlier architectures. We found that encoding vectors as float16 yields speedup with almost no loss of accuracy.
Faiss is implemented in C++ and has bindings in Python. To get started, get Faiss from GitHub, compile it, and import the Faiss module into Python. Faiss is fully integrated with numpy, and all functions take numpy arrays (in float32).
Faiss (both C++ and Python) provides instances of Index. Each Index subclass implements an indexing structure, to which vectors can be added and searched. For example, IndexFlatL2 is a brute-force index that searches with L2 distances.
To help personalize content, tailor and measure ads and provide a safer experience, we use cookies. By clicking or navigating the site, you agree to allow our collection of information on and off Facebook through cookies. Learn more, including about available controls: Cookie Policy
FastText is an open-source, free, lightweight library that allows users to learn text representations and text classifiers. It works on standard, generic hardware. Models can later be reduced in size to even fit on mobile devices.
Since its inception in 2019, the Facebook Ad Library has revolutionized how businesses and organizations advertise on the platform. Now, in 2024, it remains an essential tool in any marketer's arsenal and has never been more effective.
In 2019, the Facebook Ad Library was created in response to increasing concerns about political advertising on social media platforms. It was built for transparency, allowing users, journalists, businesses, and researchers to see all active political ads on Facebook's Advertising Network. This transparency ensures that users know which ads are being targeted towards them and by whom.
However, the Facebook Ad Library has evolved well beyond its initial purpose of tracking political ads. Today, it is an invaluable resource for businesses and marketers to understand competitor advertising strategies and generate new ideas. With advanced filtering and search options, it has become the go-to tool for businesses looking to make a significant impact on Meta's platforms.
The Facebook Ad Library is a public resource, meaning it's free and accessible to anyone online. To find it, type in facebook.com/ads/library. Alternatively, you can type in 'Facebook ad library' on your Facebook search bar.
You don't have to make a Facebook account to access the library, nor will you need to log in. Anyone, anywhere (all countries allowed to access Meta's advertising network) can use the Facebook Ad Library to their advantage.
With over 10 million active advertisers on Facebook and 93% of marketers regularly investing in Facebook ads, the Facebook Ad Library has never been more essential. It is designed to be user-friendly, with a simple interface and intuitive search options.
In the search bar, type a keyword you want to research. This can be a brand name, e.g., 'Apple,' a type of product, e.g., 'fitness equipment,'. You'll then get a drop-down menu of all advertisers who have that keyword in their name.
Determine what visual elements and ad copy are used in the high-performing ads. Are they images, videos, or animations? Do they use the same tone of voice, i.e., formal or casual? Do their videos feel authentic or more like a television commercial?Use this information to inspire and improve your campaign's ad creatives.
Is the ad remarketing to the same audience or targeting a new demographic? Check for UTM parameters at the end of links to learn who they're targeting. If you see the word "Retargeting" or 'utm_campaign=mof-retargeting' in the URL, it's most likely targeting people who saw and clicked on the initial ad but didn't convert. This should only be used if you're running a retargeting campaign.
PRO TIP: Look for patterns in the targeting parameters across multiple ads from the same advertiser. This can provide insights into their broader audience strategy and help you refine your own targeting efforts.
Check the 'Platforms' list to see where the ad was run, e.g., Facebook, Instagram, Messenger, or Audience Network. These can reveal unique insights into an ad's strategy. For example, if an ad is only running on Audience Network, the advertiser is likely targeting a broad audience. In contrast, Instagram-only ads may focus on a younger or more visually oriented audience.
If you believe a specific competitor's ad is effective, compare it with others they've run or other competitors. You'll quickly identify which ad elements are consistent and assume the most important.
PRO TIP: If multiple ads in your industry use the same tone, voice, or color scheme, determine why that may be. For example, many wellness brands use a minimal, relaxing, or earthy aesthetic. Is there an underlying trend you can capitalise on?
To simplify the researching process, you can save ads from the Facebook Ad Library to organise into collections and reference them later. This way, you'll have a quick and easy way to track an advertiser's past ads.
PRO TIP: Use the MagicBrief Chrome extension to save library ads into our platform. From there, you can organise the ads into collections, add notes and insights, and share them with your team.
As of 2024, marketers can use the Facebook Ad Library to conduct a deeper analysis of their competitors' ads in the EU. This includes the ability to see an advert's reach, targeted audience's age, gender, and location.
This section displays all EU countries and regions targeted by the ad. Users can also filter results by 'Included' and 'Excluded' countries, which will display the specific locations targeted or excluded in that ad.
In these sections, you can see the ad's target age range and gender. Meta advertisers can select a minimum and maximum age range for ad viewers, aswell as specific genders. In this example, the advertiser has targeted women between the ages of 44-65+.
d3342ee215