A method, system and device for automatically extracting traffic scene information in a multi-modal manner
Through a multi-modal method of automatically extracting traffic scene information, using visual and text encoders combined with a self-attention mechanism, it solves the problems of delayed acquisition of traffic event information and insufficient personalization in the existing technology, and achieves real-time and personalized Traffic scene broadcasting reduces labor costs.
Patent Information
- Application Number
- CN202210235588.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-03-11
- Publication Date
- 2024-10-29
- Estimated Expiration
- 2042-03-11
AI Technical Summary
Existing technology is difficult to extract and report complex and changeable traffic event information in real-time and personalized manner in traffic scenes, resulting in delays in drivers obtaining information and inability to customize it for different areas.
A multi-modal method is used to automatically extract traffic scene information. By obtaining surveillance videos, news pictures and weather information, the visual encoder and text encoder are combined with the self-attention mechanism to generate traffic scene information text to achieve real-time analysis of specific traffic scenes. Analyze and report.
It achieves real-time and personalized broadcast of traffic scene information without manual intervention, improves the timeliness of information and the pertinence of broadcast, and reduces labor costs.
Smart Images

Figure CN114926788B_ABST
Abstract
Description
Technical Field
[0001] The present invention belongs to the technical field of computer image and natural language processing, and relates to a method, system and device for automatically extracting traffic scene information, and specifically to a method, system and device for automatically extracting traffic scene information in a multimodal manner, which can be further applied to automatically generate professional commentaries based on traffic monitoring videos, news report pictures and news texts. Background Art
[0002] At present, in the transportation system, there are a large number of video recording equipment to monitor traffic conditions in real time. At the same time, the news media is very developed. Based on the Internet, the speed of news information dissemination is extremely fast, weather forecasts are becoming more and more accurate, and the accuracy of the global positioning system has been greatly improved. These data are of high value and can be applied to the field of automatic broadcasting of traffic scenes. At present, on busy traffic arteries, the traffic conditions are very complicated and various dangerous events may occur at any time. Drivers need to obtain the latest road condition event information in a timely manner so as to make more reasonable response measures.
[0003] Most existing research focuses on traffic flow prediction and traffic trajectory classification, but specific events cannot be known. Traffic broadcasts also have a certain delay and are usually not targeted. They cannot be customized for drivers in different areas and cannot adapt to complex and changing traffic scenarios. Summary of the invention
[0004] In order to solve the above technical problems, the present invention provides a method and electronic device for automatically extracting traffic scene information in a multimodal manner based on computer image and natural language processing technology, which can analyze the events and meanings of specific traffic scenes and further broadcast the traffic scenes in real time.
[0005] The technical solution adopted by the method of the present invention is: a method for automatically extracting traffic scene information in a multi-modal manner, comprising the following steps:
[0006] Step 1: Obtain surveillance video of the traffic scene, capture news pictures and text related to the traffic scene, and current weather information;
[0007] Step 2: Capture a frame from the surveillance video at a predetermined interval i , stored in chronological order as a video frame sequence set, the video frames and captured news pictures are extracted with image features to obtain the feature vector v i , the feature vector sequence is processed by a visual encoder, which belongs to the encoder in the "encoder-decoder framework" and contains a self-attention mechanism (Self-Attention) component. First, the feature vector sequence v is processed to obtain the feature representation h of each video frame and news picture.i , and then obtain the final output h of the visual encoder, h is h i The sequences are combined and then multiplied by a weight matrix to produce a vector containing visual features;
[0008] Step 3: Combine the captured news text and weather information to obtain the text vector sequence ee 1 ,e 2 ,…,e L , where e i Represents a word, and then uses word embedding to convert the text sequence into a word vector representation. The vector sequence is processed by a text encoder. The text encoder belongs to the encoder in the "encoder-decoder framework" and contains a self-attention mechanism (Self-Attention) component. First, the text vector sequence e is processed to obtain value information, and then combined with the output h of the visual encoder in step 2 to obtain the feature representation g of each word in the text. i , and then obtain the final output g of the text encoder, g is g i The sequences are combined and then multiplied by a weight matrix to produce a vector containing text features;
[0009] Step 4: Generate traffic scene information text.
[0010] The technical solution adopted by the system of the present invention is: a system for automatically extracting traffic scene information in a multi-modal manner, comprising the following modules:
[0011] Module 1 is used to obtain surveillance videos of traffic scenes, capture news pictures and texts related to the traffic scenes, and current weather information;
[0012] Module 2, used to capture a frame I from the surveillance video at a predetermined time interval i , stored in chronological order as a video frame sequence set, the video frames and captured news pictures are extracted with image features to obtain the feature vector v i , a visual encoder processes the feature vector sequence, where the feature vector sequence v is first processed to obtain the feature representation h of each video frame and news picture i , and then obtain the final output h of the visual encoder, h is h i The sequences are combined and then multiplied by a weight matrix to produce a vector containing visual features;
[0013] Module 3 is used to merge the captured news text and weather information to obtain the text vector sequence ee 1 ,e 2 ,…,e L , where e iRepresents a word, and then uses word embedding to convert the text sequence into a word vector representation. The vector sequence is processed by a text encoder, where the text vector sequence e is first processed to obtain value information, and then combined with the output h of the visual encoder in module 2 to obtain the feature representation g of each word in the text. i , and then obtain the final output g of the text encoder, g is g i The sequences are combined and then multiplied by a weight matrix to produce a vector containing text features;
[0014] Module 4 is used to generate traffic scene information text.
[0015] The technical solution adopted by the device of the present invention is: a device for multimodal automatic extraction of traffic scene information, including one or more processors and a storage device for storing one or more programs. When the one or more programs are executed by the one or more processors, the one or more processors implement the method for multimodal automatic extraction of traffic scene information.
[0016] The present invention fully considers the different needs of drivers in different areas, filters out irrelevant traffic events, and automatically generates scene explanations based on surveillance videos widely installed in different areas, as well as real-time news information, weather and trajectory data, without the need for additional human intervention, thereby improving efficiency, reducing labor costs, and providing personalized reports for drivers in different areas.
[0017] The present invention can automatically complete the analysis and broadcast of a traffic scene without human intervention, only by acquiring surveillance videos, some news reports, and external data such as weather and trajectory, thereby improving timeliness and reducing labor costs. BRIEF DESCRIPTION OF THE DRAWINGS
[0018] Figure 1 The figure is a flow chart of a method according to an embodiment of the present invention.
[0019] Figure 2 Schematic diagram of the method according to an embodiment of the present invention. DETAILED DESCRIPTION
[0020] In order to facilitate ordinary technicians in the field to understand and implement the present invention, the present invention is further described in detail below in conjunction with the accompanying drawings and embodiments. It should be understood that the implementation examples described herein are only used to illustrate and explain the present invention, and are not used to limit the present invention.
[0021] In machine learning, convolutional neural networks are a type of feedforward neural network with deep structures that include convolutional calculations. Convolutional neural networks have representational learning capabilities and can classify input information in a translation-invariant manner according to their hierarchical structure. The attention mechanism is based on the principle that when humans observe things, they focus on a part of the observed thing to determine the part to focus on and allocate limited processing resources to the important part. Based on convolutional neural networks and attention mechanisms, key information in videos and texts can be accurately interpreted, thereby generating effective traffic scene broadcasts.
[0022] Please see Figure 1 and Figure 2 The present invention provides a method for automatically extracting traffic scene information in a multi-modal manner, comprising the following steps:
[0023] Step 1: Obtain surveillance video of the traffic scene, capture news reports and text related to the traffic scene, and current weather information; obtain the traffic entity target in the video frame, as well as the latitude and longitude coordinates and running direction of the traffic entity target, and update them in real time;
[0024] In this embodiment, the monitoring video of the traffic entity is obtained, that is, the monitoring video of a certain traffic scene, which may include a large port with busy transportation tasks, a large and complex street intersection, etc. Relevant news report pictures and text briefs are captured, and real-time news pictures and texts are captured on real-time news platforms such as Weibo, Douyin, and Toutiao based on the specific place name, longitude and latitude of the current monitoring area using a web crawler. The weather conditions in the monitoring area are queried through the China Meteorological Administration's weather real-time interface. Stuttering, incoherent video frames and noisy text are cleared.
[0025] Step 2: Capture a frame from the surveillance video at a predetermined interval i , stored in chronological order as a video frame sequence set, the video frames and captured news pictures are extracted with image features to obtain the feature vector v i , a visual encoder processes the feature vector sequence, where the feature vector sequence v is first processed to obtain the feature representation h of each video frame and news picture i , and then obtain the final output h of the visual encoder, h is h i The sequences are combined and then multiplied by a weight matrix to produce a vector containing visual features;
[0026] In this embodiment, the more common vgg-16 convolutional neural network extracts image features, the video preprocessed in step 1 is processed by the video processing tool ffmpeg, video frames are extracted at a time interval of 1 second, the obtained video frames and news pictures are converted into 224×224 pictures, and the video frames are numbered, and the video frames are represented by I=I 1 ,I 2,…,I n . Input the video frames and news pictures into the convolutional neural network to obtain the feature representation v i , expressed as:
[0027] v i =CNN(I i )
[0028] Through the image attention component, the extracted image feature vector v i All are converted into the final vector h representing each image i , expressed as:
[0029] h i = Transformer(v i ,v)
[0030] where v is v i The feature vectors of the other previous video frames, that is, v = v 1 ,v 2 ,…,v m .
[0031] Step 3: Combine the captured news text and weather information to obtain a text vector sequence e = e 1 ,e 2 ,…,e L , where e i Represents a word, and then uses word embedding to convert the text sequence into a word vector representation. The vector sequence is processed by a text encoder, where the text vector sequence e is first processed to obtain value information, and then combined with the output h of the visual encoder in step 2 to obtain the feature representation g of each word in the text. i , and then obtain the final output g of the text encoder, g is g i The sequences are combined and then multiplied by a weight matrix to produce a vector containing text features;
[0032] In this embodiment, for news text, word embedding is used to represent it as a vector and its order is guaranteed, that is, the word sequence e = e 1 ,e 2 ,…,e L , where e i Represents a word, then word embedding is used to convert the text sequence into a word vector representation, the text vector e is processed by the text attention component, and then combined with h in step 2 to input the image-text joint attention component to obtain the feature representation g of each word in the text i , whose expression is:
[0033] g i = Transformer(e i,e,h)
[0034] Among them, two attention components, one is used to process the text vector e, and the other is used to process the image feature vector h in step 2.
[0035] Step 4: Use the traffic scene information decoder to generate traffic scene information text.
[0036] In this embodiment, the specific implementation of step 4 includes the following sub-steps:
[0037] Step 4.1: Determine the word corresponding to each position of the sentence to be generated;
[0038] The probability of the words in the first 0 to i-1 positions is obtained by using formula 1 and formula 2, that is, p(y 0 ,…,y i-1 ,h,g);
[0039] s i = Transformer(y i ,y,h,g); (1)
[0040] p(y 0 ,…,y i-1 ,h,g)=Softmax(Ws i ); (2)
[0041] Among them, y i ∈y, y is the target text, h is the visual feature, g is the text feature, Transformer() represents the traffic scene information decoder; Softmax() represents the Softmax activation function, W represents the weight of a fully connected neural network layer at the end of the traffic scene information decoder, W si Represents the weights W and s in the fully connected layer i Perform matrix multiplication;
[0042] Get the probability distribution of the sentence from 0 to the current position i, that is, p(y 0 ,…,y t |h,g);
[0043]
[0044] Among them, i represents a certain position; w i is the probability distribution of the word at the ith position generated by the traffic scene information decoder. It is a vector in which each element is a probability value and the sum of all elements equals 1. Formula (3) multiplies the probability distribution of all positions from 1 to T by the corresponding elements, and determines the entire sentence from the overall perspective of the entire sentence. Among so many possible sentences, the sentence with the highest probability can be selected; 0≤i≤T.
[0045] Step 5.2: Take p(y 0 ,…,y t |h,g), and then correspond to the dictionary to obtain the final generated text.
[0046] The dictionary generation method of this embodiment adopts the Chinese word segmentation tool Jieba.
[0047] This embodiment obtains a traffic field corpus, uses a generative adversarial neural network, and uses a professional detection module to determine whether the generated text is automatically generated or comes from the corpus. A reward and punishment mechanism is set up to make the generated commentary content conform to the professionalism of the sentences in the traffic field corpus. Among them, the generator is implemented by the multimodal automatic extraction of traffic scene information method from steps 1 to 5, and the discriminator is implemented by LSTM, and its expression is as follows:
[0048]
[0049] is the hidden state of LSTM, q t Represents the generated sentence S t The probability that the discriminator thinks it comes from the corpus. If S is a real sentence from the corpus, then q t It means the probability that the first t parts of the sentence come from the corpus.
[0050] The discriminator determines whether a sentence comes from the corpus, and the generator generates sentences that are highly similar to the corpus to fool the discriminator. In order to achieve this goal, a reward and punishment mechanism is set up. The reward value for the tth generated word is the logarithm of the probability estimated by the discriminator. The formula is:
[0051]
[0052] By maximizing the reward, the generator gradually learns to generate professional sentences, and the corresponding adversarial loss is defined as:
[0053]
[0054] Based on the broadcast content of the present invention, the traffic conditions in the monitored area can be interpreted, providing a more timely, more accurate and more targeted interpretation of traffic scenes. Based on the present invention, the interpretation broadcast of various scenes can be further carried out, and the content of various scenes can be broadcasted in real time.
[0055] It should be understood that the above description of the preferred embodiment is relatively detailed and cannot be regarded as limiting the scope of patent protection of the present invention. Under the enlightenment of the present invention, ordinary technicians in this field can also make substitutions or modifications without departing from the scope of protection of the claims of the present invention, which all fall within the scope of protection of the present invention. The scope of protection requested for the present invention shall be based on the attached claims.
Claims
1. A method for automatically extracting traffic scene information in a multi-modal manner, characterized in that: The following steps are involved: Step 1: Obtain surveillance video of the traffic scene, capture news pictures and text related to the traffic scene, and current weather information; Step 2: Capture a frame from the surveillance video at a predetermined interval i , stored in chronological order as a video frame sequence set, the video frames and captured news pictures are extracted with image features to obtain the feature vector v i , a visual encoder processes the feature vector sequence, where the feature vector sequence v is first processed to obtain the feature representation h of each video frame and news picture i , and then obtain the final output h of the visual encoder, h is h i The sequences are combined and then multiplied by a weight matrix to produce a vector containing visual features; Step 3: Combine the captured news text and weather information to obtain a text vector sequence e = e1, e2, …, e L , where e i Represents a word, and then uses word embedding to convert the text sequence into a word vector representation. The vector sequence is processed by a text encoder, where the text vector sequence e is first processed to obtain value information, and then combined with the output h of the visual encoder in step 2 to obtain the feature representation g of each word in the text. i , and then obtain the final output g of the text encoder, g is g i The sequences are combined and then multiplied by a weight matrix to produce a vector containing text features; Step 4: Generate traffic scene information text; the specific implementation includes the following sub-steps: Step 4.1: Determine the word corresponding to each position of the sentence to be generated; The probability of the words in the first 0 to i-1 positions is obtained by using formula 1 and formula 2, that is, p(y0,…,y i-1 ,h,g); s i =Transformer(y i ,y,h,g); (1) p(y0,…,y i-1 ,h,g)=Softmax(Ws i ); (2) Among them, y i ∈y, y is the target text, h is the visual feature, g is the text feature, Transformer() represents the traffic scene information decoder; Softmax() represents the Softmax activation function, W represents the weight of a fully connected neural network layer at the end of the traffic scene information decoder, Ws i Represents the weights W and s in the fully connected layer i Perform matrix multiplication; Get the probability size corresponding to each possible sentence from 0 to position i, that is, p(y0,…,y i |h,g); Among them, w i Represents the probability distribution of the word at the i-th position generated, 0≤i≤T; Step 4.2: Take p(y0,…,y i |h,g) and then correspond to the dictionary to obtain the words at each position to get the final generated sentence; The dictionary is generated by segmenting all existing texts, assigning numbers to each word, and obtaining a word-number set.
2. The method for automatically extracting traffic scene information using multi-modal methods according to claim 1, characterized in that: In step 2, a convolutional neural network is used to extract image features.
3. The method for automatically extracting traffic scene information using multi-modal methods according to claim 1, characterized in that: In step 2, the feature vector sequence v is processed using the image attention component.
4. The method for automatically extracting traffic scene information using multi-modal methods according to claim 1, characterized in that: In step 3, the text vector sequence e is processed using the text attention component.
5. The method for automatically extracting traffic scene information using multi-modal methods according to claim 1, characterized in that: In step 3, the image-text joint attention component is used to obtain the feature representation g of each word in the text i .
6. The method for automatically extracting traffic scene information using multi-modal methods according to claim 1, characterized in that: In step 4, a traffic scene information decoder is used to generate traffic scene information text.
7. The method for automatically extracting traffic scene information using multimodal methods according to any one of claims 1 to 6, characterized in that: In step 4, a corpus in the field of transportation is obtained, and a generative adversarial neural network is used to generate text. The commentary professionalism detection discriminator determines whether the text is automatically generated or comes from the corpus, and a reward and punishment mechanism is set up to ensure that the generated information conforms to the professionalism of the transportation field.
8. A multi-modal automatic extraction system for traffic scene information, characterized in that: Includes the following modules: Module 1 is used to obtain surveillance videos of traffic scenes, capture news pictures and texts related to the traffic scenes, and current weather information; Module 2, used to capture a frame I from the surveillance video at a predetermined time interval i , stored in chronological order as a video frame sequence set, the video frames and captured news pictures are extracted with image features to obtain the feature vector v i , a visual encoder processes the feature vector sequence, where the feature vector sequence v is first processed to obtain the feature representation h of each video frame and news picture i , and then obtain the final output h of the visual encoder, h is h i The sequences are combined and then multiplied by a weight matrix to produce a vector containing visual features; Module 3 is used to merge the captured news text and weather information to obtain a text vector sequence e=e1,e2,…,e L , where e i Represents a word, and then uses word embedding to convert the text sequence into a word vector representation. The vector sequence is processed by a text encoder, where the text vector sequence e is first processed to obtain value information, and then combined with the output h of the visual encoder in module 2 to obtain the feature representation g of each word in the text. i , and then obtain the final output g of the text encoder, g is g i The sequences are combined and then multiplied by a weight matrix to produce a vector containing text features; Module 4 is used to generate traffic scene information text; it specifically includes the following sub-modules: Module 4.1 is used to determine the word corresponding to each position of the sentence to be generated; The probability of the words in the first 0 to i-1 positions is obtained by using formula 1 and formula 2, that is, p(y0,…,y i-1 ,h,g); s i =Transformer(y i ,y,h,g); (1) p(y0,…,y i-1 ,h,g)=Softmax(Ws i ); (2) Among them, y i ∈y, y is the target text, h is the visual feature, g is the text feature, Transformer() represents the traffic scene information decoder; Softmax() represents the Softmax activation function, W represents the weight of a fully connected neural network layer at the end of the traffic scene information decoder, Ws i Represents the weights W and s in the fully connected layer i Perform matrix multiplication; Get the probability size corresponding to each possible sentence from 0 to position i, that is, p(y0,…,y i |h,g); Among them, w i Represents the probability distribution of the word at the i-th position generated, 0≤i≤T; Module step 4.2 is used to obtain p(y0,…,y i |h,g) and then correspond to the dictionary to obtain the words at each position to get the final generated sentence; The dictionary is generated by segmenting all existing texts, assigning numbers to each word, and obtaining a word-number set.
9. A device for automatically extracting traffic scene information in a multi-modal manner, characterized in that: include: one or more processors; A storage device for storing one or more programs, which, when executed by the one or more processors, enables the one or more processors to implement the method for multimodal automatic extraction of traffic scene information as described in any one of claims 1 to 7.
Citation Information
Patent Citations
Industrial atlas construction method based on attention mechanism and entity description
CN111522961A
Generating recommendation information
US20210027018A1
Computer-implemented method and computer programme product for obtaining an environment scene representation for an automated driving system, computer-implemented method for learning an environment scene prediction for an automated driving system, and control device for an automated driving system
WO2022033810A1
