W-TALC: Weakly-supervised Temporal Activity Localization and Classification
Sujoy Paul Sourya Roy Amit K Roy-Chowdhury



 


W-TALC: Weakly-supervised Temporal Activity Localization and Classification









S. Paul, S. Roy and A. K. Roy-Chowdhury



University of California, Riverside, CA 92521, USA
{supaul,sroy,amitrc}@ece.ucr.edu



W-TALC: Weakly-supervised Temporal Activity Localization and Classification
    Sujoy Paul, Sourya Roy Amit K Roy-Chowdhury
    December 30, 2023
===========================================================================




[European Conference on Computer Vision (ECCV), 2018]




Most activity localization methods in the literature suffer from the burden of frame-wise annotation requirement. Learning from weak labels may be a potential solution towards reducing such manual labeling effort. Recent years have witnessed a substantial influx of tagged videos on the Internet, which can serve as a rich source of weakly-supervised training data. Specifically, the correlations between videos with similar tags can be utilized to temporally localize the activities. Towards this goal, we present W-TALC, a Weakly-supervised Temporal Activity Localization and Classification framework using only video-level labels. The proposed network can be divided into two sub-networks, namely the Two-Stream based feature extractor network and a weakly-supervised module, which we learn by optimizing two complimentary loss functions. Qualitative and quantitative results on two challenging datasets - Thumos14 and ActivityNet1.2, demonstrate that the proposed method is able to detect activities at a fine granularity and achieve better performance than current state-of-the-art methods. Codes available at https://github.com/sujoyp/wtalc-pytorchhttps://github.com/sujoyp/wtalc-pytorch










§ INTRODUCTION


Temporal activity localization and classification in continuous videos is a challenging and interesting problem in computer vision <cit.>. Its recent success <cit.> has evolved around a fully supervised setting, which considers the availability of frame-wise activity labels. However, acquiring such precise frame-wise information requires enormous manual labor. This may not scale efficiently with a growing set of cameras and activity categories. On the other hand, it is much easier for a person to provide a few labels which encapsulate the content of a video. Moreover, videos available on the Internet are often accompanied by tags which provide semantic discrimination. Such video-level labels are generally termed as weak labels, which may be utilized to learn models with the ability to classify and localize activities in continuous videos. In this paper, we propose a novel framework for Temporal Activity Localization and Classification (TALC) from such weak labels. Fig. <ref> presents the train-test protocol W-TALC. 


	
    < g r a p h i c s >
	
	This figure presents the train-test protocol of W-TALC. The training set consists of videos and the corresponding video-level activity tags. Whereas, while testing, the network not only estimates the labels of the activities in the video, but also temporally locates their occurrence representing the start (s_j) and end time (e_j), category (c_j) and confidence of recognition (p_j) of the j^th activity located by the model.
	

In computer vision, researchers have utilized weak labels to learn models for several tasks including semantic segmentation <cit.>, visual tracking <cit.>, reconstruction <cit.>, video summarization <cit.>, learning robotic manipulations <cit.>, video captioning <cit.>, object boundaries <cit.>, place recognition <cit.>, and so on. The weak TALC problem is analogous to weak object detection in images, where object category labels are provided at the image-level. There have been several works in this domain mostly utilizing the techniques of Multiple Instance Learning (MIL) <cit.> due to their close relation in terms of the structure of information available for training. 

The positive and negative bags required for MIL are generated by state-of-the-art region proposal techniques <cit.>. On the other hand, end-to-end learning with categorical loss functions are presented in <cit.> and recently, the authors in <cit.> incorporated the proposal generation network in an end-to-end manner. 

Temporal localization using weak labels is a much more 
challenging task compared to weak object detection. The key reason is the additional variation in content as well as the length along the temporal axis in videos. 

Activity localization from weakly labeled data remains relatively unexplored. Some works <cit.> focus on weakly-supervised spatial segmentation of the actor region in short videos. Another set of works <cit.> considers video-level labels of the activities and their temporal ordering during training. However, such information about the activity order may not be available for a majority of web-videos. A recent work <cit.> utilizes state-of-the-art object detectors for spatial annotations but considers full temporal supervision. In <cit.>, a soft selection module is introduced for untrimmed video classification along with activity localization and a sparsity constraint is included in <cit.>.

In W-TALC, as we have labels only for the entire video, we need to process them at once. Processing long videos at fine temporal granularity may have considerable memory and computation requirements. On the other hand, coarse temporal processing may result in reduced detection granularity. Thus, there is a trade-off between performance and computation. Over the past few years, networks trained on ImageNet <cit.> and recently on Kinetics <cit.>, has been used widely in several applications. Based on these advances in literature and the aforementioned trade-off, we may want to ask the question that: is it possible to utilize these networks just as feature extractors and develop a framework for weakly-supervised activity localization which learns only the task-specific parameters, thus scaling up to long videos and processing them at fine temporal granularity? To address this question, in this paper, we present a framework (W-TALC) for weakly-supervised temporal activity localization and video classification, which utilizes pair-wise video similarity constraints via an attention-based mechanism along with multiple instance learning to learn only the task-specific parameters.



Framework Overview.
A pictorial representation of W-TALC is presented in Fig. <ref>. The proposed method utilizes off-the-shelf Two-Stream networks (<cit.>) as a feature extractor. The number of frame inputs depend on the network used and will be discussed in Section <ref>. 
After passing the frames through the networks, we obtain a matrix of feature vectors with one dimension representing the temporal axis. Thereafter, we apply a FullyConnected-ReLU-Dropout layer followed by label space projection layer, both of which is learned for the weakly-supervised task. 

The activations over the label space are then used to compute two complimentary loss functions using video-level labels. The first one is Multiple Instance Learning Loss, where the class-wise k-max-mean strategy is employed to pool the class-wise activations and obtain a probability mass function over the categories. Its cross-entropy with the ground-truth label is the Multiple Instance Learning Loss (MILL). The second one is the Co-Activity Similarity Loss (CASL), which is based on the motivation that a pair of videos having at least one activity category (say biking) in common should have similar features in the temporal regions which correspond to that activity. Also, the features from one video corresponding to biking should be different from features of the other video (of the pair) not corresponding to biking. However, as the temporal labels are not known in weakly-supervised data, we use the attention obtained from the label space activations as weak temporal labels, to compute the CASL. Thereafter, we jointly minimize the two loss functions to learn the network parameters. 

Main contributions. The main contributions of the proposed method are as follows. 1. We propose a novel approach for weakly-supervised temporal activity localization and video classification, without fine-tuning the feature extractor, but learning only the task-specific parameters. Our method does not consider any ordering of the labels in the video during training and can detect multiple activities in the same temporal duration.

2. We introduce the Co-Activity Similarity Loss and jointly optimize it with the Multiple Instance Learning Loss to learn the network weights specific to the weakly-supervised task. We empirically show that the two loss functions are complimentary in nature. 

3. We perform extensive experimentations on two challenging datasets and show that the proposed method performs better than the current state-of-the-art methods. 



§ RELATED WORKS.

The problem of learning from weakly-supervised data has been addressed in several computer vision tasks including object detection <cit.>, segmentation <cit.>, video captioning <cit.> and summarization <cit.>. Here, we discuss in detail the other works which are more closely related to our work.

Weakly-supervised Spatial Action Localization. Some researchers have looked into the problem of spatial localization of actors in mostly short and trimmed videos using weak supervision. In <cit.> a framework is developed for localization of players in sports videos, using detections from state-of-the-art fully supervised player detector, as inputs to their network. Person detectors are also used in <cit.> to generate person tubes, which is used to learn different Multiple Instance Learning based classifiers. Conditional Random Field (CRF) is used in <cit.> to perform actor-action segmentation from video-level labels but on short videos. 

Scripts as Weak Supervision. Some works in the literature use scripts or subtitles generally available with videos as weak labels for activity localization. In <cit.> words related to human actions are extracted from subtitles to provide coarse temporal localizations of actions for training. In <cit.>, actor-action pairs extracted from movie scripts serve as weak labels for spatial actor-action localization by using discriminative clustering. Our algorithm on the other hand only considers that the label of the video is available as a whole, agnostic to the source from where the labels are acquired, i.e., movie scripts, subtitles, humans or other oracles.

Temporal Localization with Ordering. Few works in the literature have considered the availability of temporal order of activities, apart from the video-level labels during training. The activity orderings in the training videos are used as constraints in discriminative clustering to learn activity detection models in <cit.>. A similar approach was taken in <cit.>. In <cit.>, the authors propose a dynamic programming based approach to evaluate and search for possible alignments between video frames and the corresponding labels. The authors in <cit.> use a Recurrent Neural Network (RNN) to iteratively train and realign the activity regions until convergence. A similar iterative process is presented by the same authors in <cit.>, but without employing an RNN. Unlike these works in literature, our work does not consider any information about the orderings of the activity.

The works in <cit.> are closely related to the problem setting presented in this paper. However, as the framework in <cit.> is based on the temporal segments network <cit.>, a fixed number of segments, irrespective of the length of the video, are considered during training, which may lead to a reduction in localization granularity. Moreover, they only employ the MILL, which may not be enough to localize activities at fine temporal granularity. A sparsity-based loss function is optimized in <cit.>, along with a loss function similar to that obtained using the soft selection method in <cit.>. In this paper, we introduce a novel loss function named Co-Activity Similarity Loss (CASL) which imposes pair-wise constraints for better localization performance. We also propose a mechanism for dealing with long videos and yet detecting activities at high temporal granularity. In spite of not finetuning the feature extractor, we can still achieve better performance than state-of-the-art methods on weak TALC. Moreover, experimental results show that CASL is complimentary in nature with MILL. 



§ METHODOLOGY

In this section, we present our framework (W-TALC) for weakly-supervised activity localization and classification. First, we present the mechanism we use to extract features from the two standard networks, followed by the layers of the network we learn. Thereafter, we present two loss functions MILL and CASL, which we jointly optimize to learn the weights of the network. It may be noted that we compute both the loss functions using only the video-level labels of training videos. Before going into the details of our framework, let us define the notations and problem statement formally. 

Problem Statement. Consider that we have a training set of n videos 𝒳={x_i}_i=1^n with variable temporal durations denoted by L={l_i}_i=1^n (after feature extraction) and activity label set A={a_i}_i=1^n, where a_i={a_i^j}_j=1^m_i are the m_i (≥ 1) labels for the i^th video. We also define the set of activity categories as 𝒮=⋃_i=1^na_i={α_i}_i=1^n_c. During test time, given a video x, we need to predict a set x_det={(s_j,e_j,c_j,p_j)}_j=1^n(x), where n(x) is the number of detections for x. s_j,e_j are the start time and end time of the j^th detection, c_j represents its predicted activity category with confidence p_j. With these notations, our proposed framework is presented next. 



 §.§ Feature Extraction


In this paper, we focus particularly on two architectures - UntrimmedNets <cit.> and I3D <cit.> for feature extraction, mainly due to their two stream nature, which incorporates rich temporal temporal information in one of the streams, necessary for activity recognition. Please note that the rest of our framework is agnostic to the features used.

UntrimmedNet Features. In this case, we pass one frame through the RGB stream and 5 frames through the Optical Flow stream as in <cit.>. We extract the features from just before the classification layer at 2.5 fps. We use the network which is pre-trained on ImageNet <cit.>, and finetuned using weak labels and MILL for task-specific dataset as in <cit.>. Thus, this feature extractor has no knowledge about activities using strong labels. 

I3D Features. As in <cit.>, we also experiment with features extracted from the Kinetics pre-trained I3D network <cit.>. The input to the two streams are non-overlapping 16 frame chunks. The output is passed through a 3D average pooling layer of kernel size 2 × 7 × 7 to obtain features of dimension 1024 each from the two streams. 

At the end of the feature extraction procedure, each video x_i is represented by two matrices X^r_i and X^o_i, denoting the RGB and optical flow features respectively, both of which are of dimension 1024 × l_i. Note that l_i is not only dependent on the video index i, but also on the feature extraction procedure used. These matrices become the input to our weakly-supervised learning module.

Memory Constraints. As mentioned previously, natural videos may have large variations in length, from a few seconds to more than an hour. In the weakly-supervised setting, we have information about the labels for the video as a whole, thus requiring it to process the entire video at once. This may be problematic for very long videos due to GPU memory constraints. A possible solution to this problem may be to divide the videos into chunks along the temporal axis <cit.> and apply a temporal pooling technique to reduce the length of each chunk to a single representation vector. The number of chunks depends on the available GPU memory. However, this will introduce unwanted background activity feature in the representation vectors as the start and end period of the activities in the video will not overlap with the pre-defined chunks for most of the videos. To cope with this problem, we introduce a simple video sampling technique.

Long Video Sampling. As granularity of localizations is important for activity localization, we take an approach alternative to the one mentioned above. We process the entire video if its length is less than the pre-defined length T necessary to meet the GPU bandwidth. However, if the length of the video is greater than T, we randomly extract from it a clip of length T with contiguous frames and assign all the labels of the entire video to the extracted video clip. It may be noted that although this may introduce some errors in the labels, this way of sampling does have advantages, as will be discussed in more detail in Section <ref>. 

Computational Budget and Finetuning. The error introduced by the video sampling strategy will increase with a decrease in the pre-defined length T, which meet the GPU bandwidth constraints. If we want to jointly finetune the feature extractor along with training our weakly-supervised module, T may be very small in order to maintain a reasonable batch size for Stochastic Gradient Descent (SGD) <cit.>. Although the value of T may be increased by using multiple GPUs simultaneously, it may not be a scalable approach. Moreover, the time to train both the modules may be high. Considering these problems, we do not finetune the feature extractors, but only learn the task-specific parameters, described next, from scratch. The advantages for doing this are twofold - the weakly-supervised module is light-weight in terms of the number of parameters, thus requiring less time to train, and it increases T considerably, thus reducing labeling error while sampling long videos. We next present our weakly-supervised module.



 §.§ Weakly Supervised Layer


In this section, we present the proposed weakly-supervised learning scheme, which uses only weak labels to learn models for simultaneous activity localization and classification. 

Fully Connected Layer. We introduce a fully connected layer followed by ReLU <cit.> and Dropout <cit.> on the extracted features. The operation can be formalized for a video with index i as follows.


    X_i = 𝒟( max(0,W_fc[ X_i^r; X_i^o;       ]⊕b_fc),k_p
    )

where 𝒟 represents  with k_p representing its keep probability, ⊕ is the addition with broadcasting operator,  W_fc∈ℝ ^2048 × 2048 and b∈ℝ^2048 × 1 are the parameters to be learned from the training data and X_i ∈ℝ^2048 × l_i is the output feature matrix for the entire video.

Label Space Projection
We use the feature representation X_i to classify and localize the activities in the videos. We project the representations X_i to the label space (∈ℝ^n_c,  n_c is the number of categories), using a fully connected layer, with weight sharing along the temporal axis. The class-wise activations we obtain after this projection can be represented as follows.


    𝒜_i = W_aX_i ⊕b_a

where W_a ∈ℝ^n_c × 2048, b_a ∈ℝ^n_c are to be learned and 𝒜_i ∈ℝ^n_c × l_i. These class-wise activations represent the possibility of activities at each of the temporal instants. These activations are used to compute the loss functions as presented next. 



 §.§ k-max Multiple Instance Learning

As discussed in Section <ref>, the weakly-supervised activity localization and classification problem as addressed in this paper can be directly mapped to the problem of Multiple Instance Learning (MIL) <cit.>. In MIL, individual samples are grouped in two bags, namely positive and negative bags. A positive bag contains at least one positive instance and a negative bag contains no positive instance. Using these bags as training data, we need to learn a model, which will be able to distinguish each instance to be positive or negative, besides classifying a bag. In our case, we consider the entire video as a bag of instances, where each instance is represented by a feature vector at a certain time instant. In order to compute the loss for each bag, i.e., video in our case, we need to represent each video using a single confidence score per category. For a given video, we compute the activation score corresponding to a particular category as the average of k-max activation over the temporal dimension for that category. As in our case, the number of elements in a bag varies widely, we set k proportional to the number of elements in a bag. Specifically,

    k_i=max(1,⌊l_is⌋)

where s is a design parameter. Thus, our class-wise confidence scores for the j^th category of the i^th video can be represented as,

    s_i^j = 1/k_imax_ℳ⊂𝒜_i[j,:] 
    
    		|ℳ| = k_i∑_l=1^k_iℳ_l


where ℳ_l indicates the l^th element in the set ℳ. Thereafter, a softmax non-linearity is applied to obtain the probability mass function over the all the categories as follows, p^j_i=exp(s^j_i)/∑_j=1^n_cexp(s^j_i). We need to compare this pmf with the ground truth distribution of labels for each video in order to compute the MILL. As each video can have multiple activities occurring in it, we represent the label vector for a video with ones at the positions if that activity occurs in the video, else zero. We then normalize this ground truth vector in order to convert it to a legitimate pmf. The MILL is then the cross-entropy between the predicted pmf p_i and ground-truth, which can then be represented as follows,

    ℒ_MILL = 1/n∑_i=1^n ∑_j=1^n_c -y_i^jlog(p_i^j)

where y_i=[y_i^1,…,y_i^n_c]^T is the normalized ground truth vector. This loss function is semantically similar to that used in <cit.>. We next present the novel Co-Activity Similarity Loss, which enforces constraints to learn better weights for activity localization.



 §.§ Co-Activity Similarity

As discussed previously, the W-TALC problem motivates us to identify the correlations between videos of similar categories. Before discussing in more detail, let us define category-specific sets for the j^th category as, 𝒮_j={x_i  | ∃ a_i^k ∈a_i, s.t. a_i^k= α_j  }, 
i.e., the set 𝒮_j contains all the videos of the training set, which has activity α_j as one of its labels. Ideally, we may want the following properties in the learned feature representations X_i in Eqn. <ref>.


	
  * A video pair belonging to the set 𝒮_j (for any j ∈{1, …, n_c}) should have similar feature representations in the portions of the video where the activity α_j occurs. 
	
  * For the same video pair, feature representation of the portion where α_j occurs in one video should be different from that of the other video where α_j does not occur.
 
These properties are not directly enforced in MILL. Thus, we introduce Co-Activity Similarity Loss to embed the desired properties in the learned feature representations. As we do not have frame-wise labels, we use the class-wise activations obtained in Eqn. <ref> to identify the required activity portions. The loss function is designed in a way which helps to learn simultaneously the feature representation as well as the label space projection. We first normalize the per-video class-wise activations scores along the temporal axis using softmax non-linearity as follows:

    𝒜̂_i[j,t] = exp(𝒜_i[j,t])/∑_t'=1^l_iexp(𝒜_i[j,t'])

where t indicates the time instants and j ∈{1, …, n_c}. We refer to these as attention, as they attend to the portions of the video where an activity of a certain category occurs. A high value of attention for a particular category indicates its high occurrence-probability of that category. In order to formulate the loss function, let us first define the class-wise feature vectors of regions with high and low attention as follows: 

    ^Hf_i^j    = X_i 𝒜̂_i[j,:]^T 
    
    ^Lf_i^j    = 1/l_i-1X_i (1-𝒜̂_i[j,:]^T)

where ^Hf_i^j, ^Lf_i^j ∈ℝ^2048 represents the high and low attention region aggregated feature representations respectively of video i for category j. It may be noted that in Eqn. <ref> the low attention feature is not defined if a video contains a certain activity and the number of feature vectors, i.e., l_i=1. This is also conceptually valid and in such cases, we cannot compute the CASL. We use cosine similarity in order to obtain a measure of the degree of similarity between two feature vectors and it may be expressed as follows:

    d[f_i,f_j] = 1 - ⟨f_i,f_j ⟩/⟨f_i,f_i⟩^1/2⟨f_j,f_j⟩^1/2

In order to enforce the two properties discussed above, we use the ranking hinge loss. Given a pair of videos x_m, x_n ∈𝒮_j, the loss function may be represented as follows:

    ℒ^mn_j    = 1/2{max(0, d[ ^Hf_m^j, ^Hf_n^j] - d[ ^Hf_m^j, ^Lf_n^j] + δ) 
       + max(0, d[ ^H f_m^j, ^H f_n^j] - d[  ^Lf_m^j, ^Hf_n^j] + δ)}

where δ is the margin parameter and we set it to 0.5 in our experiments. The two terms in the loss function are equivalent in meaning, and they represent that the high attention region features in both the videos should be more similar than the high attention region feature in one video and the low attention region feature in the other video. The total loss for the entire training set may be represented as follows:

    ℒ_CASL = 1/n_c∑_j=1^n_c1/|𝒮_j|  2∑_x_m, x_n ∈𝒮_jℒ^mn_j


Optimization. The total loss function we need to optimize in order to learn the weights of the weakly supervised layer can be represented as follows:

    ℒ = λℒ_MILL + (1-λ)ℒ_CASL + α  ||W||_F^2

where the weights to be learned in our network are lumped to W. We use λ=0.5 and α=5 × 10^-4 in our experiments. We optimize the above loss function using Adam <cit.> with a batch size of 10. We create each batch in a way such that it has a minimum of three pairs of videos such that each pair has at least one category in common. We use a constant learning rate of 10^-4 in all our experiments.

Classification and Localization. After learning the weights of the network, we use them to classify an untrimmed video as well as localize the activities in it during test time. Given a video, we obtain the class-wise confidence scores as in Eqn. <ref> followed by softmax to obtain a pmf over the possible categories. Then, we can threshold the pmf to classify the video to contain one or more activity categories. However, as defined by the dataset <cit.> and used in literature <cit.>, we use mAP for comparison, which does not require the thresholding operation, but directly uses the pmf. 

For localization, we employ a two-stage thresholding scheme. First, we discard the categories which have confidence score (Eqn. <ref>) below a certain threshold (0.0 used in our experiments). Thereafter, for each of the remaining categories, we apply a threshold on the corresponding activation in 𝒜 (Eqn. <ref>) along the temporal axis to obtain the localizations. It may be noted that as l_i is generally less than the frame rate of the videos, we upsample the activations to meet the frame rate. 



§ EXPERIMENTS


In this section, we experimentally evaluate the proposed framework for activity localization and classification from weakly labeled videos. We first discuss the datasets we use, followed by the implementation details, quantitative and some qualitative results.

Datasets. 
We perform experimental analysis on two datasets namely ActivityNet v1.2 <cit.> and Thumos14 <cit.>. These two datasets contain untrimmed videos with frame-wise labels of activities occurring in the video. However, as our algorithm is weakly-supervised, we use only the activity tags associated with the videos.

ActivityNet1.2. This dataset has 4819 videos for training, 2383 videos for validation and 2480 videos for testing whose labels are withheld. The number of classes involved is 100, with an average of 1.5 temporal activity segments per video. As in literature <cit.>, we use the training videos to train our network, and the validation set to test. 

Thumos14. The Thumos14 dataset has 1010 validation videos and 1574 test videos divided into 101 categories. Among these videos, 200 validation videos and 213 test videos have temporal annotations belonging to 20 categories. Although this is a smaller dataset than ActivityNet1.2, the temporal labels are very precise and with an average of 15.5 activity temporal segments per video. This dataset has several videos where multiple activities occur, thus making it even more challenging. The length of the videos also varies widely from a few seconds to more than an hour. The lesser number of videos make it challenging to efficiently learn the weakly-supervised network. Following literature <cit.>, we use the validation videos for training and the test videos for testing.


Implementation Details. We use the corresponding repositories to extract the features for UntrimmedNets[www.github.com/wanglimin/UntrimmedNet] and I3D[www.github.com/deepmind/kinetics-i3d]. We do not finetune the feature extractors. The weights of the weakly supervised layers are initialized by Xavier method <cit.>. We use TVL1 optical flow  [www.github.com/yjxiong/temporal-segment-networks]. We train our network on a single Tesla K80 GPU using Tensorflow. We set s=8 in Eqn. <ref> for both the datasets.




Activity Localization. We first perform a quantitative analysis of our framework for the task of activity localization. We use mAP with different Intersection over Union (IoU) thresholds as a performance metric, as in <cit.>. We compare our results with several state-of-the-art methods on both strong and weak supervision in Table <ref> and <ref> for Thumos14 and ActivityNet1.2 respectively. It may be noted that to the best of our knowledge, we are first to present quantitative results on weakly-supervised temporal activity localization on ActivityNet1.2. We show results for different combinations of features and loss function used. It may be noted that our framework performs much better than the other weakly supervised methods with similar feature usage. It is important to note that although the Kinetics pre-trained I3D features (I3DF) have some knowledge about activities, using only MILL as in <cit.> along with I3DF performs much worse than combining it with CASL, which is introduced in this paper. Moreover, our framework performs much better than other state-of-the-art methods even when using UNTF, which is not trained using any strong labels of activities. A detailed analysis of the two loss functions MILL and CASL will be presented subsequently.  

Activity Classification.
We now present the performance of our framework for activity classification. We use mean average precision (mAP) to compute the classification performance from the predicted videos-level scores in Eqn. <ref> after applying softmax. We compare with both fully supervised and weakly-supervised methods and the results are presented in Table <ref> and <ref> for Thumos14 and ActivityNet1.2 respectively. The proposed method performs significantly better than the other state-of-the-art approaches. Please note that the methods indicated with ^↑ utilize a larger training set compared to ours as mentioned in the tables. 




Relative Weights on Loss Functions. In our framework, we jointly optimize two loss functions - MILL and CASL defined in Eqn. <ref> to learn the weights of the weakly-supervised module. It is interesting to investigate the relative contributions of the loss functions to the detection performance. In order to do that, we performed experiments, using the I3D features, with different values of λ (higher value indicate larger weight on MILL) and present the detection results on the Thumos14 dataset in Fig. <ref>. 

As may be observed from the plot, the proposed method performs best with λ=0.5, i.e., when both the loss functions have equal weights. Moreover, using only MILL, i.e., λ=1.0, results in a decrease of 7-8% in mAP compared to when both CASL and MILL are given equal weights in the loss function. This shows that the CASL introduced in this work has a major effect towards the better performance of our framework compared to using I3D features along with the loss function in <cit.>, i.e., MILL.

Sensitivity to Maximum Length of Sequence.
Natural videos may often be very long. As mentioned previously, in the weakly-supervised setting, we have only video-level labels, so we need to process the entire video at once in order to compute the loss functions. In Section <ref>, we discuss a simple sampling strategy, which we use to maintain the length of the videos in a batch to be less than a pre-defined length T to meet GPU memory constraints. This method has the following advantages and disadvantage. 

- Advantages: First, we can learn from long length videos using this scheme. Secondly, this strategy will act as a data augmentation technique as we randomly crop, along the temporal axis to make it a fixed length sequence, if the length of the video ≥ T. Also a lower value of T reduces computation time.

- Disadvantage: In this sampling scheme, errors will be introduced in the labels of the training batch, which may increase with the number of training videos with length > T. 

The above factors induce a trade-off between performance and computation time. This can be seen in Figure <ref>, wherein the initial portion of the plot, with an increase of T, the detection performance improves, but the computational time increases. However, the detection performance eventually reaches a plateau suggesting T=320 s to be a reasonable choice for this dataset.





Qualitative Results. We present a few interesting example localizations with ground truths in Fig. <ref>. The figure has four examples from Thumos14 and ActivityNet1.2 datasets. To test how the proposed framework performs on videos outside the datasets used in this paper, we tested the learned networks on randomly collected videos from YouTube. We present two such example detections in Fig. <ref>, using the model trained on Thumos14. 

The first example in Fig. <ref> is quite challenging as the localization should precisely be the portions of the video, where Golf Swing occurs, which has very similar features in the RGB domain to portions of the video where the player prepares for the swing. In spite of this, our model is able to localize the relevant portions of Golf Swing, potentially based on the flow features. In the second example from Thumos14, the detections of Cricket Shot and Cricket Bowl appear to be correlated in time. This is because Cricket Shot and Bowl are two activities which generally co-occur in videos. To have fine-grained localizations for such activities, videos which have only one of these activities are required. However, in the Thumos14 dataset, very few training examples contain only one of these two activities. 

In the third example, which is from ActivityNet1.2, although `Playing Polo' occurs in the first portion of the video, it is absent in the ground truth. However, our model is able to localize those activity segments as well. The same discussion is also applicable to the fourth example, where `Bagpiping' occurs in the frames in a sparse manner, and our model's response is aligned with its occurrence, but the ground truth annotations are for almost the entire video. These two examples are motivations behind weakly-supervised localization, because obtaining precise unanimous ground truths from multiple labelers is difficult, costly and sometimes even infeasible.

The fifth example is on a randomly selected video from YouTube. It has a person, who is juggling balls in an outdoor environment. But, most of the examples in Thumos14 of the same category are indoors, with the person taking up a significant portion of the frames spatially. Despite such differences in data, our model is able to localize some portions of the activity. However, the model also predicts some portions of the video to be `Soccer Juggling', which may be because its training samples in Thumos14 contains a combination of feet, hand, and head, and a subset of such movements are present in `Juggling Balls'. Moreover, it is interesting to note that the first two frames show some maneuver of a ball with feet and it is detected as `Soccer Juggling' as well.



§ CONCLUSIONS AND FUTURE WORK

In this paper, we present an approach to learn temporal activity localization and video classification models using only weak supervision with video-level labels. We present the novel Co-Activity Similarity loss, which is empirically shown to be complimentary with the Multiple Instance Learning Loss. We also show a simple mechanism to deal with long length videos, yet processing them at high granularity. Experiments on two challenging datasets demonstrate that the proposed method achieves state-of-the-art results in the weak TALC problem. Future work will concentrate on extending the idea of Co-Activity Similarity Loss to other problems in computer vision.

Acknowledgments. This work was partially supported by ONR contract N00014-15-C-5113 through a sub-contract from Mayachitra Inc and NSF grant IIS-1724341. We thank Victor Hill of UCR CS for setting up the computing infrastructure.


splncs04


