Video captioning is the task of automatically generating natural language descriptions of videos, and may include a combination of computer vision and language processing. Practical applications of video captioning include determining descriptions for video retrieval and indexing, and helping people with visual impairments.
The following detailed description of example implementations refers to the accompanying drawings. The same reference numbers in different drawings may identify the same or similar elements.
Road safety and safety-critical events (e.g., crashes and near-crashes) are of significant importance, as vehicle safety systems have been shown to actively contribute to the reduction of traffic-related deaths and serious injuries. However, current video captioning techniques apply inaccurate captions or fail to apply captions to videos associated with vehicle operation, require an inordinate quantity of time for individuals to label each frame of a video (e.g., of a crash or a near-crash). Thus, current video captioning techniques fail to generate human-understandable captions of an unsafe situation in a driving scenario (e.g., a crash or a near-crash) from a video acquired from a dashcam mounted inside one of the vehicles and based on vehicle sensor data (e.g., received from global positioning system (GPS) and/or inertial motion unit (IMU) sensors). Thus, current video captioning techniques consume computing resources (e.g., processing resources, memory resources, communication resources, and/or the like), networking resources, and/or other resources associated with failing to generate video captions for safety-critical events, failing to prevent traffic-related deaths and serious injuries, emergency handling of preventable traffic-related deaths and serious injuries, handling legal consequences of preventable traffic-related deaths and serious injuries, and/or the like.
Some implementations described herein provide a captioning system that video captions safety-critical events from video data. For example, the captioning system may receive a video and corresponding sensor information associated with a vehicle, and may extract feature vectors associated with the corresponding sensor information and an appearance and a geometry of another vehicle captured in the video. The captioning system may generate a tensor (e.g., an object that describes a multilinear relationship between sets of objects related to a vector space) based on the feature vectors, and may process the tensor, with a convolutional neural network model, to generate a modified tensor. The captioning system may select a decoder model from a plurality of decoder models, and may process the modified tensor, with the decoder model, to generate a caption for the video based on attributes associated with the video. The captioning system may perform one or more actions based on the caption for the video.
In this way, the captioning system video captions safety-critical events from video data. For example, the captioning system may include an encoder-decoder architecture. The encoder may be utilized to classify safety-critical driving events in videos. Four different types of decoders may be utilized to generate captions for the videos based on the classification of the safety-critical driving events output by the encoder. The captioning system may apply captions to videos associated with vehicle operation and safety-critical events, and may utilize contextual information (e.g., a presence or an absence of a crash and an unsafe maneuver type) to further improve the generated captions. Thus, the captioning system may conserve computing resources, networking resources, and/or other resources that would have otherwise been consumed by failing to generate video captions for safety-critical events, failing to prevent traffic-related deaths and serious injuries, emergency handling of preventable traffic-related deaths and serious injuries, handling legal consequences of preventable traffic-related deaths and serious injuries, and/or the like.
As shown in
As further shown in
As further shown in
In some implementations, a dataset stored in the captioning data store 110 may include the plurality of videos (e.g., where each video includes 450 frames at 15 frames per second (fps) with a resolution of 480×356), associated with events (e.g., crashes, near-crashes, and/or the like), and the sensor information (e.g., with a sampling frequency of 1-10 Hertz). Each of the videos may capture an event from different angles (e.g., front-facing, rear-facing, and driving-facing). However, the captioning system 105 may utilize a front-facing camera angle (e.g., a dashcam video) since such an angle is the most common and widely used set up in commercial scenarios.
In some implementations, the captioning system 105 may annotate the events with a set of temporally ordered sentences. Such sentences may include a single action (i.e., a verb) in present simple tense, while a subject may include a subject vehicle (SV), other vehicles in a scene (e.g., V2, V3, and V4), or other actors (e.g., pedestrians, bicycles, animals, and/or objects). A set of temporally ordered sentences may include one or more sentences describing an environment (e.g., a presence of an intersection or a stop sign, a presence and position of other relevant entities in the scene, and/or the like); one or more sentences describing the events or the maneuvers computed by various subjects (e.g., changing lanes, going through an intersection, traffic light changing, losing control of a vehicle, and/or the like); one or more sentences describing the event itself and reactions that the actors involved had with respect to the event (e.g., braking, steering in the adjacent lane, and/or the like); and one or more sentences describing what happened after the event (e.g., the actors continued driving or remained stopped). As a quantity of verbs and nouns describing an event on a roadway is limited, a total quantity of distinct words may be small (e.g., 576 words). On the other hand, due to the complexity of safety-critical events, a larger quantity of sentences may be provided in order to have a complete description (e.g., 17,647 sentences for 2,982 annotations, with an average of roughly 6 sentences per annotation). In some implementations, the dataset may include approximately 3,000 multi-sentence descriptions of crash or near-crash events.
In some implementations, the captioning system 105 may replace an instance-specific part of a sentence with a placeholder, such as replacing the actors (SV, V2, V3, and V4) with the term “subject” (SBJ) and directions (e.g., left and right) with the term “DIRECTION.” The captioning system 105 may execute an agglomerative clustering model with an inverse of a metric for evaluation of translation with explicit ordering (METEOR) score (e.g., a metric for the evaluation of machine translation output) as a distance. The captioning system 105 may determine a threshold for a quantity of clusters to select (e.g., 1,500) to provide a best silhouette score. The most frequent sentences may include sentences describing an event itself, in a form (e.g., SBJ brakes or SBJ brakes to avoid a collision with SBJ). The most common sentences may include sentences describing an environment (e.g., SBJ is the leading vehicle or SBJ approaches an intersection), and sentences describing a potentially non-dangerous maneuver (e.g., SBJ turns DIRECTION and SBJ change lanes to the DIRECTION).
As shown in
As further shown in
The encoder of the captioning system 105 may produce feature vectors relative to an evolution of each object (e.g., vehicle) in a scene over several consecutive frames of the video. The feature vectors extracted from the object detection outputs allow the decoder of the captioning system 105 to model output explicitly on entities in the scene. In some implementations, the encoder may utilize an object tracking model to extract feature vectors of the same real object (e.g., a vehicle) over time, may combine two heterogeneous inputs (e.g., the video and the sensor information) in an effective way, and may generate feature vectors that are pre-trained on a safety-critical event classification task (e.g., which aids in generating a caption for the video).
The video may include T frames, a set (e.g., ot={ot,1, . . . , ot,N
For each object ot,i, the encoder may extract two feature vectors, xt,ia and xt,ig respectively associated with an appearance and a geometry of the object. The encoder may determine the appearance feature vector for each object by pooling an output of a ResNet-50 backbone pre-trained on an unsafe maneuver classification task via an RoI-pooling layer. The geometry feature vector may include a normalized position of a top left corner of a box, a normalized width and height of the box, a confidence of the detection, and a one-hot encoded vector indicating a class of the object. The encoder may extract a third feature vector (e.g., a sensor information feature vector) xt,is based on the corresponding sensor information and utilizing a two-dimensional depth-wise separable convolution in order to preserve a single-sensor semantic. The encoder may perform the aforementioned steps for each object in the video to generate appearance feature vectors, geometries feature vectors, and sensor information feature vectors for the video.
As further shown in
x
t,i
=[x
t,i
a
|x
t,i
g
|x
t,i
s].
As shown in
As shown in
The captioning system 105 may utilize the decoder model to translate a representation (e.g., the modified tensor Y) produced by the encoder into human-readable text. At a core of the decoder model may be a neural network model, such as a recurrent neural network (RNN) model, trained to predict a next word based on the output of the encoder (e.g., the modified tensor Y) and based on a previous internal state of the RNN. For paragraph captioning, the decoder model may utilize hierarchical RNN models, such as two asynchronous RNN models (e.g., a sentence RNN model and a word RNN model). The sentence RNN model may store information of the produced sentences and may be triggered at a start of every sentence, producing an initial state of the word RNN model. The word RNN model may be trained to produce a next word, similar to a single-loop decoder model. Moreover, the output of the encoder (e.g., the modified tensor 1) is a feature tensor that includes the objects over different segments, that has to be reduced to a single vector to be handled by the decoder model. The feature tensor may be reduced to the single vector by a simple pooling layer or based on utilizing attention.
The plurality of decoder models may be based on long short-term memory (LSTM) cells. An LSTM operation may be referred to with a notation, ht=LSTM(xt, ht-1), where xt and ht respectively correspond to an LSTM input vector and an LSTM output vector at a time t. Variables associated with the memory cells may be omitted for notational convenience. Ground truth captions for each annotation W may be defined as:
W={W
0
,W
2
, . . . ,W
N
}
W
i
={w
0
i
,w
1
i
, . . . ,w
N
i
i},
where Wi corresponds to an i-th sentence of the annotation W, wji corresponds to a j-th word of the sentence Wi, Np corresponds to a quantity of sentences in the annotation W, and Nsi corresponds to a quantity of words in the i-th sentence of the annotation W. Concatenations (W) of the words wji for each sentence W, of the annotation W may be defined as:
0
|W
1
| . . . |W
N
0
,
1
, . . . ,
},
where
The single-loop decoder model with pooling may receive the modified tensor Y, and may apply a two-dimensional max-pooling operation to reduce the temporal dimension and the object dimension and to compress the modified tensor Y into a single context vector. The max-pooling operation may be effective at identifying an unsafe maneuver event or task. The single-loop decoder model with pooling may apply a max-pooling operation over the first two dimensions of the modified tensor Y, and may apply a fully-connected layer of size de followed by a ReLU activation to generate a feature vector y. The single-loop decoder model with pooling may iteratively perform, for each word
h
j=LSTMw(y|embedding(
The single-loop decoder model with pooling may provide hj to a linear layer for a size of a vocabulary and may be trained to predict a following word
The single-loop decoder model with attention may utilize dot-product attention to dynamically generate the context vector y. An architecture of the single-loop decoder model with attention may be identical to the single-loop decoder model with pooling, with one exception. The single-loop decoder model with attention may process the modified tensor Y and a previous hidden state of a decoder LSTM hj−1 to generate the context vector y as a weighted sum:
and f corresponds to a similarity function that includes a projection of the two factors hj−1 and yt,i to a common dimension da using a linear operation and a dot-product operation.
The hierarchical decoder model with pooling may include two nested and asynchronous LSTM operations: a first LSTM operation triggered at a beginning of each sentence of the annotation, and a second LSTM operation for each word, as in the single-loop decoder models. The sentence LSTM may oversee a generation process by keeping track of which sentence has been predicted and by postponing generation of a next sentence to the word LSTM, by generating an initial internal state h0w. The hierarchical decoder model with pooling may process the modified tensor Y to generate the context vector y (e.g., similar to the single-loop decoder model with pooling). For each sentence
h
t
s=LSTMS(y,ht-1s),
and, for each word wji of the sentence Wi, the hierarchical decoder model with pooling may perform the following operation (e.g., with h0w=hts):
h
j=LSTMW(y|embedding(
The hierarchical decoder model with attention may be similar to the hierarchical decoder model with pooling, but may compute the context vector y for the word LSTM using dot-product attention, as described above in connection with the single-loop decoder model with attention. As for the context vector y of the sentence LSTM, the hierarchical decoder model with attention may maintain the max-pooling operation over the modified tensor Y, as described above for the pooling decoders. A portion of the hierarchical decoder model with attention may review an entire event (e.g., all objects identified at a particular time).
As shown in
The captioning system 105 may process the modified tensor Y, with the selected decoder model, to generate the caption for the video. For example, the captioning system 105 may generate the caption for the video depending on the selected decoder model, as described above in connection with
As shown in
In some implementations, performing the one or more actions includes the captioning system 105 causing the caption to be displayed and/or played for a passenger of an autonomous vehicle associated with the video. For example, the captioning system 105 may provide the caption in textual format and/or audio format to the vehicle associated with the video. An infotainment system of the vehicle may receive the caption in the textual format and may display the caption to a passenger of the vehicle. The infotainment system may also play the audio of the caption for the passenger. In this way, the captioning system 105 conserves computing resources, networking resources, and/or other resources that would have otherwise been consumed by failing to prevent traffic-related deaths and serious injuries, emergency handling of preventable traffic-related deaths and serious injuries, handling legal consequences of preventable traffic-related deaths and serious injuries, and/or the like.
In some implementations, performing the one or more actions includes the captioning system 105 providing the caption and the video to a fleet system responsible for a vehicle associated with the video. For example, if the vehicle associated with the video is part of a fleet of vehicles used for a service (e.g., a moving service, a delivery service, a transportation service, and/or the like), the captioning system 105 may provide the caption and the video to the fleet system monitoring the vehicle. The fleet service may take appropriate measures against the driver (e.g., an employee of the fleet service) based on a severity of the caption (e.g., caused a crash or a near-crash). In this way, the captioning system 105 conserves computing resources, networking resources, and/or other resources that would have otherwise been consumed by failing to generate video captions for safety-critical events, emergency handling of preventable traffic-related deaths and serious injuries, handling legal consequences of preventable traffic-related deaths and serious injuries, and/or the like.
In some implementations, performing the one or more actions includes the captioning system 105 causing a driver of a vehicle associated with the video to be scheduled for a defensive driving course based on the caption. For example, if the caption indicates that the driver of the vehicle caused a crash or a near-crash, the driver's insurance rate may increase because of the crash or near-crash. The captioning system 105 may cause the driver to be scheduled for the defensive driving course to counteract an increase in the driver's insurance rate. In this way, the captioning system 105 conserves computing resources, networking resources, and/or other resources that would have otherwise been consumed by failing to generate video captions for safety-critical events, failing to prevent traffic-related deaths and serious injuries, handling legal consequences of preventable traffic-related deaths and serious injuries, and/or the like.
In some implementations, performing the one or more actions includes the captioning system 105 causing insurance for a driver of a vehicle associated with the video to be adjusted based on the caption. For example, the captioning system 105 may provide the caption and/or the video to an insurance company of the driver of the vehicle. The insurance company may modify the insurance rate of the driver based on the caption. If the caption indicates that the driver performed defensively and avoided a crash, the insurance company may decrease the insurance rate of the driver. If the caption indicates that the driver caused a crash, the insurance company may increase the insurance rate of the driver. In this way, the captioning system 105 conserves computing resources, networking resources, and/or other resources that would have otherwise been consumed by failing to generate video captions for safety-critical events, failing to prevent traffic-related deaths and serious injuries, emergency handling of preventable traffic-related deaths and serious injuries, and/or the like.
In some implementations, performing the one or more actions includes the captioning system 105 retraining the CNN model and/or one or more of the decoder models based on the caption. For example, the captioning system 105 may utilize the caption as additional training data for retraining the machine learning model, thereby increasing the quantity of training data available for training the CNN model and/or one or more of the decoder models. Accordingly, the captioning system 105 may conserve computing resources associated with identifying, obtaining, and/or generating historical data for training the CNN model and/or one or more of the decoder models relative to other systems for identifying, obtaining, and/or generating historical data for training machine learning models.
In some implementations, performing the one or more actions includes the captioning system 105 adding a textual description of a video to the video itself The textual description may enable the captioning system 105 to search for the video in the future, to classifying a type of event encountered in the video, and/or the like.
In this way, the captioning system 105 video captions safety-critical events from video data. For example, the captioning system 105 may include an encoder-decoder architecture. The encoder may be utilized to classify safety-critical driving events in videos. Four different types of decoders may be utilized to generate captions for the videos based on the classification of the safety-critical driving events output by the encoder. The captioning system 105 may apply captions to videos associated with vehicle operation and safety-critical events, and may utilize contextual information (e.g., a presence or an absence of a crash and an unsafe maneuver type) to further improve the generated captions. Thus, the captioning system 105 conserves computing resources, networking resources, and/or other resources that would have otherwise been consumed by failing to generate video captions for safety-critical events, failing to prevent traffic-related deaths and serious injuries, emergency handling of preventable traffic-related deaths and serious injuries, handling legal consequences of preventable traffic-related deaths and serious injuries, and/or the like.
As indicated above,
The captioning data store 110 includes one or more devices capable of receiving, generating, storing, processing, and/or providing information, as described elsewhere herein. The captioning data store 110 may include a communication device and/or a computing device. For example, the captioning data store 110 may include a database, a server, a database server, an application server, a client server, a web server, a host server, a proxy server, a virtual server (e.g., executing on computing hardware), a server in a cloud computing system, a device that includes computing hardware used in a cloud computing environment, or a similar type of device. The captioning data store 110 may communicate with one or more other devices of the environment 200, as described elsewhere herein.
The cloud computing system 202 includes computing hardware 203, a resource management component 204, a host operating system (OS) 205, and/or one or more virtual computing systems 206. The cloud computing system 202 may execute on, for example, an Amazon Web Services platform, a Microsoft Azure platform, or a Snowflake platform. The resource management component 204 may perform virtualization (e.g., abstraction) of the computing hardware 203 to create the one or more virtual computing systems 206. Using virtualization, the resource management component 204 enables a single computing device (e.g., a computer or a server) to operate like multiple computing devices, such as by creating multiple isolated virtual computing systems 206 from the computing hardware 203 of the single computing device. In this way, the computing hardware 203 can operate more efficiently, with lower power consumption, higher reliability, higher availability, higher utilization, greater flexibility, and lower cost than using separate computing devices.
The computing hardware 203 includes hardware and corresponding resources from one or more computing devices. For example, the computing hardware 203 may include hardware from a single computing device (e.g., a single server) or from multiple computing devices (e.g., multiple servers), such as multiple computing devices in one or more data centers. As shown, the computing hardware 203 may include one or more processors 207, one or more memories 208, one or more storage components 209, and/or one or more networking components 210. Examples of a processor, a memory, a storage component, and a networking component (e.g., a communication component) are described elsewhere herein.
The resource management component 204 includes a virtualization application (e.g., executing on hardware, such as the computing hardware 203) capable of virtualizing computing hardware 203 to start, stop, and/or manage one or more virtual computing systems 206. For example, the resource management component 204 may include a hypervisor (e.g., a bare-metal or Type 1 hypervisor, a hosted or Type 2 hypervisor, or another type of hypervisor) or a virtual machine monitor, such as when the virtual computing systems 206 are virtual machines 211. Additionally, or alternatively, the resource management component 204 may include a container manager, such as when the virtual computing systems 206 are containers 212. In some implementations, the resource management component 204 executes within and/or in coordination with a host operating system 205.
A virtual computing system 206 includes a virtual environment that enables cloud-based execution of operations and/or processes described herein using the computing hardware 203. As shown, the virtual computing system 206 may include a virtual machine 211, a container 212, or a hybrid environment 213 that includes a virtual machine and a container, among other examples. The virtual computing system 206 may execute one or more applications using a file system that includes binary files, software libraries, and/or other resources required to execute applications on a guest operating system (e.g., within the virtual computing system 206) or the host operating system 205.
Although the captioning system 105 may include one or more elements 203-213 of the cloud computing system 202, may execute within the cloud computing system 202, and/or may be hosted within the cloud computing system 202, in some implementations, the captioning system 105 may not be cloud-based (e.g., may be implemented outside of a cloud computing system) or may be partially cloud-based. For example, the captioning system 105 may include one or more devices that are not part of the cloud computing system 202, such as the device 300 of
The network 220 includes one or more wired and/or wireless networks. For example, the network 220 may include a cellular network, a public land mobile network (PLMN), a local area network (LAN), a wide area network (WAN), a private network, the Internet, and/or a combination of these or other types of networks. The network 220 enables communication among the devices of the environment 200.
The number and arrangement of devices and networks shown in
The bus 310 includes one or more components that enable wired and/or wireless communication among the components of the device 300. The bus 310 may couple together two or more components of
The memory 330 includes volatile and/or nonvolatile memory. For example, the memory 330 may include random access memory (RAM), read only memory (ROM), a hard disk drive, and/or another type of memory (e.g., a flash memory, a magnetic memory, and/or an optical memory). The memory 330 may include internal memory (e.g., RAM, ROM, or a hard disk drive) and/or removable memory (e.g., removable via a universal serial bus connection). The memory 330 may be a non-transitory computer-readable medium. Memory 330 stores information, instructions, and/or software (e.g., one or more software applications) related to the operation of the device 300. In some implementations, the memory 330 includes one or more memories that are coupled to one or more processors (e.g., the processor 320), such as via the bus 310.
The input component 340 enables the device 300 to receive input, such as user input and/or sensed input. For example, the input component 340 may include a touch screen, a keyboard, a keypad, a mouse, a button, a microphone, a switch, a sensor, a global positioning system sensor, an accelerometer, a gyroscope, and/or an actuator. The output component 350 enables the device 300 to provide output, such as via a display, a speaker, and/or a light-emitting diode. The communication component 360 enables the device 300 to communicate with other devices via a wired connection and/or a wireless connection. For example, the communication component 360 may include a receiver, a transmitter, a transceiver, a modem, a network interface card, and/or an antenna.
The device 300 may perform one or more operations or processes described herein. For example, a non-transitory computer-readable medium (e.g., the memory 330) may store a set of instructions (e.g., one or more instructions or code) for execution by the processor 320. The processor 320 may execute the set of instructions to perform one or more operations or processes described herein. In some implementations, execution of the set of instructions, by one or more processors 320, causes the one or more processors 320 and/or the device 300 to perform one or more operations or processes described herein. In some implementations, hardwired circuitry may be used instead of or in combination with the instructions to perform one or more operations or processes described herein. Additionally, or alternatively, the processor 320 may be configured to perform one or more operations or processes described herein. Thus, implementations described herein are not limited to any specific combination of hardware circuitry and software.
The number and arrangement of components shown in
As shown in
As further shown in
As further shown in
As further shown in
As further shown in
As further shown in
As further shown in
In some implementations, process 400 includes receiving sensor information associated with sensors of vehicles that capture a plurality of videos; receiving the plurality of videos; and mapping, in a data store, the sensor information and the plurality of videos, where the video and the corresponding sensor information is received from the data store.
Although
As used herein, the term “component” is intended to be broadly construed as hardware, firmware, or a combination of hardware and software. It will be apparent that systems and/or methods described herein may be implemented in different forms of hardware, firmware, and/or a combination of hardware and software. The actual specialized control hardware or software code used to implement these systems and/or methods is not limiting of the implementations. Thus, the operation and behavior of the systems and/or methods are described herein without reference to specific software code-it being understood that software and hardware can be used to implement the systems and/or methods based on the description herein.
As used herein, satisfying a threshold may, depending on the context, refer to a value being greater than the threshold, greater than or equal to the threshold, less than the threshold, less than or equal to the threshold, equal to the threshold, not equal to the threshold, or the like.
To the extent the aforementioned implementations collect, store, or employ personal information of individuals, it should be understood that such information shall be used in accordance with all applicable laws concerning protection of personal information. Additionally, the collection, storage, and use of such information can be subject to consent of the individual to such activity, for example, through well known “opt-in” or “opt-out” processes as can be appropriate for the situation and type of information. Storage and use of personal information can be in an appropriately secure manner reflective of the type of information, for example, through various encryption and anonymization techniques for particularly sensitive information.
Even though particular combinations of features are recited in the claims and/or disclosed in the specification, these combinations are not intended to limit the disclosure of various implementations. In fact, many of these features may be combined in ways not specifically recited in the claims and/or disclosed in the specification. Although each dependent claim listed below may directly depend on only one claim, the disclosure of various implementations includes each dependent claim in combination with every other claim in the claim set. As used herein, a phrase referring to “at least one of” a list of items refers to any combination of those items, including single members. As an example, “at least one of: a, b, or c” is intended to cover a, b, c, a-b, a-c, b-c, and a-b-c, as well as any combination with multiple of the same item.
No element, act, or instruction used herein should be construed as critical or essential unless explicitly described as such. Also, as used herein, the articles “a” and “an” are intended to include one or more items and may be used interchangeably with “one or more.” Further, as used herein, the article “the” is intended to include one or more items referenced in connection with the article “the” and may be used interchangeably with “the one or more.” Furthermore, as used herein, the term “set” is intended to include one or more items (e.g., related items, unrelated items, or a combination of related and unrelated items), and may be used interchangeably with “one or more.” Where only one item is intended, the phrase “only one” or similar language is used. Also, as used herein, the terms “has,” “have,” “having,” or the like are intended to be open-ended terms. Further, the phrase “based on” is intended to mean “based, at least in part, on” unless explicitly stated otherwise. Also, as used herein, the term “or” is intended to be inclusive when used in a series and may be used interchangeably with “and/or,” unless explicitly stated otherwise (e.g., if used in combination with “either” or “only one of”).
In the preceding specification, various example embodiments have been described with reference to the accompanying drawings. It will, however, be evident that various modifications and changes may be made thereto, and additional embodiments may be implemented, without departing from the broader scope of the invention as set forth in the claims that follow. The specification and drawings are accordingly to be regarded in an illustrative rather than restrictive sense.