<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by Luis Remis on Medium]]></title>
        <description><![CDATA[Stories by Luis Remis on Medium]]></description>
        <link>https://medium.com/@luisremis?source=rss-4dc3ed21714f------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*E990A58Kr3kFKpHk5Jj91Q.png</url>
            <title>Stories by Luis Remis on Medium</title>
            <link>https://medium.com/@luisremis?source=rss-4dc3ed21714f------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Thu, 03 Dec 2026 00:26:30 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@luisremis/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[Minute-Made Data Preparation with ApertureDB]]></title>
            <link>https://blogs.aperturedata.io/minute-made-data-preparation-with-aperturedb-603971710672?source=rss-4dc3ed21714f------2</link>
            <guid isPermaLink="false">https://medium.com/p/603971710672</guid>
            <category><![CDATA[machine-learning-tools]]></category>
            <category><![CDATA[database-design]]></category>
            <category><![CDATA[visual-data]]></category>
            <category><![CDATA[feature-store]]></category>
            <category><![CDATA[data-science-training]]></category>
            <dc:creator><![CDATA[Luis Remis]]></dc:creator>
            <pubDate>Tue, 05 Jan 2021 06:59:59 GMT</pubDate>
            <atom:updated>2021-01-05T21:23:18.015Z</atom:updated>
            <content:encoded><![CDATA[<p>Working with visual data (images, videos) and its metadata is no picnic. Especially if you are running analytics on them. You not only need to deal with the visual data itself, but also have to deal with multimodal metadata (i.e., bounding boxes’ coordinates and their labels, or a text description with the content of the image, just to name a few), and even feature vectors. After you complete a project and attempt to reuse your data infrastructure to solve a new, yet similar, business problem you discover that you have to deal with various new types of metadata all over again. There is not much re-use. Your prior experience does help, but only so much. If you were wondering what is missing, you are not alone.</p><p>If you have trained an ML model to run object detection, segmentation, or tracking, you are familiar with the long list of steps needed before you can even start tuning your neural network model’s parameters (let alone run the training and wait for the results).</p><p>Let’s walk through some of the steps. For this, let’s use as an example a popular dataset: <a href="https://cocodataset.org/#home">Common Objects in Context</a> (or COCO for short). COCO is a large-scale object detection, segmentation, and captioning dataset that includes more than 200 thousand images, together with annotations. These annotations include bounding boxes, segmentation masks, and recognition in context for about 1.5 million different objects. While COCO could be stored on a single machine (it takes less than 100GB, including images and labels, bounding boxes, and segmentation information), its rich annotations and complexity, make it a great example dataset to start with.</p><p>COCO can be used for training models on general objects (for which labels are provided) to later train (using transfer learning) on more specific objects based on application specific needs. We could also select a subset of the images for training, throwing away images that are not relevant to our application (i.e., images containing objects and labels that are not relevant).</p><p>Now, consider a ML engineering team constructing a pipeline for object detection. First, we have to have all images in an accessible place, and the right data structures that associate each image and its bounding boxes with the right labels. This requires assigning consistent identifiers for the images and adding their metadata in some form of relational or key-value database. Finally, if the ML pipeline needs images that are of a size different than the original ones present in the dataset, there is additional compute diverted towards pre-processing once the images are fetched. All these steps require integration of different software solutions that provide various functionalities that can then be stitched together with a script for this specific use case.</p><p>More generally, data scientists and machine learning developers usually end up building an ad-hoc solution that results in a combination of databases and file systems to store metadata and visual data (images, videos), respectively. There are many technologies for dealing with visual data and as well as many other (different ones) for metadata only. Each is mostly unaware of the other, therefore a connector, or a “glue”, has to be written in order to have a solution for a given problem, as we describe in greater detail <a href="https://medium.com/aperturedata/managing-visual-data-for-machine-learning-and-data-science-painlessly-cd808cd1ebfe">here</a>. Companies (or teams within the same company) select one of each technology according to immediate needs or developer knowledge, which results in multiple implementations of different connectors. These ad-hoc solutions make replicating experiments difficult, and more importantly, they do not scale well when deployed in the real-world. The reason behind such complexity is the lack of a one-system that is flexible enough to allow the user to store and access all the data and visual data that different applications may need.</p><p>Now, to add more real-world complexity, let’s assume we work in a team of ML engineers and data scientists. There are many steps in the ML pipeline, and many people involved in the task. It is important for the team to share data, intermediate results, and good practices. However, given the usual growing scale of the data, having multiple replicas of the dataset is no longer an option. An ad-hoc solution with loosely defined interfaces is painful to maintain and error-prone. What we need is a database system design for visual data and ML workloads.</p><p>The good news is that at ApertureData, we have been focusing all our efforts on solving these problems. Our solution, <a href="https://aperturedata.io/">ApertureDB</a>, provides an <a href="https://docs.aperturedata.io/">API</a> that enables a smooth interaction with visual data. Images, videos, bounding boxes, feature vectors and labels are first-class entities.</p><h4>Accelerating Data Preparation</h4><p>Let’s see how easy it is to interact with the COCO dataset using Python and ApertureDB. As a starting point, we have pre-populated the dataset in ApertureDB. Connecting to ApertureDB is very simple. All we need to do is instantiate a connector to the database, using the binary-compatible <a href="https://arxiv.org/abs/1810.11832">VDMS</a> connector (VDMS is the open-source version of ApertureDB):</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/ca5c4726fd7e9df4f867c14f2d57eeff/href">https://medium.com/media/ca5c4726fd7e9df4f867c14f2d57eeff/href</a></iframe><p>Now, with a connection open to the database, we can start sending queries to fetch filtered, and even pre-processed, visual data and its metadata. We can do this in two ways: using the <a href="https://docs.aperturedata.io/">Native API</a>, or using ApertureDB Object Model API. The latter allows us to interact with the data in the database as if we were dealing with Python Objects, and without the need to write a query using the native API. We will use the Object Model API for this demonstration.</p><p>Here is an example of how easy it is to filter and retrieve images. Let’s retrieve only the images that are larger than 600x600 pixels, and of a specific type of Creative Common License:</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/1c9497045e294ae1b985c6c94b38b0e4/href">https://medium.com/media/1c9497045e294ae1b985c6c94b38b0e4/href</a></iframe><p>And that’s it. The <em>imgs</em> object will contain a handler for all the images. We can pass those images to our favourite framework for processing (Pytorch, Tensorflow, etc). We also provide tools for quick visualization. Combining the snippets above will help us find the images that are 600x600 in resolution and covered by license 4 with a few (6) examples displayed below</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/b93a365d45dd1e5fab90a7fcd4199d4b/href">https://medium.com/media/b93a365d45dd1e5fab90a7fcd4199d4b/href</a></iframe><p>The result is:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/936/1*U_QRaIDo2SN-eVyCJIUobg.png" /></figure><p>Even if the images are now fully accessible to the application and ready for use, these images need to be pre-processed with basic operations like a resize (to make it the size expected in the input layer of our neural network), and/or a normalization step. It is a shame that we fetched the full-size image from ApertureDB only to later discard most of that information with a resize (which most likely will downsample the image to, say, 224x224). Since ApertureDB was designed with ML use cases in mind, these basic pre-processing operations are natively supported as part of the API. Instead of retrieving the full-size images, we can simply indicate that we want the images to be resized before retrieving them, saving bandwidth and accelerating the fetching significantly.</p><p>We can retrieve resized images directly (and even rotate them as a data augmentation technique) by simply doing:</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/d5645e0a2ce6cc924680ffc8729ec2b1/href">https://medium.com/media/d5645e0a2ce6cc924680ffc8729ec2b1/href</a></iframe><p>The result is:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/977/1*N5TZ-MW3SmQ5gsX_PKGKMw.png" /></figure><p>As part of our pipeline, we may also need to retrieve metadata associated with the images. We can easily obtain a list of all the metadata properties associated with the images by doing:</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/43d844bf5ddee582e7e092d249248278/href">https://medium.com/media/43d844bf5ddee582e7e092d249248278/href</a></iframe><p>Now, let’s retrieve the metadata information associated with the images we retrieved in our last query:</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/62e2f6c69c8649d3b0685cc5b5288a65/href">https://medium.com/media/62e2f6c69c8649d3b0685cc5b5288a65/href</a></iframe><h4>Bounding boxes and segmentation masks</h4><p>Because ApertureDB recognizes images, videos, and bounding boxes as first-class citizens of the database, we can easily retrieve and show these objects with little effort. For instance, retrieving the bounding boxes associated with the images is as simple as doing:</p><pre> imgs.display(limit=6, show_bboxes=True)</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/936/1*IOBZxMtUGGWtvoABFKpTMQ.png" /></figure><p>Similarly, let’s retrieve the segmentation masks associated with the images. Same as bounding boxes, we can do that with a simple function parameter, as follows:</p><pre>imgs.display(limit=6, show_segmentation=True)</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/936/1*raSC9nFR6wIHgH9AKvDajA.png" /></figure><p>Note that the segmentation masks needed will be retrieved from ApertureDB only when explicitly requested (in this case, for displaying them). You can also use other interfaces to retrieve bounding boxes’ coordinates, labels, and segmentation polygons directly as JSON objects or Python dictionaries.</p><h4>Support for Similarity Search</h4><p>Another important piece of the puzzle when dealing with visual data are feature vectors. For instance, in the context of the COCO dataset, feature vectors contain information that describe the image or the objects on the image. Feature vectors represent this information in a high-dimensional hyper-space, which can be used to perform, among other things, a <em>“similarity search”</em> (i.e., finding objects that are similar). This <em>similarity</em> is not tied to metadata (like labels or image properties), but rather to <em>“how similar”</em> those feature vectors are. A Feature Store systems would offer this functionality, but at the expenses of dealing with yet another sub-component. But because ApertureDB recognizes feature vectors as part of its interface, associating feature vectors to images to later search for similar images is as simple as it can be, without the need of an external feature store.</p><p>Let’s take as an example the following image:</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/d196d32c047d06b97d42946cdf583ca6/href">https://medium.com/media/d196d32c047d06b97d42946cdf583ca6/href</a></iframe><p>In this case, we get a single image as a result:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/824/1*XXd4qweDEctJ1KuPwDcO2g.png" /></figure><p>Now, let’s find the 6 most similar images (and, say, their bounding boxes):</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/7905e96b6a2dc2ca28a5a35a3c97b7f6/href">https://medium.com/media/7905e96b6a2dc2ca28a5a35a3c97b7f6/href</a></iframe><figure><img alt="" src="https://cdn-images-1.medium.com/max/828/1*f69hrYTFrmvhe42orIgVZw.png" /></figure><p>We were able to retrieve similar images (i.e., people skiing in the snow) without the need for searching and filtering based on rigid labels, but rather using feature vectors as a measure of <em>similarity</em>.</p><p>As we have seen, interacting with visual data has never been easier, and we are only scratching the surface of ApertureDB’s powerful API.</p><p>Last, but not least, ApertureDB offers a <a href="https://coco.datasets.aperturedata.io/">web user interface</a> that allows a user to explore the content of the database and run an image search. Here is an example of what our webUI looks like for the COCO dataset:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/936/1*uNhRSWdxIJk68u6YHZkzYw.png" /></figure><p>If you want to learn more and try ApertureDB, we have made a free trial available through our <a href="https://aperturedata.io/demo-request">website</a>, with all the sample code we show here. Simply select the COCO Dataset from the dropdown menu, and you will receive an email with instructions on how to access your newly instantiated ApertureDB, pre-populated with the COCO dataset, in Google Cloud.</p><h4>Coming Up Next…</h4><p>While COCO is a good case to study because of its rich annotations, its size is rather small. We have designed ApertureDB to support a significantly large number of objects while providing the same simple interfaces, without sacrificing performance. We have been using much larger datasets such as the Yahoo Flickr Creative Common 100 million dataset (or YFCC100m for short) both to support real-world customer use cases, and for internal evaluation. We will be releasing this evaluation and more details soon.</p><p>Special thanks to Vishakha and Andrei from ApertureData, who helped me shape this article, and to my friends and family who reviewed and annotated it countless times.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=603971710672" width="1" height="1" alt=""><hr><p><a href="https://blogs.aperturedata.io/minute-made-data-preparation-with-aperturedb-603971710672">Minute-Made Data Preparation with ApertureDB</a> was originally published in <a href="https://blogs.aperturedata.io/">ApertureData</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
    </channel>
</rss>