Driving scene recognition method and device, equipment, storage medium and product

Through the combination of visual language model and multi-label classification model, the problems of low driving scene recognition efficiency and poor flexibility in the existing technology are solved, a more efficient and flexible driving scene recognition method is realized, and the cost of labeling and training is reduced.

CN118609073APending Publication Date: 2024-09-06ZHEJIANG GEELY HLDG GRP CO LTD +1
View PDF 0 Cites 4 Cited by

Patent Information

Application Number
CN202410654958.6
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-05-24
Publication Date
2024-09-06

AI Technical Summary

Technical Problem

In the field of autonomous vehicle driving, the driving scene recognition efficiency in the existing technology is low, mainly due to the need to split it into multiple tasks and use different models for recognition, resulting in complex and time-consuming model training, and various categories of scenes are coupled together, resulting in poor flexibility. .

Method used

Using a combination of visual language model and multi-label classification model, the similarity between the image to be recognized and the preset driving scene description sentence is calculated through the visual language model, the target text label is generated, and the multi-label classification model is fine-tuned to achieve Unified task and unified model recognition of driving scenarios.

Benefits of technology

It greatly reduces task complexity, improves driving scene recognition efficiency and scalability, reduces labeling and training costs, and improves multi-classification accuracy.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118609073A
    Figure CN118609073A
Patent Text Reader

Abstract

The invention discloses a driving scene recognition method and device, equipment, a storage medium and a product, relates to the technical field of artificial intelligence, and discloses a driving scene recognition method which comprises the steps that a to-be-recognized image is input into a visual language model, and the similarity between the to-be-recognized image and each preset driving scene description statement is obtained; according to the similarity between the to-be-recognized image and each preset driving scene description statement, obtaining the similarity between the to-be-recognized image and each preset text tag; inputting the similarity between the to-be-recognized image and each preset driving scene description statement into a multi-label classification model to obtain a target text label corresponding to the to-be-recognized image; and determining a driving scene of the vehicle according to the target text tag. And the recognition efficiency of the driving scene of the vehicle is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of artificial intelligence technology, and in particular to a method, device, equipment, storage medium and product for identifying a driving scene. Background Art

[0002] In the field of autonomous driving, accurate recognition of driving scenarios is one of the key technologies to ensure driving safety and improve the user experience of autonomous driving. Due to the diversity and complexity of the driving environment, how to accurately identify different driving scenarios is a very challenging problem.

[0003] At present, the driving scene recognition task is divided into multiple tasks, such as classification tasks, detection tasks, segmentation tasks, etc., and multiple tasks together constitute a complex system. Different models are used to realize the recognition of different tasks, such as road recognition through convolutional neural network models and road condition recognition through recurrent convolutional neural network models.

[0004] However, each model requires a large number of labels before training. Model training is relatively complicated and takes a lot of time, resulting in low recognition efficiency of vehicle driving scenes.

[0005] The above contents are only used to assist in understanding the technical solution of the present application and do not constitute an admission that the above contents are prior art. Summary of the invention

[0006] The main purpose of this application is to provide a driving scene recognition method, device, equipment, storage medium and product, aiming to solve the technical problem of low efficiency in recognizing driving scenes of vehicles.

[0007] To achieve the above objectives, the present application proposes a method for identifying a driving scene, the method comprising:

[0008] Inputting the image to be recognized into a visual language model to obtain the similarity between the image to be recognized and each preset driving scene description sentence, wherein the visual language model is trained according to the mapping relationship between preset driving scene image samples and preset driving scene description sentence samples, and the preset driving scene description sentence is obtained by expanding the corresponding preset text label through the corresponding prompt information;

[0009] According to the similarity between the image to be identified and each preset driving scene description sentence, the similarity between the image to be identified and each preset text label is obtained;

[0010] Inputting the similarity between the image to be identified and each preset driving scene description sentence into a multi-label classification model to obtain a target text label corresponding to the image to be identified;

[0011] A driving scenario of the vehicle is determined according to the target text label.

[0012] In one embodiment, the visual language model includes a text encoder and a visual encoder, and the step of inputting the image to be recognized into the visual language model to obtain the similarity between the image to be recognized and each preset driving scene description sentence includes:

[0013] Inputting the image to be recognized into the visual encoder to obtain an image feature vector corresponding to the image to be recognized;

[0014] And, inputting each of the preset driving scene description sentences into the text encoder to obtain a text feature vector corresponding to each of the preset driving scene description sentences;

[0015] Mapping the prompt information corresponding to each layer of the first K layers of the text encoder to the corresponding layer of the visual encoder through a coupling function, so that the image feature vector and each of the text feature vectors are semantically aligned in the same space, wherein the coupling function includes a first fully connected layer and an activation function;

[0016] The similarity between the image to be identified and each preset driving scene description sentence is obtained according to the semantically aligned image feature vector and each text feature vector.

[0017] In one embodiment, the step of obtaining the similarity between the image to be identified and each preset driving scene description sentence according to the semantically aligned image feature vector and each text feature vector comprises:

[0018] Determine the cosine similarity between the semantically aligned image feature vector and each of the text feature vectors;

[0019] The similarity between the image to be identified and each preset driving scene description sentence is obtained according to the cosine similarity.

[0020] In one embodiment, the multi-label classification model includes a second fully connected layer, a third fully connected layer and a sigmoid activation function, and the step of inputting the similarity between the image to be identified and each preset driving scene description sentence into the multi-label classification model to obtain the target text label corresponding to the image to be identified includes:

[0021] According to the similarity between the image to be identified and each preset driving scene description sentence, the similarity between the image to be identified and each preset text label is obtained;

[0022] The similarity between the image to be identified and each preset text label is sequentially passed through the second fully connected layer and the third fully connected layer of the multi-label classification model, and is calculated through the sigmoid activation function to obtain the confidence corresponding to each preset text label;

[0023] According to the confidence level corresponding to each of the preset text labels, a target text label corresponding to the image to be recognized is obtained.

[0024] In one embodiment, the step of obtaining the target text label corresponding to the image to be recognized according to the confidence level corresponding to each of the preset text labels includes:

[0025] Sorting each of the preset text labels based on the corresponding confidence level, and selecting a preset number of preset text labels with the highest confidence level;

[0026] The preset number of preset text tags are filtered according to a preset filtering method, and the preset text tags remaining after filtering are determined as the target text tags.

[0027] In one embodiment, the method further includes:

[0028] Determine the overall loss value according to the loss value between the confidence level corresponding to each preset text label and the standard confidence level;

[0029] Determining, according to the overall loss value, a first correction value of the prompt information corresponding to the visual language model and a second correction value of the model parameter corresponding to the multi-label classification model, wherein the model parameter includes a weight and / or bias of each of the second fully connected layer and the third fully connected layer;

[0030] The visual language model is updated using the first correction value, and the multi-label classification model is updated using the second correction value.

[0031] In one embodiment, the step of determining the overall loss value according to the loss value between the confidence level corresponding to each preset text label and the standard confidence level comprises:

[0032] The loss value between the confidence level and the standard confidence level corresponding to each preset text label is calculated through the cross entropy loss function;

[0033] The loss values ​​are summed up and then averaged to obtain the overall loss value.

[0034] In addition, to achieve the above purpose, the present application also proposes a driving scene recognition device, the driving scene recognition device comprising:

[0035] a similarity determination module, configured to input an image to be identified into a visual language model to obtain a similarity between the image to be identified and each preset driving scene description sentence, wherein the visual language model is trained based on a mapping relationship between preset driving scene image samples and preset driving scene description sentence samples, and the preset driving scene description sentence is obtained by expanding a corresponding preset text label through corresponding prompt information;

[0036] A multi-label classification module, used for inputting the similarity between the image to be identified and each preset driving scene description sentence into a multi-label classification model to obtain a target text label corresponding to the image to be identified;

[0037] The driving scene determination module is used to determine the driving scene of the vehicle according to the target text label.

[0038] In addition, to achieve the above-mentioned purpose, the present application also proposes a driving scene recognition device, which includes: a memory, a processor, and a computer program stored in the memory and executable on the processor, and the computer program is configured to implement the steps of the driving scene recognition method as described above.

[0039] In addition, to achieve the above-mentioned purpose, the present application also proposes a storage medium, which is a computer-readable storage medium, and a computer program is stored on the storage medium. When the computer program is executed by a processor, the steps of the driving scene recognition method described above are implemented.

[0040] In addition, to achieve the above-mentioned purpose, the present application also provides a computer program product, which includes a computer program, and when the computer program is executed by a processor, the steps of the driving scene recognition method described above are implemented.

[0041] One or more technical solutions proposed in this application have at least the following technical effects:

[0042] Since the visual language model is used to process the image to be identified, the similarity between the image to be identified and each preset driving scene description statement is obtained, and then the similarity between the image to be identified and each preset text label is determined. Based on the similarity, all text labels in the image to be identified can be identified, and then the driving scene of the vehicle can be obtained by identifying the obtained text labels. By using the large visual language pre-training model, its powerful prior knowledge and generalization ability are fully utilized, so that the driving scene recognition method is transformed from a complex system of multiple tasks and multiple models to a unified task and unified model method, which greatly reduces the complexity of the task, improves the recognition efficiency of text labels, and thus improves the recognition efficiency of vehicle driving scenes. BRIEF DESCRIPTION OF THE DRAWINGS

[0043] The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the present application and, together with the description, serve to explain the principles of the present application.

[0044] In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, for ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative labor.

[0045] Figure 1 A schematic diagram of a process flow provided for the first embodiment of the method for identifying a driving scene of the present application;

[0046] Figure 2 A schematic diagram of the model structure involved in the driving scene recognition method of this application;

[0047] Figure 3 A schematic diagram of a brief process of a method for identifying a driving scene provided in Embodiment 2 of the present application;

[0048] Figure 4 A schematic diagram of the training process of the model involved in the driving scene recognition method of this application;

[0049] Figure 5 A schematic diagram of the use process of the model involved in the driving scene recognition method of this application;

[0050] Figure 6 This is a schematic diagram of the module structure of the driving scene recognition device of this application;

[0051] Figure 7 Schematic diagram of the device structure of the hardware operating environment involved in the driving scene recognition method in the embodiment of the present application.

[0052] The purpose, features and advantages of this application will be further described in conjunction with the embodiments and with reference to the accompanying drawings. DETAILED DESCRIPTION

[0053] It should be understood that the specific embodiments described herein are only used to explain the technical solutions of the present application and are not used to limit the present application.

[0054] In order to better understand the technical solution of the present application, a detailed description will be given below in conjunction with the accompanying drawings and specific implementation methods.

[0055] The main solution of the embodiment of the present application is: inputting the image to be recognized into a visual language model to obtain the similarity between the image to be recognized and each preset driving scene description sentence, wherein the visual language model is trained according to the mapping relationship between preset driving scene image samples and preset driving scene description sentence samples, and the preset driving scene description sentence is obtained by expanding the corresponding preset text label through the corresponding prompt information; inputting the similarity between the image to be recognized and each preset driving scene description sentence into a multi-label classification model to obtain the target text label corresponding to the image to be recognized; and determining the driving scene of the vehicle according to the target text label.

[0056] In this embodiment, for ease of description, the following description is made with the driving scene recognition device as the execution subject.

[0057] In the prior art, most current driving scene recognition methods are implemented by disassembling tasks and separately identifying them. Driving scene recognition is split into multiple subtasks and implemented separately in different ways. For example, road recognition is implemented by traditional convolutional neural network model classification tasks, and road conditions are implemented by traditional recurrent convolutional neural network detection tasks. These tasks require reliance on a large amount of labeled data for model training, which is extremely costly, and the task framework is not unified, resulting in a complex system, low maintainability, and poor scalability.

[0058] The present application provides a solution by using a large visual language pre-training model, making full use of its powerful prior knowledge and generalization ability, so that the driving scene recognition method is transformed from a complex system of multiple tasks and multiple models to a unified task and unified model method, which greatly reduces the complexity of the task and improves the recognition efficiency of text labels, thereby improving the recognition efficiency of vehicle driving scenes.

[0059] Because the recognition of various categories of scenes is coupled together in the existing technology, each expansion of a new scene may require re-labeling of data and retraining of one or more models, which has extremely poor flexibility.

[0060] The present application provides a solution, which adds a multi-label classification model after the visual language model, predicts the confidence score for each category separately, decouples the categories of the driving scene, and facilitates adding categories at any time. Compared with the traditional method, only a small amount of labeled data needs to be added for a small amount of training, which greatly enhances the scalability; the multi-label classification model of the present application actually uses a two-layer fully connected network plus a sigmoid activation function to output the final result, uses a multi-label classification model to replace the softmax output in the original visual language model structure, and uses a cross entropy loss function to replace the contrast loss function of the original visual language model to adapt to multi-classification tasks. By replacing the contrast learning output of the original visual language model with a multi-label classification head, the visual language model is given the ability to output multiple labels, which is more suitable for the complex task of driving scene recognition; at the same time, using a two-layer fully connected neural network can better learn the implicit relationship between various types, thereby improving the accuracy of multi-classification.

[0061] In addition, the present application uses a multimodal deep cue learning method to fine-tune the visual language model. Compared with the traditional solution that uses a large amount of annotated data for training, the present application only needs to use simple text label annotated data for fine-tuning for each category, so as to migrate the visual language model from the general field to the vertical field of driving scene recognition, which can greatly save the labor and time costs of annotation and training; and, compared with the original method of adding a single layer of learnable cue information to the single modality of text / image, the present application adds cue information to the first K layers of the text encoder, and each layer uses a learnable coupling function to map it to the image encoder, which not only increases the amount of learnable parameters, but also emphasizes the correlation between text / image branches, and better aligns multimodal feature extraction.

[0062] It should be noted that the execution subject of this embodiment may be a computing service device with data processing, network communication and program running functions, such as a tablet computer, a personal computer, a mobile phone, etc., or an electronic device capable of realizing the above functions, a driving scene recognition device, etc. The following takes the driving scene recognition device as an example to illustrate this embodiment and the following embodiments.

[0063] It should be noted that the driving scenarios of this application include but are not limited to the following subtasks:

[0064] (1) Road recognition: The system needs to identify the current road type, such as highway, urban area, parking lot, tunnel, gas station, intersection, ramp entrance and exit, etc.

[0065] (2) Weather identification: It is necessary to judge the weather conditions of the current driving environment, such as rain, snow, fog, cloudy, sunny, and the level of rain, snow, fog, etc.

[0066] (3) Lighting conditions: Identify scenes such as strong light, weak light, darkness, backlight, and backlight to better assist the driver.

[0067] Road conditions: abnormal road conditions such as narrow, cracked, bumpy, waterlogged, snowy, etc.

[0068] This application replaces the contrastive learning output of the original visual language model with a multi-label classification model, giving the visual language model the ability of multi-label output, which is more suitable for the complex task of driving scene recognition.

[0069] Based on this, the present application embodiment provides a method for identifying a driving scene. Figure 1 , Figure 1 This is a flow chart of the first embodiment of the driving scene recognition method of the present application.

[0070] In this embodiment, the driving scene recognition method includes steps S10 to S40:

[0071] Step S10, inputting the image to be recognized into a visual language model to obtain the similarity between the image to be recognized and each preset driving scene description sentence, wherein the visual language model is trained according to the mapping relationship between preset driving scene image samples and preset driving scene description sentence samples, and the preset driving scene description sentence is obtained by expanding the corresponding preset text label through the corresponding prompt information.

[0072] It should be noted that the image to be identified may be an image currently captured by a camera on the vehicle during the vehicle's current driving process. The image to be identified captured by the vehicle may be one or more frames, and may be one or more frames of images to be identified captured by cameras located at different positions.

[0073] When the vehicle collects multiple frames of images to be identified, image detection can be performed on each of the images to be identified, and images to be identified that do not meet the requirements can be screened out, and better images to be identified can be retained to improve the accuracy of subsequent vehicle positioning results. For example, images to be identified whose brightness is less than a preset brightness can be screened out, or images to be identified whose clarity is less than a preset clarity can be screened out.

[0074] When the images to be identified are collected by cameras at different locations, the images to be identified collected by each camera can be spliced ​​together, and the vehicle can be positioned based on the spliced ​​images to be identified. Since the spliced ​​images to be identified can clearly show the environment around the vehicle, the accuracy of subsequent vehicle positioning results is improved.

[0075] In some special driving scenarios, such as bad weather scenarios such as rain or snow, the image to be identified may be blocked by raindrops or snow, resulting in inaccurate extraction of image feature points, thereby affecting the accuracy of vehicle positioning results. Therefore, in these driving scenarios, it is necessary to process the image to be identified collected by the vehicle to remove noise points such as raindrops and snow. For example, a discrete wavelet decomposition algorithm can be used to perform wavelet decomposition processing on the image to be identified collected by the vehicle to obtain different sub-bands, and a convolution encoder can be used to extract first image features of different scales, and then a gated recursive transformer model is used to process the first image features of different scales to extract second image features, and finally the second image features are upsampled to obtain a processed image to be identified. When the processed image to be identified is used for subsequent driving scene recognition, the accuracy of the recognition result of the driving scene is improved. Other methods can also be used to pre-process the image to be identified collected by the vehicle, such as a convolutional neural network model or a recurrent convolutional neural network model, so as to improve the clarity of the image to be identified and improve the accuracy of the recognition result of the vehicle's driving scene.

[0076] It should be noted that the visual language model is a deep learning model used to process data that contains both images and natural language descriptions. This model combines the techniques of computer vision and natural language processing to achieve understanding of image content and description generation. Typical tasks of the visual language model include image annotation, visual question answering, and image description generation. In these tasks, the model needs to be able to extract features from the image and associate them with the corresponding natural language description.

[0077] Specifically, the visual language model needs to complete the following main steps:

[0078] The model first extracts features from the input image, usually using a convolutional neural network (CNN) to capture the visual information of the image and generate a corresponding feature representation. At the same time, the model also extracts features from the input natural language description, usually using models such as a recurrent neural network (RNN) or Transformer to capture semantic information. Next, the model will fuse the features extracted from the image and language, usually using an attention mechanism or other fusion strategies to combine the two features. Finally, depending on the specific task, the visual language model may need to be processed differently. For example, in an image annotation task, the model may need to generate a natural language description related to the image content; in a visual question-and-answer task, the model may need to answer natural language questions related to the image. In this application, the text labels in the image to be identified are identified by a visual language model to obtain the driving scene of the vehicle.

[0079] It should be noted that the preset text labels may be elements in the preset driving scene image, such as logos, target objects, etc., and the corresponding preset text labels are different in different driving scenes. For example, for road recognition, the corresponding preset text labels may be highways, urban areas, parking lots, tunnels, gas stations, intersections, ramp entrances and exits, etc. For weather recognition, the corresponding preset text labels may be rain, snow, fog, cloudy, sunny, and rain, snow, fog levels, etc.

[0080] In addition, it should be noted that the corresponding prompt information should be different in different driving scenarios. In the visual language model, the role of prompt information is similar to clues or guidance to guide the model to perform related tasks, which helps the model to better understand the input images and texts and generate accurate outputs. Prompt information can clearly inform the visual language model of the type of task to be performed, and help the visual language model adjust its own structure and parameters according to the task requirements to achieve better performance. Prompt information can also provide semantic constraints for the visual language model, limiting the scope or direction of the preset driving scene description statement.

[0081] In addition, it should be noted that the preset driving scene description sentence refers to a sentence used to describe the driving scene of the vehicle. Appropriate prompt information can be designed to expand the preset text label into a driving scene description sentence. For example, the preset driving scene description sentence obtained by expanding the preset text label "raining" is "it is raining in this picture, and the road is slippery", and the preset driving scene description sentence obtained by expanding the preset text label "snowing" is "it is snowing in this picture, and the road is covered with snow".

[0082] In a feasible implementation manner, a preset text label corresponding to a preset driving scene image can be pre-identified, and the preset text label can be expanded to obtain a preset driving scene description sentence, and then the preset driving scene image, the preset text label and the preset driving scene description sentence are related. In the above manner, the preset driving scene description sentence corresponding to each preset driving scene image can be obtained, a preset driving scene image sample and its corresponding preset driving scene description sentence are formed, and a mapping relationship between the preset driving scene image sample and the preset driving scene description sentence is constructed.

[0083] In a feasible implementation manner, a preset driving scene image sample is obtained, wherein the preset driving scene image sample includes corresponding images under different driving scenes; a corresponding preset text label is annotated for each preset driving scene image in the preset driving scene image sample, wherein the preset text label is used for an element in the preset driving scene image; each of the preset text labels is expanded using prompt information to obtain a preset driving scene description sentence corresponding to each of the preset driving scene images; each of the preset driving scene description sentences is combined to obtain a preset driving scene description sentence sample corresponding to the preset driving scene image sample; and a mapping relationship between the preset driving scene image sample and the preset driving scene description sentence sample is generated.

[0084] In a feasible implementation, after the image to be recognized is input into the visual language model, the cosine similarity between the image to be recognized and each preset driving scene description sentence is calculated, and the matching between the image to be recognized and each preset driving scene description sentence is determined by the cosine similarity.

[0085] It is understandable that since the visual language model is trained based on the mapping relationship between the preset driving scene image samples and the preset driving scene description sentence samples, it makes full use of its powerful prior knowledge and generalization ability, so that the driving scene recognition method is transformed from a complex system of multiple tasks and multiple models to a unified task and unified model method, which greatly reduces the complexity of the task. In addition, the visual language model is fine-tuned using prompt information. Compared with the traditional solution that uses a large amount of labeled data for training, each category of this application only needs to be fine-tuned using simple label labeled data, which can migrate the pre-trained model from the general field to the vertical field of driving scene recognition, which can greatly save the labor and time costs of labeling and training.

[0086] In a feasible implementation, the visual language model includes a text encoder and a visual encoder, and step S10 includes steps A11 to A14:

[0087] Step A11, inputting the image to be identified into the visual encoder to obtain an image feature vector corresponding to the image to be identified.

[0088] In this embodiment, a first embedding vector corresponding to the image to be identified is determined, and the first embedding vector is input into the visual encoder to obtain an image feature vector corresponding to the image to be identified.

[0089] It should be noted that the visual language model consists of a text encoder and an image encoder, which are used to process text and image inputs and encode them into vector representations. These vector representations can be used for different tasks. Among them, the text encoder is a component used to process driving scene description sentences. It converts the driving scene description sentences into vector representations so that the model can understand and process text information. Commonly used text encoders include Transformer models (such as BERT, GPT, etc.) and RNN models (such as LSTM, GRU, etc.). Text encoders are usually able to capture the semantic, syntactic and contextual information of the text and convert it into a high-dimensional vector representation. The image encoder is a component used to process the image input to be recognized. It converts the image to be recognized into a vector representation so that the model can understand and process image information. Commonly used image encoders include convolutional neural network (CNN) models, such as ResNet, VGG, etc. Image encoders are usually able to extract features and structural information in images and convert them into high-dimensional vector representations.

[0090] Optionally, image features may be extracted from the image to be identified, and then the extracted image features may be converted into a first embedding vector.

[0091] Step A12: input each of the preset driving scene description sentences into the text encoder to obtain a text feature vector corresponding to each of the preset driving scene description sentences.

[0092] In this embodiment, a second embedding vector corresponding to each of the preset driving scene description sentences is obtained, and each of the second embedding vectors is input into the text encoder to obtain a text feature vector corresponding to each of the preset driving scene description sentences.

[0093] Step A13, mapping the prompt information corresponding to each layer of the first K layers of the text encoder to the corresponding layer of the visual encoder through a coupling function, so that the image feature vector and each of the text feature vectors are semantically aligned in the same space, wherein the coupling function includes a first fully connected layer and an activation function.

[0094] In this embodiment, the first K layers of the text encoder are added with prompt information, and each layer of the first K layers of the text encoder is associated with each layer of the first K layers of the visual encoder through a coupling function, so as to map the prompt information corresponding to each layer of the first K layers of the text encoder to each layer of the first K layers of the visual encoder, wherein the coupling function is composed of a first fully connected layer and an activation function. Among them, the activation function can be one of a Sigmoid function, a Tanh function, a ReLU function, and a Softmax function. By mapping through the coupling function, the image feature vector and each text feature vector can be semantically aligned in the same space, which is convenient for subsequent similarity calculation in the same semantic space.

[0095] It should be noted that, compared with the prior art in which the prompt information is preset, the prompt information of the present application is learnable.

[0096] For example, refer to Figure 2 , Figure 2 This is a schematic diagram of the visual language model and multi-label classification model of the present application. The visual language model includes a text encoder (above) and a visual encoder (below). Text represents the second embedding vector after the driving scene description sentence is embedded, which is then input into the text encoder. P1, P2, P3...Pk are learnable prompt information added to the first K layers of the text encoder. F1, F2...Fk represents the coupling function of the first k layers, which is composed of a fully connected layer and an activation function, and is responsible for mapping the prompt information corresponding to each layer of the text encoder to the corresponding layer of the visual encoder, thereby adding prompt information to the first k layers of the visual encoder and improving the coupling degree of the visual text branch, which not only enhances the transfer learning ability of the model, but also improves the alignment of multimodal feature extraction.

[0097] It can be understood that compared with the prior art that only adds a single layer of learnable prompt information to a single modality of text / image, the text encoder and the image encoder are usually trained separately. The present application adds prompt information to the first K layers of the text encoder, and each layer uses a learnable coupling function to map it to the image encoder, which not only increases the amount of learnable parameters, but also emphasizes the correlation between the text / image branches, and better aligns the multi-modal feature extraction.

[0098] Step A14, obtaining the similarity between the image to be identified and each preset driving scene description sentence according to the semantically aligned image feature vector and each text feature vector.

[0099] In this embodiment, the cosine similarity between the semantically aligned image feature vector and each of the text feature vectors can be determined; based on the cosine similarity, the similarity between the image to be identified and each of the preset driving scene description sentences can be obtained. Since semantic alignment is performed first and then the cosine similarity is calculated, the accuracy of the calculation result of the cosine similarity is improved.

[0100] It can be understood that the cosine similarity between the image feature vector of the image to be identified and the text feature vector corresponding to each preset driving scene description sentence represents the similarity between the image to be identified and each preset driving scene description sentence. Since the calculation of cosine similarity is very simple and only involves the dot product and norm calculation of the vector, it can improve the calculation efficiency of the similarity between the image to be identified and each preset driving scene description sentence.

[0101] Step S20: input the similarity between the image to be identified and each preset driving scene description sentence into a multi-label classification model to obtain a target text label corresponding to the image to be identified.

[0102] It should be noted that since the preset driving scene description sentences are obtained by text expansion of the preset text tags, the similarity between the image to be identified and each preset driving scene description sentence is actually the similarity between the image to be identified and each preset text label. Since the similarity between the image to be identified and each preset text label can be quickly determined through the visual language model, it is convenient for the subsequent text label classification of the image to be identified.

[0103] In this embodiment, a multi-label classification model is added after the visual language model to predict the confidence score for each category separately, so that the categories of driving scenes are decoupled and categories can be added at any time. Compared with traditional methods, only a small amount of labeled data needs to be added for a small amount of training, which greatly enhances scalability. The multi-label classification model replaces the contrast learning output of the original visual language model, giving the visual language model the ability of multi-label output, which is more suitable for the complex task of driving scene recognition; at the same time, the use of a two-layer fully connected neural network can better learn the implicit relationship between various types, such as "rainy" weather is more related to "road water", "snowy" weather is more related to "road snow", etc., thereby improving the accuracy of multi-classification.

[0104] It should be noted that the multi-label classification model is a machine learning model used to solve classification problems with multiple labels. In traditional single-label classification problems, each sample belongs to only one category, while in multi-label classification problems, each sample can belong to multiple categories at the same time. Since the driving scene recognition task of this application includes subtasks such as road recognition, weather recognition, lighting conditions, and road conditions, by inputting the image to be recognized into the multi-label classification model, all target text labels corresponding to the image to be recognized can be obtained.

[0105] It should be noted that there can be multiple target text labels.

[0106] In a feasible embodiment, the multi-label classification model includes a fully connected layer and a sigmoid activation function. The input of the multi-label classification model is the similarity between the image to be identified and each preset text label, and the output is the confidence corresponding to each preset text label. Step S30 includes: calculating the similarity between the image to be identified and each preset text label in turn through the fully connected layer and the sigmoid activation function of the multi-label classification model to obtain the confidence corresponding to each preset text label; obtaining the target text label corresponding to the image to be identified according to the confidence corresponding to each preset text label, thereby realizing multi-label classification of the image to be identified.

[0107] In another feasible implementation, the multi-label classification model includes two fully connected layers, namely the second fully connected layer and the third fully connected layer, and a sigmoid activation function. Step S20 includes: Steps A21 to A23:

[0108] Step A21, obtaining the similarity between the image to be identified and each preset text label according to the similarity between the image to be identified and each preset driving scene description sentence;

[0109] Step A22, the similarity between the image to be identified and each preset text label is passed through the second fully connected layer and the third fully connected layer of the multi-label classification model in turn, and is calculated through the sigmoid activation function to obtain the confidence corresponding to each preset text label.

[0110] Step A23, obtaining a target text label corresponding to the image to be recognized according to the confidence level corresponding to each of the preset text labels.

[0111] It should be noted that the second fully connected layer can be used to increase the dimension of text features and learn the implicit association between different preset text labels. The third fully connected layer performs dimensionality reduction, represents the feature mapping relationship between the output and the number of text labels, and performs the final classification or regression task. The role of the sigmoid activation function is to map the feature value corresponding to each preset text label in the multi-label classification model to a number between 0 and 1 as the confidence corresponding to the preset text label.

[0112] It can be understood that the multi-label classification model of the present application actually uses a two-layer fully connected network plus a sigmoid activation function to output the final result, and uses a multi-label classification model to replace the softmax output in the original visual language model structure to adapt to multi-classification tasks. It gives the visual language model the ability to output multiple labels, which is more suitable for the complex task of driving scene recognition; it can better learn the implicit relationship between various types, thereby improving the accuracy of multi-classification.

[0113] In a feasible implementation, step A23 includes: sorting each preset text label based on the corresponding confidence level, and taking the preset text label with a confidence level greater than the preset confidence level as the target text label corresponding to the image to be recognized.

[0114] In another feasible implementation, step A23 includes:

[0115] Step A231 , sorting each of the preset text labels based on the corresponding confidence level, and selecting a preset number of preset text labels with the highest confidence level.

[0116] It should be noted that the preset number can be determined according to the actual situation, and each preset text label is sorted from large to small based on the corresponding confidence, and the first preset number of preset text labels with the highest confidence are selected. The confidence is in the range of 0-1, and the higher the confidence, the more the image to be identified matches the preset text label.

[0117] Step A232, filtering the preset number of preset text tags according to a preset filtering method, and determining the preset text tags remaining after filtering as the target text tags.

[0118] In a feasible implementation, the preset filtering method may be confidence filtering, similarity filtering, conflict filtering, etc. Specifically, confidence filtering may be to use the preset text tags with a confidence greater than or equal to the preset confidence among the preset number of preset text tags as the target text tags, and filter out the preset text tags with a confidence less than the preset confidence. Similarity filtering may be to filter out one of the two preset text tags with a similarity greater than the preset similarity among the preset number of preset text tags. Conflict filtering may be: analyzing the correlation between the preset number of preset text tags. This can be achieved by calculating the co-occurrence frequency, correlation coefficient, mutual information between the text tags, or using a special correlation analysis method. According to the correlation between the preset text tags, the conflict between the preset text tags is analyzed. This includes identifying mutually exclusive tags (i.e., tags that cannot appear at the same time), dependent tags (i.e., the appearance of certain tags may depend on other tags), or other types of associations. Improve the accuracy of the target text tags of the image to be identified.

[0119] Step S30: determining a driving scenario of the vehicle according to the target text label.

[0120] In this embodiment, determining the driving scenario of the vehicle generally involves identifying key information in the text label and then mapping it to a specific driving scenario.

[0121] In a feasible implementation, it is necessary to understand the information contained in the target text label. The target text label may include information describing the vehicle status, driving environment, road conditions, traffic conditions, etc. Keywords or phrases are extracted from the target text label, which usually directly or indirectly indicate the driving scene. For example, keywords may include "highway", "city road", "rainy day", "congestion", "night driving", etc. The extracted keywords are mapped to specific driving scenes. This requires inference and judgment based on domain knowledge and common sense. For example: if the target text label mentions words such as "highway" and "expressway", it may mean that the vehicle is in a high-speed driving state. If the words "congestion" and "traffic jam" are mentioned, it may mean that the vehicle is in a city road with traffic congestion. If the words "rainy day" and "snowy day" are mentioned, it may mean that the vehicle is driving in bad weather. If the words "night driving" and "night" are mentioned, it may mean that the vehicle is driving at night. Finally, the multiple keywords mentioned in the target text label are comprehensively considered and analyzed to determine the most likely driving scene. Sometimes, a target text label may contain descriptions of multiple driving scenes, which need to be inferred based on the context to improve the accuracy of the driving scene recognition results.

[0122] It is understandable that, since the visual language model is used to process the image to be identified, the similarity between the image to be identified and each preset driving scene description statement is obtained, and then the similarity between the image to be identified and each preset text label is determined. Based on the similarity, all text labels in the image to be identified can be identified, and then the driving scene of the vehicle can be obtained by identifying the obtained text labels. By using the visual language pre-trained large model, its powerful prior knowledge and generalization ability are fully utilized, so that the driving scene recognition method is transformed from a complex system of multiple tasks and multiple models to a unified task and unified model method, which greatly reduces the complexity of the task, improves the recognition efficiency of text labels, and thus improves the recognition efficiency of vehicle driving scenes.

[0123] Based on the first embodiment of the present application, in the second embodiment of the present application, the same or similar contents as those in the above-mentioned embodiment 1 can refer to the above introduction, and will not be repeated later. Figure 3 After step A31, the driving scene method further includes steps S01 to S03:

[0124] Step S01, determining an overall loss value according to the loss values ​​between the confidences corresponding to the preset text labels and the standard confidences.

[0125] It should be noted that the standard confidence level can be set according to the actual situation. The calculation methods of the above loss values ​​include but are not limited to: mean square error, cross entropy loss, logarithmic loss, etc.

[0126] In a feasible implementation, step S01 includes: using the cross entropy loss function, respectively calculating the loss value between the confidence corresponding to each preset text label and the standard confidence; summing up the individual loss values ​​and averaging them to obtain the overall loss value. Since the cross entropy loss function is very simple and efficient for gradient calculation. For the back propagation algorithm of the neural network, the derivative calculation of the cross entropy loss function is relatively easy, which helps to speed up the training process of the multi-label classification model. In addition, the cross entropy loss function is based on the comparison of probability distributions, which measures the difference between the predicted distribution and the true distribution of the multi-label model. Therefore, it performs well in modeling probability distributions and can well represent the uncertainty of the model. In addition, due to the calculation method of the cross entropy loss function, the multi-label classification model is encouraged to output a probability distribution that conforms to the actual data distribution during the optimization process, which can produce more certain and clear prediction results.

[0127] Step S02: determining, based on the overall loss value, a first correction value of the prompt information corresponding to the visual language model and a second correction value of the model parameters corresponding to the multi-label classification model, wherein the model parameters include respective weights and / or biases of the second fully connected layer and the third fully connected layer.

[0128] In a feasible implementation, a mapping relationship between the correction value corresponding to the prompt information and the correction value of the model parameter corresponding to the multi-label classification model under different overall loss values ​​can be pre-established, and then based on the mapping relationship, the first correction value of the prompt information and the second correction value of the model parameter corresponding to the multi-label classification model can be quickly determined. Compared with the related art, the prompt information is fixed and cannot be adjusted. The present application can improve the recognition accuracy of the driving scene by correcting the prompt information and the model parameters.

[0129] In another feasible implementation, the training parameters corresponding to the coupling function between the text encoder and the video encoder may be modified according to the overall loss value to achieve the correlation between the text / image branches and better align the multimodal feature extraction.

[0130] Step S03: using the first correction value to update the visual language model, and using the second correction value to update the multi-label classification model.

[0131] In a feasible implementation, the number of updates can be set. When the preset number of updates is reached, the update is stopped and the updated visual language model and the multi-label classification model are output. The updated visual language model and the multi-label classification model are used to identify the driving scene again to improve the recognition accuracy of the driving scene. For example, the image to be recognized is input into the updated visual language model to obtain the similarity between the image to be recognized and each preset driving scene description sentence, wherein the visual language model is trained according to the mapping relationship between preset driving scene image samples and preset driving scene description sentence samples, and the preset driving scene description sentence is obtained by expanding the corresponding preset text label through the corresponding prompt information; according to the similarity between the image to be recognized and each preset driving scene description sentence, the similarity between the image to be recognized and each preset text label is obtained; the similarity between the image to be recognized and each preset text label is successively passed through the second fully connected layer and the third fully connected layer of the updated multi-label classification model, and is calculated through the sigmoid activation function to obtain the confidence corresponding to each preset text label; according to the confidence corresponding to each preset text label, the target text label corresponding to the image to be recognized is obtained; according to the target text label, the driving scene of the vehicle is determined.

[0132] It is understandable that by replacing the contrastive learning output of the original visual language model with a multi-label classification head, the visual language model is endowed with the ability of multi-label output, which is more suitable for the complex task of driving scene recognition.

[0133] For example, to help understand the implementation process of the driving scene recognition method obtained by combining the above-mentioned embodiment 1 and embodiment 2 in this embodiment, please refer to Figure 4 and Figure 5 , Figure 4 This is a flow chart of the model training process for this application. Figure 5 This is a schematic diagram of the use process of the visual language model after training for this application, specifically:

[0134] The model training process is as follows Figure 4 When training models (including visual language models and multi-label classification models), the visual language model parameters are frozen and only the Figure 2 The red part of the model structure diagram includes the first k layers of prompt information of the text / vision encoder, the coupling function between text / vision, and the first two fully connected layers of the multi-label classification head. Specifically:

[0135] First, the amount of labeled data is determined according to the number of driving scene categories. Each category of scene requires approximately 100 preset driving scene images, and simple text labeling is performed on the preset driving scene images.

[0136] Secondly, before inputting the model, design appropriate prompt information to expand the preset text labels into preset driving scene description sentences. For example, expand the "raining" label to "it is raining in this picture and the road is slippery."

[0137] Then, the preset driving scene image and all the preset driving scene description sentences are input into the visual language model with added multimodal prompt information, and the similarity between the preset driving scene image and each preset driving scene description sentence is calculated.

[0138] Next, the similarity between the preset driving scene image and each preset driving scene description statement is input into the multi-label classification model, and the confidence of the preset driving scene image and each preset text label is calculated. The confidence is in the range of 0-1. The higher the confidence, the more the preset driving scene image matches the preset text label.

[0139] Finally, the confidence of the network output is compared with the standard confidence to calculate the loss, and the model parameters of the multimodal prompt information and multi-label classification model are updated. The above steps are repeated until the set number of training times.

[0140] Reference Figure 5 ,After the visual language model training is completed, scene recognition is performed on the ,driving video.

[0141] First, a short video for driving scene recognition is obtained, and frames are extracted from the short video to form a set of driving scene pictures corresponding to the video, i.e., images to be recognized.

[0142] Secondly, obtain the driving scene description sentence library defined during the visual language model training, load the visual language model and multi-label classification head parameters, and input the visual language model fine-tuned by multimodal prompt learning together with the image to be recognized to obtain the similarity between each image to be recognized and all preset text labels.

[0143] Then, the similarity between the image to be identified and all preset text labels is input into the multi-label classification head, and the confidence of each image to be identified and all preset text labels is output.

[0144] Finally, the final results are filtered and fused through rule-based methods such as confidence filtering, similarity filtering, and conflict filtering to obtain all text labels corresponding to the final video, thereby realizing the entire process of driving scene recognition.

[0145] It should be noted that the above examples are only used to understand the present application and do not constitute a limitation on the driving scene recognition method of the present application. More simple transformations based on this technical concept are all within the scope of protection of the present application.

[0146] This application also provides a driving scene recognition device, please refer to Figure 6, the driving scene recognition device comprises:

[0147] The similarity determination module 10 is used to input the image to be identified into the visual language model to obtain the similarity between the image to be identified and each preset driving scene description sentence, wherein the visual language model is trained according to the mapping relationship between the preset driving scene image samples and the preset driving scene description sentence samples, and the preset driving scene description sentence is obtained by expanding the corresponding preset text label through the corresponding prompt information.

[0148] The multi-label classification module 20 is used to input the similarity between the image to be identified and each preset driving scene description sentence into a multi-label classification model to obtain a target text label corresponding to the image to be identified.

[0149] The driving scene determination module 30 is used to determine the driving scene of the vehicle according to the target text label.

[0150] Optionally, the similarity determination module 10 is further used for:

[0151] Inputting the image to be recognized into the visual encoder to obtain an image feature vector corresponding to the image to be recognized;

[0152] And, inputting each of the preset driving scene description sentences into the text encoder to obtain a text feature vector corresponding to each of the preset driving scene description sentences;

[0153] Mapping the prompt information corresponding to each layer of the first K layers of the text encoder to the corresponding layer of the visual encoder through a coupling function, so that the image feature vector and each of the text feature vectors are semantically aligned in the same space, wherein the coupling function includes a first fully connected layer and an activation function;

[0154] The similarity between the image to be identified and each preset driving scene description sentence is obtained according to the semantically aligned image feature vector and each text feature vector.

[0155] Optionally, the similarity determination module 10 is further used for:

[0156] Determine the cosine similarity between the semantically aligned image feature vector and each of the text feature vectors; and obtain the similarity between the image to be identified and each preset driving scene description sentence based on the cosine similarity.

[0157] Optionally, the multi-label classification module 20 is further used for:

[0158] According to the similarity between the image to be identified and each preset driving scene description sentence, the similarity between the image to be identified and each preset text label is obtained;

[0159] The similarity between the image to be identified and each preset text label is passed through the second fully connected layer and the third fully connected layer of the multi-label classification model in turn, and is calculated through the sigmoid activation function to obtain the confidence corresponding to each preset text label;

[0160] According to the confidence level corresponding to each preset text label, the target text label corresponding to the image to be recognized is obtained.

[0161] Optionally, the multi-label classification module 20 is further used for:

[0162] Sort each preset text label based on the corresponding confidence level, and select a preset number of preset text labels with the highest confidence level;

[0163] The preset number of preset text labels are filtered according to a preset filtering method, and the preset text labels remaining after filtering are determined as target text labels.

[0164] Optionally, the driving scene recognition device further includes:

[0165] Determine the overall loss value according to the loss value between the confidence level corresponding to each preset text label and the standard confidence level;

[0166] Determine, according to the overall loss value, a first correction value of the prompt information corresponding to the visual language model and a second correction value of the model parameter corresponding to the multi-label classification model, wherein the model parameter includes the weights and / or biases of the second fully connected layer and the third fully connected layer;

[0167] The visual language model is updated using the first correction value, and the multi-label classification model is updated using the second correction value.

[0168] Optionally, the driving scene recognition device further includes:

[0169] The loss value between the confidence level and the standard confidence level corresponding to each preset text label is calculated through the cross entropy loss function;

[0170] The individual loss values ​​are summed and averaged to get the overall loss value.

[0171] The driving scene recognition device provided by the present application adopts the driving scene recognition method in the above embodiment, which can solve the technical problem of low efficiency in recognition of vehicle driving scenes. Compared with the prior art, the beneficial effects of the driving scene recognition device provided by the present application are the same as the beneficial effects of the driving scene recognition method provided by the above embodiment, and other technical features in the driving scene recognition device are the same as the features disclosed in the above embodiment method, which will not be repeated here.

[0172] The present application provides a driving scene recognition device, the driving scene recognition device comprising: at least one processor; and a memory communicatively connected to the at least one processor; wherein the memory stores instructions executable by the at least one processor, and the instructions are executed by the at least one processor so that the at least one processor can execute the driving scene recognition method in the above-mentioned embodiment one.

[0173] Reference below Figure 7 , which shows a schematic diagram of the structure of a driving scene recognition device suitable for implementing the embodiment of the present application. The driving scene recognition device in the embodiment of the present application may include but is not limited to mobile terminals such as mobile phones, laptop computers, digital broadcast receivers, PDAs (Personal Digital Assistants), PADs (Portable Application Descriptions), PMPs (Portable Media Players), vehicle-mounted terminals (such as vehicle-mounted navigation terminals), etc., and fixed terminals such as digital TVs, desktop computers, etc. Figure 7 The driving scene recognition device shown is merely an example and should not bring any limitation to the functions and scope of use of the embodiments of the present application.

[0174] like Figure 7As shown, the driving scene recognition device may include a processing device 1001 (e.g., a central processing unit, a graphics processor, etc.), which can perform various appropriate actions and processes according to a program stored in a read-only memory (ROM: Read Only Memory) 1002 or a program loaded from a storage device 1003 to a random access memory (RAM: Random Access Memory) 1004. In RAM1004, various programs and data required for the operation of the driving scene recognition device are also stored. The processing device 1001, ROM1002, and RAM1004 are connected to each other via a bus 1005. An input / output (I / O) interface 1006 is also connected to the bus. Generally, the following systems can be connected to the I / O interface 1006: an input device 1007 including, for example, a touch screen, a touchpad, a keyboard, a mouse, an image sensor, a microphone, an accelerometer, a gyroscope, etc.; an output device 1008 including, for example, a liquid crystal display (LCD: Liquid Crystal Display), a speaker, a vibrator, etc.; a storage device 1003 including, for example, a magnetic tape, a hard disk, etc.; and a communication device 1009. The communication device 1009 can allow the driving scene recognition device to communicate with other devices wirelessly or by wire to exchange data. Although the figure shows a driving scene recognition device with various systems, it should be understood that it is not required to implement or have all the systems shown. More or fewer systems can be implemented or provided instead.

[0175] In particular, according to the embodiments disclosed in the present application, the process described above with reference to the flowchart can be implemented as a computer software program. For example, the embodiments disclosed in the present application include a computer program product, which includes a computer program carried on a computer-readable medium, and the computer program includes a program code for executing the method shown in the flowchart. In such an embodiment, the computer program can be downloaded and installed from a network through a communication device, or installed from a storage device 1003, or installed from a ROM 1002. When the computer program is executed by the processing device 1001, the above-mentioned functions defined in the method of the embodiment disclosed in the present application are executed.

[0176] The driving scene recognition device provided by the present application adopts the driving scene recognition method in the above embodiment, which can solve the technical problem of low efficiency in recognition of the driving scene of the vehicle. Compared with the prior art, the beneficial effects of the driving scene recognition device provided by the present application are the same as the beneficial effects of the driving scene recognition method provided by the above embodiment, and other technical features in the driving scene recognition device are the same as the features disclosed in the method of the previous embodiment, which will not be repeated here.

[0177] It should be understood that the various parts disclosed in this application can be implemented by hardware, software, firmware or a combination thereof. In the description of the above embodiments, specific features, structures, materials or characteristics can be combined in any one or more embodiments or examples in a suitable manner.

[0178] The above is only a specific implementation of the present application, but the protection scope of the present application is not limited thereto. Any person skilled in the art who is familiar with the present technical field can easily think of changes or substitutions within the technical scope disclosed in the present application, which should be included in the protection scope of the present application. Therefore, the protection scope of the present application should be based on the protection scope of the claims.

[0179] The present application provides a computer-readable storage medium having computer-readable program instructions (ie, computer programs) stored thereon, and the computer-readable program instructions are used to execute the driving scene recognition method in the above-mentioned embodiment.

[0180] The computer-readable storage medium provided in the present application may be, for example, a USB flash drive, but is not limited to electrical, magnetic, optical, electromagnetic, infrared, or semiconductor systems, systems or devices, or any combination of the above. More specific examples of computer-readable storage media may include, but are not limited to: an electrical connection with one or more wires, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the above. In this embodiment, the computer-readable storage medium may be any tangible medium containing or storing a program that can be used by or in combination with an instruction execution system, system or device. The program code contained on the computer-readable storage medium may be transmitted using any appropriate medium, including but not limited to: wires, optical cables, RF (Radio Frequency), etc., or any suitable combination of the above.

[0181] The computer-readable storage medium may be included in the driving scene recognition device; or may exist independently without being assembled into the driving scene recognition device.

[0182] The computer-readable storage medium carries one or more programs. When the one or more programs are executed by a driving scene recognition device, the driving scene recognition device: inputs the image to be recognized into a visual language model to obtain the similarity between the image to be recognized and each preset driving scene description sentence, wherein the visual language model is trained according to the mapping relationship between preset driving scene image samples and preset driving scene description sentence samples, and the preset driving scene description sentence is obtained by expanding the corresponding preset text label through the corresponding prompt information; inputs the similarity between the image to be recognized and each preset driving scene description sentence into a multi-label classification model to obtain a target text label corresponding to the image to be recognized; and determines the driving scene of the vehicle according to the target text label.

[0183] Computer program code for performing the operations of the present application may be written in one or more programming languages ​​or a combination thereof, including object-oriented programming languages ​​such as Java, Smalltalk, C++, and conventional procedural programming languages ​​such as "C" or similar programming languages. The program code may be executed entirely on the user's computer, partially on the user's computer, as a separate software package, partially on the user's computer and partially on a remote computer, or entirely on a remote computer or server. In the case of a remote computer, the remote computer may be connected to the user's computer through any type of network, including a local area network (LAN) or a wide area network (WAN), or may be connected to an external computer (e.g., via the Internet using an Internet service provider).

[0184] The flow chart and block diagram in the accompanying drawings illustrate the possible architecture, function and operation of the system, method and computer program product according to various embodiments of the present application. In this regard, each square box in the flow chart or block diagram can represent a module, a program segment or a part of a code, and the module, the program segment or a part of the code contains one or more executable instructions for realizing the specified logical function. It should also be noted that in some alternative implementations, the functions marked in the square box can also occur in a sequence different from that marked in the accompanying drawings. For example, two square boxes represented in succession can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each square box in the block diagram and / or flow chart, and the combination of the square boxes in the block diagram and / or flow chart can be implemented with a dedicated hardware-based system that performs a specified function or operation, or can be implemented with a combination of dedicated hardware and computer instructions.

[0185] The modules involved in the embodiments described in this application may be implemented by software or hardware, wherein the name of the module does not constitute a limitation on the unit itself in some cases.

[0186] The readable storage medium provided in the present application is a computer-readable storage medium, which stores computer-readable program instructions (i.e., computer programs) for executing the above-mentioned driving scene recognition method, and can solve the technical problem of low efficiency in recognition of vehicle driving scenes. Compared with the prior art, the beneficial effects of the computer-readable storage medium provided in the present application are the same as the beneficial effects of the driving scene recognition method provided in the above-mentioned embodiment, and will not be repeated here.

[0187] The present application also provides a computer program product, including a computer program, which implements the steps of the above-mentioned driving scene recognition method when executed by a processor.

[0188] The computer program product provided by the present application can solve the technical problem of low efficiency in identifying the driving scene of the vehicle. Compared with the prior art, the beneficial effects of the computer program product provided by the present application are the same as the beneficial effects of the method for identifying the driving scene provided by the above embodiment, which will not be described in detail here.

[0189] The above descriptions are only some embodiments of the present application, and are not intended to limit the patent scope of the present application. All equivalent structural changes made using the contents of the present application specification and drawings under the technical concept of the present application, or direct / indirect applications in other related technical fields are included in the patent protection scope of the present application.

Claims

1. A driving scene recognition method, It is characterized in that The method comprises: Inputting the image to be recognized into a visual language model to obtain the similarity between the image to be recognized and each preset driving scene description sentence, wherein the visual language model is trained according to the mapping relationship between preset driving scene image samples and preset driving scene description sentence samples, and the preset driving scene description sentence is obtained by expanding the corresponding preset text label through the corresponding prompt information; Inputting the similarity between the image to be identified and each preset driving scene description sentence into a multi-label classification model to obtain a target text label corresponding to the image to be identified; A driving scenario of the vehicle is determined according to the target text label.

2. The method according to claim 1, It is characterized in that The visual language model includes a text encoder and a visual encoder. The step of inputting the image to be recognized into the visual language model to obtain the similarity between the image to be recognized and each preset driving scene description sentence includes: Inputting the image to be recognized into the visual encoder to obtain an image feature vector corresponding to the image to be recognized; And, inputting each of the preset driving scene description sentences into the text encoder to obtain a text feature vector corresponding to each of the preset driving scene description sentences; Mapping the prompt information corresponding to each layer of the first K layers of the text encoder to the corresponding layer of the visual encoder through a coupling function, so that the image feature vector and each of the text feature vectors are semantically aligned in the same space, wherein the coupling function includes a first fully connected layer and an activation function; The similarity between the image to be identified and each preset driving scene description sentence is obtained according to the semantically aligned image feature vector and each text feature vector.

3. The method according to claim 2, It is characterized in that The step of obtaining the similarity between the image to be identified and each preset driving scene description sentence according to the semantically aligned image feature vector and each text feature vector comprises: Determine the cosine similarity between the semantically aligned image feature vector and each of the text feature vectors; The similarity between the image to be identified and each preset driving scene description sentence is obtained according to the cosine similarity.

4. The method according to claim 1, It is characterized in that The multi-label classification model includes a second fully connected layer, a third fully connected layer and a sigmoid activation function. The step of inputting the similarity between the image to be identified and each preset driving scene description sentence into the multi-label classification model to obtain the target text label corresponding to the image to be identified includes: According to the similarity between the image to be identified and each preset driving scene description sentence, the similarity between the image to be identified and each preset text label is obtained; The similarity between the image to be identified and each preset text label is sequentially passed through the second fully connected layer and the third fully connected layer of the multi-label classification model, and is calculated through the sigmoid activation function to obtain the confidence corresponding to each preset text label; According to the confidence level corresponding to each of the preset text labels, a target text label corresponding to the image to be recognized is obtained.

5. The method according to claim 4, It is characterized in that The step of obtaining the target text label corresponding to the image to be recognized according to the confidence corresponding to each of the preset text labels comprises: Sorting each of the preset text labels based on the corresponding confidence level, and selecting a preset number of preset text labels with the highest confidence level; The preset number of preset text tags are filtered according to a preset filtering method, and the preset text tags remaining after filtering are determined as the target text tags.

6. The method according to claim 4, It is characterized in that The method comprises: Determine the overall loss value according to the loss value between the confidence level corresponding to each preset text label and the standard confidence level; Determining, according to the overall loss value, a first correction value of the prompt information corresponding to the visual language model and a second correction value of the model parameter corresponding to the multi-label classification model, wherein the model parameter includes a weight and / or bias of each of the second fully connected layer and the third fully connected layer; The visual language model is updated using the first correction value, and the multi-label classification model is updated using the second correction value.

7. The method according to claim 6, It is characterized in that The step of determining the overall loss value according to the loss value between the confidence level corresponding to each preset text label and the standard confidence level comprises: The loss value between the confidence level and the standard confidence level corresponding to each preset text label is calculated through the cross entropy loss function; The loss values ​​are summed up and then averaged to obtain the overall loss value.

8. A driving scene recognition device, It is characterized in that The device comprises: a similarity determination module, configured to input an image to be identified into a visual language model to obtain a similarity between the image to be identified and each preset driving scene description sentence, wherein the visual language model is trained based on a mapping relationship between preset driving scene image samples and preset driving scene description sentence samples, and the preset driving scene description sentence is obtained by expanding a corresponding preset text label through corresponding prompt information; A multi-label classification module, used for inputting the similarity between the image to be identified and each preset driving scene description sentence into a multi-label classification model to obtain a target text label corresponding to the image to be identified; The driving scene determination module is used to determine the driving scene of the vehicle according to the target text label.

9. A driving scene recognition device, It is characterized in that The device comprises: a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the computer program is configured to implement the steps of the method for recognizing a driving scene according to any one of claims 1 to 7.

10. A storage medium, It is characterized in that The storage medium is a computer-readable storage medium, and a computer program is stored on the storage medium. When the computer program is executed by a processor, the steps of the driving scene recognition method according to any one of claims 1 to 7 are implemented.

11. A computer program product, It is characterized in that The computer program product comprises a computer program, and when the computer program is executed by a processor, the steps of the method for recognizing a driving scene according to any one of claims 1 to 7 are implemented.

Citation Information

Cited By

  • Image labeling method and device based on automatic driving scene, equipment and medium

    CN119339380A

  • Behavior recognition method based on computer vision

    CN120913278A

  • Driving environment identification method and vehicle-mounted terminal

    CN121671618A

  • Image caption generation method, apparatus, device, and medium

    WO2026166211A1