RT-Deet intelligent traffic target detection optimization method and system fused with Prompt prompt mechanism
Through the RT-Detr model integrating the Prompt prompt mechanism, the problem of category conflicts and insufficient feature extraction in smart traffic target detection is solved, more accurate target detection is achieved, detection accuracy and recall rate are improved, and real-time monitoring needs are met.
Patent Information
- Application Number
- CN202510889894.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-06-30
- Publication Date
- 2025-07-29
- Estimated Expiration
- 2045-06-30
AI Technical Summary
The existing smart traffic target detection model has insufficient category conflicts and feature extraction, resulting in low detection accuracy and recall, which cannot meet the needs of real-time intelligent traffic monitoring.
The RT-Detr model with the fusion Prompt prompt mechanism is adopted to accurately locate target feature through box prompts, and use the category decoding module and the decoupled classification head to achieve more accurate target detection.
It improves the target detection accuracy and recall rate of the smart traffic edge AI system, meeting the needs of real-time intelligent traffic monitoring.
Smart Images

Figure CN120388248A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of smart transportation technology, and in particular to an RT-Detr smart transportation target detection optimization method and system integrating a Prompt prompt mechanism. Background Art
[0002] Smart transportation V2X roadside MEC detection systems use target detection models. Typically, edge devices employ CNN-based YOLO models or Transformer-based DETR models, leveraging fine-grained data to detect urban objects. This requires real-time video surveillance. However, using a one-stage detection algorithm that relies on large amounts of data and a single target detection model makes it difficult to achieve both precision and recall in smart transportation. These issues primarily fall into two categories: First, the category conflict problem, manifested as a conflict between categories with extremely similar features, resulting in reduced model accuracy and even missed detections, such as sedans and SUVs; Second, existing detection models output predicted box coordinates (the coordinates of the target box) and class probabilities all at once, failing to consider a phased strategy of predicting coordinates first and then the class. This all-in-one approach leads to oversimplification without decoupled refinement, causing confusion between features of similarly classified objects and impacting the model's feature extraction capabilities. This results in insufficient feature extraction, and similar features with different classes lead to severe feature confusion and feature conflict, preventing the model from knowing how to extract more effective features. Specifically, this manifests in inaccurate predictions due to confusion between the predicted box and the class, and in feature conflict, leading to reduced accuracy and failure to predict the box at all, or missed detections.
[0003] To address these technical issues, existing methods use a combination of multiple models. For example, they build scenario-based models to improve intelligent traffic target detection performance. However, this approach fails to fundamentally address the issue of insufficient image feature extraction within the model, and instead increases resource consumption and processing time on edge devices. Existing methods inadequately extract target features, resulting in insufficient target feature information for the model classification head to accurately determine the target category. This degrades model performance, leading to inaccurate target classification and coordinates, and hinders effective and precise real-time intelligent traffic monitoring. Summary of the Invention
[0004] This invention overcomes the shortcomings of existing technologies and provides an optimized method and system for intelligent transportation target detection using the RT-Detr (Real-Time Detection Transformer) that incorporates a prompt mechanism. This method uses box prompts to accurately locate target features, uses a category decoding module to obtain more precise target features, and uses a decoupled classification head to achieve category prediction. This results in more accurate target detection results in intelligent transportation edge AI systems.
[0005] To achieve the above object, the technical solution adopted by the present invention is: an RT-Detr intelligent transportation target detection optimization method integrating a Prompt prompting mechanism, including: Obtain environmental data and preprocess the environmental data; the preprocessed environmental data is subjected to feature modulation through a feature modulation model to obtain environmental feature encoding, and the environmental feature encoding includes coordinate feature encoding and category feature encoding; the environmental feature encoding is based on a pre-trained target detection model for traffic detection prediction to obtain a prediction result; Among them, the target detection model includes a category feature decoding mechanism and a coordinate feature decoding mechanism; the coordinate feature decoding mechanism decodes the coordinate feature encoding in the environmental feature encoding to obtain coordinate feature decoding, and the coordinate feature decoding obtains a coordinate box through a box prediction head mechanism, and the coordinate box is encoded through a coordinate box encoding mechanism to obtain coordinate box encoding; the category feature decoding mechanism obtains the category feature encoding in the environmental feature encoding, and combines and predicts the obtained coordinate box encoding and category feature encoding through a category prediction head mechanism to obtain a category prediction head.
[0006] In a preferred embodiment of the present invention, the environmental data is preprocessed through a Backbone backbone network, and the data preprocessing includes one or more of data cleaning and formatting, size standardization, pixel value normalization, and data augmentation. Among them, data cleaning and formatting mainly removes noise images, repairs damaged data, and unifies the data format for the environmental data.
[0007] In a preferred embodiment of the present invention, the preprocessed environmental data is input into a feature modulation model through an object detection enhancement mechanism for feature modulation of environmental features to obtain environmental feature encoding.
[0008] Specifically, the feature modulation model includes a CCFM (Multi-level Feature Fusion Module; Cross / Contextual Feature Merge) feature modulation module.
[0009] In a preferred embodiment of the present invention, the target detection model includes a category feature decoding mechanism and a coordinate feature decoding mechanism; the coordinate feature decoding mechanism decodes the coordinate feature encoding in the environmental feature encoding to obtain coordinate feature decoding, and the coordinate feature decoding obtains a coordinate box through a box prediction head mechanism, and the coordinate box is encoded through a coordinate box encoding mechanism to obtain coordinate box encoding; The category feature decoding mechanism obtains the category feature encoding in the environmental feature encoding, and combines and predicts the obtained coordinate box encoding and category feature encoding through a category prediction head mechanism to obtain a category prediction head.
[0010] In a preferred embodiment of the present invention, the coordinate feature decoding mechanism includes: capturing the corresponding spatial information from the original coordinate points of the coordinate features in the environmental features and converting them into high-dimensional position encoding after normalization, random Gaussian matrix projection, and trigonometric function encoding operations.
[0011] In a preferred embodiment of the present invention, the coordinate feature decoding mechanism includes the following algorithm: The target coordinate is Box1, ; The target coordinate is normalized to Box2, ; The Gaussian matrix M, ; , where is the scale factor, and Box3 is the Gaussian expression of the high dimension of the box coordinates of Box2. The box coordinates are the bounding box coordinates, which is the image size input to the model; V b is the coordinate vector feature, , is the word embedding layer in the deep learning framework, serving as the embedding embed vector. The embed vector is the embedding vector, and the 2 in it represents the size of the input vocabulary, and C represents the dimension of each embedding vector.
[0012] In a preferred embodiment of the present invention, the category feature decoding mechanism includes: Performing a cat connection on V b and the learnable query vector Q b to obtain the result of the self-attention mechanism and residual connection for the new vector; Performing a cross-attention mechanism and residual connection on the result of the self-attention mechanism and residual connection for the new vector and the image features to obtain the connection result; Obtaining the coordinate vector feature V b by passing the connection result through the feed-forward neural network layer and decoding it in the image features.
[0013] In a preferred embodiment of the present invention, the self-attention mechanism understands the interaction of the coordinate vector feature V b ; The cross-attention mechanism decodes in the image features through the query vector and extracts relevant target information content using the coordinate positions; The feed-forward neural network structure performs non-linear feature extraction and strengthens the learning ability of the model by providing non-linear transformation and dimension transformation.
[0014] In a preferred embodiment of the present invention, for the vectors obtained from the coordinate points of the box coordinates, directly splice and use learnable vectors; The attention mechanism includes a transformer structure implemented by conventional linear convolutions Q, K, and V. The algorithm of the transformer structure includes: ; Among them, represents the feature expression dimension, Q is the query vector, K is the key vector, V is the value vector, Softmax is the activation function, which is used to convert a set of numerical values into the corresponding range of [0,1], indicating normalizing the scaled similarity; Attention represents the attention mechanism function, where Q, K, and V are parameters obtained through the linear layer; The FFN structure includes linear convolution and the ReLU activation function. The algorithm includes: ; W1 and W2 respectively represent the linear weights of nn.Linear, and b1 and b2 are the corresponding biases; x represents the input feature vector, that is, the features output after passing through the attention layer in the Transformer are subjected to non-linear transformation and representation enhancement. FFN (Feed-Forward Neural Network; feed-forward neural network).
[0015] In a preferred embodiment of the present invention, the class prediction head mechanism includes: a box prediction head and a class prediction head. The algorithm includes: ; Among them, is the activation function, and the activation function is the ReLU activation function.
[0016] In a preferred embodiment of the present invention, an intelligent transportation detection system improved based on the rtdetr of the target detection model with prompt prompts is used to implement an RT-Detr intelligent transportation target detection optimization method integrating the Prompt prompt mechanism; It includes: an acquisition module, a preprocessing module, a feature modulation module, and a target detection module; The acquisition module is used to acquire environmental data; The preprocessing module is used to perform neural network processing on the acquired environmental data to obtain preprocessed environmental data; The feature modulation module is used to perform feature modulation on the preprocessed environmental data through the feature modulation model to obtain environmental feature encodings, and the environmental feature encodings include coordinate feature encodings and class feature encodings; The object detection module includes a class feature decoding module and a coordinate feature decoding module; the coordinate feature decoding module decodes the coordinate feature encoding in the environmental feature encoding to obtain a coordinate feature decoding. The coordinate feature decoding obtains a coordinate box through a box prediction head module, and the coordinate box is encoded through a coordinate box encoding module to obtain a coordinate box encoding; The class feature decoding module obtains the class feature encoding in the environmental feature encoding, and combines and predicts the obtained coordinate box encoding and class feature encoding through a class prediction head module to realize traffic detection prediction and obtain a class prediction head; finally, a prediction result is obtained.
[0017] The present invention solves the defects existing in the technical background, and the beneficial technical effects of the present invention are: An RT-Detr intelligent transportation object detection optimization method and system integrating a Prompt prompting mechanism of the present invention accurately locates target features through box prompts, obtains more accurate target features using a class decoding module, and realizes class prediction using a decoupled classification head. Thus, more accurate object detection results are achieved in the intelligent transportation edge AI system.
[0018] 1. The object detection model based on Prompt prompting of the present invention adopts a coordinate prompting module BEM to convert the predicted box coordinates into a high-dimensional vector representation as a query vector with coordinates; 3. A class decoding module (ClassFeatureDecoderModule, CFDM) is constructed in the object detection model of the present invention. The class decoding module can perform feature decoding and extraction on image features using the box prompt vector, and fuse the coordinate accurate information and the learnable query vector to effectively extract the target class features; 4. The combined mode of coordinate prediction and class prediction adopted by the present invention effectively alleviates the feature conflict problem caused by simultaneous output; in cooperation with the coordinate and class decoupling module, the effectiveness of alleviating the feature conflict problem is further improved. BRIEF DESCRIPTION OF THE DRAWINGS
[0019] The present invention will be further described below with reference to the drawings and embodiments.
[0020] Figure 1 is a schematic diagram of the network framework of an RT-Detr intelligent transportation object detection optimization method integrating a Prompt prompting mechanism according to a preferred embodiment of the present invention Figure 1 ; Figure 2 is a schematic diagram of the network framework of an RT-Detr intelligent transportation object detection optimization method integrating a Prompt prompting mechanism according to a preferred embodiment of the present invention Figure 2 ; Figure 3It is a schematic diagram of the category decoding module of an RT-Detr intelligent transportation target detection optimization method that integrates the Prompt prompt mechanism in a preferred embodiment of the present invention; Figure 4 It is a schematic diagram of the attention mechanism structure of an RT-Detr intelligent transportation target detection optimization method that integrates the Prompt prompt mechanism in a preferred embodiment of the present invention; Figure 5 It is a schematic diagram of the Head structure of an RT-Detr intelligent transportation target detection optimization method that integrates the Prompt prompt mechanism in a preferred embodiment of the present invention; Figure 6 It is a target image of a real picture collected; Figure 7 It is a result image obtained by predicting the real target image using the original model; Figure 8 It is a result image obtained by predicting the real target image using the improved model of an RT-Detr intelligent transportation target detection optimization method that integrates the Prompt prompt mechanism in a preferred embodiment of the present invention. Detailed implementation manners
[0021] Now, the present invention will be further described in detail with reference to the accompanying drawings and embodiments. These drawings are all simplified schematic diagrams, only illustrating the basic structure of the present invention in a schematic manner, so they only show the components related to the present invention.
[0022] It should be noted that if there are directional indications (such as up, down, bottom, top, etc.) involved in the embodiments of the present invention, the directional indications are only used to explain the relative positional relationship and movement conditions between components in a specific posture. If the specific posture changes, the directional indications will also change accordingly. The terms "first" and "second" are only used for descriptive purposes and cannot be understood as indicating or implying relative importance or implicitly specifying the quantity of the indicated technical features. Thus, the features defined with "first" and "second" may explicitly or implicitly include one or more of such features. Unless otherwise clearly defined and limited, the terms "set", "connected", and "connected" should be understood in a broad sense. For example, it can be a fixed connection, a detachable connection, or an integral connection; it can be directly connected, or indirectly connected through an intermediate medium, and it can be the internal communication of two components. For those of ordinary skill in the art, the specific meanings of the above terms in the present invention can be understood according to specific situations.
[0023] Embodiment 1, an RT-Detr intelligent transportation target detection optimization method that integrates the Prompt prompt mechanism, includes: Obtain environmental data and preprocess the environmental data. Specifically, preprocessing the environmental data includes the following steps: The environmental data is preprocessed through the Backbone backbone network, and the preprocessed environmental data is input into the feature modulation model for environmental feature modulation after passing through the object detection enhancement mechanism. The feature modulation model includes a CCFM feature modulation module.
[0024] The preprocessed environmental data is feature-modulated through the feature modulation model to obtain environmental feature encodings, and the environmental feature encodings include coordinate feature encodings and class feature encodings.
[0025] The environmental feature encodings are used for traffic detection prediction based on a pre-trained object detection model to obtain prediction results.
[0026] Specifically, the object detection model includes a class feature decoding mechanism and a coordinate feature decoding mechanism; the coordinate feature decoding mechanism decodes the coordinate feature encodings in the environmental feature encodings to obtain coordinate feature decodings, the coordinate feature decodings obtain coordinate boxes through the box prediction head mechanism, and the coordinate boxes are encoded through the coordinate box encoding mechanism to obtain coordinate box encodings; the class feature decoding mechanism obtains the class feature encodings in the environmental feature encodings, and combines and predicts the obtained coordinate box encodings and class feature encodings through the class prediction head mechanism to obtain class prediction heads.
[0027] Among them, as Figure 1 shown is the architecture flowchart of the object detection model. The input is a traffic scene image (including vehicles and road elements), representing the visual data processed by the model; basic feature extraction is performed through the Backbone backbone structure; then feature enhancement and fusion (AIFI+CCFM) are carried out. Among them, the role of AIFI (Attention / Feature Interaction) is: receiving multi-scale features (S3-S5), strengthening key information (such as highlighting vehicles and traffic signs) through the attention mechanism / feature interaction, suppressing irrelevant backgrounds, and outputting enhanced features. Among them, the role of CCFM (Cross / Contextual Feature Fusion Module) is: The Fusion sub-module constructs a feature pyramid / hierarchical fusion structure: performs "sampling + fusion" on different scale features (AIFI output + original multi-scale features), and integrates detailed (S3) and semantic (S5) information. Finally, the fused image features are output, enabling the model to simultaneously master "fine-grained details" and "global semantics".
[0028] Among them, as Figure 2The figure shows a flowchart of a deep learning network architecture; the process includes: obtaining environmental data, and performing initial feature extraction on the input environmental data. The initial feature extraction includes: StemConv / h-swish, where StemConv is the starting convolutional layer for preliminarily extracting the basic features of the image; h-swish is the activation function, and ×1 represents the size ratio of the output feature map to the input image in this stage; DepthSepConv is the depthwise separable convolution, 3×3 and 5×5 are the convolution kernels respectively, 3×3 pays more attention to local features, and 5×5 pays attention to local features in a larger range; ×1, ×2, and ×5 are the numbers of repetitions respectively; AIFI (Attention / Feature Interaction Module) is the intermediate feature processing module, and the role of AIFI is to strengthen feature interaction and enable the model to focus on key information; CCFM (Cross / Contextual Feature Merge Module); the role of CCFM is to receive the features processed by AIFI and the features passed internally at different levels, and integrate features of different scales and different degrees of abstraction.
[0029] Embodiment 2. On the basis of Embodiment 1, an optimized method for RT-Detr intelligent transportation object detection integrating the Prompt prompt mechanism further includes: The coordinate feature decoding mechanism includes: After the original coordinate points of the coordinate features in the environmental features are subjected to normalization, random Gaussian matrix projection, and trigonometric function encoding operations, the corresponding spatial information is captured and converted into high-dimensional position encoding. The coordinate feature decoding mechanism includes the following algorithms: The target coordinate is Box1, ; the target coordinate is normalized to Box2, ; the Gaussian matrix M, ; , is the scale factor, Box3 is the Gaussian expression of the box coordinates in the high dimension of Box2, and the box coordinates are the bounding box coordinates, is the image size input to the model; V b is the coordinate vector feature, , is the word embedding layer in the deep learning framework, serving as the embedding embed vector, and the said embed vector is the embedding vector, and the 2 in it represents the size of the input vocabulary, and C represents the dimension of each embedding vector. nn.embedding represents vector embedding in NLP and is a parameter that can be updated.
[0030] Specifically, the target coordinates are represented in the form of [x1, y1, x2, y2] using point coordinates. The coordinates of Box1 are moved to the pixel center, divided by the corresponding image height and width dimensions, normalized, and the normalized range of [0, 1] is converted to the range of [-1, 1]. Further, we use the normal distribution, and the random Gaussian distribution generates the Gaussian matrix M. At the same time, we also multiply the previous Box2 by the Gaussian matrix M and use as the scale factor to achieve the Gaussian expression of the box coordinates in high dimensions, and further use the 2π coefficient to make it periodic. Finally, we use the sine and cosine functions for the coordinate expression Box3 to further achieve the periodic coordinate expression, and then add it to the embedded embed vector to finally obtain the box coordinate vector prompt. After obtaining the vector expression of the box, we call V b the coordinate vector feature.
[0031] The category feature decoding mechanism includes: Such as Figure 3 is the flowchart of the decoding module based on the Transformer structure model, that is, the category feature decoding module; the feature vector concatenation (Concat) is to concatenate the coordinate vector feature V b with the learnable query vector Q b for cat concatenation (connection); obtain the result of the self-attention mechanism and the residual connection for the new vector; the result of the self-attention mechanism and the residual connection for the new vector is subjected to the cross-attention mechanism and the residual connection with the image feature to obtain the connection result; the connection result passes through the feed-forward neural network layer (FFN) to obtain the coordinate vector feature V b for decoding in the image feature. Figure 3 Among them, B1 is the number of coordinate boxes, B is the batch, and L is the token; C is the dimension, (B1 2 C) represents the 2 coordinate points of a bounding box (the upper left corner coordinate point and the lower right corner coordinate point), which have been prompt-encoded and are respectively expressed in C dimensions. (B1 1 C) represents the C dimensions of 1 learnable embedding used for the corresponding coordinate box B1, which is actually a one-dimensional vector with C elements in one dimension. The feature vector concatenation (Concat) is to concatenate the coordinate vector feature V b with the learnable query vector Q bPerform cat concatenation to obtain a vector of dimension (B1 3 C), which serves as the input for the subsequent self-attention mechanism. The self-attention mechanism performs cross-attention mechanism (mining internal correlations) and residual connection (avoiding gradient vanishing and enhancing training stability). The cross-attention mechanism deeply interacts the text / prompt features (Q) with the image features (K, V) and outputs features (B1 3 C) that fuse the image semantics. The feed-forward neural network (FFN) performs a non-linear transformation (two-layer linear + activation) on the output of the cross-attention to further refine the features and outputs the refined features (B1 3 C). Figure 3 In the process, Nx indicates that the "self-attention mechanism + cross-attention mechanism + feed-forward neural network" can be repeatedly stacked to strengthen feature fusion multiple times. Further,[ Figure 3 The output is (B1 3 C). In one embodiment, only the previous (B1 1 C) is taken and deformed into (B1C). Here, B1 is the number of boxes, and finally the class probability corresponding to each box is given.
[0032] Specifically, the self-attention mechanism understands the coordinate vector feature V b for interaction; the cross-attention mechanism decodes in the image features through the query vector and extracts relevant target information content using the coordinate positions; the feed-forward neural network structure performs non-linear feature extraction and strengthens the learning ability of the model by providing non-linear transformation and dimensional transformation.
[0033] Further, in a preferred embodiment of the present invention, a learnable vector is introduced, and the vector obtained from the coordinate points of the box coordinates is directly concatenated with the learnable vector.
[0034] Further, as Figure 4 shown, the attention mechanism includes a transformer structure implemented by conventional linear convolutions Q, K, V. The transformer structure algorithm includes: ; wherein, represents the feature expression dimension; Q (Query) is the query vector, K (Key) is the key vector, and V (Value) is the value vector. Softmax is an activation function used to convert a set of numerical values into the corresponding range of [0, 1], indicating normalizing the scaled similarity; Attention represents the attention mechanism function, where Q, K, V are parameters obtained through a linear layer. As Figure 4The figure shows the flowchart of the attention mechanism; the original data received by the model mines internal associations through the query vector (Query), key vector (Key), and value vector (Value) obtained by linear transformation from the input in the attention mechanism, and performs similarity and weighted summation calculations.
[0035] Furthermore, the FFN structure includes linear convolution and the ReLU activation function, and the algorithm includes: ; W1 and W2 respectively represent the linear weights of nn.Linear, and b1 and b2 are the corresponding biases; linear convolution: ; activation function: . x represents the input feature vector, that is, the features output after passing through the attention layer in the Transformer are non-linearly transformed and the representation is enhanced.
[0036] The class prediction head mechanism includes: a box prediction head and a class prediction head. Specifically, the box prediction head uses the original box coordinate prediction head of RT-DETR. The class prediction head is implemented using the MLPs (Multi-layer Perceptron) structure. As Figure 5 shown, the structure of the class prediction head is obtained by looping a multi-layer perceptron MLP module multiple times, and an MLP structure with residual connections is added, specifically including two fully connected layers and an activation function; the algorithm includes: ; where is the activation function, the activation function is the ReLU activation function, and x is the input parameter variable.
[0037] Embodiment 3, a smart traffic detection system improved by a target detection model rtdetr based on prompt prompts, which is used to implement a RT-Detr smart traffic target detection optimization method integrating a Prompt prompt mechanism in Embodiment 1 or Embodiment 2; It includes: an interconnected acquisition module, a preprocessing module, a feature modulation module, and a target detection module; The acquisition module is used to acquire environmental data; The preprocessing module is used to perform neural network processing on the acquired environmental data to obtain preprocessed environmental data; The feature modulation module is used to perform feature modulation on the preprocessed environmental data through a feature modulation model to obtain environmental feature encodings, and the environmental feature encodings include coordinate feature encodings and class feature encodings; The object detection module includes a class feature decoding module and a coordinate feature decoding module; the coordinate feature decoding module decodes the coordinate feature encoding in the environmental feature encoding to obtain a coordinate feature decoding. The coordinate feature decoding obtains a coordinate box through a box prediction head module, and the coordinate box is encoded through a coordinate box encoding module to obtain a coordinate box encoding; The class feature decoding module obtains the class feature encoding in the environmental feature encoding, and combines and predicts the obtained coordinate box encoding and class feature encoding through a class prediction head module to implement traffic detection prediction to obtain a class prediction head; finally, a prediction result is obtained.
[0038] Working principle: An RT-Detr intelligent transportation object detection optimization method and system integrating a Prompt prompting mechanism according to the present invention.
[0039] By means of an object detection model with strong real-time performance, the present invention uses a coordinate prompting project to convert coordinates into query vectors for class prediction, and uses a class decoding module to perform feature decoding, effectively enhancing the expression of class-related features. The present invention adopts an object detection model with a box prompting project, makes full use of the box coordinate position information, and effectively extracts the class prediction feature expression; it not only meets the improvement of the performance of intelligent transportation object detection, but also meets the real-time performance requirements. The present invention solves the problem in the prior art that it is impossible to accurately focus on the image feature content, resulting in insufficient model performance, unable to provide accurate object detection information, and affecting the effective supervision of intelligent transportation.
[0040] Through Figure 6 、 Figure 7 、 Figure 8 As shown, based on the improved model, the present invention can make the model focus more on the target features, pay more attention to the focus of more useful information, and overall improve the class detection accuracy.
[0041] The above specific implementation manners are specific supports for the proposed solution idea of the present invention, and the protection scope of the present invention cannot be limited thereby. Any equivalent change or equivalent modification made on the basis of the present technical solution according to the technical idea proposed by the present invention still belongs to the protection scope of the technical solution of the present invention.
Claims
1. An optimized method for RT-Detr intelligent transportation object detection integrating the Prompt prompting mechanism, characterized in that, Including: Obtain environmental data and preprocess the environmental data; The preprocessed environmental data is subjected to feature modulation through a feature modulation model to obtain environmental feature encodings, and the environmental feature encodings include coordinate feature encodings and category feature encodings; The environmental feature encodings are used for traffic detection prediction based on a pre-trained object detection model to obtain a prediction result; Among them, the object detection model includes a category feature decoding mechanism and a coordinate feature decoding mechanism; The coordinate feature decoding mechanism decodes the coordinate feature encodings in the environmental feature encodings to obtain coordinate feature decodings. The coordinate feature decodings obtain coordinate boxes through a box prediction head mechanism, and the coordinate boxes are encoded through a coordinate box encoding mechanism to obtain coordinate box encodings; The category feature decoding mechanism obtains the category feature encodings in the environmental feature encodings, and combines and predicts the obtained coordinate box encodings and category feature encodings through a category prediction head mechanism to obtain a category prediction head.
2. An optimized method for RT-Detr intelligent transportation target detection integrating the Prompt prompt mechanism, characterized in that: Preprocessing the environmental data includes the following steps: The environmental data is preprocessed through a Backbone main network, and the data preprocessing includes one or more of data cleaning and formatting, size standardization, pixel value normalization, and data augmentation.
3. An optimized method for RT-Detr intelligent transportation target detection integrating the Prompt prompting mechanism according to claim 1, characterized in that: The preprocessed environmental data is input into a feature modulation model through an object detection enhancement mechanism for feature modulation of environmental features to obtain environmental feature encodings.
4. The optimized method for RT-Detr intelligent transportation target detection integrating the Prompt prompting mechanism according to claim 3, characterized in that: The coordinate feature decoding mechanism includes: capturing corresponding spatial information from the original coordinate points of the coordinate features in the environmental features and converting them to high-dimensional position encodings through normalization, random Gaussian matrix projection, and trigonometric function encoding operations.
5. The optimized method for RT-Detr intelligent transportation target detection integrating the Prompt prompting mechanism according to claim 4, characterized in that: The coordinate feature decoding mechanism includes the following algorithms: The target coordinates are Box1, ; Target coordinate normalization Box2, ; Gaussian matrix M, ; , is the scale factor. Box3 is the Gaussian representation of Box2 in the high dimension of the box coordinates, and the box coordinates are the bounding box coordinates. is the image size input to the model; V b is the coordinate vector feature, , is the word embedding layer in the deep learning framework, as the embedding embed vector, and the embed vector is the embedding vector, and its the 2 in it represents the size of the input vocabulary, and C represents the dimension of each embedding vector.
6. The optimized method for RT-Detr intelligent transportation target detection integrating the Prompt prompting mechanism according to claim 5, characterized in that: The category feature decoding mechanism includes: Concatenate V b with the learnable query vector Q b to obtain the result of self-attention mechanism and residual connection for the new vector; The result of the self-attention mechanism and residual connection of the new vector is subjected to a cross-attention mechanism and residual connection with the image features to obtain a connection result; The connection result obtains the coordinate vector feature V through the feedforward neural network layer b Decode on the image features 7. The optimized method for RT-Detr intelligent transportation target detection integrating the Prompt prompting mechanism according to claim 6, characterized in that: Self-attention mechanism understands the coordinate vector feature V b Perform interaction; The cross-attention mechanism decodes through a query vector in the image features and extracts relevant target information content using coordinate positions; A feed-forward neural network structure performs non-linear feature extraction to enhance the learning ability of the model through non-linear transformation and dimensional transformation.
8. An optimized method for RT-Detr intelligent transportation object detection integrating the Prompt prompting mechanism, characterized in that: For the vectors obtained from the coordinate points of the box coordinates, directly splice and use learnable vectors; The attention mechanism includes a transformer structure implemented by linear convolutional Q, K, and V. The transformer structure algorithm includes: ; Among them, represents the feature expression dimension, Q is the query vector, K is the key vector, V is the value vector, Softmax is the activation function used to convert a set of numerical values into the corresponding range of [0, 1], indicating the normalization of the scaled similarity; Attention represents the attention mechanism function, where Q, K, and V are parameters obtained through the linear layer; The FFN structure includes linear convolution and a ReLU activation function. The algorithm includes: ; W1 and W2 respectively represent the linear weights of nn.Linear, and b1 and b2 are the corresponding biases; x represents the input feature vector, that is, the features output after the attention layer in the Transformer are subjected to non-linear transformation and representation enhancement.
9. The optimized method for RT-Detr intelligent transportation target detection integrating the Prompt prompting mechanism according to claim 8, characterized in that: The category prediction head mechanism includes: a box prediction head and a category prediction head. The algorithm includes: ; Among them, is an activation function, and the activation function is the RELU activation function.
10. A smart traffic detection system improved based on the rtdetr target detection model with prompt prompts, characterized in that, Used to implement a method for optimizing RT-Detr intelligent transportation object detection that fuses a Prompt hint mechanism according to any one of claims 1-9; Including: an acquisition module, a preprocessing module, a feature modulation module, and an object detection module; The acquisition module is used to acquire environmental data; The preprocessing module is used to perform neural network processing on the acquired environmental data to obtain preprocessed environmental data; The feature modulation module is used to perform feature modulation on the preprocessed environmental data through a feature modulation model to obtain environmental feature encodings, and the environmental feature encodings include coordinate feature encodings and category feature encodings; The object detection module includes a class feature decoding module and a coordinate feature decoding module; the coordinate feature decoding module decodes the coordinate feature encoding in the environmental feature encoding to obtain a coordinate feature decoding, the coordinate feature decoding obtains a coordinate box through a box prediction head module, and the coordinate box is encoded through a coordinate box encoding module to obtain a coordinate box encoding; The class feature decoding module obtains the class feature encoding in the environmental feature encoding, and combines and predicts the obtained coordinate box encoding and class feature encoding through a class prediction head module to implement traffic detection prediction to obtain a class prediction head, and finally obtains a prediction result.
Citation Information
Patent Citations
Remote sensing image target detection method based on fusion convolution attention mechanism
CN116229295A
Traffic element detection method, device, equipment, medium and product
CN117726996A
Fog-containing image target detection method based on multi-scale feature extraction
CN118674911A
Transform-based unsupervised cell segmentation method
CN120047460A
Object detection using a trained neural network
EP4553788A1
Cited By
Semi-autonomous remote sensing water area generalization segmentation method fused with multispectral inversion
CN120808175A
A semi-autonomous remote sensing water area generalization segmentation method fusing multi-spectral inversion
CN120808175B