{'fraction_non_alphanumeric': 0.03428494749907746, 'fraction_numerical': 0.0055016941192257375, 'mean_word_length': 4.816585365853658, 'pattern_counts': {'":': 0, '<': 0, '<?xml version=': 0, '>': 0, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 12, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
Revisit Visual Representation in Analytics Taxonomy: A Compression Perspective

Visual analytics have played an increasingly critical role in the Internet of Things, where massive visual signals have to be compressed and fed into machines. But facing such big data and constrained bandwidth capacity, existing image/video compression methods lead to very low-quality representations, while existing feature compression techniques fail to support diversified visual analytics applications/tasks with low-bit-rate representations. In this paper, we raise and study the novel problem of supporting multiple machine vision analytics tasks with the compressed visual representation, namely, the information compression problem in analytics taxonomy. By utilizing the intrinsic transferability among different tasks, our framework successfully constructs compact and expressive representations at low bit-rates to support a diversified set of machine vision tasks, including both high-level semantic-related tasks and mid-level geometry analytic tasks. In order to impose compactness in the representations, we propose a codebook-based hyperprior, which helps map the representation into a low-dimensional manifold. As it well fits the signal structure of the deep visual feature, it facilitates more accurate entropy estimation, and results in higher compression efficiency. With the proposed framework and the codebook-based hyperprior, we further investigate the relationship of different task features owning different levels of abstraction granularity. Experimental results demonstrate that with the proposed scheme, a set of diversified tasks can be supported at a significantly lower bit-rate, compared with existing compression schemes.


Introduction
In the big data era, the Internet of Things generates massive and heterogenous visual data. The data volume is too large that conventional paradigm, i.e. compressing videos and analyzing in the cloud, leads to severe compression artifacts and largely degrades the usability and robustness of visual analytics systems. Directly compressing the visual features is more feasible. However, existing techniques cannot support various tasks with a unified representation and transmitting multiple features also consumes large volume bit-rates when dealing with tremendous visual data. Ideally, the desirable visual information compression for machine analytics prefers the following properties: Compactness. Image/video pixels carry much redundant information, some of which is unnecessary for machine vision analytics. The compression scheme should only select the most valuable information for analytics to achieve compactness in the representation, in order to improve the efficiency of the whole processing system.
Versatility. Due to the diversity of applications, such a scheme has to work with a wide range of analytics tasks/applications. Some tasks handle object/background semantics, e.g. object recognition [21] and semantic segmentation [19]. Other tasks may focus on the geometry of objects/background, including 3D and 2D vision analytics, e.g. surface normal estimation [14], depth estimation [22], and edge extraction [9].
Scalability. Constraints on bit-rates and requirements of precision vary among different application scenarios. A practical vision analytics system should be flexible to support tasks that require more abundant information when more bit-rates can be provided. Meanwhile, it should be possible to enforce the compactness of the compressed feature when the constraint on the bit-rate is tight.
Some works explore the joint optimization of visual analytics and compression, e.g. semantic guided bit allocation [5,15], analytics with image bit-streams [25]. Recently, the video coding for machine (VCM) paradigm [11] attempts to bridge the gap between feature coding for machine vision and video compression by typical geometric visual descriptors, e.g. key points [27] and edges [28]. However, these schemes still rely on reconstructed video representation at the low bit-rate, and thus lack versatility and scalability. Meanwhile, there are works on compressing highly abstract visual features [20,10,12] and deep features [4,6]. It has been proposed in [23] and [13] to jointly optimize the feature extraction and compression for visual classification. But very deep features without spatial dimensions are adopted, which results in inability to handle various kinds of tasks.
It has been analyzed in [29] that different machine vision tasks have underlying transferability among features extracted by learned neural networks. The result indicates that some visual information can be shared among tasks, and there exists cross-task feature redundancy. Thus, it implies the great potential to collaboratively compress a set of visual tasks. However, it is still unclear about the characteristics of different tasks from the perspective of information entropy, and how to fully investigate their complementarity. It is non-trivial to properly aggregate different granularity features to support a variety of tasks jointly.
In this work, we explore to address the problem of information compression in analytics taxonomy. We study the signal structure of deep feature representations, and propose a codebook-based hyperprior model to estimate the information entropy of the general visual representations. With the proposed method, we study the rate-distortion characteristics of the representations among different tasks. The study leads to an aggregation transformed compression model that generates a unified representation from multiple representations. Such a compression scheme saves more bit-rates than the strategy of compressing for each task independently. We further explore the potential of the proposed information compression scheme to support external unseen tasks. Our contributions are summarized as follows, • To the best of our knowledge, we are the first to formulate and study the problem of visual data compression in analytics taxonomy, where the compression of the unified feature for both high-level semantic-related tasks and mid-level geometry analytic tasks are investigated.
• We propose a codebook-based hyperprior model to compress deep feature representations. The proposed scheme employs a novel entropy estimation to well fit the signal structure of deep visual data. With the proposed scheme, we minimize the bit-rates but still efficiently support different machine vision tasks.
• With the compression scheme, we further study the joint compression of visual data for a set of tasks. We show that a set of tasks can be supported by unified compressed representation. We also explore the potential of the compressed representation to support unseen tasks.

From the Remote Source Coding Perspective
This section aims to formulate the rate-distortion (R-D) optimization problem for information compression in analytics taxonomy. Compared with the traditional R-D performance of the video compression, the compression for analytics has two distinct differences: 1) the original signal (i.e. the ground truth labels) cannot be observed during the encoding process; 2) the compression scheme has to consider aggregated R-D performance measuring a wide range of tasks (including known and unseen) in an emerging collaborative intelligent system. The distinctions lead to the indirect source coding problem [18].
As shown in Fig. 1a, X is the random variable representing the captured image/video by the front-end sensors, which are assumed to be generated by a stochastic process P X|Y1,Y2,...,Y N conditioned on (a) From the remote source coding perspective.
Compression for analytics with knowledgeable neural networks. Figure 1: The problem formulation of the compression for analytics in a collaborative intelligent visual analytics system. (a) The goal is to estimate the latent semantic labels from the observed image data, constrained by the bandwidth. (b) When the problem is relaxed with the help of pre-trained neural networks, the proposed turns into compact, effective, and general feature extraction, which needs to be optimized in three aspects: information entropy, aggregation transform and generality.
the semantic labels Y 1 , Y 2 , ..., Y N , where N is the total task number. For convenience, we refer Y = (Y 1 , Y 2 , ..., Y N ) to the random vector related to a wide range of possible machine vision tasks (known and unseen). It represents the intrinsic semantics.
The goal of the compression scheme is to extract semantic predictionsŷ = (ŷ 1 ,ŷ 2 , · · · ,ŷ N ), from the observed image x ∼ P X|Y , to minimize the distortion under the constraint of bit-rate. The aggregated distortion d * (·) w.r.t. the semantic predictionŷ and the original semantic label y = (y 1 , y 2 , · · · , y N ) is defined as, where d t :Ŷ t × Y t → R, t ∈ [1, N ] is a distortion metric forŷ t ∈Ŷ t with the ground truth label y t ∈ Y t .Ŷ t × Y t is the corresponding sample space of (Ŷ t , Y t ). f (·) defines the aggregation of different distortion metrics.
As Y cannot be observed when conducting analytics on X, we can assume a Markov chain Y → X →Ŷ [24,17], namely predictingŷ from x is not correlated with y. The goal of achieving the optimal analytics performance can be formulated as the following optimization problem, where I(·; ·) denotes the mutual information and R denotes the bit-rate constraint. The estimated Y can only be generated from the noisy observation X. According to existing works on indirect source coding [8,26], if the distortion metric d * (·) is known, the best R-D tradeoff is attained with the estimation-then-compression strategy, namely to first estimateŶ from X and then compresŝ Y according to the R-D tradeoff directly. However, such optimality in the ideal circumstance is intractable and impractical in the intelligent visual analytics system targeting real applications: • Absence of the accurate definition of d * (·). The aggregation function f (·) can vary case by case, corresponding to the relative importance among different d t (·), which may also have various forms at different times.
To make the problem tractable in the real-world cases, we narrow down the scenarios into a series of Neural Network (NN)-based applications. We show that with knowledgeable neural networks pre-trained on visual data, we can approach a practical system that solves the relaxed form of indirect source coding problem in the analytics taxonomy.

Compression for Analytics with Knowledgeable Neural Networks
We assume that for a specific task {X, Y t }, a neural network with M layers has been trained to predictŶ t from X. For simplicity, we neglect t in the following notation and refer to Y as the label for each task. The Markov chain involving the processing of the neural network can be formulated as, where f i denotes the processing function of the i-th layer. According to the Information Bottleneck theory of neural networks [24], a well-trained network tends to reduce the mutual information between X and h i as i increases, by dismissing the irrelevant parts of X w.r.t. Y . Meanwhile, it preserves the mutual information I(Y ;Ŷ ) for accurately estimatingŶ . The goal of the information compression for analytics can be naturally implemented by compressing the latent representation h i and decoding the compressed representation for estimatingŶ . Compared with the raw scheme in Sec. 2.1 that searches for the universally optimal representation to support multiple tasks jointly, the relaxed problem has a smaller search space and becomes tractable.
When we look into the relaxed indirect source coding problem in the above-mentioned NN form, as shown in Fig. 1b, three aspects have to be investigated as follows, Information Entropy of Representations. We first aim to compress the deep features towards its bit-rate lower bound, i.e. the information entropy. We propose a general dimension reduction-based compression model to measure the entropy of each latent representation h i produced in a multi-layer NN-based processing pipeline. The compression scheme employs a parametric entropy model to accurately estimate its probability distribution and the related entropy. We define the plateau bit-rate R p for h i as, R p refers to the threshold bit-rate that, if more bit-rate is allowed beyond R p , the distortion E[d(y,ŷ )] will not be improved, but remain approximately the same at the plateau. An encoder E and a decoder D are optimized to transform h i for entropy estimation and reconstruction for further processing, respectively. We also show that different tasks have different R p .
Aggregated Compression of Multiple Representations. While each compressed latent representation can be used to support a specific task, in the multi-task compression circumstance, independently compressing the representation of each task inevitably leads to inefficiency due to the cross-task redundancy. We further investigate the issue of the transform to aggregate the multiple representations into a unified one. We observe that while aggregation compression can reduce redundancy and save bit-rates, a side effect comes, namely that the analytics performance might be interfered. When involving feature representations for other tasks (e.g., h 2 , h 3 , · · · , h N for tasks Y 2 , Y 3 , · · · , Y N , respectively), the additional information in h 2 , h 3 , · · · , h N tend to be the noise from the perspective of the intrinsic signal h 1 in the Markov chain We further provide an analysis on different ways of aggregation, to improve compression efficiency while avoiding such a side effect.
Generalizability of the Representations to Unseen Tasks. With the proper design, the aggregated latent representation contains the information of multiple tasks and can effectively support these tasks. However, as stated in the problem formulation, we hope to support a super-set of any given set of tasks, thus the aggregated latent representation is expected to be generalized to handle unseen tasks. Therefore, we further study the potential of the compressed feature representation to generalize to external unseen tasks.  In order to estimate the information entropy of each deep feature representation h i in the processing paradigm shown in Fig. 1b, we design a compression model for the extracted deep features, illustrated in Fig. 2. We aim to estimate the entropy of h i by compressing it to a bit-stream. As the mainstream neural networks do not apply any constraint on its generated h i , the probability distribution of h i is usually unknown and it is intractable to estimate the entropy of h i . Therefore, we apply a transform to h i and obtain an equivalent representation z. The transform makes z have the desired signal structure. Thus, its probability distribution is tractable. Hence, we can estimate the entropy of h i via calculating the entropy of the structured representation z. Specifically, z has the following properties for easier entropy estimation. Firstly, elements of z have been quantized to integers. The value of each element z k belongs to a finite set S = {t min , · · · , −1, 0, 1, · · · , t max }, and thus z is sampled from the finite space S K , where K denotes the dimension of z. Given a probability distribution in the finite space, the information entropy can be calculated as, which is the lower bound of the average bit-rate needed to encode z. As it is usually intractable to estimate p z , we adopt a parametric probability model q z to estimate the probability distribution of z during the encoding. The actual bit-rate to encode z with the probability p z under an estimated entropy model q z equals to the cross-entropy [7] of p and q, as, It has been shown in Eq. (6) that H(p) ≤ H(p, q), where the equality is achieved when D KL (p||q) = 0, i.e. when the probability model q estimates p perfectly.
Ballé et al. [1] propose to extract and encode a hyperprior from an image representation for more accurate entropy estimation control. The hyperprior is used to estimate the probability distribution of the corresponding image representation, which is often a lower-resolution representation, and a hierarchical structure of a hyperprior can further improve the accuracy of the probability estimation for image representation [16]. However, feature representations h i and z are not image-level signals. They are only expected to serve machine vision tasks and do not include the information of image appearances. Although their extracted features might take the form of tensor and have the spatial dimensions, these features in fact are capable of being embedded into very low-dimensional space, which does not have the spatial dimensions. As image compression oriented hyperprior model much relies on the assumption of hierarchical structure in images, it fails to capture the signal structure of h i and z, making the entropy estimation less effective. It leads to a gap between p and q.
To reduce the gap, we make the assumption that the extracted feature representations from the neural network can be embedded into a very low-dimensional manifold. Each observed instance can be regarded as a point sampled from that the low-dimensional subspace, and the perturbation is independently distributed conditioned on the coordinates that expand the space. This assumption naturally leads to the proposed low-dimensional hyperprior model. The main idea is that, we adopt the hyperprior vector without the spatial dimensions in the encoding to capture the intrinsic signal structure of h i and z, but transform the hyperprior vector into the hyperprior tensor with the spatial dimensions in the decoding to augment the hyperprior's modeling capacity. To estimate the probability distribution of z, a hyperprior v is extracted from z via a hyper analysis transform f Ha (·) as, namely, v = f Ha (z). The estimation of probability p(z) can be divided into p(z) = p(z, v) = p(v)p(z|v). Then, we apply a global pooling operation to reduce the spatial dimensions of z, producing v in the vector form. Note that v is also quantized to integers. We further assume that each element in v follows a zero-mean Gaussian distribution N (0, σ j ), and conditioned on v, each element z k in z is conditionally independently distributed. The entropy of v is estimated by tuning the parameter σ j .
We model q z k |v with a Gaussian distribution where the mean and scale are generated through a function of v. To achieve this, we decode n sequences of coefficients from v. Each sequence A l = a l 1 , a l 2 , · · · , a l τ , l ∈ [1, n] indicates a linear combination of the spatial bases, defined by a codebook, in the form of {C 1 , C 2 , · · · , C τ }. With the codebook and the sequences of coefficients {A} n , we generate the spatial hyperpriorẐ as, Z l = a l 1 C 1 + a l 2 C 2 + · · · + a l τ C τ , for l = 1, 2, · · · , n, Z = (Ẑ 1 ,Ẑ 2 , · · ·Ẑ n ).
We employ a prediction sub-network to estimate µ k = f (v; θ f ), σ k = g(v; θ g ) fromẐ. By learning the parameters of the sub-network, θ f and θ g are estimated to provide an accurate estimation q(z|v) for p(z|v). The spatial dimensions of the codebook {C 1 , C 2 , · · · , C τ } are fixed, and therefore it requires a re-sampling to deal with the inputs of different resolutions.
The proposed model is also general and flexible to support the deep features without spatial dimensions, i.e. feature vectors. This can be achieved by directly producing the vector-form probability with v, via multi-layer perceptions.

Aggregation Transformed Compression
It has been shown in [29] that, there exist connections among feature representations of different tasks. Thus, if multiple tasks are supported as we mentioned in the problem formulation, the separate compression for each task may be less efficient due to the cross-task redundancy. Therefore, we propose the aggregation transformed compression scheme to generate the compressed representation for different tasks jointly.
An example of the proposed aggregation transformed compression scheme is shown in Fig. 3. The illustrated structure compresses and aggregates the feature representations of two tasks into one bit-stream. Each representation is transformed with a sub-network with convolutional layers. The transformed features are concatenated and compressed via a compression model. The decompressed representation is then split via another set of convolutional layers, serving as the input of the rest of the pre-trained analytics network.
The aggregation transformed compression model is trained in two stages, corresponding to the two application scenarios, including 1) analytics oriented compression in a known set of tasks; and 2) out-of-set analytics, i.e. handling the unseen task. During the first training phase, the parameters of the compression model and the multi-layer peripheral convolutions f perc (·) before the compression model for each task are tuned. Parameters of the pre-trained analytics models are fixed. The compression model learns to compress different forms of feature representations jointly. The parameters are trained with the joint R-D loss function as, where λ i are Lagrange multipliers to indicate the relative importance of different tasks i, respectively. The second training phase is triggered if an external unseen task is involved. In this phase, the compression model is fixed to ensure that the compressed feature representation does not alter. An external task-specific decoder is trained to decode the compressed feature representation z toĥ N +1 . A task-related loss function L d N +1 is applied to ensure that the decodedĥ N +1 can maximally utilize the information in the bit-stream to support the external task.

Experimental Settings
We conduct the experiments on the Taskonomy dataset [29], which contains approximately 4.5 million images, all labeled by 25 attributes, to support various machine vision tasks. The abundance of tasks link to one image provides the desired environment for our study. We utilize the pre-trained models on the dataset, provided by the authors under the MIT License. All pre-trained models are hourglass encoder-decoder neural networks, as described in [29].
The following experiments are conducted on a subset of the original raw data. The subsets are selected at random, while we control the numbers of images in the splits, i.e. 51,316 images for training, 945 for validation, and 1,024 for testing. Images in different splits of the data are captured in different buildings. Thus, the splits are diverse in content. We select a set of real-world tasks for evaluation, i.e. scene classification, object classification, semantic segmentation, surface normal estimation, reshading, and principle curvature estimation. The selected tasks include diversified categories, with which we evaluate both high-level semantics driven analytics and mid-level geometry related estimation.

Efficacy of the Proposed Compression Scheme
We first evaluate the efficacy of the proposed codebook-hyperprior driven compression model for deep feature representations. We compare our method with the intermediate deep feature compression (IDFC) method [4], and the hyperprior model [1] used in the feature compression scheme [3]. Note that both the hyperprior model and the proposed scheme involve a training process. To avoid the potential bias due to the training procedure, we set up the Control Group experiments, where a transform network with an identical structure to the compression model is trained, but no bit-rate constraint is applied. For the evaluated semantic segmentation task, we train the models with the element-wise cross-entropy loss function, weighted by the parameters originally provided by [29]. We select the model checkpoint with the lowest R-D cost and compare on the testing set. Both hyperprior and the proposed model are trained with L = R + λL CE , where λ = 1. We follow the  setting in [29] to compare on 256 × 256 images, and calculate bits-per-pixel on that resolution. The results are shown in Table 1, where Original refers to the results given by the originally provided hourglass-like networks in [29]. We calculate mean pixel-level accuracy (Acc.), the accuracy of pixels in the non-background regions (Non-BG Acc.), and mean IoU (mIoU) by averaging the result among all 17 classes, respectively, to evaluate the semantic segmentation performance.
The range of bit-rates we show in Table 1 is regarded as the plateau bit-rate, where the compressed feature representation provides enough information to make the prediction accuracy comparable to models without bit-rate control. It is suggested by the results that the proposed method can better compress the deep features than existing methods [4,3], as it consumes less bit-rate to reach a higher analytics performance in multiple metrics.

Plateau Bit-Rate in Different Tasks
With the proposed compression scheme, we study the plateau bit-rate w.r.t. different tasks. In this experiment, we train compression models for each task, respectively, and measure the bit-rate of the compressed feature representations. We search for the minimal bit-rate needed to support a task to its maximally achievable performance by the provided feature, i.e. to make the performance comparable to non-rate-control settings. The experiments involve four different tasks. We measure the performance of each task in different criteria, i.e. accuracy for scene classification (Scene Class), mIoU for semantic segmentation (Semantic Seg.), and L 1 distance for surface normal estimation of indoor scenes (Surface Normal) as well as reshading of an indoor image (Reshading).
The results are shown in Table 2. As shown, the performances of different tasks reach their plateau at different bit-rates, indicating that the information entropy to support a machine vision task varies among different tasks. Image-level analytics, e.g., classification, requires less bit-rate to support, while pixel-level analytics require more. There are also differences among pixel-level analytics. We also show that IDFC consumes significantly more bit-rates. Besides, as IDFC involves a quantization based transform coding process, the quantization noise can result in unpredictable interference on the analytics performance. The results suggest that such quantization noise degrades the analytics performance more significantly on the geometry related tasks. Meanwhile, the proposed scheme provides better support for different kinds of tasks.

Aggregation Transform for Compression in Analytics Taxonomy
In this experiment, we compare the aggregated transformed compression scheme with the customized compression setting for different tasks. We present the results on the validation set, shown in Table 3,  where Hex means jointly compress all six kinds of representations with the model in Fig. 3. We further investigate the Trinity compression setting, by separating the six tasks into two groups, i.e. A: Scene Class, Semantic Seg. and Object Class; B: Surface Normal, Reshading and Curvature. As shown in Table 3, the joint compression of multiple representations saves more bit-rate. When all tasks reach the performance plateau, the Trinity setting saves about 16.9% bit-rate than Customized (the last row in Table 3). However, a larger aggregation set affects the analytics performance. This may be because the information from the external tasks tends to act as additional noise for the focused task. By grouping similar tasks in one aggregation, higher analytics performance and lower bit-rate can be achieved.

Supporting Unseen Tasks
We further explore employing the compressive representation to support external tasks that are not used in R-D training. We conduct the experiment in two trinity groups as described in Sec. 4.4, while we train the compression model only for two supervision tasks. The representation is used to train an external decoder for an unseen task, as shown in Fig. 3. When evaluating object classification, only scene classification and semantic segmentation are used for supervision. The same goes for the reshading task, where only the surface normal and curvature tasks are used for supervision. This is marked as Binary representations in Table 4. We also note that in some application scenarios, although the compression component cannot be supervised by an unseen task, the pre-trained model for that task is available. Thus, in the Binary+ setting, the source feature for the third task is included in the compression but only the other two tasks are used for supervision. We compare with BPG [2] compressed images, which is also task-independent. The results on the validation set are shown in Table 4.
As shown, the proposed method can generate compressed visual representations that support external unseen tasks, achieving better performance than utilizing image compression methods. The results also indicate that including the external feature representation can further help improve the performance for the representation sensitive tasks, e.g., object classification, although the R-D training is not supervised for that task.

Conclusion
In this paper, we formulate and study the problem of information compression in analytics taxonomy.
We propose a codebook-hyperprior model for more efficient deep feature representation compression, with which we explore to analyze the information entropy of feature representations for a set of machine vision tasks. We further propose to jointly compress visual representations for different tasks, which saves the bit-rate and provides the support of external unseen tasks. With the study, we provide the insight in designing a more efficient remote visual data processing system.