Machine-learning visual encoder for generating multi-vector embeddings for videos

The video analysis system uses a machine-learning visual encoder model to generate multiple embeddings for video clips, addressing the challenge of incomplete information capture by effectively mapping global and specific objects, thereby improving retrieval accuracy.

US20260377473A1Pending Publication Date: 2026-11-26TWELVE LABS INC
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
US19/215263
Authority / Receiving Office
US · United States
Patent Type
Applications(United States)
Current Assignee / Owner
Filing Date
2025-05-21
Publication Date
2026-11-26

AI Technical Summary

Technical Problem

Existing video analysis systems face challenges in effectively incorporating diverse data modalities such as images, text, and audio into embedding vectors due to the complexity of video data, leading to incomplete capture of information granularity, especially for smaller or background objects.

Method used

A video analysis system employs a machine-learning visual encoder model that generates multiple embeddings for video clips, including a global embedding for the entire clip and specific embeddings for identified objects, using a transformer architecture to train learnable tokens that extract and map different types of objects into a latent space.

Benefits of technology

This approach allows for the identification of higher granularity information in videos, including background and smaller objects, by generating multiple embeddings that enhance the accuracy of video retrieval based on specific object queries and global context queries.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure US20260377473A1-D00000_ABST
    Figure US20260377473A1-D00000_ABST
Patent Text Reader

Abstract

A video analysis system trains parameters of one or more visual encoder models coupled to receive a set of video tokens obtained from a video clip, and generate a plurality of two or more video embeddings for the video clip. At least one video embedding may represent the entirety of the video clip, and one or more video embeddings represents different types of objects identified in the video clip in the latent space. The values of the set of learned tokens are learned during the training process, and the values set of learned tokens are trained to extract and generate video embeddings that identify and map different types of objects of a video clip into the latent space.
Need to check novelty before this filing date? Find Prior Art

Description

BACKGROUND

[0001] A video analysis system manages and analyzes a data store of videos. The video analysis system may perform various tasks, including query retrieval, analysis of the videos, and the like. Typically, a user of the video analysis system submits a query that is a request to identify and retrieve videos that are related to the query. For example, a user may submit a query to the video analysis system of “a guy in a red shirt playing tennis in a court” to request videos that include a man in a red shirt playing tennis in a court. As another example, a user may submit a query that includes an image of a basketball. The video analysis system performs a relevance analysis and identifies videos that relate to the query, for example, videos that include a man in a red shirt playing tennis in a court, or videos that include the query image of the basketball.

[0002] In order to perform these applications, the video analysis system performs an indexing process to map video clips of a video to embedding vectors, and create an index of the parsed information such that the index can be used to identify relevant video clips to a search query. As an example, video clips of the video are mapped to respective embedding vectors in a latent space, and the embedding vectors can be used to identify and retrieve video clips relevant to the search query. However, video data can be relatively complicated as the data includes various modalities such as images, text, audio, and the like, and it is difficult to incorporate the information into an embedding vector.BRIEF DESCRIPTION OF THE DRAWINGS

[0003] FIG. 1 is a high-level block diagram of a system environment for a video analysis system, in accordance with an embodiment.

[0004] FIG. 2A illustrates an inference process of applying a machine-learning visual encoder model to generate multi-embeddings of a video clip and querying a query for an object, in accordance with an embodiment. FIG. 2B illustrates an inference process of applying the machine-learning visual encoder model and querying a global query, in accordance with an embodiment.

[0005] FIG. 3 is a block diagram of an architecture of a video analysis system, in accordance with an embodiment.

[0006] FIG. 4 illustrates a training process of the machine-learning visual encoder model, in accordance with an embodiment.

[0007] FIGS. 5A-5B illustrates a flowchart of a method of training a visual encoder model for extracting a plurality of video embeddings, in accordance with an embodiment.

[0008] FIG. 6 illustrates an example machine to read and execute computer readable instructions, in accordance with an embodiment.

[0009] The figures depict various embodiments of the present invention for purposes of illustration only. One skilled in the art will readily recognize from the following discussion that alternative embodiments of the structures and methods illustrated herein may be employed without departing from the principles of the invention described herein.DETAILED DESCRIPTIONOverview

[0010] FIG. 1 is a high-level block diagram of a system environment for a video analysis system 130, in accordance with an embodiment. The system environment 100 shown by FIG. 1 includes one or more client devices 116, a network 120, and a video analysis system 130. In alternative configurations, different and / or additional components may be included in the system environment 100.

[0011] The video analysis system 130 is a system for providing various types of services related to videos to users of client devices 116A, 116B. For example, the video analysis system 130 may manage a collection of videos, where users of the video analysis system 130 can view, retrieve, and share videos managed by the video analysis system 130. The video analysis system 130 may have access to a significant number of videos that when analyzed, provides the video analysis system 130 with insight. For example, the video analysis system 130 may have access to a significant number of reviews by online users that when analyzed, provides the video analysis system 130 with insight into preferences of users.

[0012] The video analysis system 130 may receive requests from the client devices 116 to perform various types of tasks on the videos of the video analysis system 130. For example, the video analysis system 130 may perform sentiment classification on video reviews to identify positive or negative reviews for a video. Based on the classification results, the video analysis system 130 may also recommend videos to users associated with positive reviews. As another example, the video analysis system 130 may provide and present statistics on the videos.

[0013] In one embodiment, the video analysis system 130 receives one or more search queries from users of client devices 116A, 116B. The request may include a query used by the video analysis system 130 to retrieve videos related to the query. For example, a user may submit a query to the video analysis system 130 to identify videos or video clips of “a man in a red shirt playing tennis in a court.” The video analysis system 130 performs a relevance analysis to identify videos that are determined to include a man in a red shirt playing tennis in a court. As another example, a user may submit a query that includes an image of a basketball. The video analysis system 130 performs a relevance analysis to identify videos that are determined to include the basketball in the image. In one instance, the query may include text data, image data, video data, audio data, and the like. The video analysis system 130 may present the identified videos or particular segments of the videos that are relevant to the query.

[0014] In one embodiment, the video analysis system 130 performs the relevance analysis by applying one or more machine-learned encoder models to the videos managed by the video analysis system 130 as well as the data in the query. Specifically, the video analysis system 130 may split a video into one or more video clips, where each video clip is a relatively short (e.g., 2-10 seconds) portion of the video. The video analysis system 130 performs an indexing process to map the video clips of a video to embedding vectors, and creates an index of the parsed information. In one embodiment, an embedding vector for a respective video clip represents the semantic content of the video clip as a numerical vector in a latent space. Thus, by mapping the query into the latent space, the video analysis system 130 can identify and retrieve the video clips relevant to the search query as the subset of video clips closer in distance to the embedding vector for the query, as the distance indicates the semantic content of the video clip is relevant to that of the query.

[0015] In one embodiment, the video analysis system 130 may generate a single embedding vector for a video clip by applying one or more machine-learning encoder models to information obtained from the video clip, therefore, mapping the video clip into a latent space. However, video data can be complicated as the data includes various data modalities such as frames, images, text, audio, and the like. It is technically difficult to embed information of different data modalities into a single embedding vector. For example, a video clip may include various types of objects, movements, or scenes that span through the duration of the video clip, and a single embedding vector may not fully capture a wide range of information granularity in the video, for example, smaller objects or objects in the background of a scene.

[0016] Therefore, in one embodiment, the video analysis system 130 described herein trains parameters of one or more visual encoder models coupled to receive a set of video tokens obtained from a video clip, and generates a plurality of (two or more) video embeddings for the video clip. In one embodiment, at least one video embedding represents the entirety of the video clip, and one or more video embeddings represent different types of objects identified in the video clip in the latent space. In one instance, the plurality of two or more video embeddings are generated by applying the parameters of the visual encoder model to a set of video tokens obtained from a video and a set of learned tokens. As described in detail below in conjunction with FIG. 4, the values of the set of learned tokens are learned during the training process of the visual encoder model, and the values of the set of learned tokens are trained to extract and generate video embeddings that identify and map different types of objects of a video clip into the latent space.

[0017] FIG. 2A illustrates an inference process of applying a machine-learning visual encoder model to generate multi-embeddings of a video clip and querying a query for an object, in accordance with an embodiment. FIG. 2B illustrates an inference process of applying the machine-learning visual encoder model and querying a global query, in accordance with an embodiment. The example inference process illustrated in FIGS. 2A and 2B assumes the parameters of the visual encoder model 250 and the values for a set of learned tokens are trained during the training process that will be described in further detail below in conjunction with FIG. 4.

[0018] During an inference process, the video analysis system 130 retrieves one or more videos from a video database. For each video, the video analysis system 130 splits the video into one or more video clips that each represents a shorter duration (e.g., 2-10 seconds) of the video it belongs to. For a video clip, the video analysis system 130 obtains a set of video tokens for the video clip. A video token may represent a particular patch of a frame of the video clip as a numerical embedding with a hidden dimensionality (e.g., 1024 dimensions), and the set of video tokens are arranged according to the temporal ordering of the frames in the video clip. In the example of FIG. 2A, a video clip c is represented as a set of Video Tokensc. In particular, the set of video tokens include sequentially concatenated video tokens for the first frame of the video clip, then video tokens for the second frame of the video clip, and so on, including video tokens for the last frame. In other words, the video tokens for the first frame are concatenated to the video tokens for the second frame, and so on, until the video tokens for the last frame are concatenated to the set. The video analysis system 130 also obtains a set of learned tokens L0, L1, . . . , Ln. In one embodiment, each learned token Lk is an embedding with a hidden dimensionality (e.g., 1024 dimensions), and the values for the set of learned tokens are learned during a training process. The video analysis system 130 generates a set of video embeddings Zv0, Zv1, . . . , Zvn by applying the parameters of the visual encoder model 250 to the set of learned tokens and the set of video tokens for the video clip.

[0019] In one embodiment, the set of generated video embeddings includes a global video embedding Zv0 for a video clip that represents the content of the video clip as a whole. Moreover, the set of generated video embeddings also includes one or more video embeddings Zv1, . . . , Zvn that each represents a respective object identified in the video clip and maps the object to a latent space as an embedding vector. An object may correspond to any type of person, animal, thing, and the like. Specifically, each of the learned tokens L1, . . . , Ln extracts information about a respective type of object (e.g., sports balls). The values for a learned token Lk may interact with the set of video tokens for the video clip within the attention layers and other neural network layers of the visual encoder 250 to extract information on whether the video clip includes objects of this type. A corresponding embedding vector Zvk is generated as the output for any such object.

[0020] The video analysis system 130 may repeat this process for remaining video clips in the video to generate video embeddings for the remaining video clips. Similarly, the video analysis system 130 also generates video embeddings for other videos in the database. In one embodiment, the video analysis system 130 stores the set of video embeddings for different video clips in an embeddings datastore. For example, each set of video embeddings for a respective video clip of a video may be stored in the embedding datastore in association with an identifier for the video clip.

[0021] In one embodiment, as shown in FIG. 2A, the video analysis system 130 receives, from a client device 116, a query requesting to retrieve one or more videos or clips related to a particular object. In one instance, the query includes an image of a particular object of interest that the user of the query would like to identify in one or more video clips (or videos including these clips). In the example in FIG. 2A, the query includes an image of a basketball. In one primary embodiment referred throughout the remainder of the specification, the query is an image, but it is appreciated that the query can be any appropriate data modality or combination of multiple data modalities including, but not limited to, text, video, images, audio, and the like. For example, the query may include text “find me video clips including a basketball,” or an audio of a user making such a request.

[0022] The video analysis system 130 obtains a set of object query tokens for the query. In one embodiment, the set of object query tokens when the query is an image is a set of image tokens. An image token may represent a particular patch of the image (e.g., patch of 20×20 pixels) as a numerical embedding with a hidden dimensionality (e.g., 1024 dimensions). In the example in FIG. 2A, the image of the basketball is represented as a set of image tokens Object Query Tokensq. The video analysis system 130 generates an image embedding for the particular object by applying the parameters of the visual encoder model 250 to the set of image tokens for the query image. In the example of FIG. 2A, the image embedding is denoted by Zq.

[0023] The video analysis system 130 retrieves the set of video embeddings for one or more candidate video clips from the embeddings datastore. For each candidate video clip, the video analysis system 130 compares the image embedding Zq for the object query to the set of video embeddings Zv1, . . . , Zvn for the video clip to determine a first similarity score that indicates whether the candidate video clip is related to the object query. In one embodiment, the first similarity score is determined by selecting a video embedding from the set of video embeddings that has the highest degree of similarity to the image embedding. In one instance, the similarity between embedding vectors is measured by a distance metric between the two embedding vectors, such as cosine similarity (i.e., dot product between two vectors), L2-norm, L1-norm, and the like. In the example in FIG. 2A, the video embedding Zv(n-1) may be determined to have the highest degree of similarity to the object query embedding Zq, as it is closest in distance or is above a threshold distance with respect to the object query embedding Zq.

[0024] The video analysis system 130 determines whether the first similarity score is above a threshold value or proportion. For example, the first similarity score may be inversely proportional to the distance, and the threshold may be a value such as 0.05. Responsive to determining that the first similarity score is above the threshold, the video analysis system 130 determines the video clip is relevant to the query, or in other words, the video clip contains an image of the object or a similar object represented by the query image. The video analysis system 130 performs the retrieval process for remaining candidate video clips to identify a subset of video clips that are identified to be relevant to the object query. The video analysis system 130 presents the subset of retrieved video clips to the user of the client device 116 on a user interface (UI). In this manner, the user interacts (e.g., clicks or hovers over) each identified video clip in the presented subset to view the contents of the video clip.

[0025] In another embodiment, as shown in FIG. 2B, the video analysis system 130 receives, from a client device 116, a global query requesting to retrieve one or more videos or video clips related to the query with respect to a global context. In one instance, the global query includes a text description of what the user is interested in looking for. Different from the queries on specific objects as described in conjunction with FIG. 2A, a global query may target to retrieve video clips based on the entire semantic context, rather than specific objects in the video clips. In the example in FIG. 2B, the global query includes a text description “find me video clips including scenes of a basketball game for the Team Wolverines.” In one primary embodiment referred throughout the remainder of the specification, the global query is a text description, but it is appreciated that the global query can be any appropriate data modality or combination of multiple data modalities including, but not limited to, video, images, audio, and the like. For example, the global query may include images of example basketball game scenes.

[0026] The video analysis system 130 obtains a set of global query tokens for the global query. In one embodiment, the set of global query tokens when the global query is a text description is a set of text tokens. A text token may represent a particular unit of text (e.g., word, phrase, sub-phrase) as a numerical embedding with a hidden dimensionality (e.g., 1024 dimensions). In the example in FIG. 2B, the text description is represented as a set of text tokens Global Query Tokensq. The video analysis system 130 generates a global query embedding that is a text embedding in FIG. 2 by applying the parameters of a machine-learning text encoder model 270 to the set of text tokens for the global query. In the example of FIG. 2B, the text embedding is denoted by Z′.

[0027] For each candidate video clip, the video analysis system 130 compares the text embedding Zt for the global query to the global video embedding Zv0 for the video clip to determine a second similarity score that indicates whether the candidate video clip is related to the global query. In the example in FIG. 2B, the video analysis system 130 determines a distance between the global video embedding Zv0 and the global query embedding Zt, and determines a second similarity score that is inversely proportional to the distance. Different from the video embeddings Zv1, . . . , Zvn used in FIG. 2A, the global video embedding Zv0 may represent the content of the video clip as a whole in the latent space.

[0028] The video analysis system 130 determines whether the second similarity score is above a threshold. Responsive to determining that the second similarity score is above the threshold, the video analysis system 130 determines the video clip is relevant to the global query, or in other words, the context of the video clip as a whole is relevant to the text description of the global query. The video analysis system 130 performs this retrieval process for the remaining candidate video clips to identify a subset of video clips that are identified to be relevant to the global query. The video analysis system 130 presents the subset of retrieved video clips on a user interface (UI) of the client device 116. In this manner, the user can interact (e.g., clicking or hovering over) each identified video clip to view contents of the video clip identified to be relevant to the global query.

[0029] In this manner, the video analysis system 130 generates a global video embedding for a video that is used to identify video clips related to a global query, but also generates one or more video embeddings from one or more learned tokens each configured to identify and map a respective type of object in a video clip. This allows the video analysis system 130 to identify a higher granularity of information in a video that can typically go unnoticed, like background objects, smaller objects, hidden objects, using existing indexing methods in the art.

[0030] Returning to the system environment 100 of FIG. 1, the client devices 116A, 116B are computing devices that display information to users and communicates user actions to the video analysis system 130. While two client devices 116A, 116B are illustrated in FIG. 1, in practice many client devices 116 may communicate with the video analysis system 130 in environment 100. In one embodiment, a client device 116 is a conventional computer system, such as a desktop or laptop computer. Alternatively, a client device 116 may be a device having computer functionality, such as a personal digital assistant (PDA), a mobile telephone, a smartphone or another suitable device. A client device 116 is configured to communicate via the network 120, which may comprise any combination of local area and / or wide area networks, using both wired and / or wireless communication systems.

[0031] In one embodiment, a client device 116 executes an application allowing a user of the client device 116 to interact with the video analysis system 130. For example, a client device 116 executes a browser application to enable interaction between the client device 116 and the video analysis system 130 via the network 120. In another embodiment, the client device 116 interacts with the video analysis system 130 through an application programming interface (API) running on a native operating system of the client device 116.

[0032] The client device 116 allows users to perform various actions on the video analysis system 130. In one embodiment, as described in conjunction with FIG. 2, users of the client devices 116 can submit queries to the video analysis system 130 to retrieve video clips or videos relevant to the query. As an example, the client device 116 may generate an interface for the user to submit the query, and responsive to receiving the query from the client device 116, provide the query to the video analysis system 130. Responsive to the video analysis system 130 identifying a subset of relevant video clips to the query, the video analysis system 130 may present a set of video clips that are determined to be relevant to the query.Video Analysis System

[0033] FIG. 3 is a block diagram of an architecture of a video analysis system 130, in accordance with an embodiment. In one embodiment, the video analysis system 130 includes components including a data management module 320, a training module 330, an encoding module 335, and a retrieval module 340. The video analysis system 130 also includes a video datastore 360 and an embeddings datastore 365. However, it is appreciated that in other embodiments, the video analysis system 130 may include fewer or more components than illustrated in FIG. 3.

[0034] The video datastore 360 is a storage system that includes a collection of videos. Each video may include a sequence of frames or images and encoding or decoding information for the video. In one embodiment, the video datastore 360 may be a local storage, but in other embodiments, may be stored on servers on a datacenter or cloud object storage associated with a virtual datacenter. In one embodiment, the videos of the video datastore 360 are indexed, such that features including title, description, a thumbnail image, a link to play the video, and metadata are stored in association with the video. Moreover, the indexing may mark one or more segments of the video that are each a collection of frames dedicated to, for example, the same scene, subject matter, and the like.

[0035] In one embodiment, the videos are each split into video clips, which are shorter portions (e.g., 2-10 seconds) of the video. A video clip may depict a particular scene or shot of the video. For example, a video of a soccer game that is one-minute long may be split into five video clips with respective durations at (00:00)-(00:12), (00:12)-(00:25), (00:25)-(00:38), (00:38)-(00:47), (00:47)-(00:60) of the video.

[0036] For each training video clip, the training data may include a set of video tokens that encode the frames and data of the video into a latent space. The training data may also include one or more identified objects in the training video clip, and one or more sets of object tokens, in which each set of object tokens represent a respective object identified in the video clip in the latent space. The training data may also include a global description for the training video clip that describes the video clip. In one instance, the global description is in the form of text and the training data includes a set of text tokens for the training video clip. However, in other embodiments, it is appreciated that the global description can include any one or a combination of data modalities.

[0037] In one embodiment, the training video clip is converted to a set of video tokens by selecting one or more key frames from the training video clip that may indicate a shot change or scene change. For each key frame in the one or more key frames, the key frame is split into one or more patches of pixels to identify a set of patches across the one or more key frames. For example, a patch may be a region encompassing 50×50 pixels. Each patch is mapped to a respective video token in a latent space to generate the set of video tokens for the training video clip.

[0038] The training module 330 trains parameters for a set of machine-learning encoder models for encoding data to one or more embedding vectors in a latent space. In one embodiment, the set of machine-learning encoder models includes the visual encoder model and the text encoder model described in conjunction with FIGS. 2A and 2B. In one embodiment, the video analysis system 130 selects a set of training video clips from the video datastore 360 for training the set of encoder models.

[0039] FIG. 4 illustrates a training process of the machine-learning visual encoder model 450, in accordance with an embodiment. The training module 330 accesses a machine-learning visual encoder model 450 configured as a transformer architecture. Specifically, the visual encoder 450 to be trained may have identical architecture as the visual encoder 250 of FIGS. 2A and 2B, but may have at least a portion of parameters that need to be trained via a training process. The training module 330 also obtains a plurality of two or more learnable tokens, L0, L1, . . . , Ln. In one instance, the plurality of learnable tokens are identical in dimensionality to the set of learned tokens described in FIGS. 2A and 2B, but may have at least a portion of values that need to be trained via the training process.

[0040] The training module 330 sequentially performs one or more iterations of the training process. In particular, for each iteration, the training module 330 obtains a set of video tokens for at least one training video clip for a current iteration of the training process. The example training process in FIG. 4 illustrates a training video clip of a soccer game for one iteration of the training process. The training module 330 generates a set of estimated video embeddings Zv0, Zv1, . . . , Zvn by applying the parameters of the visual encoder model 450 to values for the plurality of two or more learnable tokens L0, L1, . . . , Ln for the current iteration and the set of video tokens for the training video clip obtained from the training dataset.

[0041] For each identified object in the training video clip, the training module 330 obtains a respective set of object tokens for the object. The training module 330 generates an estimated image embedding by applying the parameters of the visual encoder model 450 to the respective set of object tokens for the object.

[0042] In the example training process shown in FIG. 4, the identified objects in the video clip include n objects, including a first object representing a soccer ball encoded into Object Tokens1, a second object encoded into Object Tokens2, and so on, and a last object representing a person encoded into Object Tokensn. After applying parameters of the visual encoder 450, the first object is represented by a first estimated image embedding Zi1, the second object is represented by a second estimated image embedding Zi2, and so on, and the last object is represented by a n-th estimated image embedding Zin.

[0043] For each identified object, the training module 330 computes a respective loss for the object indicating a difference between the estimated image embedding for the object and at least one estimated video embedding selected from the set of estimated video embeddings Zv1, . . . , Zvn. In one embodiment, the loss for each identified object is given by selecting an estimated video embedding in the set of estimated video embeddings Zv1, . . . , Zvn having the highest degree of similarity to the estimated image embedding for the object among the set of estimated video embeddings. In one embodiment, the respective loss for the object indicates a difference between the estimated image embedding for the object and the selected estimated video embedding.

[0044] The training module 330 computes a first loss function for the current iteration including at least the losses associated with the one or more identified objections in the training video clip. In one embodiment, the first loss function is given by:LF1=1n⁢∑j=1nCL⁡(Zij,Zvk)where CL(·) indicates the contrastive loss function, j=1, 2, . . . , n indicates an index for each identified object in a given training video clip, and k=1, 2, . . . , n corresponds to an index for the number of video embeddings extracted from the training video clip.In one embodiment, the training video clip may also be associated with a description of the video clip. In one embodiment, when the description is a text description, the training module 330 accesses a text encoder model 470. For the current iteration, the training module 330 also obtains a set of description tokens from the description of the training video clip. In the example shown in FIG. 4, the description is encoded into Description Tokenstr. After applying the parameters of the text encoder 470, the description is represented by an estimated text embedding Zt.

[0046] The training module 330 computes a second loss function indicating a difference between the estimated text embedding Zt and an estimated global video embedding Zv0 from the set of estimated video embeddings. In one embodiment, the second loss function is given by:LF2=CL(Zt,Zv0)where CL(·) indicates the contrastive loss function.The training module 330 backpropagates one or more terms obtained from at least the first loss function to update parameters of the visual encoder model 450 and the values of the plurality of two or more learnable tokens to reduce the first loss function. This way, the values of a learnable token are determined to capture and identify a respective type of object from a given video clip. In one embodiment, the description of the video clip is used to jointly train the parameters of the visual encoder model 450 and a separate encoder model (e.g., text encoder model 470) that is used to encode the description of the training video clip. In such an embodiment, the training module 330 backpropagates one or more terms obtained from a combination of the first loss function and the second loss function to jointly update parameters of the visual encoder model 450, the text encoder model 470, and the values of the plurality of learnable tokens to reduce the loss function, which is a combination of the first loss function and the second loss function.

[0048] The training module 330 repeats this process for different batches of training video clips in the training dataset for subsequent iterations. The training module 330 may complete the training process when a convergence criteria is reached, such as when the loss function is determined to be below a threshold or the changes in parameter values of the visual encoder 450 of the values of the learnable tokens are less than a threshold between consecutive iterations. The training module 330 stores the values of the plurality of two or more learned tokens L0, L1, . . . , Ln and the parameters of the visual encoder model 450 in a database.

[0049] Returning to FIG. 3, the encoding module 335 retrieves one or more video clips from the video store 360 and encodes each video clip into a plurality of video embeddings, as described in detail with respect to the inference process in FIG. 2. The encoding module 335 obtains the set of learned tokens and the trained visual encoder model. The encoding module 335 may also convert the video clip into a set of video tokens.

[0050] For each video clip, the encoding module 335 applies the visual encoder model to the set of learned tokens and video tokens for the video clip to generate a set of video embeddings. As described in conjunction with FIG. 2, the set of video embeddings for the video clip includes at least a global video embedding and one or more additional video embeddings that extract different types of objects from the video clip. In one embodiment, the encoding module 335 stores the video embeddings for different video clips in an embeddings store 365, such that the embeddings can be retrieved for downstream applications.

[0051] The retrieval module 340 receives queries from users of client devices 116, and based on the video embeddings, identifies one or more video clips that are relevant to the queries. In one embodiment, the retrieval module 340 receives an object query from a user that describes or otherwise specifies an object that the user would like to identify in the video clips. As described in conjunction with FIG. 2, the object query may be in the form of an image, but may also include other types of modalities such as text, video, or audio. The retrieval module 340 encodes the object query into a query embedding. In one embodiment, the query embedding is generated using the same visual encoder model used to generate the video embeddings.

[0052] The retrieval module 340 then compares the query embedding with the one or more video embeddings of video clips that were extracted during the encoding process. In one embodiment, the retrieval module 340 identifies a similarity score for a video clip as the maximum similarity between the query embedding and the one or more video embeddings. The retrieval module 340 determines that the video clip contains the object when the similarity score is above a threshold.

[0053] In one embodiment, the retrieval module 340 receives a global query from a user that describes the content of video clips the user would like to identify. As described in conjunction with FIG. 2, the global query may be in the form of text, but may also include other types of modalities such as image, video, or audio. The retrieval module 340 encodes the global query into a global query embedding. The retrieval module 340 compares the global query embedding with the global video embedding of video clips to generate a similarity score. The retrieval module 340 determines that the video clip matches or is relevant to the global query when the similarity score is above a threshold.

[0054] Depending on which type of query is received, the retrieval module 340 collects the subset of video clips that are identified to be relevant to the query, and presents the subset of video clips to an interface of the client device 116 of the user. In one embodiment, the retrieval module 340 may order the subset of video clips according to the similarity score determined for the video clip, such that the user can view the video clips that are determined to be the most relevant earlier in the list. In another embodiment, the retrieval module 340 may present the subset of video clips in a random order as long as each video clip in the subset is deemed to be relevant to the query.Method of Training Visual Encoder

[0055] FIGS. 5A-5B illustrates a flowchart of a method of training a visual encoder model for extracting a plurality of video embeddings, in accordance with an embodiment. The video analysis system 130 accesses 502 a machine-learning visual encoder model configured as a transformer architecture. The video analysis system 130 obtains 504 a plurality of two or more learnable tokens. The video analysis system 130 sequentially performs one or more training iterations. For each iteration, the video analysis system 130 obtains 506 a set of video tokens for a training video clip for a current iteration. The video analysis system 130 generates 508 a set of estimated video embeddings by applying the parameters of the visual encoder model to values for the plurality of two or more learnable tokens for the current iteration and the set of video tokens.

[0056] For each object in one or more identified objects in the training video clip, the video analysis system 130 obtains 510 a respective set of object tokens for the object. The video analysis system 130 generates 512 an estimated image embedding by applying the parameters of the visual encoder model to the respective set of object tokens for the object. The video analysis system 130 computes 514 a respective loss for the object indicating a difference between the estimated image embedding for the object and at least one estimated video embedding selected from the set of estimated video embeddings. The video analysis system 130 computes 516 a first loss function including at least the losses associated with the one or more identified objects in the training video clip. The video analysis system 130 backpropagates 518 terms obtained from a loss function including the first loss function to update the parameters of the visual encoder model and the values of the plurality of two or more learnable tokens. The video analysis system 130 stores 520 the values of the plurality of two or more learnable tokens and the parameters of the visual encoder model in a datastore.Example Machine to Read and Execute Instructions

[0057] Turning now to FIG. 6, illustrated is an example machine to read and execute computer readable instructions, in accordance with an embodiment. Specifically, FIG. 6 shows a diagrammatic representation of the data processing service 102 (and / or data processing system) in the example form of a computer system 600. The computer system 600 is structured and configured to operate through one or more other systems (or subsystems) as described herein. The computer system 600 can be used to execute instructions 624 (e.g., program code or software) for causing the machine (or some or all of the components thereof) to perform any one or more of the methodologies (or processes) described herein. In executing the instructions, the computer system 600 operates in a specific manner as per the functionality described. The computer system 600 may operate as a standalone device or a connected (e.g., networked) device that connects to other machines. In a networked deployment, the machine may operate in the capacity of a server machine or a client machine in a server-client network environment, or as a peer machine in a peer-to-peer (or distributed) network environment.

[0058] The computer system 600 may be a server computer, a client computer, a personal computer (PC), a tablet PC, a smartphone, an internet of things (IoT) appliance, a network router, switch or bridge, or other machine capable of executing instructions 624 (sequential or otherwise) that enable actions as set forth by the instructions 624. Further, while only a single machine is illustrated, the term “machine” shall also be taken to include any collection of machines that individually or jointly execute instructions 624 to perform any one or more of the methodologies discussed herein.

[0059] The example computer system 600 includes a processing system 602. The processor system 602 includes one or more processors. The processor system 602 may include, for example, a central processing unit (CPU), a graphics processing unit (GPU), a neural network processor (NPU), a digital signal processor (DSP), a controller, a state machine, one or more application specific integrated circuits (ASICs), one or more radio-frequency integrated circuits (RFICs), or any combination of these. The process or system 602 executes an operating system for the computing system 600. The computer system 600 also includes a memory system 604. The memory system 604 may include or more memories (e.g., dynamic random access memory (RAM), static RAM, cache memory). The computer system 600 may include a storage system 616 that includes one or more machine readable storage devices (e.g., magnetic disk drive, optical disk drive, solid state memory disk drive).

[0060] The storage unit 616 stores instructions 624 (e.g., software) embodying any one or more of the methodologies or functions described herein. For example, the instructions 624 may include instructions for implementing the functionalities of the video analysis system 130. The instructions 624 may also reside, completely or at least partially, within the memory system 604 or within the processing system 602 (e.g., within a processor cache memory) during execution thereof by the computer system 600, the main memory 604 and the processor system 602 also constituting machine-readable media. The instructions 624 may be transmitted or received over a network 626, such as the network 626, via the network interface device 620.

[0061] The storage system 616 should be taken to include a single medium or multiple media (e.g., a centralized or distributed database, or associated caches and servers communicatively coupled through the network interface system 620) able to store the instructions 624. The term “machine-readable medium” shall also be taken to include any medium that is capable of storing instructions 624 for execution by the machine and that cause the machine to perform any one or more of the methodologies disclosed herein. The term “machine-readable medium” includes, but not be limited to, data repositories in the form of solid-state memories, optical media, and magnetic media.

[0062] In addition, the computer system 600 can include a display system 610. The display system 610 may use driver firmware (or code) to enable rendering on one or more visual devices, e.g., drive a plasma display panel (PDP), a liquid crystal display (LCD), or a projector. The computer system 600 also may include one or more input / output systems 612. The input / output (IO) systems 612 may include input devices (e.g., a keyboard, mouse (or trackpad), a pen (or stylus), microphone) or output devices (e.g., a speaker). The computer system 600 also may include a network interface system 620. The network interface system 620 may include one or more network devices that are configured to communicate with an external network 626. The external network 626 may be a wired (e.g., ethernet) or wireless (e.g., WiFi, BLUETOOTH, near field communication (NFC).

[0063] The processor system 602, the memory system 604, the storage system 616, the display system 610, the IO systems 612, and the network interface system 620 are communicatively coupled via a computing bus 608.SUMMARY

[0064] The foregoing description of the embodiments of the disclosure has been presented for the purpose of illustration; it is not intended to be exhaustive or to limit the invention to the precise forms disclosed. Persons skilled in the relevant art can appreciate that many modifications and variations are possible in light of the above disclosure.

[0065] Some portions of this description describe the embodiments of the invention in terms of algorithms and symbolic representations of operations on information. These algorithmic descriptions and representations are commonly used by those skilled in the data processing arts to convey the substance of their work effectively to others skilled in the art. These operations, while described functionally, computationally, or logically, are understood to be implemented by computer programs or equivalent electrical circuits, microcode, or the like. Furthermore, it has also proven convenient at times, to refer to these arrangements of operations as modules, without loss of generality. The described operations and their associated modules may be embodied in software, firmware, hardware, or any combinations thereof.

[0066] Any of the steps, operations, or processes described herein may be performed or implemented with one or more hardware or software modules, alone or in combination with other devices. In one embodiment, a software module is implemented with a computer program product comprising a computer-readable medium containing computer program code, which can be executed by a computer processor for performing any or all of the steps, operations, or processes described.

[0067] Embodiments of the invention may also relate to an apparatus for performing the operations herein. This apparatus may be specially constructed for the required purposes, and / or it may comprise a general-purpose computing device selectively activated or reconfigured by a computer program stored in the computer. Such a computer program may be stored in a non-transitory, tangible computer readable storage medium, or any type of media suitable for storing electronic instructions, which may be coupled to a computer system bus. Furthermore, any computing systems referred to in the specification may include a single processor or may be architectures employing multiple processor designs for increased computing capability.

[0068] Embodiments of the invention may also relate to a product that is produced by a computing process described herein. Such a product may comprise information resulting from a computing process, where the information is stored on a non-transitory, tangible computer readable storage medium and may include any embodiment of a computer program product or other data combination described herein.

[0069] Finally, the language used in the specification has been principally selected for readability and instructional purposes, and it may not have been selected to delineate or circumscribe the inventive subject matter. It is therefore intended that the scope of the invention be limited not by this detailed description, but rather by any claims that issue on an application based hereon. Accordingly, the disclosure of the embodiments of the invention is intended to be illustrative, but not limiting, of the scope of the invention, which is set forth in the following claims.

Claims

1. A computer-implemented method, comprising:accessing a machine-learning visual encoder model configured as a transformer architecture;obtaining a plurality of two or more learnable tokens;sequentially performing, for each iteration in one or more iterations:obtaining a set of video tokens for a training video clip for a current iteration;generating a set of estimated video embeddings by applying parameters of the visual encoder model to values for the plurality of two or more learnable tokens for the current iteration and the set of video tokens;for each object in one or more identified objects in the training video clip:obtaining a respective set of object tokens for the object,generating an estimated image embedding by applying the parameters of the visual encoder model to the respective set of object tokens for the object, andcomputing a respective loss for the object indicating a difference between the estimated image embedding for the object and at least one estimated video embedding selected from the set of estimated video embeddings;computing a first loss function including at least losses associated with the one or more identified objects in the training video clip;obtaining a set of description tokens from a description of the training video clip;generating an estimated text embedding by applying parameters of an encoder model to the set of description tokens;computing a second loss function including a difference between the estimated text embedding and an estimated global video embedding from the set of estimated video embeddings;backpropagating one or more terms obtained from a loss function including the first loss function and the second loss function to update the parameters of the visual encoder model and the values of the plurality of two or more learnable tokens; andstoring the values of the plurality of two or more learnable tokens and the parameters of the visual encoder model in a datastore.

2. The computer-implemented method of claim 1,wherein backpropagating the one or more terms further comprises updating the parameters of the text encoder model.

3. The computer-implemented method of claim 1, wherein a dimensionality of an estimated video embedding in the set of estimated video embeddings and a dimensionality of an estimated image embedding for an identified object in the one or more identified objects is equal.

4. The computer-implemented method of claim 1, wherein obtaining the set of video tokens for the training video clip further comprises:selecting one or more key frames from the training video clip;for each key frame in the one or more key frames, splitting the key frame into one or more patches of pixels to identify a set of patches for the one or more key frames; andmapping the set of patches to video tokens to generate the set of video tokens for the training video clip.

5. The computer-implemented method of claim 1, wherein for each object, computing the respective loss for the object further comprises:selecting an estimated video embedding in the set of estimated video embeddings having a highest degree of similarity to the estimated image embedding for the object among the set of estimated video embeddings, wherein the respective loss for the object indicates a difference between the estimated image embedding for the object and the selected estimated video embedding.

6. The computer-implemented method of claim 1, further comprising:receiving, from a client device, an object query including a query image corresponding to a particular object and a request to retrieve one or more videos related to the particular object;generating an image embedding for the particular object by applying the parameters of the visual encoder model to object query tokens for the query image;for a candidate video clip, generating a set of video embeddings by applying the parameters of the visual encoder model to video tokens for the candidate video clip;comparing the image embedding for the query image to the set of video embeddings to determine a similarity score the candidate video clip is related to the query image; andresponsive to determining that the similarity score is above a threshold, presenting the candidate video clip to the client device as a response to the object query.

7. The computer-implemented method of claim 6, further comprising:selecting a video embedding from the set of video embeddings that has a highest degree of similarity to the image embedding, wherein the likelihood is above the threshold when the selected video embedding has at least a threshold similarity to the image embedding.

8. A non-transitory computer readable storage medium comprising stored instructions, the instructions when executed causing one or more processing systems to:access a machine-learning visual encoder model configured as a transformer architecture;obtain a plurality of two or more learnable tokens;for each iteration in one or more iterations:obtain a set of video tokens for a training video clip for a current iteration;generate a set of estimated video embeddings by applying parameters of the visual encoder model to values for the plurality of two or more learnable tokens for the current iteration and the set of video tokens;for each object in one or more identified objects in the training video clip:obtain a respective set of object tokens for the object,generate an estimated image embedding by applying the parameters of the visual encoder model to the respective set of object tokens for the object, andcompute a respective loss for the object indicating a difference between the estimated image embedding for the object and at least one estimated video embedding selected from the set of estimated video embeddings;compute a first loss function including at least losses associated with the one or more identified objects in the training video clip;obtaining a set of description tokens from a description of the training video clip;generating an estimated text embedding by applying parameters of an encoder model to the set of description tokens;computing a second loss function including a difference between the estimated text embedding and an estimated global video embedding from the set of estimated video embeddings;backpropagate one or more terms obtained from a loss function including the first loss function and the second loss function to update the parameters of the visual encoder model and the values of the plurality of two or more learnable tokens; andstore the values of the plurality of two or more learnable tokens and the parameters of the visual encoder model in a datastore.

9. The non-transitory computer readable storage medium of claim 8,wherein backpropagating the one or more terms further comprises updating the parameters of the text encoder model.

10. The non-transitory computer readable storage medium of claim 8, wherein a dimensionality of an estimated video embedding in the set of estimated video embeddings and a dimensionality of an estimated image embedding for an identified object in the one or more identified objects is equal.

11. The non-transitory computer readable storage medium of claim 8, the instructions when executed further causing the one or more processing systems to:select one or more key frames from the training video clip;for each key frame, split the key frame into one or more patches of pixels to identify a set of patches for the one or more key frames; andmap the set of patches to video tokens to generate the set of video tokens for the training video clip.

12. The non-transitory computer readable storage medium of claim 8, the instructions when executed further causing the one or more processing systems to, for each object:select an estimated video embedding in the set of estimated video embeddings having a highest degree of similarity to the estimated image embedding for the object among the set of estimated video embeddings, wherein the respective loss for the object indicates a difference between the estimated image embedding for the object and the selected estimated video embedding.

13. The non-transitory computer readable storage medium of claim 8, the instructions when executed further causing the one or more processing systems to:receive, from a client device, an object query including a query image corresponding to a particular object and a request to retrieve one or more videos related to the particular object;generate an image embedding for the particular object by applying the parameters of the visual encoder model to object query tokens for the query image;for a candidate video clip, generate a set of video embeddings by applying the parameters of the visual encoder model to video tokens for the candidate video clip;compare the image embedding for the query image to the set of video embeddings to determine a similarity score the candidate video clip is related to the query image; andresponsive to determining that the similarity score is above a threshold, present the candidate video clip to the client device as a response to the object query.

14. The non-transitory computer readable storage medium of claim 13, the instructions when executed further causing the one or more processing systems to:select a video embedding from the set of video embeddings that has a highest degree of similarity to the image embedding, wherein the likelihood is above the threshold when the selected video embedding has at least a threshold similarity to the image embedding.

15. A computer system, comprising:one or more processing systems; anda non-transitory computer readable storage medium comprising stored instructions, the instructions when executed causes the one or more processing systems to:access a machine-learning visual encoder model configured as a transformer architecture;obtain a plurality of two or more learnable tokens;for each iteration in one or more iterations:obtain a set of video tokens for a training video clip for a current iteration;generate a set of estimated video embeddings by applying parameters of the visual encoder model to values for the plurality of two or more learnable tokens for the current iteration and the set of video tokens;for each object in one or more identified objects in the training video clip:obtain a respective set of object tokens for the object,generate an estimated image embedding by applying the parameters of the visual encoder model to the respective set of object tokens for the object, andcompute a respective loss for the object indicating a difference between the estimated image embedding for the object and at least one estimated video embedding selected from the set of estimated video embeddings;compute a first loss function including at least losses associated with the one or more identified objects in the training video clip;obtaining a set of description tokens from a description of the training video clip;generating an estimated text embedding by applying parameters of an encoder model to the set of description tokens;computing a second loss function including a difference between the estimated text embedding and an estimated global video embedding from the set of estimated video embeddings;backpropagate one or more terms obtained from a loss function including the first loss function and the second loss function to update the parameters of the visual encoder model and the values of the plurality of two or more learnable tokens; andstore the values of the plurality of two or more learnable tokens and the parameters of the visual encoder model in a datastore.

16. The computer system of claim 15,wherein backpropagating the one or more terms further comprises updating the parameters of the text encoder model.

17. The computer system of claim 15, wherein a dimensionality of an estimated video embedding in the set of estimated video embeddings and a dimensionality of an estimated image embedding for an identified object in the one or more identified objects is equal.

18. The computer system of claim 15, the instructions when executed further causing the one or more processing systems to:select one or more key frames from the training video clip;for each key frame, split the key frame into one or more patches of pixels to identify a set of patches for the one or more key frames; andmap the set of patches to video tokens to generate the set of video tokens for the training video clip.

19. The computer system of claim 15, the instructions when executed further causing the one or more processing systems to, for each object:select an estimated video embedding in the set of estimated video embeddings having a highest degree of similarity to the estimated image embedding for the object among the set of estimated video embeddings, wherein the respective loss for the object indicates a difference between the estimated image embedding for the object and the selected estimated video embedding.

20. The computer system of claim 15, the instructions when executed further causing the one or more processing systems to:receive, from a client device, an object query including a query image corresponding to a particular object and a request to retrieve one or more videos related to the particular object;generate an image embedding for the particular object by applying the parameters of the visual encoder model to object query tokens for the query image;for a candidate video clip, generate a set of video embeddings by applying the parameters of the visual encoder model to video tokens for the candidate video clip;compare the image embedding for the query image to the set of video embeddings to determine a similarity score the candidate video clip is related to the query image; andresponsive to determining that the similarity score is above a threshold, present the candidate video clip to the client device as a response to the object query.