Class agnostic repetition counting in video(s) utilizing a temporal self-similarity matrix
Abstract
Techniques are disclosed that enable processing a video capturing a periodic activity using a repetition network to generate periodic output (e.g., a period length of the periodic activity captured in the video and/or a frame wise periodicity indication of the video capturing the periodic activity). Various implementations include a class agnostic repetition network which can be used to generate periodic output for a wide variety of periodic activities. Additional or alternative implementations include generating synthetic repetition videos which can be utilized to train the repetition network.
Interactive Citation Constellation Global Citation Ranking
Interactive SVG Citation Constellation renders in Rust/WebAssembly. Prior art cited: 5 · Forward citations: 0.
Claims (23 — 3 Independent, 20 Dependent)
- Claim 1Independent Claim
A method implemented by one or more processors, the method comprising: processing a sequence of video frames capturing a periodic activity, using an encoder portion of a repetition network, to generate a sequence of encoded video frames, wherein processing the sequence of video frames capturing the periodic activity, using the encoder portion of the repetition network, to generate the sequence of encoded video frames comprises: for each video frame in the sequence of video frames: processing the video frame using a first portion of the encoder to generate two dimensional features of the video frame; processing the two dimensional features, of the video frame, using a second portion of the encoder, to generate temporal context features for the video frame, and processing the temporal context features, of the video frame, using a third portion of the encoder, to generate a corresponding encoded video frame of the sequence of encoded video frames; generating, based on the sequence of encoded video frames, a temporal self-similarity matrix indicating a pairwise similarity between encoded video frames in the sequence of encoded video frames; and processing the temporal self-similarity matrix using a period predictor model portion of the repetition network, to generate (a) a period length of the periodic activity in the sequence of video frames and/or (b) a per frame periodicity classification of the sequence of video frames.
- Claim 2Depends on #1
The method of claim 1, further comprising: processing an additional sequence of video frames capturing an additional periodic activity, using the encoder portion of the repetition network, to generate an additional sequence of additional encoded video frames; generating, based on the additional sequence of encoded video frames, an additional temporal self-similarity matrix indicating a pairwise similarity between additional encoded video frames in the additional sequence of additional encoded video frames; and processing the additional temporal self-similarity matrix, using the period predictor model of the repetition network, to generate (a) an additional period length of the additional periodic activity in the additional sequence of video frames and/or (b) an additional per frame periodicity classification of the additional sequence of video frames.
- Claim 3Depends on #1
The method of claim 1, wherein generating the temporal self-similarity matrix indicating the pairwise similarity between the encoded video frames, in the sequence of encoded video frames, comprises: for each pair of encoded video frames, in the sequence of encoded video frames: determining a distance measure between the pair of encoded video frames; and generating the temporal self-similarity matrix based on the distance measure between the pair of encoded video frames, for each pair of encoded video frames.
- Claim 4Depends on #3
The method of claim 3, wherein determining the distance measure between the pair of encoded video frames comprises: for each pair of encoded video frames, in the sequence of encoded video frames: determining a Euclidean distance, a squared Euclidean distance, a negative squared Euclidean distance, a Gaussian distance, and/or a cosine similarity measure, between the pair of encoded video frames.
- Claim 5Depends on #4
The method of claim 4, wherein generating the temporal self-similarity matrix based on the distance measure between the pair of encoded video frames, for each pair of encoded video frames, comprises: generating the temporal self-similarity matrix by processing the distance measure between the pair of encoded video frames, for each pair of encoded video frames, using a row-wise Softmax process.
- Claim 6Depends on #5
The method of claim 5, wherein processing the temporal self-similarity matrix using the period predictor model to generate the period length of the periodic activity comprises: processing the temporal self-similarity matrix using a two dimensional convolutional neural network portion to generate convolutional output; processing the convolutional output using a transformer portion to generate transformer output; and processing the transformer output using a period length classifier to generate the period length of the periodic activity.
- Claim 7Depends on #6
The method of claim 6, wherein the sequence of video frames capturing the periodic activity are a sequence of randomly sampled video frames from a video capturing the periodic activity.
- Claim 8Depends on #7
The method of claim 7, further comprising: prior to processing the sequence of video frames capturing the periodic activity using the encoder portion of the repetition network, training the repetition network, wherein training the repetition network comprises: for each of a plurality of training instances: processing a training sequence of training video frames portion of the training instance, capturing a periodic training activity, using the encoder portion of the repetition network, to generate a training sequence of encoded training video frames; generating a training temporal self-similarity matrix indicating a pairwise similarity between encoded training video frames in the training sequence of encoded training video frames; and processing the training sequence of encoded training video frames using a period predictor model portion of the repetition network, to generate (a) a training period length of the training periodic activity and/or (b) a training per frame periodicity classification of the training sequence of video frames; determining a loss based on (1) the training period length of the training periodic activity and/or the training per frame periodicity classification of the training sequence of video frames and (2) a corresponding ground truth portion of the training instance; and updating one or more portions of the repetition network based on the determined loss.
- Claim 9Depends on #8
The method of claim 8, wherein the training sequence of training video frames portion of at least one of the training instances is a synthetic repetition video.
- Claim 10Depends on #9
The method of claim 9, wherein the synthetic repetition video is generated based on an unlabeled video, and wherein generating the synthetic repetition video based on an unlabeled video comprises: selecting a sequence of video frames from the unlabeled video; and for each of a plurality of iterations: generating the synthetic training video by appending the selected sequence of video frames, in the sequence, to the synthetic repetition video, where the selected sequence of video frames is the synthetic repetition video at an initial iteration.
- Claim 11Depends on #9
The method of claim 9, wherein the synthetic repetition video is generated based on an unlabeled video, and wherein generating the synthetic repetition video based on an unlabeled video comprises: selecting a sequence of video frames from the unlabeled video; for each of a plurality of iterations: generating the synthetic training video by appending the selected sequence of video frames, in the sequence, and appending the selected sequence of video frames, in a reverse sequence, to the synthetic repetition video, wherein the selected sequence of video frames, in the sequence, and the selected sequence of video frames, in the reverse sequence, is the synthetic repetition video in an initial iteration.
- Claim 12Depends on #11
The method of claim 11, wherein generating the synthetic repetition video further comprises: selecting an additional sequence of video frames from the unlabeled video, wherein the additional sequence of video frames are immediately preceding the selected sequence of video frames; and prepending the selected additional sequence of video frames to the beginning of the synthetic repetition video.
- Claim 13Depends on #12
The method of claim 12, wherein generating the synthetic repetition video further comprises: selecting a further sequence of video frames from the unlabeled video, wherein the further sequence of video frames are immediately following the selected sequence of video frames; and appending the selected further sequence of video frames to the end of the synthetic repetition video.
- Claim 14Depends on #13
The method of claim 13, wherein generating the synthetic repetition video further comprises: processing each frame of the synthetic repetition video using an affine image transformation.
- Claim 15Depends on #14
The method of claim 14, wherein the affine image transformation includes a rotation, a translation, and/or a scale.
- Claim 16Depends on #15
The method of claim 15, further comprising: generating a repetition count of the number of repetitions in the sequence of video frames based on the period length of the periodic activity and/or the per frame periodicity classification of the sequence of video frames.
- Claim 17Independent Claim
A method implemented by one or more processors, the method comprising: training a repetition network to generate (a) a period length of the periodic activity in the sequence of video frames and/or (b) a per frame periodicity classification of the sequence of video frames, wherein training the repetition network comprises: for each of a plurality of training instances: processing a training sequence of training video frames portion of the training instance, capturing a periodic training activity, using the encoder portion of the repetition network, to generate a training sequence of encoded training video frames, wherein processing the training sequence of training video frames, using the encoder portion of the repetition network, to generate a sequence of encoded training video frames comprises: for each training video frame in the sequence of training video frames: processing the training video frame using a first portion of the encoder to generate two dimensional features of the training video frame, and processing the two dimensional features, of the training video frame, using a second portion of the encoder, to generate temporal context features for the training video frame, and processing the temporal context features, of the training video frame, using a third portion of the encoder, to generate a corresponding encoded training video frame of the sequence of encoded training video frames; generating a training temporal self-similarity matrix indicating a pairwise similarity between encoded training video frames in the training sequence of encoded training video frames; and processing the training sequence of encoded training video frames using a period predictor model portion of the repetition network, to generate (a) a training period length of the training periodic activity and/or (b) a training per frame periodicity classification of the training sequence of video frames; determining a loss based on (1) the training period length of the training periodic activity and/or the training per frame periodicity classification of the training sequence of video frames and (2) a corresponding ground truth portion of the training instance; and updating one or more portions of the repetition network based on the determined loss.
- Claim 18Independent Claim
A method implemented by one or more processors, the method comprising: generating a synthetic repetition video, wherein generating the synthetic repetition video comprises: selecting a sequence of video frames from an unlabeled video; identifying one or more video frames, in the unlabeled video, that are immediately preceding the selected sequence of video frames; generating an initial portion of the synthetic repetition video based on the one or more video frames that are immediately preceding the selected sequence of video frames in the unlabeled video; for a plurality of iterations and until one or more conditions are satisfied, appending one or more video frames, of the selected sequence of video frames, to the synthetic repetition video; and generating an ending portion of the synthetic repetition video based on one or more video frames that are immediately subsequent to the selected sequence of video frames in the unlabeled video.
- Claim 19Depends on #18
The method of claim 18, further comprising: training a model, using the synthetic training video, to generate (a) a period length of a periodic activity in an additional sequence of video frames and/or (b) a per frame periodicity classification of the additional sequence of video frames.
- Claim 20Depends on #19
The method of claim 19, wherein training the model, using the synthetic training video, to generate (a) the period length of a periodic activity in the additional sequence of video frames and/or (b) the per frame periodicity classification of the additional sequence of video frames comprises: processing the synthetic training video using the model to generate (a) a candidate period length of a training periodic length in the synthetic training video and/or (b) a candidate per frame periodicity classification of the synthetic training video; determining a loss based on (1) the candidate period length of the synthetic training video and/or the candidate per frame periodicity classification of the synthetic training video and (2) a corresponding ground truth representation of the synthetic training video; and updating one or more portions of the model based on the determined loss.
- Claim 21Depends on #18
The method of claim 18, wherein appending the one or more video frames, of the selected sequence of video frames, to the synthetic repetition video comprises: in a first iteration, of the plurality of iterations, appending the sequenced sequence of video frames, in the sequence, to the synthetic repetition video; and in a second iteration, of the plurality of iterations, appending the selected sequence of video frames, in the sequence, to the synthetic repetition video.
- Claim 22Depends on #18
The method of claim 18, wherein appending the one or more video frames, of the selected sequence of video frames, to the synthetic repetition video comprises: in a first iteration, of the plurality of iterations, appending the selected sequence of video frames, in the reverse sequence, to the synthetic repetition video; and in a second iteration, of the plurality of iterations, appending the selected sequence of video frames, in the reverse sequence, to the synthetic repetition video.
- Claim 23Depends on #18
The method of claim 18, wherein appending the one or more video frames, of the selected sequence of video frames, to the synthetic repetition video comprises: in a first iteration, appending one or more of the selected frames, in the sequence, to the synthetic repetition video; and in a second iteration, appending one or more of the selected frames, in the reverse sequence of the first iteration, to the synthetic repetition video.
Technical Overview & Description
BACKGROUND Repeating actions and processes are prevalent in daily life. A person stirring sugar in a cup of coffee while chewing food and tapping their feed to background music is performing at least three periodic activities in parallel. Periodic activity can be found in biological processes, manufacturing processes, human activities (e.g., exercising), object manipulation, and/or additional or alternative activities. Given the ubiquity of repetitions, understanding repetitions in videos may be helpful to a wide variety of computing systems. For example, determining repetitions can be useful to systems because (1) there is usually an intent or a driving cause behind something happening multiple times; (2) the same event can be observed again but with slight variations; (3) there may be gradual changes in a scene as a result of these repetitions; (4) they can provide unambiguous action units (e.g., a sub-sequence in the action that can be segmented in time); and/or for additional or alternative reason(s). SUMMARY Techniques disclosed herein are directed towards processing video capturing periodic activity, using a repetition network, to generate periodic output including (a) period length of the periodic activity and/or (b) a per frame periodicity classification (e.g., an indication of whether the periodic activity is captured in a particular frame of the video). In some implementations, the repetition network can be used to generate periodic output in a class agnostic manner. In other words, the same repetition network can be used to generate periodic output for a variety of periodic activities. For example, the repetition network can be used to generate periodic output based on a video capturing a human doing jumping jacks (i.e., a first class of periodic activity), and the same repetition network can be used to generate periodic output based on an additional video capturing a birds wings flapping (e.g., a second class of periodic activity). In some implementation
Cited By — Indexed Forward Citations (0 of 0 total)
No indexed citing patents in this generation yet. Ingest USPTO/PatentsView bulk citation tables via patents-ingest to expand the local forward citation graph.
References Cited — Backward Prior Art (5)
Non-Patent Literature (10)
- Karvounas, G., Oikonomidis, I.,
- &
- Argyros, A. (2019). Reactnet: Temporal localization of repetitive activities in real-world videos. arXiv preprint arXiv:1910.06096. (Year: 2019).
- Levy, O.,
- &
- Wolf, L. (2015). Live repetition counting. In Proceedings of the IEEE international conference on computer vision (pp. 3020-3028). (Year: 2015).
- China National Intellectual Property Administration; Notification of First Office Action issued in Application No. 202080100900.7; 21 pages; dated Aug. 26, 2024.
- European Patent Office; Communication pursuant to Article 94(3) EPC issued in Application No. 20751350.8; 6 pages; dated Dec. 2, 2024.
- Sun, C. et al.,
- “