RT-Detr intelligent traffic target detection optimization method and system integrating 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 results are 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
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-06-30
- Publication Date
- 2025-08-29
- Estimated Expiration
- 2045-06-30
AI Technical Summary
The existing smart traffic target detection model has problems with insufficient category conflicts and feature extraction, resulting in low detection accuracy and recall, and it is impossible to achieve real-time and efficient target detection.
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 in the smart traffic edge AI system to meet the needs of real-time intelligent traffic monitoring.
Smart Images

Figure CN120388248B_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:
[0003] 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;
[0004] 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.
[0005] 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
[0006] 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.
[0007] To achieve the above objectives, the technical solution adopted by the present invention is: an RT-Detr intelligent traffic target detection optimization method integrating the Prompt prompt mechanism, comprising:
[0008] Acquiring environmental data and preprocessing the environmental data; performing feature modulation on the preprocessed environmental data through a feature modulation model to obtain environmental feature coding, wherein the environmental feature coding includes coordinate feature coding and category feature coding; performing traffic detection prediction based on the environmental feature coding and obtaining a prediction result based on a pre-trained target detection model;
[0009] 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 code in the environment feature code to obtain the coordinate feature decoding, and the coordinate feature decoding obtains the coordinate frame through the box prediction head mechanism, and the coordinate frame is coordinate frame encoded by the coordinate frame encoding mechanism to obtain the coordinate frame code; the category feature decoding mechanism obtains the category feature code in the environment feature code, and combines the obtained coordinate frame code and category feature code through the category prediction head mechanism for prediction to obtain the category prediction head.
[0010] In a preferred embodiment of the present invention, environmental data undergoes data preprocessing via a Backbone network. This preprocessing includes one or more of data cleaning and formatting, size standardization, pixel value normalization, and data enhancement. Data cleaning and formatting primarily involves routine image noise removal, data repair, and data format unification.
[0011] In a preferred embodiment of the present invention, the pre-processed environmental data is input into a feature modulation model after passing through an object detectability enhancement mechanism to perform feature modulation of environmental features to obtain environmental feature coding.
[0012] Specifically, the feature modulation model includes a CCFM (Multi-level Feature Fusion Module; Cross / Contextual Feature Merge) feature modulation module.
[0013] 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 code in the environment feature code to obtain a coordinate feature decoding, the coordinate feature decoding obtains a coordinate frame through a box prediction head mechanism, and the coordinate frame is coordinate frame encoded by the coordinate frame encoding mechanism to obtain a coordinate frame code;
[0014] The category feature decoding mechanism obtains the category feature code in the environment feature code, and combines the obtained coordinate frame code and the category feature code through a category prediction head mechanism to obtain a category prediction head.
[0015] 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 through normalization, random Gaussian matrix projection, and trigonometric function encoding operations, and converting them into high-dimensional position coding.
[0016] In a preferred embodiment of the present invention, the coordinate feature decoding mechanism includes the following algorithm:
[0017] The target coordinate is Box1, ;
[0018] Target coordinates normalized Box2, ;
[0019] Gaussian matrix M, ;
[0020] , is the scale factor, Box3 is the Gaussian expression of the high-latitude box coordinates of Box2, and the box coordinates are the bounding box coordinates. is the image size of the input model;
[0021] V b is the coordinate vector feature, , It is the word embedding layer in the deep learning framework, which is used as the embedding vector. The 2 in represents the vocabulary size of the input, and C represents the dimension of each embedding vector.
[0022] In a preferred embodiment of the present invention, the category feature decoding mechanism includes:
[0023] V b With the learnable query vector Q b Perform cat connection to obtain the result of self-attention mechanism and residual connection of the new vector;
[0024] The new vector performs self-attention mechanism and residual connection with the image features to obtain the connection result;
[0025] The connection result is passed through the feedforward neural network layer to obtain the coordinate vector feature V b Decoding the image features.
[0026] In a preferred embodiment of the present invention, the self-attention mechanism understands the coordinate vector feature V b interact;
[0027] The cross-attention mechanism decodes the image features through the query vector and extracts the relevant target information content using the coordinate position;
[0028] The feedforward neural network structure performs nonlinear feature extraction and enhances the learning ability of the model by providing nonlinear transformation and dimensionality transformation.
[0029] In a preferred embodiment of the present invention, the vectors obtained from the coordinate points of the box coordinates are directly concatenated using learnable vectors;
[0030] The attention mechanism includes the transformer structure implemented by conventional linear convolution Q, K, V. The transformer structure algorithm includes:
[0031] ;
[0032] in, 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 [0,1] range, 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;
[0033] The FFN structure includes linear convolution and ReLU activation functions, and the algorithms include:
[0034] W1 and W2 represent nn.Linear linear weights, b1 and b2 are the corresponding biases, and x represents the input feature vector, which is the nonlinear transformation and representation enhancement of the output features after the attention layer in the Transformer. FFN (Feed-Forward Neural Network).
[0035] In a preferred embodiment of the present invention, the category prediction head mechanism includes: a box prediction head and a category prediction head, and the algorithm includes: ;
[0036] in, is the activation function, and the activation function is the RELU activation function.
[0037] In a preferred embodiment of the present invention, an improved intelligent traffic detection system based on the prompt prompt target detection model rtdetr is used to implement an RT-Detr intelligent traffic target detection optimization method integrating the prompt prompt mechanism;
[0038] Includes: acquisition module, preprocessing module, feature modulation module, target detection module;
[0039] The acquisition module is used to obtain environmental data;
[0040] The preprocessing module is used to perform neural network processing on the acquired environmental data to obtain preprocessed environmental data;
[0041] The feature modulation module is used to perform feature modulation on the pre-processed environmental data through a feature modulation model to obtain environmental feature coding, wherein the environmental feature coding includes coordinate feature coding and category feature coding;
[0042] The target detection module includes a category feature decoding module and a coordinate feature decoding module; the coordinate feature decoding module decodes the coordinate feature code in the environment feature code to obtain a coordinate feature decoding, the coordinate feature decoding obtains a coordinate frame through the box prediction head module, and the coordinate frame is encoded by the coordinate frame encoding module to obtain a coordinate frame code;
[0043] The category feature decoding module obtains the category feature code in the environmental feature code, and combines the obtained coordinate frame code and the category feature code through the category prediction head module to perform combined prediction, thereby realizing traffic detection prediction and obtaining the category prediction head; and finally obtaining the prediction result.
[0044] The present invention solves the defects existing in the technical background, and the beneficial technical effects of the present invention are:
[0045] This paper presents an RT-Detr intelligent transportation target detection optimization method and system that integrates a prompt mechanism. This method uses box prompts to accurately locate target features, uses a category decoding module to obtain more accurate 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.
[0046] 1. The Prompt-based object detection model of the present invention uses a coordinate prompt module (BEM) to convert the predicted box coordinates into a high-dimensional vector expression as a query vector with coordinates;
[0047] 3. The target detection model of the present invention constructs a class decoding module (Class Feature Decoder Module, CFDM), which can use the box prompt vector to decode and extract image features, and fuse the precise coordinate information and the learnable query vector to effectively extract the target category features;
[0048] 4. The combined mode of coordinate prediction and category prediction adopted by the present invention effectively alleviates the feature conflict problem caused by simultaneous output; combined with the coordinate and category decoupling module, it further improves the effectiveness of alleviating the feature conflict problem. BRIEF DESCRIPTION OF THE DRAWINGS
[0049] The present invention will be further described below with reference to the accompanying drawings and examples.
[0050] Figure 1 This is a network framework diagram of the RT-Detr intelligent traffic target detection optimization method integrating the Prompt prompt mechanism in the preferred embodiment of the present invention. Figure 1 ;
[0051] Figure 2 This is a network framework diagram of the RT-Detr intelligent traffic target detection optimization method integrating the Prompt prompt mechanism in the preferred embodiment of the present invention. Figure 2 ;
[0052] Figure 3 This is a schematic diagram of a category decoding module of an RT-Detr intelligent traffic target detection optimization method integrating a Prompt prompt mechanism according to a preferred embodiment of the present invention;
[0053] Figure 4 This is a schematic diagram of the attention mechanism structure of the RT-Detr intelligent traffic target detection optimization method that integrates the Prompt prompt mechanism in a preferred embodiment of the present invention;
[0054] Figure 5 It is a schematic diagram of the Head structure of an RT-Detr intelligent traffic target detection optimization method integrating a Prompt prompt mechanism according to a preferred embodiment of the present invention;
[0055] Figure 6 is the collected real-life target image;
[0056] Figure 7 It is the result image of predicting the real target image using the original model;
[0057] Figure 8 It is a result image of a real target image predicted by an improved model of the RT-Detr intelligent traffic target detection optimization method integrating the Prompt prompt mechanism in a preferred embodiment of the present invention. DETAILED DESCRIPTION
[0058] The present invention will now be described in further detail with reference to the accompanying drawings and embodiments. These drawings are simplified schematic diagrams that only illustrate the basic structure of the present invention in a schematic manner, and therefore only show the components related to the present invention.
[0059] It should be noted that if the embodiments of the present invention involve directional indications (such as up, down, bottom, top, etc.), the directional indications are only used to explain the relative positional relationship, movement status, etc. between the components in a certain specific posture. If the specific posture changes, the directional indication 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 indicating the number of technical features indicated. Therefore, the features defined as "first" and "second" may explicitly or implicitly include one or more of the features. Unless otherwise clearly specified and defined, 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, or it can be a communication between the internal parts of two components. For ordinary technicians in this field, the specific meanings of the above terms in the present invention can be understood according to specific circumstances.
[0060] Example 1, an RT-Detr intelligent traffic target detection optimization method integrating a Prompt prompt mechanism, comprising:
[0061] Acquire and preprocess environmental data. Specifically, preprocessing the environmental data includes the following steps: preprocessing the environmental data through a backbone network, applying the preprocessed environmental data to an object detectability enhancement mechanism, and then inputting the preprocessed environmental data into a feature modulation model for environmental feature modulation. The feature modulation model includes a CCFM feature modulation module.
[0062] The pre-processed environmental data is feature-modulated by a feature modulation model to obtain environmental feature coding, which includes coordinate feature coding and category feature coding.
[0063] Environmental feature encoding is used to perform traffic detection prediction based on a pre-trained target detection model to obtain prediction results.
[0064] Specifically, 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 code in the environment feature code to obtain the coordinate feature decoding, and the coordinate feature decoding obtains the coordinate frame through the box prediction head mechanism, and the coordinate frame is coordinate frame encoded by the coordinate frame encoding mechanism to obtain the coordinate frame code; the category feature decoding mechanism obtains the category feature code in the environment feature code, and combines the obtained coordinate frame code and category feature code through the category prediction head mechanism for prediction to obtain the category prediction head.
[0065] Among them, such as Figure 1 The following is a flowchart of the object detection model architecture. The input is a traffic scene image (including vehicles and road elements), representing the visual data processed by the model. Basic features are extracted through the Backbone architecture, followed by feature enhancement and fusion (AIFI + CCFM). The AIFI (Attention / Feature Interaction) receives multi-scale features (S3-S5) and, through the attention mechanism / feature interaction, enhances key information (such as highlighting vehicles and traffic signs), suppresses irrelevant background, and outputs enhanced features. The CCFM (Cross / Contextual Feature Fusion Module) serves as a fusion submodule, constructing a feature pyramid / hierarchical fusion structure. It performs "sampling and fusion" of features at different scales (AIFI output + original multi-scale features), integrating detail (S3) and semantic information (S5). The fused image features are ultimately output, allowing the model to capture both fine-grained details and global semantics.
[0066] Among them, such as Figure 2The figure shows a flowchart of the deep learning network architecture; the process includes: obtaining environmental data, performing initial feature extraction on the input environmental data, and the initial feature extraction includes: StemConv / h-swish, where StemConv is the starting convolution layer, which preliminarily extracts basic image features; h-swish is the activation function, and ×1 represents the size ratio of the output feature map and the input image at this stage; DepthSepConv is a depth-separable convolution, 3×3 and 5×5 are the convolution kernels, 3×3 focuses more on local features, and 5x5 focuses on local features in a larger range; ×1, ×2, and ×5 are different numbers of repetitions respectively; AIFI (Attention / Feature Interaction Module; Attention / Feature Interaction) is an intermediate feature processing module, and the role of AIFI is to strengthen feature interaction and let the model focus on key information; CCFM (Multi-level Feature Fusion Module; Cross / ContextualFeatureMerge); the role of CCFM is to receive the features processed by AIFI and the features transmitted by the internal layers, and integrate features of different scales and different levels of abstraction.
[0067] Example 2, based on Example 1, an RT-Detr intelligent traffic target detection optimization method integrating a Prompt prompt mechanism, further comprising:
[0068] The coordinate feature decoding mechanism includes:
[0069] The original coordinate points of the coordinate features in the environmental features are normalized, projected by random Gaussian matrices, and encoded using trigonometric functions to capture the corresponding spatial information and convert it into a high-dimensional position encoding. The coordinate feature decoding mechanism includes the following algorithms:
[0070] The target coordinate is Box1, ; Target coordinates normalized Box2, ; Gaussian matrix M, ; , is the scale factor, Box3 is the Gaussian expression of the high-latitude box coordinates of Box2, and the box coordinates are the bounding box coordinates. is the image size of the input model;
[0071] V b is the coordinate vector feature, , It is the word embedding layer in the deep learning framework, which is used as the embedding vector. The 2 in represents the input vocabulary size, and C represents the dimension of each embedding vector. nn.embedding in nlp represents vector embedding, a parameter that can be updated.
[0072] Specifically, the target coordinates [x1, y1, x2, y2] are expressed as point coordinates. The Box1 coordinates are moved to the pixel center and divided by the corresponding image height and width dimensions, normalized, and the normalized [0, 1] range is converted to the [-1, 1] range. Further, we use the normal distribution and random Gaussian distribution to generate the Gaussian matrix M. At the same time, we also multiply the previous Box2 with the Gaussian matrix M and use As a scaling factor, we can achieve a Gaussian expression of the high-dimensional box coordinates, and further use the 2π coefficient to make it periodic. Finally, we use the sine and cosine functions on the coordinate expression Box3 to further achieve a periodic coordinate expression, and then add it to the embedding vector to finally obtain the box coordinate vector prompt. After obtaining the vector expression of the box, we can use V b It is called the coordinate vector feature.
[0073] The category feature decoding mechanism includes:
[0074] like Figure 3 This is a flowchart of the decoding module based on the Transformer structure model, that is, the category feature decoding module; feature vector concatenation (Concat) is to concatenate the coordinate vector feature V b With the learnable query vector Q b Perform cat splicing (connection); obtain the result of self-attention mechanism and residual connection of the new vector; the result of self-attention mechanism and residual connection of the new vector is cross-attention mechanism and residual connection with the image feature to obtain the connection result; the connection result is passed through the feedforward neural network layer (FFN) to obtain the coordinate vector feature V b Decoding the image features. Figure 3 In [1], B1 is the number of coordinate boxes, B is the batch size, L is the token, and C is the dimension. (B1 2 C) represents the two coordinate points of a bounding box (the upper left corner and the lower right corner), which are prompted and expressed in C dimensions. (B1 1 C) means that the corresponding coordinate box B1 is expressed using a learnable embedding of C dimensions, which is actually a one-dimensional vector with C elements. Feature vector concatenation (Concat) is to combine the coordinate vector feature V b With the learnable query vector Q bCat concatenation is performed to obtain a vector of dimension (B1 3 C), which serves as the input for the subsequent self-attention mechanism. The self-attention mechanism uses a cross-attention mechanism (to exploit internal correlations) and residual connections (to prevent vanishing gradients and enhance training stability). The cross-attention mechanism deeply interacts the text / hint features (Q) with the image features (K, V), outputting features (B1 3 C) that integrate image semantics. A feed-forward neural network (FFN) performs a nonlinear transformation (two linear layers + activation) on the output of the cross-attention mechanism to further refine the features and output the refined features (B1 3 C). Figure 3 The Nx in the middle process indicates that the "self-attention mechanism + cross-attention mechanism + feedforward neural network" can be repeatedly stacked to strengthen feature fusion multiple times. Figure 3 The output is (B1 3 C). In one embodiment, only the first one (B1 1 C) is taken and deformed into (B1C), where B1 is the number of boxes, and the probability of the category corresponding to each box is finally given.
[0075] Specifically, the self-attention mechanism understands the coordinate vector feature V b The cross-attention mechanism decodes the image features through the query vector and extracts the relevant target information content using the coordinate position; the feedforward neural network structure performs nonlinear feature extraction and enhances the learning ability of the model by providing nonlinear transformation and dimensionality transformation.
[0076] Furthermore, in a preferred embodiment of the present invention, a learnable vector is introduced, and the vectors obtained from the coordinate points of the box coordinates are directly spliced and used.
[0077] Furthermore, if Figure 4 As shown, the attention mechanism includes the transformer structure implemented by conventional linear convolution Q, K, V. The transformer structure algorithm includes: ;
[0078] in, Indicates 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 a range corresponding to [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. Figure 4The figure shows a flowchart of the attention mechanism. The original data received by the model is mined for internal associations through the query vector (Query), key vector (Key), and value vector (Value) obtained by linear transformation of the input in the attention mechanism, and similarity and weighted sum calculations are performed.
[0079] Furthermore, the FFN structure includes linear convolution and ReLU activation functions, and the algorithm includes:
[0080] ; W1 and W2 represent nn.Linear linear weights, b1 and b2 are the corresponding biases; linear convolution: Activation function: x represents the input feature vector, that is, the features output by the Transformer after the attention layer undergo nonlinear transformation and representation enhancement.
[0081] The category prediction head mechanism includes: box prediction head and category prediction head. Specifically, the box prediction head uses the RT-DETR original box coordinate prediction head. The category prediction head is implemented using the MLPs (Multi-layer Perceptron) structure, such as Figure 5 As shown in the figure, the structure of the category prediction head is obtained by multiple cycles of a multi-layer perceptron MLP module, and an MLP structure with residual connections is added, specifically including two fully connected layers and an activation function; the algorithm includes:
[0082] ;in, is the activation function, the activation function is the RELU activation function, and x is the input parameter variable.
[0083] Example 3: An improved intelligent traffic detection system based on the prompt-based target detection model rtdetr, which is used to implement an RT-Detr intelligent traffic target detection optimization method integrating the prompt mechanism of Example 1 or Example 2;
[0084] Includes: interconnected acquisition module, preprocessing module, feature modulation module, and target detection module;
[0085] The acquisition module is used to obtain environmental data;
[0086] The preprocessing module is used to perform neural network processing on the acquired environmental data to obtain preprocessed environmental data;
[0087] The feature modulation module is used to perform feature modulation on the pre-processed environmental data through a feature modulation model to obtain environmental feature coding, wherein the environmental feature coding includes coordinate feature coding and category feature coding;
[0088] The target detection module includes a category feature decoding module and a coordinate feature decoding module; the coordinate feature decoding module decodes the coordinate feature code in the environment feature code to obtain a coordinate feature decoding, the coordinate feature decoding obtains a coordinate frame through the box prediction head module, and the coordinate frame is encoded by the coordinate frame encoding module to obtain a coordinate frame code;
[0089] The category feature decoding module obtains the category feature code in the environmental feature code, and combines the obtained coordinate frame code and the category feature code through the category prediction head module to perform combined prediction, thereby realizing traffic detection prediction and obtaining the category prediction head; and finally obtaining the prediction result.
[0090] Working principle:
[0091] The present invention provides an RT-Detr intelligent traffic target detection optimization method and system integrating a Prompt prompt mechanism.
[0092] The present invention uses a target detection model with strong real-time performance, uses a coordinate prompting project, converts coordinates into a query vector query for category prediction, and uses a category decoding module to perform feature decoding, effectively enhancing the expression of category-related features. The present invention adopts a target detection model with a box prompting project, fully utilizing the box coordinate position information to effectively extract the category prediction feature expression; it not only meets the performance improvement of smart transportation target 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 image feature content, resulting in insufficient model performance, an inability to provide accurate target detection information, and an impact on the effective supervision of smart transportation.
[0093] pass Figure 6 、 Figure 7 、 Figure 8 As shown, the present invention is based on the improved model and can see that the model focuses more on target features, pays more attention to focusing on more useful information, and also improves the category detection accuracy as a whole.
[0094] The above specific implementation methods are specific support for the scheme ideas proposed in the present invention, and cannot be used to limit the scope of protection of the present invention. Any equivalent changes or equivalent modifications made on the basis of this technical scheme in accordance with the technical ideas proposed in the present invention still fall within the scope of protection of the technical scheme of the present invention.
Claims
1. An RT-Detr intelligent traffic target detection optimization method integrating the Prompt prompt mechanism, characterized in that: include: Acquire environmental data and preprocess the environmental data; The pre-processed environmental data is feature modulated by a feature modulation model to obtain an environmental feature code, wherein the environmental feature code includes a coordinate feature code and a category feature code; The environmental feature encoding performs traffic detection prediction based on a pre-trained target detection model 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 code in the environment feature code to obtain the coordinate feature decoding, the coordinate feature decoding obtains the coordinate box through the box prediction head mechanism, and the coordinate box is encoded by the coordinate box encoding mechanism to obtain the coordinate box code; The category feature decoding mechanism obtains the category feature code in the environment feature code, and combines the obtained coordinate frame code and the category feature code through the category prediction head mechanism to obtain a category prediction head; The coordinate feature decoding mechanism includes the following algorithms: The target coordinate is Box1, ; Target coordinates normalized Box2, ; Gaussian matrix M, ; , is the scale factor, Box3 is the Gaussian expression of the high-latitude box coordinates of Box2, and the box coordinates are the bounding box coordinates. is the image size of the input model; V b is the coordinate vector feature, , It is the word embedding layer in the deep learning framework, which is used as the embedding embed vector. The 2 in represents the input vocabulary size, and C represents the dimension of each embedding vector; The category feature decoding mechanism includes: V b With the learnable query vector Q b Perform cat connection to obtain the result of self-attention mechanism and residual connection of the new vector; The new vector performs self-attention mechanism and residual connection with the image features to obtain the connection result; The connection result is passed through the feedforward neural network layer to obtain the coordinate vector feature V b Decoding the image features.
2. The RT-Detr intelligent traffic target detection optimization method integrating the Prompt prompt mechanism according to claim 1 is characterized by: Preprocessing of environmental data includes the following steps: The environmental data is preprocessed through the Backbone network, and the data preprocessing includes one or more of data cleaning and formatting, size standardization, pixel value normalization, and data enhancement.
3. The RT-Detr intelligent traffic target detection optimization method integrating the Prompt prompt mechanism according to claim 1 is characterized by: The preprocessed environmental data is input into the feature modulation model after passing through the object detectability enhancement mechanism to perform feature modulation of the environmental features and obtain the environmental feature coding.
4. The RT-Detr intelligent traffic target detection optimization method integrating the Prompt mechanism as claimed in claim 3 is characterized by: The coordinate feature decoding mechanism includes: capturing the corresponding spatial information from the original coordinate points of the coordinate features in the environmental features through normalization, random Gaussian matrix projection, and trigonometric function encoding operations, and converting them into high-dimensional position coding.
5. The RT-Detr intelligent traffic target detection optimization method integrating the Prompt prompt mechanism as claimed in claim 4 is characterized by: Self-attention mechanism understands the coordinate vector feature V b interact; The cross-attention mechanism decodes the image features through the query vector and extracts the relevant target information content using the coordinate position; The feedforward neural network structure performs nonlinear feature extraction and enhances the learning ability of the model through nonlinear transformation and dimensionality transformation.
6. The RT-Detr intelligent traffic target detection optimization method integrating the Prompt mechanism as claimed in claim 5 is characterized by: The vectors obtained from the coordinate points of the box coordinates are directly concatenated using learnable vectors; The attention mechanism includes a transformer structure implemented by linear convolution Q, K, and V. The transformer structure algorithm includes: ; in, represents the feature expression dimension, Q is the query vector, K is the key vector, and V is the value vector. Softmax is an activation function used to convert a set of numerical values into the corresponding range [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 ReLU activation functions, and the algorithms include: ; W1 and W2 represent nn.Linear linear weights, 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 nonlinearly transformed and enhanced.
7. The RT-Detr intelligent traffic target detection optimization method integrating the Prompt mechanism as claimed in claim 6 is characterized by: The category prediction head mechanism includes: box prediction head and category prediction head, and the algorithm includes: ; in, is the activation function, and the activation function is the RELU activation function.
8. An improved intelligent traffic detection system based on the prompt target detection model rtdetr, characterized in that: A method for optimizing RT-Detr intelligent traffic target detection integrating a Prompt prompt mechanism for realizing any one of claims 1 to 7; Includes: acquisition module, preprocessing module, feature modulation module, target detection module; The acquisition module is used to obtain 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 pre-processed environmental data through a feature modulation model to obtain environmental feature coding, wherein the environmental feature coding includes coordinate feature coding and category feature coding; The target detection module includes a category feature decoding module and a coordinate feature decoding module; the coordinate feature decoding module decodes the coordinate feature code in the environment feature code to obtain a coordinate feature decoding, the coordinate feature decoding obtains a coordinate frame through the box prediction head module, and the coordinate frame is encoded by the coordinate frame encoding module to obtain a coordinate frame code; The category feature decoding module obtains the category feature code in the environmental feature code, and combines the obtained coordinate frame code and the category feature code through the category prediction head module to perform combined prediction, realize traffic detection prediction to obtain the category prediction head, and finally obtain the 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
Cited By
Method for improving accuracy of intelligent traffic target detection based on YOLO-World
CN121415354A