Elamur Research

Physical Representation-based Predicate Optimization for a Visual Analytics Database

Paper · 2018 · Michael R. Anderson, Michael Cafarella, German Ros et al.

Summary

A database can look up an image’s capture date if the date has been recorded. Finding every image that contains a bicycle is a different kind of task. The answer may still be hidden in the pixels, so the database has to classify images as it scans them. Running a large convolutional neural network on every image makes that scan expensive. Loading the images and preparing them for the network also takes time, and those costs can determine which classifier actually finishes the scan first.

The authors’ system, Tahoma, searches for faster ways to answer a binary question about an image. It trains small classifiers that differ in both their network design and the image representation they receive. A classifier can work with a reduced-resolution image, a grayscale version, an individual color channel, or a larger full-color input. Tahoma arranges classifiers into cascades. A confident result can end the test early, while an uncertain image goes to another classifier. The system reuses predictions from held-out images to evaluate many such arrangements, then estimates their throughput under the conditions in which the images will be read and processed. Users can choose among the candidates that offer the strongest measured tradeoffs between speed and accuracy.

For 10 binary predicates drawn from ImageNet categories and evaluated on a separate collection of web images, Tahoma delivered an average 98x speedup over fine-tuned ResNet50 at comparable accuracy when the timing covered inference alone. In that same setting, it averaged a 35x speedup over the accuracy range of a baseline whose cascades used full-size color inputs and ended in ResNet50. The fastest Tahoma choices reached 20,926 frames per second on average under inference-only timing and were on average 12% less accurate than ResNet50. With archival loading and transformation costs included, the reported gains over both baselines were nearly 2x.

The experiments also show why the choice depends on the installation. Resizing provided the largest throughput gain among the tested input transformations, while extending the search to all available three-stage arrangements yielded little additional throughput at a much higher evaluation cost. In the camera scenario, selecting cascades with preparation costs included raised average throughput from 344.7 to 549.9 frames per second at the tested 5% permissible accuracy loss. A cascade can therefore have the right accuracy and still be a poor choice for a particular installation if the optimizer leaves image preparation out of its timing.

Deep dive: Physical Representation-based Predicate Optimization for a Visual Analytics Database

Tahoma speeds up image and video queries by choosing which classifiers to run and which image sizes and color formats to give them. · about 30 minutes to read

The problem and its context

The answer may have to be computed during the scan

A visual analytics database is intended to answer questions about the contents of an image collection. Some questions combine information the database already has with information it must extract from pixels. Finding bicycle images from Detroit, for instance, can involve a location test and a test for the presence of a bicycle. A stored location field can support the first test. The second requires a classifier if the database has yet to record which images contain bicycles. Tahoma addresses that second operation, the implementation of a single content predicate. A predicate here is a test that returns true or false for a given image.

The need for such a test depends on when the query becomes known. An installation with a limited collection and stable categories can compute labels ahead of time and record them as data arrives. A large collection assembled for retrospective analysis presents another situation. An engineer reviewing images from vehicles might discover a failure case and only then know what examples to look for. Old images can be relevant even when the system had no reason to compute that particular label at ingestion. The computational burden comes from having to fill in the missing labels across the collection at query time.

The paper places this problem in the history of visual retrieval. Some earlier systems relied on people to attach text labels, while others used low-level measurements extracted from images. Later work added object descriptions based on hand-written procedures and statistical methods. The authors also describe relational approaches to multimedia retrieval. Garlic, for instance, addresses the uncertainty and approximate matching involved in comparisons of multimedia content. Tahoma’s query interface treats a content predicate as true or false. The classifier can use its uncertainty internally to route an image between stages, but the completed predicate returns a definite label.

Advances in image recognition made such labels practical for more kinds of queries. The paper describes a drop from 25% to 18% in classification error in the ImageNet challenge in 2012, when a deep convolutional network was introduced into the competition. It mentions later progress, including the residual network whose ResNet50 variant serves as a baseline in the experiments. The significance for databases is that reasonably accurate classification makes the operator worth having, while the cost of running the classifier over a collection can still prevent interactive use. ImageNet Large Scale Visual Recognition Challenge · ImageNet Classification with Deep Convolutional Neural Networks · Deep Residual Learning for Image Recognition

Where the scan spends its time

The authors describe a loop that visits images and applies an expensive test. One approach to speeding up a loop like this is to visit fewer items, for example by sampling or selectively choosing inputs. Tahoma focuses on the work done for an image that the system does visit. The distinction matters because a classifier cascade changes the amount of work spent on individual images. A scan can still assign a label to each image it processes while using its expensive classifier sparingly.

The query also determines what kind of visual processing is necessary. An object detector can locate instances within an image, whereas an image classifier assigns a label to the image as a whole. A predicate that asks whether the image contains a given object can be implemented with the image-level answer. The introduction illustrates the cost of richer processing with YOLOv2, which it says requires 8.52 billion operations for a 416x416 pixel image and processes about 67 images per second on the GPU hardware described in that example. The Tahoma experiments primarily use image classifiers for the simpler presence test. YOLO9000: Better, Faster, Stronger

A cascade offers a way to limit the number of times a scan needs its expensive test. The paper traces this idea back to the Viola–Jones face detector, in which inexpensive classifiers based on simple image features could dispose of many candidate regions. It also describes subsequent cascades designed to speed up deep neural network inference, including the ones in NoScope. If an early stage makes a dependable decision on an easy image, subsequent stages can be reserved for harder ones. The authors discuss efficient network designs such as MobileNets as complementary work. Such a network could supply a stage within the larger search for a suitable cascade. MobileNets: Efficient Convolutional Neural Networks for Mobile Vision Applications

Tahoma extends the choice of an early stage to include the image it reads. The paper offers a hypothetical pair of classifiers with similarly accurate results. One takes a 3-channel color image and uses fewer convolutional layers. The other takes a 1-channel grayscale image of the same 224x224 resolution and makes up for the reduced input with additional layers. If the color classifier runs faster after its input is in memory, inference timings favor it. The grayscale classifier could still finish first if the savings from reading its smaller input outweigh the extra computation. That choice requires information about storage and preparation as well as the classifier.

Even the timing of the same general operation can change with the installation. An archive may hold full-size originals on disk. An ongoing ingestion system can prepare and store alternate representations in anticipation of queries. A camera can deliver frames directly to memory under the conditions the authors consider. A database optimizer that can choose among classifier implementations needs to know which of those costs the query will incur. The authors also draw an analogy to approximate query systems such as BlinkDB, where users can specify acceptable approximation. In Tahoma the choice concerns the quality and throughput of the image predicate. BlinkDB

The method, step by step

Turn the content question into a classification task

Suppose the database has images and the user wants to find the bicycle images. Tahoma’s job is to provide a yes-or-no classifier for that category. The authors describe the possible contents of an image as a tuple, a collection with a place for each content attribute relevant to queries. An image may have several such attributes. A bicycle query only needs the entry for bicycle presence. The classifier’s predictions can be understood as filling a virtual column for that entry as the scan runs.

I = (I₁, …, Iₙ)

Here I is the image corpus, I₁ through Iₙ are its component images, and n is the number of images. Parentheses enclose the collection and the ellipsis stands for intermediate entries.

Tᵢ = (tᵢ₁, …, tᵢₘ)

Tᵢ is the content tuple of image Iᵢ. The index i identifies the image, m is the number of entries in its tuple, and tᵢⱼ denotes the entry at position j. The tuple notation describes the content that a query can ask about, even when the database must compute the answer from the image.

Lᵢ = K(Iᵢ)

K is the classifier used for the predicate, Iᵢ is the image at position i, and Lᵢ is its predicted binary label for the requested content entry. The parentheses in K(Iᵢ) denote applying the classifier to that image. A single network or a cascade can implement K.

Tahoma separates the installation of a predicate from its execution. Installation requires labeled data and prepares classifiers and routing thresholds. The system can then evaluate candidate cascades and identify which ones give the strongest tradeoffs. At query time it selects an implementation for the requested predicate and applies it to the image collection. The authors describe the following sequence.

How Tahoma prepares and runs an image predicate

The steps in order.

How Tahoma prepares and runs an image predicateStep 1: Split labeled images by purpose1. Split labeled images by purposeStep 2: Train classifiers across architectures and image formats2. Train classifiers across architectures and image formatsStep 3: Calibrate confidence thresholds on separate images3. Calibrate confidence thresholds on separate imagesStep 4: Profile inference and image handling costs4. Profile inference and image handling costsStep 5: Simulate candidate cascades with held-out predictions5. Simulate candidate cascades with held-out predictionsStep 6: Identify the accuracy and throughput frontier6. Identify the accuracy and throughput frontierStep 7: Select and run a cascade7. Select and run a cascade

Build classifiers around different inputs

The individual classifiers are convolutional neural networks, or CNNs. In the small networks used here, convolutional layers respond to patterns in the input. Pooling reduces the spatial detail carried forward, and rectified linear activations supply nonlinear responses. A dense layer, which takes inputs from across the preceding representation, feeds a sigmoid output. The sigmoid produces a score on the scale that the cascade uses to decide whether to accept or defer the classification.

Tahoma varies the number of convolutional layers, the number of convolutional nodes per layer, and the width of the final dense layer. It also changes what is fed to the network. The possible input sizes in the experiments are 30x30, 60x60, 120x120, and 224x224 pixels. At each size it considers full 3-channel color, each individual red, green, or blue channel, and a grayscale representation. The result is a collection of classifiers trained for the same predicate with different arrangements of layers and different amounts or kinds of visual information.

An architecture specification tells the trainer how to build the network. A transformation tells the system how to prepare an image for it. Giving both a place in the search means that an input reduction can be paired with a network suited to the reduced representation. A small image can retain enough information for confident decisions on some examples even if the same representation leaves other examples ambiguous. The cascade can exploit the first group and defer the second.

F(I) = I′

In this expression I denotes an individual input image, F is the chosen transformation function, and I′ is the resulting representation. The prime distinguishes the transformed image from its source. Here the paper uses I for a single image in the transformation definition and for the collection when describing the corpus.

ℱ × 𝒜

ℱ is the collection of available transformation functions, 𝒜 is the collection of network architecture specifications, and × denotes their cross product. Each pair specifies a candidate classifier design. The experiments use 360 small CNNs for each predicate. A fine-tuned ResNet50 is also available for comparisons and as a possible final stage.

Give training, configuration and evaluation different images

The system design describes a requirement of 3,000–4,000 labeled images per predicate, with positive and negative examples in equal numbers. A positive example contains the category under test according to its label. A negative example is labeled as an image outside that category. Keeping these labels attached to the image when creating alternate representations lets all candidate classifiers learn the same binary task.

Tahoma divides the labeled material according to what decisions it will support. The training set, I_train, supplies examples used to adjust the networks. The configuration set, I_config, is used to determine which scores are sufficiently trustworthy for early exit. The evaluation set, I_eval, is used to measure the behavior of the completed cascades. In the reported experiments, training and threshold configuration draw on ImageNet images, while performance evaluation uses separate images collected through web image search. That arrangement gives the threshold search and the final accuracy calculation different examples.

The early exit rule depends on where a classifier’s score falls. A low score supports a negative decision, and a high score supports a positive one. The thresholds can leave a band between those regions in which the classifier defers the case. A classifier that exits on only the clearest images can be useful at the front of the cascade even if it would be a poor choice for deciding every image on its own. Its job there is to make a dependable decision frequently enough to save the work of the later stages.

o ≤ p_low or o ≥ p_high

o is the classifier’s score, a real number from 0 to 1. p_low and p_high are its lower and upper decision thresholds, respectively. ≤ means less than or equal to, and ≥ means greater than or equal to. A score in either of these outer regions triggers acceptance at a stage that can defer.

p_low < o < p_high

The < signs denote strict inequalities. The expression says that o exceeds p_low and falls below p_high. Such a case proceeds to the next stage. If the final classifier is reached, its decision is used, so the cascade produces a label even for an image that all earlier stages defer.

To set the thresholds, Tahoma searches a grid of possible values on the configuration images. Precision concerns how reliably the selected predictions are correct, while recall concerns how many relevant cases are recovered. The authors use the grid to find thresholds that achieve at least the target precision and then favor the thresholds that maximize recall. A high precision setting can produce fewer early decisions by raising the standard a score must meet. Several settings let the optimizer consider different balances between the amount of early filtering and the risk of committing to an incorrect answer.

An important design choice is that thresholds belong to individual classifiers. A classifier’s thresholds are fitted without specifying which other classifiers will run before or after it. Once fitted, they can be reused across candidate cascades. In actual execution, a classifier late in the cascade sees the cases that survived earlier stages, so its effective input population can differ from the configuration set. The system deals with that at evaluation time by replaying each candidate’s routing on held-out images. It does not have to fit new thresholds each time it considers a different neighboring stage.

Reuse predictions to evaluate whole cascades

C = (M₁, …, Mₙ)

C denotes a cascade, M₁ through Mₙ are its basic classifiers in execution order, and n is its depth, the number of stages. The tuple is ordered because changing which classifier sees an image first can change both its eventual answer and the work required to obtain it. The search compares a collection of such C values built from the available classifiers.

Running every candidate over the images from scratch would perform the same network evaluation repeatedly. Tahoma instead runs each basic classifier on the evaluation images and records the resulting scores. To evaluate a particular cascade, it starts with the recorded score for the first classifier and applies that classifier’s decision thresholds. For any image that would have continued, it retrieves the recorded score from the next stage. This procedure reconstructs the label the cascade would have produced and shows which stages and input representations that image would have needed.

Replaying decisions preserves the dependence between stages. If an early classifier regularly defers the very images a later classifier also finds hard, those images still go through both stages in the replay. A method that multiplied independent estimates of how frequently the stages defer could miss that pattern. Here the reuse comes from having saved each classifier’s result for the same image. The routing is recomputed in the order specified by each candidate.

The paper distinguishes this work from the initial training. It reports that evaluating 1.3 million cascades took just over one minute once the individual predictions had been generated. The more precise count for the main experimental search is 1,301,405 candidate cascades per predicate. These figures refer to the reuse and evaluation of the prepared components. Training the components and producing their scores are prerequisites.

Price the work a scan will actually do

Tahoma evaluates cascades by accuracy and throughput. Accuracy is the fraction of evaluation labels that agree with the known labels. Throughput is the number of images classified per unit of time. The timing definition in the paper makes the cost of getting the input ready explicit.

t_classify = t_load + t_transform + t_infer

t_classify is average classification time under the chosen deployment assumptions. t_load is average time spent obtaining the needed image data, t_transform is average time spent preparing the required image representation, and t_infer is average time spent running the classifier. The plus signs add these cost components. Measurements refer to a representative collection of inputs on the system being profiled.

throughput = 1 / t_classify

throughput is the classification rate, 1 represents a single classified image, / denotes division, and t_classify is the average time per image. The rate can be expressed in frames per second when the time is measured in seconds.

For a cascade, the score replay determines which costs apply to each image. A later classifier generates an inference cost only if the image reaches it. Image handling costs are charged once per input representation needed for a given image. If successive stages both take a 30x30 red-channel input, preparing that image for the first pays for the representation used by the second. The latter still has to run its own classifier. The distinction lets the optimizer account for the way shared inputs change the marginal cost of an additional stage.

Cost profiles can represent different situations with the same recorded decisions. An inference-only profile presumes that the network’s input is already prepared. An archive profile includes reading the source and creating the representation needed by the classifier. A camera profile includes the preparation work when the image arrives in memory. An ongoing-ingestion profile accounts for loading a suitable version that was prepared and saved in advance. These profiles can assign different throughputs to the same candidate without changing its predicted labels on the same evaluation images.

Choose among the best available tradeoffs

Once accuracy and throughput have been evaluated, Tahoma identifies a Pareto frontier. A cascade belongs on this frontier if no candidate is at least as good on both measures and strictly better on one. For instance, a candidate that gives the same accuracy as another and scans faster makes the slower candidate unnecessary for these objectives. If a faster candidate also has lower accuracy, both may matter, depending on the quality the user needs.

O(n log n)

O denotes an asymptotic upper bound on growth, n here is the number of candidate points being compared, and log n is the logarithm of that count. Multiplication between n and log n is implicit. The paper gives this bound for finding a Pareto frontier in two dimensions. In this expression n counts cascades, whereas in the ordered cascade tuple it counts stages.

At query time the user can specify a tolerable loss in accuracy or throughput. The paper gives an example in which U_acc, the user’s accuracy-loss constraint, is 0.05 and U_thru, the corresponding throughput constraint, is left unspecified. The stated accuracy floor is 95% of the best available cascade’s accuracy. A selection from the frontier can then emphasize throughput among candidates that meet the floor. This is a relative criterion tied to the measured accuracy of the candidates for that predicate.

The authors implemented Tahoma as a standalone prototype. They describe how a relational database could expose the content predicate as a user-defined function and use the measured cost when planning queries. A metadata condition could reduce the set of images reaching that function. The database could also store predicate outputs for newly ingested images after the predicate had been installed. These are integration designs discussed in the paper. The experimental comparison concerns the predicate implementations and their estimated or measured rates under the specified cost conditions.

Experiments and results

Images, predicates and comparison methods

The main evaluation uses 10 object categories sampled from the 1,000 ImageNet categories. They span acorn, amphibian, cloak and coho, along with fence, ferret and komondor. Pinwheel, scorpion and wallet complete the set. Each category defines a separate query and a separate training problem. The classifier for a fence query sees positive and negative examples with respect to fence presence. A separate classifier collection is prepared for a query about wallets. This setup tests whether the same search procedure can produce effective operators for different content predicates.

The authors started from about 1,200 ImageNet training images per category. They held out 200 category images for validation, which supplies the material for fitting the routing thresholds. The remaining images of the target category served as positive training examples, while the authors sampled a matching number of negatives from the other 999 ImageNet categories. They augmented training by adding horizontally flipped copies. Validation examples were labeled using the analogous positive and negative construction.

For performance evaluation, the authors used image search from Google and Bing. They gathered roughly 500 positive images for each target category. To obtain negative examples, they built a pool from searches covering the other 999 categories, then randomly selected negatives to match the positive count. Accuracy therefore refers to labels on a balanced evaluation collection assembled for each predicate. The main results use ImageNet to define the categories and furnish training and validation data, while the separate web-image collection supplies the examples on which the final cascade comparisons are made.

The small CNNs were trained with Keras running on TensorFlow. The tested architectures used 1, 2, or 4 convolutional layers, with 16 or 32 convolutional nodes per layer and 16, 32, or 64 nodes in the final dense layer. The different architectures were combined with the input formats described above. For each classifier, 0.91, 0.93, 0.95, 0.97, and 0.99 were the target precision settings used to configure decision thresholds on validation data. Those settings specify calibration targets for early decisions. Overall accuracy is measured separately when the whole cascade is evaluated.

The ResNet50 comparator was already trained on ImageNet and then adapted to each binary task. The authors replaced its 1000-class output with a 64-node dense layer using rectified linear activation and a 2-node softmax layer giving the binary prediction. The new layers learned from the same training set used by the small classifiers. The reported fine-tuning took 2 to 4 hours on a GPU. Training all 360 small CNNs for a predicate took about 12 hours when performed serially on an NVIDIA Tesla K80. The authors observe that the small networks can be trained in parallel, with runtimes for individual networks ranging from less than a minute to nearly an hour.

The main experiments compare Tahoma with the fine-tuned ResNet50 running alone and with a family called Baseline. A Baseline cascade has two stages, both taking full-color 224x224 inputs, and it ends with ResNet50. It represents the choice to use a specialized classifier to avoid some expensive calls while retaining the original input format. Tahoma can also choose a smaller or reduced-color image and has a larger set of possible arrangements. Its main search includes single-stage and two-stage candidates as well as three-stage candidates ending in ResNet50. The Baseline comparison thus measures the combined advantage of a broader design space, with the transformation and depth analyses examining parts of that advantage separately.

All CNN training, inference and throughput measurements used an Amazon EC2 p2.xlarge instance with an NVIDIA Tesla K80. The authors used a 32-core Opteron 6100 server running at 2.8GHz with 512GB RAM for CPU work such as identifying frontiers. These details qualify both the observed timings and the cost tradeoffs. A classifier’s accuracy can be evaluated with the same recorded scores when the cost assumptions change, while its position in the throughput ranking is tied to the measured system and the chosen profile.

What counts as a speedup

The paper compares throughput under four definitions of what the query must pay for. Infer Only counts CNN inference. Archive adds the cost of loading a full-size image from an SSD and transforming it for the classifier. Ongoing assumes the needed representations were prepared during ingestion and charges for retrieving the appropriate stored version. Camera assumes negligible loading time and charges for the transformation as well as inference. These definitions apply when comparing against the baselines, so a reported gain refers to a specific set of costs.

For comparisons with ResNet50 alone, the authors select the Tahoma candidate on the frontier whose accuracy is closest to and above the ResNet50 accuracy. The comparison has a different interpretation from choosing the fastest Tahoma option. The first asks how much throughput the expanded design space offers while meeting the reference classifier’s measured accuracy. The second asks how fast the predicate can run with the accuracy that the fastest option happens to provide.

A set of cascades can offer different gains at different accuracy levels. To compare such sets, the paper plots accuracy against throughput and treats the frontier as a step function. It measures the area to the left of that stepped curve over the accuracy interval being compared. The resulting area is called ALC. Dividing by the width of the accuracy interval gives the average throughput over that interval. Comparing areas over the same interval gives a throughput speedup for one frontier relative to another. The authors use the smaller accuracy range for comparative evaluation and can also reprice a set of candidates under different timing assumptions before measuring its area.

average throughput = ALC / accuracy interval width

ALC is the area to the left of the stepped throughput curve over the selected accuracy interval. accuracy interval width is the extent of that interval, and / denotes division. average throughput here summarizes the rates available along a frontier over the interval. It has a different role from averaging the selected rate across different predicates.

frontier speedup = ALC_candidate / ALC_reference

ALC_candidate denotes the area for the frontier being assessed. ALC_reference is the area for the comparison frontier over the same accuracy interval. Their quotient is frontier speedup. When a frontier from another deployment is repriced this way, it represents the options selected under the original assumptions, whether or not those options are still optimal after repricing.

Large inference gains, smaller gains with archival costs

Under Infer Only, the Tahoma candidate selected at ResNet50’s accuracy level delivered an average 98x speedup over standalone fine-tuned ResNet50 across the 10 predicates. Compared with the Baseline cascade family, Tahoma’s average speedup over the family’s accuracy range was 35x. When the comparison instead used the accuracy of the fastest Baseline cascade for each predicate, Tahoma averaged a 59x speedup. These results answer different questions. The frontier-wide result summarizes gains over an interval. The comparison to the fastest Baseline focuses on the operating point where that baseline family places the most emphasis on throughput.

The gains narrowed when the accounting included additional data handling. In Archive, which charges for reading and transforming the source image, the paper reports nearly 2x speedups versus both ResNet50 and Baseline. A classifier can make the neural computation much cheaper while leaving an expensive archive read on the query path. The resulting end-to-end classification rate reflects the remaining work. The paper uses this scenario to show why the inference-only figures are best understood as results under a particular accounting assumption.

Tahoma also lets the user choose the highest-throughput option without matching ResNet50 accuracy. For every tested predicate, the fastest choice had a single specialized classifier. Under Infer Only these choices averaged 20,926 frames per second, versus about 75 frames per second for fine-tuned ResNet50. The paper gives the speedup as 280 times and reports that the fastest Tahoma choices were on average 12% less accurate than ResNet50 under this comparison. The result shows where the top speed figures sit on the quality and throughput tradeoff.

Infer Only throughput on the web-image evaluation sets for ImageNet-derived predicates

Tahoma’s fastest choices process more images per second, with a lower measured accuracy.

Infer Only throughput on the web-image evaluation sets for ImageNet-derived predicatesFine-tuned ResNet50: 75Fine-tuned ResNet5075Tahoma, fastest choice (this paper): 20,926Tahoma, fastest choice (this paper)20,926
The numbers
System or settingframes per second
Fine-tuned ResNet5075
Tahoma, fastest choice (this paper)20,926

Under Ongoing, the fastest Tahoma choices achieved 5484 frames per second, reported as an 81x speedup over the fine-tuned ResNet50 comparison. In this setting the optimizer can benefit from having smaller representations already on disk, and the measurement accounts for their loading. The paper’s 12% accuracy figure is given for the fastest-choice comparison in Infer Only. The choice of which candidate is fastest can change when the cost assumptions change.

NoScope on its public video datasets

The authors also ran a direct comparison with NoScope on its public coral and jackson video datasets, using the NoScope authors’ code and default dataset settings. Both systems used YOLOv2 as the expensive final classifier, a target precision of 0.95 when selecting thresholds, and AWS p2.xlarge instances. The paper notes that its NoScope installation had different CPU and GPU specifications from those in NoScope’s own publication. The relevant throughput comparison is between the systems as run for this experiment.

NoScope can avoid some classification calls by comparing a frame with previously seen frames and reusing earlier results when they are similar enough. To give Tahoma the same opportunity, the authors constructed a variant called Tahoma +DD. They recorded the frame similarities produced by NoScope’s difference detector and used the same reuse threshold to decide when Tahoma could supply a previous result. The experiment therefore evaluates Tahoma’s cascades with simulated frame reuse. Both systems also processed one of every 30 frames. Reported rates count the frames included in processing and exclude those skipped by this periodic rule.

The comparison uses Infer Only cost accounting and selects the Tahoma +DD cascade at the closest higher accuracy to NoScope for each dataset. On coral, Tahoma +DD processed 10,700 frames per second, compared with NoScope’s 3494 frames per second, a reported 3.1x speedup. On jackson, Tahoma +DD processed 7,150 frames per second, compared with NoScope’s 260 frames per second, a reported 27.5x speedup. The conditions around frame reuse and final-classifier calls help explain why the gains differed across videos.

Processed-frame throughput on NoScope’s jackson dataset under inference-only timing

With simulated frame reuse, Tahoma reaches higher throughput at the selected accuracy.

Processed-frame throughput on NoScope’s jackson dataset under inference-only timingNoScope: 260NoScope260Tahoma +DD (this paper): 7,150Tahoma +DD (this paper)7,150
The numbers
System or settingframes per second
NoScope260
Tahoma +DD (this paper)7,150

The authors report that the difference detector reused results for 25.2% of the relevant coral frames and 3.8% for jackson. On jackson, NoScope also called YOLOv2 for a substantial share of frames. The larger search space gave Tahoma +DD an accurate cascade that typically avoided that last call. The reuse percentages describe the video-specific opportunity to skip work, while the frequency of YOLOv2 calls depends on the cascade that handles the remaining cases.

What the ablations show

Accounting for image preparation can change the winner

The deployment comparison holds the pool of candidate cascades fixed and varies the cost information used to select from it. The scenario-oblivious procedure picks from candidates rated on inference alone and then measures those choices with the scenario’s actual costs included. The scenario-aware procedure includes those costs when making the choice. Both are evaluated at the same permissible accuracy loss for a given comparison. A throughput difference therefore shows the effect of choosing with a different cost profile, without expanding the set of trained classifiers.

In the Camera scenario, the fixed costs of obtaining an image are taken to be negligible, but creating the network input still costs time. At 5% permissible accuracy loss, the scenario-oblivious choices averaged 344.7 frames per second and the scenario-aware choices averaged 549.9 frames per second. The paper reports a 59.5% throughput increase. Some candidates that look fast once a representation exists lose their advantage when the query must create that representation for the images it sees.

Camera throughput on the web-image evaluation sets at 5% permissible accuracy loss

Selecting cascades with transformation costs included raises average throughput.

Camera throughput on the web-image evaluation sets at 5% permissible accuracy lossInfer Only selection, timed under Camera: 344.7Infer Only selection, timed under Camera344.7Camera-aware selection (this paper): 549.9Camera-aware selection (this paper)549.9
The numbers
System or settingframes per second
Infer Only selection, timed under Camera344.7
Camera-aware selection (this paper)549.9

The benefit varied with accuracy tolerance. Under Camera at 0% permissible loss, both selection procedures yielded 107.1 frames per second on average. At 2% permissible loss, scenario awareness increased the average from 267.5 to 324.6 frames per second, and at 10% permissible loss it increased the average from 568.0 to 806.8 frames per second. The gain reported at 5% was larger in percentage terms than at the other tested Camera settings. The candidates available within an accuracy requirement can determine how much room there is to benefit from a better cost estimate.

The pattern also varied across deployments. At 5% permissible loss in Archive, the average increased from 103.1 to 117.1 frames per second, a reported +13.5%. Under Ongoing at the same permissible loss, it increased from 1938.7 to 2000.8 frames per second, a reported +3.2%. Several Ongoing comparisons differed little at the precision shown in the paper. Representations in this scenario are already prepared before a query, so the additional costs used to select the cascade arise from loading the required inputs. The differences establish the value of scenario awareness under particular costs and candidate choices.

The paper also visualizes this effect by plotting candidates selected for one profile together with the frontier for another. In an illustrative semitruck predicate, the inputs start in memory in their full-size form. Pricing preprocessing moves different candidates by different amounts. The curve traced out by the old choices can include candidates that are now slower than alternatives at comparable accuracy. Repricing and rerunning frontier selection addresses that ordering problem. Adjusting every throughput estimate by a common factor would preserve the old ordering.

Resizing changes which classifiers are practical

The authors isolate the contribution of input transformations by constructing restricted cascade families. The family called None uses full-size 224x224 color inputs. Color Variations adds individual color channels and grayscale at full size. Resizing changes spatial resolution, and Full allows the whole transformation set. For each predicate the authors summarize frontier throughput with ALC using the Full family’s accuracy range. Comparing the restricted families in this way tests which input choices provide useful combinations of speed and accuracy.

Resizing has the largest effect. The reported average throughput with resizing was nearly ten-fold that of the family with full-size color inputs alone. The paper illustrates the amount of data reaching the classifiers by comparing 2,700 input values for a 3-channel 30x30 image with 150,528 for a 3-channel 224x224 image. The experiment shows the practical benefit of giving the search access to the small-input networks. Their lower computational costs can outweigh the preprocessing required to resize the image.

Color reduction also changes how many values a classifier receives. The paper describes how using an individual channel or grayscale reduces the input from three channels to one. The restricted-family comparison gives the largest observed improvement to the changes in spatial resolution. The Full family gives Tahoma the option to use both kinds of change where they help. The experiment compares the resulting cascade families, so it measures what the allowed transformations make possible across the search instead of assigning one speedup to every image transformed in the same way.

Deeper search gives diminishing returns

The depth analysis asks how much throughput the system gains from being allowed to search more complex cascades. A depth-limited family includes the shorter candidates as well. Thus the comparison can show whether deeper arrangements add useful points to a frontier that already includes single classifiers and shorter cascades. The paper illustrates the pattern for the fence predicate in Camera and reports similar behavior for the other predicates and scenarios.

The main search permits up to two specialized stages, with ResNet50 as a possible final stage. Allowing any available classifier at each of three stages broadens the search to about 45 million distinct cascades per predicate. In the paper’s comparison, that full three-stage search increased average throughput by 1.0% over the family capped at two stages plus ResNet50. Evaluation took just over 40 minutes per predicate in the comparison, nearly 40-fold longer. The reported throughput improvement is a property of the candidate set’s query-time choices. The longer duration is the time needed to evaluate those choices during preparation.

The authors keep the restricted search for the main results because the extra evaluation effort yielded little additional throughput. They describe enumerating the full four-stage space as intractable. The depth experiment supports the particular restriction used in Tahoma. The fastest choices in the main benchmark went still further in the direction of simplicity and used only a single specialized classifier. Deeper candidates are valuable when early routing and a stronger fallback can help satisfy an accuracy requirement, while the amount of depth worth searching depends on how much the existing frontier can improve.

Limitations

Limits the authors identify

The paper concerns the implementation of a single binary image predicate. A relational system could combine several such predicates with metadata conditions, but the authors leave coordinated optimization of multiple content predicates for later work. The measured results therefore concern such operations as deciding whether an image contains a bicycle. They do not establish the throughput of a complete query plan that also joins records, aggregates results, or shares work across several content tests. The suggested relational integration remains an architectural proposal.

The authors also distinguish image classification from localization. A yes-or-no image label is sufficient for a presence predicate. An application that needs the positions of objects would need a detector, and the authors suggest that detectors could be arranged in cascades. The reported measurements for the binary classifiers give no direct evidence about localization quality or the corresponding acceleration. In the NoScope comparison, YOLOv2 supplies an expensive last stage for the video query. That comparison still evaluates throughput at matched classification accuracy, rather than showing that the system speeds up the production of full detection outputs.

The need for classification during a query is conditional. If a corpus is small or grows slowly, or if the possible predicates are stable and known, the authors point out that the labels can be computed ahead of time and stored. Tahoma is intended for collections or exploratory workloads where that strategy is insufficient. The system also needs labels and preparation time when a new predicate is installed. The authors address the training burden with small classifiers, parallelizable training and fine-tuning of the larger network. Their reported serial training time still matters when judging how soon a newly specified query can be served.

The search is bounded by the candidate designs and by the available evaluation time. The authors’ depth experiment motivates the cap they use for the main measurements. Likewise, the thresholds are configured for each classifier outside the context of a particular complete cascade. This makes reuse and large-scale enumeration feasible. It leaves open what other operating points might be reached by fitting thresholds jointly in a selected cascade or by introducing new network and input designs.

Limits visible in the evaluation

The main test uses randomly selected ImageNet categories and balanced web-image collections. That setup provides a controlled comparison across predicates, but it gives no direct measurement of accuracy for a corpus with a substantially different proportion of positive images. Cascade throughput can change as well. An incoming stream that sends many images to the fallback will incur more inference and potentially more input preparation than one for which early stages frequently make decisive predictions. The reported rate and accuracy describe the image populations and costs used in each comparison.

The paper evaluates completed candidates on images separate from classifier training and threshold configuration. The scores from that evaluation are also used to choose the reported frontier from a large family. A further test on an untouched deployment corpus could measure how the selected candidates hold up after that selection. The paper gives a point estimate of the tradeoffs available on its evaluation collections. It does not give a statistical guarantee that a chosen cascade will satisfy the same accuracy floor when the images change.

The handling costs are representative profiles. The classifier scores can be replayed with those costs so that many candidates can be compared without running every complete query. This provides evidence about the effect of loading and transformation, with the underlying timings tied to the reported hardware and storage assumptions. The results leave open the performance of a full deployment with other sources of delay, such as how a relational engine schedules simultaneous scans. In particular, Ongoing assigns preparation to ingestion, which makes the query-time result different from an accounting of all ingestion, storage and query costs together.

The comparison with NoScope is narrower than the main predicate study. It uses coral and jackson, the public datasets available to the authors, and a simulated difference detector for Tahoma. The rates have a specific denominator because periodically skipped frames are excluded. The result shows a benefit for the selected cascades under those shared experimental conditions. Actual execution with frame reuse integrated throughout a deployed pipeline would be a separate measurement, and the difference in reuse and fallback behavior across the two videos shows why a video-wide speedup cannot be assumed from either example.

Finally, the large speedup figures refer to distinct quality criteria. The 98x result matches the fine-tuned reference classifier’s measured accuracy under inference-only timing. The fastest choices make a larger throughput gain while giving up accuracy. The data-handling experiments in turn show smaller gains under some more expensive cost profiles. The strongest claim supported across these results is that jointly choosing a classifier arrangement and its input representations can improve the available operating points, with the size of the improvement determined by the corpus, accuracy requirement and deployment costs.

What came after

The paper identifies two directions for extending Tahoma. One is to exploit the similarity of adjacent video frames so that decisions made for one frame can help with nearby frames. The NoScope comparison illustrates how frame reuse can be combined with Tahoma’s choice of cascade, using recorded similarity decisions for the experiment. The other direction is to extract richer visual information for more complex analytical queries. The authors present both as future work. No subsequent study is documented here as having adopted or tested those extensions.

Cite

Cite as Michael R. Anderson, Michael Cafarella, German Ros and Thomas F. Wenisch. 2018. Physical Representation-based Predicate Optimization for a Visual Analytics Database. arXiv:1806.04226 · Proceedings of the 35th IEEE International Conference on Data Engineering (ICDE 2019), 1466-1477.

The paper itself, not this page. BibTeX from the library's record of the work. DOI 10.1109/icde.2019.00132 · arXiv 1806.04226

@misc{anderson2018physical,
  title = {{Physical Representation-based Predicate Optimization for a Visual Analytics Database}},
  author = {Michael R. Anderson, Michael Cafarella, German Ros and Thomas F. Wenisch},
  year = {2018},
  doi = {10.1109/icde.2019.00132},
  eprint = {1806.04226},
  archivePrefix = {arXiv},
  url = {https://doi.org/10.1109/icde.2019.00132}
}

↑ back to top

This page in Markdown https://md.research.elamur.ai/free/en/papers/anderson-2018-physical-representation-based-predicate-optimization/