Article real-time detection method, device and equipment and storage medium
By performing feature extraction and multi-scale feature fusion on X-ray video streams, combined with the encoding and decoding network of attention mechanism, the problem of difficult detection of contrabands and high error detection rates in existing X-ray contraband detection technology is solved, and efficient and accurate automated detection is achieved.
Patent Information
- Application Number
- CN202411721841.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-11-28
- Publication Date
- 2025-03-07
- Estimated Expiration
- 2044-11-28
AI Technical Summary
The existing X-ray contraband detection technology has problems such as imbalance, monotonous image color, and lack of texture information, which makes it difficult to detect contraband, and the robustness of manual feature recognition is insufficient, the error detection rate is high, and the efficiency is low.
The feature extraction method of real-time X-ray video stream is adopted, and multi-scale feature fusion is carried out through the optimized fast spatial pyramid pooling network, combined with the encoding and decoding network of the attention mechanism, the feature values are encoded and decoded, and input to the feedforward neural network after training for contraband detection.
It improves the efficiency and accuracy of real-time detection of contraband products, reduces the false detection rate, realizes automated detection, and saves manpower and time costs.
Smart Images

Figure CN119579918A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the technical field of security inspection information management, and in particular to a method, device, equipment and storage medium for real-time object detection. Background Art
[0002] Baggage flow, passenger flow, and information flow are the three main processes to ensure the safe operation of passenger travel venues. Among them, whether the baggage flow is safe, smooth, and efficient directly affects the normality of travel schedules and passenger satisfaction. At present, in order to ensure the smooth and safe travel of passengers, luggage security inspection systems are usually set up at travel venues such as railway stations, high-speed railway stations, and airports to detect contraband. X-ray contraband detection, as the main technical method for luggage security inspection, is of great significance to maintaining public safety and protecting the personal and property of citizens. With the rise and development of deep learning technology, combined with the actual needs of security inspection tasks, X-ray contraband intelligent detection has become one of the research hotspots in the field of security prevention.
[0003] At present, the X-ray imaging system adopts the line scanning mode. The high-sensitivity X-ray array detector inside it scans the items layer by layer under the drive of the mechanical scanning device, and reconstructs the image of the obtained data after the transmission ray signal is detected and processed, so as to capture the items in the luggage. However, unlike the conventional target detection in RGB (Red Green Blue, a color standard) images, there are inherent differences between X-ray images and RGB images, such as serious class imbalance, monotonous image color, lack of texture information, etc. In addition, the current security inspection process relies heavily on manual screening and judgment of X-ray images, and it is difficult to identify deliberately hidden contraband in overlapping and messy luggage.
[0004] In addition, due to changes in spatial scale, complex background interference, similar background, lack of color information, and occlusion of prohibited items, it is easy to make it difficult to detect prohibited items. In addition, according to the needs of convenient travel, real-time detection is required during luggage detection to avoid luggage accumulation. In addition, the current X-ray image detection uses manual feature recognition and classifier classification, and distinguishes whether it is a prohibited item by sliding the positioning information window. The high subjectivity of manual feature recognition may lead to insufficient robustness of this method, and the resulting false detection rate is high, and the efficiency is low. Summary of the invention
[0005] In view of this, the purpose of this application is to provide a method, device, equipment and storage medium for real-time detection of objects, which can improve the efficiency of real-time detection of contraband, improve the accuracy of detection, and reduce the false detection rate. The specific scheme is as follows:
[0006] In a first aspect, the present application discloses a method for real-time object detection, comprising:
[0007] Extract features of the current X-ray image in the real-time received X-ray video stream, and input the extracted first eigenvalue into the optimized fast spatial pyramid pooling network for multi-scale feature fusion to obtain the second eigenvalue;
[0008] Inputting the second eigenvalue into a pre-created encoding network for encoding, and merging the encoded eigenvalue with the eigenvalue in the feature extraction process to obtain a merged eigenvalue;
[0009] Inputting the merged feature value into a pre-created decoding network to decode the merged feature value to obtain a decoded feature value; the encoding network and the decoding network are both attention mechanism networks;
[0010] The decoded feature value is input into a trained feedforward neural network to detect contraband in the current X-ray image, and a contraband detection result including a target category, a target frame and a score is obtained.
[0011] Optionally, the step of extracting features of a current X-ray image in the X-ray video stream received in real time, and inputting the extracted first eigenvalue into an optimized fast spatial pyramid pooling network for multi-scale feature fusion to obtain a second eigenvalue includes:
[0012] Acquire the X-ray image in the X-ray video stream received in real time to obtain the current X-ray image;
[0013] Inputting the current X-ray image into a feature extraction network to extract features of the current X-ray image and obtain a first feature value; the feature extraction network is a network created based on a first number of convolutional networks and a second number of C3 networks;
[0014] The first eigenvalue is input into an optimized fast spatial pyramid pooling network to perform multi-scale feature fusion on the first eigenvalue to obtain a second eigenvalue.
[0015] Optionally, inputting the current X-ray image into a feature extraction network to perform feature extraction on the current X-ray image to obtain a first feature value includes:
[0016] Scaling the current X-ray image to a preset size to obtain a scaled image;
[0017] Inputting the scaled image into the feature extraction network to perform feature extraction on the scaled image to obtain a first eigenvalue;
[0018] The number of channels corresponding to the first eigenvalue is greater than the number of channels of the scaled image, and the pixel value corresponding to the first eigenvalue is less than the pixel value of the scaled image.
[0019] Optionally, the step of inputting the second eigenvalue into a pre-created encoding network for encoding, and merging the encoded eigenvalue with the eigenvalue in the feature extraction process to obtain a merged eigenvalue includes:
[0020] Inputting the second eigenvalue into a pre-created encoding network to encode the second eigenvalue to obtain an encoded eigenvalue;
[0021] The encoded feature value is feature-concatenated with multiple feature values in the feature extraction process to obtain multiple concatenated feature values, and the multiple concatenated feature values are merged with the encoded feature value to obtain a merged feature value.
[0022] Optionally, the step of performing feature splicing on the encoded feature value and multiple feature values in the feature extraction process to obtain multiple spliced feature values, and merging the multiple spliced feature values with the encoded feature value to obtain a merged feature value includes:
[0023] The encoded eigenvalue is concatenated with the third eigenvalue output by the first C3 network in the feature extraction process to obtain a first concatenated eigenvalue; the third eigenvalue has the same number of channels or pixel values as the encoded eigenvalue;
[0024] Using a first convolutional network and a second convolutional network created in advance to perform a convolution operation on the first concatenated eigenvalues, respectively, to obtain a first convolutional eigenvalue and a second convolutional eigenvalue;
[0025] Adding the first convolution eigenvalue and the second convolution eigenvalue point by point to obtain a first summed eigenvalue;
[0026] Splicing the first summed eigenvalue with the fourth eigenvalue output by the second C3 network in the feature extraction process to obtain a second spliced eigenvalue; the fourth eigenvalue has the same number of channels or pixel values as the first summed eigenvalue;
[0027] Using a third convolutional network and a fourth convolutional network created in advance to perform a convolution operation on the second concatenated eigenvalues, respectively, to obtain a third convolutional eigenvalue and a fourth convolutional eigenvalue;
[0028] The third convolution eigenvalue and the fourth convolution eigenvalue are added point by point to obtain a second summed eigenvalue, and the first summed eigenvalue, the second summed eigenvalue and the encoded eigenvalue are merged to obtain a merged eigenvalue.
[0029] Optionally, the real-time object detection method further includes:
[0030] Collect historical X-ray images to obtain an X-ray image data set;
[0031] Using the X-ray image data set to train an initial feedforward neural network to obtain the trained feedforward neural network;
[0032] Among them, the network structure of the feedforward neural network is a fully connected network layer, a linear rectification function layer and a fully connected network layer.
[0033] Optionally, the real-time object detection method further includes:
[0034] Labeling contraband in each historical X-ray image in the X-ray image dataset to obtain a real label dataset;
[0035] Matching the predicted value data set generated after the initial feedforward neural network training with the real label data set to obtain a matching result;
[0036] A loss function is calculated according to the matching result to evaluate the performance of the trained feedforward neural network based on the loss function.
[0037] In a second aspect, the present application discloses a real-time object detection device, comprising:
[0038] A feature extraction module is used to extract features of a current X-ray image in the X-ray video stream received in real time;
[0039] A feature fusion module is used to input the extracted first eigenvalue into the optimized fast spatial pyramid pooling network for multi-scale feature fusion to obtain a second eigenvalue;
[0040] An encoding module, used for inputting the second eigenvalue into a pre-created encoding network for encoding;
[0041] A feature merging module, used to merge the encoded feature value with the feature value in the feature extraction process to obtain a merged feature value;
[0042] A decoding module, used for inputting the merged feature value into a pre-created decoding network to decode the merged feature value to obtain a decoded feature value; the encoding network and the decoding network are both attention mechanism networks;
[0043] The contraband detection module is used to input the decoded feature value into the trained feedforward neural network to detect the contraband in the current X-ray image and obtain a contraband detection result including a target category, a target frame and a score.
[0044] In a third aspect, the present application discloses an electronic device, comprising a processor and a memory; wherein the processor implements the aforementioned real-time object detection method when executing a computer program stored in the memory.
[0045] In a fourth aspect, the present application discloses a computer-readable storage medium for storing a computer program; wherein, when the computer program is executed by a processor, the aforementioned real-time object detection method is implemented.
[0046] It can be seen that the present application first extracts features from the current X-ray image in the X-ray video stream received in real time, and inputs the extracted first eigenvalue into the optimized fast spatial pyramid pooling network for multi-scale feature fusion to obtain a second eigenvalue, and then inputs the second eigenvalue into a pre-created encoding network for encoding, and merges the encoded eigenvalue with the eigenvalue in the feature extraction process to obtain a merged eigenvalue, and then inputs the merged eigenvalue into a pre-created decoding network to decode the merged eigenvalue to obtain a decoded eigenvalue, and finally inputs the decoded eigenvalue into a trained feedforward neural network to detect contraband in the current X-ray image and obtain a contraband detection result including a target category, a target box, and a score. The present application uses a fast spatial pyramid pooling network to perform multi-scale feature fusion on the X-ray image after feature extraction, then encodes the fused feature values, and merges the encoded feature values with the sub-feature values in the feature extraction process, and decodes the merged feature values, and then inputs the decoded feature values into a feedforward neural network, thereby obtaining a contraband detection result including the category, location box and score. Through the above method, real-time detection of automated X-ray contraband is achieved, saving labor costs and time costs, and improving detection efficiency. In addition, the present application adopts feature extraction, multi-feature fusion, feature merging and other technologies, which can perform comprehensive analysis of contraband during the detection process, thereby improving the accuracy of contraband detection and reducing the false detection rate. BRIEF DESCRIPTION OF THE DRAWINGS
[0047] 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, the drawings described below are only embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on the provided drawings without paying any creative work.
[0048] Figure 1 This is a flow chart of a method for real-time object detection disclosed in this application;
[0049] Figure 2A specific SPPF network structure block diagram disclosed in this application;
[0050] Figure 3 A specific C3 network structure block diagram disclosed in this application;
[0051] Figure 4 A specific convolutional network structure block diagram disclosed in this application;
[0052] Figure 5 A specific B1 network structure block diagram disclosed in this application;
[0053] Figure 6 A specific B2 network structure block diagram disclosed in this application;
[0054] Figure 7 A specific coding network structure block diagram disclosed in this application;
[0055] Figure 8 A specific decoding network structure block diagram disclosed in this application;
[0056] Fig. 9 A flowchart of a specific method for real-time object detection disclosed in this application;
[0057] Fig.10 A block diagram of a specific object real-time detection method disclosed in this application;
[0058] Fig.11 This is a schematic diagram of the structure of a real-time object detection device disclosed in this application;
[0059] Fig.12 This is a structural diagram of an electronic device disclosed in this application. DETAILED DESCRIPTION
[0060] The following will be combined with the drawings in the embodiments of the present application to clearly and completely describe the technical solutions in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of this application.
[0061] The present application discloses a method for real-time object detection. Figure 1 As shown, the method includes:
[0062] Step S11: extract features of the current X-ray image in the X-ray video stream received in real time, and input the extracted first eigenvalue into the optimized fast spatial pyramid pooling network for multi-scale feature fusion to obtain a second eigenvalue.
[0063] In this embodiment, the X-ray image in the X-ray video stream captured and transmitted by the X-ray camera is first received in real time, and then the feature of the received current X-ray image is extracted to obtain a first eigenvalue, and then the extracted first eigenvalue is input into the optimized fast spatial pyramid pooling (SPPF, Spatial Pyramid Pooling Fast) network for multi-scale feature fusion to obtain a second eigenvalue. It should be pointed out that the present application optimizes the model structure of the traditional SPPF network, further simplifies the model structure of the SPPF network, reduces the original maximum number of pooling, and thus improves the overall processing efficiency of the model. For details, see Figure 2 As shown, Figure 2 A specific optimized SPPF network is shown. When real-time detection of contraband is performed through the network, the first eigenvalue of the input can be convolved through a convolutional network (i.e., a Conv network with network parameters of k=1, s=1, p=0, and c=512), and then the convolution result is copied into two copies, one of which is input into a feature fusion node, and the other is input into a Maxpool2d layer (i.e., a two-dimensional maximum pooling layer with network parameters of k=3, s=1, and p=2) for processing. The two processing results are subjected to multi-scale feature fusion through a feature fusion node, and then the combined result is convolved through a Conv network (network parameters of k=1, s=1, p=0, and c=1024) to obtain the second eigenvalue. In the convolutional network, k represents kernel (the size of the convolution kernel), c represents column (the number of layers), s represents stride (the step length), and p represents padding (the number of padding).
[0064] Specifically, the feature extraction of the current X-ray image in the X-ray video stream received in real time, and inputting the extracted first eigenvalue into the optimized fast spatial pyramid pooling network for multi-scale feature fusion to obtain the second eigenvalue may include: acquiring the X-ray image in the X-ray video stream received in real time to obtain the current X-ray image; inputting the current X-ray image into the feature extraction network to extract the feature of the current X-ray image to obtain the first eigenvalue; the feature extraction network is a network created based on a first number of convolutional networks and a second number of C3 networks; inputting the first eigenvalue into the optimized fast spatial pyramid pooling network to perform multi-scale feature fusion on the first eigenvalue to obtain the second eigenvalue. In this embodiment, the X-ray image in the real-time received X-ray video stream can be extracted first, and then the extracted current X-ray image is input into a feature extraction network created based on a first number of convolutional networks and a second number of C3 networks, so as to extract features from the current X-ray image to obtain a first eigenvalue, and then the first eigenvalue is input into an optimized fast spatial pyramid pooling network, so as to perform multi-scale feature fusion on the first eigenvalue to obtain a second eigenvalue; wherein the first number and the second number can be selected according to actual application requirements. For details, see Figure 3 and Figure 4 As shown, a specific C3 network and a convolutional network are shown respectively, where: Figure 3 The C3 network in the example includes three convolutional layers (with parameters k=1, s=1), one B1 network or B2 network, and one eigenvalue merging node. Figure 4 The convolutional network in includes 1 Conv2d layer (2D convolution layer), 1 BN (Batch Normalization) layer and 1 SiLU (Sigmoid Linear Unit, an improved activation function) layer. In addition, see Figure 5 and Figure 6 As shown, respectively Figure 3 The network structure of B1 network and B2 network, where Figure 5 The B1 network in includes 2 convolutional layers and a feature value merging node. Figure 6 The B2 network in includes 2 convolutional layers. The accuracy of feature extraction can be improved by combining multiple C3 networks and convolutional networks.
[0065] Step S12: inputting the second eigenvalue into a pre-created encoding network for encoding, and merging the encoded eigenvalue with the eigenvalue obtained in the feature extraction process to obtain a merged eigenvalue.
[0066] In this embodiment, after the extracted first eigenvalue is input into the optimized fast spatial pyramid pooling network for multi-scale feature fusion to obtain the second eigenvalue, the second eigenvalue is further input into the pre-created encoding network for encoding to obtain the corresponding encoded eigenvalue, and then the encoded eigenvalue is merged with the sub-eigenvalue in the feature extraction process to obtain the merged eigenvalue; wherein the encoding network is a network based on the attention mechanism of the Transformer architecture. It should be pointed out that the encoding network is used for feature extraction and can be repeatedly superimposed, and the specific number of superpositions can be selected according to actual application requirements. For example, the number is set to N=6, and the number of self-attention modules can be set to M=12.
[0067] For details, see Figure 7 As shown, Figure 7 A specific encoding network is shown, and the specific process of encoding through the network includes: first flattening the input feature (i.e., the second eigenvalue), and then performing layer normalization processing on the flattened input feature to obtain the normalized feature, and then dividing the normalized feature into three groups of identical values, namely feature V (Value), feature Q (Query) and feature K (Key); further, the Transformer encoding method is used to positionally encode the feature Q and feature K, and the encoded feature Q and feature K are matrix multiplied, and then the results of the feature Q and feature K are scaled. The scaling method can be divided by a specific value. Scaling can prevent the dot product value from being too large. When calculating the dot product, if scaling is not performed, as the vector dimension increases, the dot product value may also become very large, which will cause the gradient of the softmax function to be very small, and then the gradient disappears, affecting the training effect of the model; in addition, the gradient can be stabilized by the scaling operation, making the dot product result more stable, ensuring that the softmax function works within a more appropriate range, thereby ensuring the training stability of the model. Next, the result obtained after scaling is passed through the activation function softmax, and the eigenvalue after the activation function softmax is matrix multiplied with the feature V to obtain the output feature; wherein the output feature The formula can be expressed as:
[0068] ;
[0069] In the formula, is the dimension value of feature K.
[0070] Next, the above output features The input feature (i.e., the second eigenvalue) is added point by point, and the added feature is layer-normalized. The layer-normalized feature passes through the fully connected layer, and finally the feature after the fully connected layer is added point by point to obtain the encoded eigenvalue.
[0071] Specifically, the step of inputting the second eigenvalue into a pre-created coding network for encoding, and merging the encoded eigenvalue with the eigenvalue in the feature extraction process to obtain a merged eigenvalue may include: inputting the second eigenvalue into a pre-created coding network to encode the second eigenvalue to obtain an encoded eigenvalue; performing feature splicing on the encoded eigenvalue and multiple eigenvalues in the feature extraction process to obtain multiple spliced eigenvalues, and merging the multiple spliced eigenvalues with the encoded eigenvalue to obtain a merged eigenvalue. That is, the second eigenvalue is first encoded through a pre-created coding network, and the encoded eigenvalue is feature spliced with multiple eigenvalues in the feature extraction process to obtain multiple spliced eigenvalues, and then the multiple spliced eigenvalues are merged with the encoded eigenvalue to obtain a merged eigenvalue.
[0072] Step S13: inputting the merged feature value into a pre-created decoding network to decode the merged feature value to obtain a decoded feature value; the encoding network and the decoding network are both networks of the attention mechanism.
[0073] In this embodiment, the above-mentioned merged feature values can be input into a pre-created decoding network, so as to decode the above-mentioned merged feature values to obtain corresponding decoded feature values; wherein the decoding network is a network based on the attention mechanism of the Transformer architecture.
[0074] It should be pointed out that the present application also includes an object positioning component, which is input into the decoding network after position encoding (using the position encoding format of Transformers), wherein the object positioning component is defined according to the output network of the decoding network, preferably, the number of detected objects can be set to 50, and each detected object includes three detection results: category, target box and score. By adopting the object positioning component, the object positioning component can increase the training convergence speed of the model, so that the output category, target box and score of the model correspond one to one.
[0075] In addition, the decoding network in the present application outputs all the results of the input X-ray image at one time, and no longer uses the method of outputting results in a round-robin manner and inserting the input in reverse order (and the first output result is used as input to re-enter the network until all results are traversed).
[0076] For details, see Figure 8 As shown, Figure 8 A specific decoding network is shown, and the specific process of decoding through the network includes: first obtaining the feature value of the object coding component, then layer normalizing the feature value, and dividing the normalized feature into three groups of identical features, namely feature V, feature Q and feature K; then, using the Transformer encoding method to positionally encode feature Q and feature K, and matrix multiplying the encoded feature Q and feature K; then scaling the results of feature Q and feature K, and the scaling method can be divided by a specific value. Scaling can prevent the dot product value from being too large, stabilize the gradient, make the dot product result more stable, and ensure that the softmax function works within a more appropriate range, thereby ensuring the training stability of the model; further, the result obtained after scaling is passed through the activation function softmax, The eigenvalue after the activation function softmax is matrix multiplied with the feature V to obtain the first output feature; then, the above-mentioned first output feature and the input feature (i.e., the encoded eigenvalue) are added point by point, and the added first feature is layer normalized, and the layer-normalized value is positionally encoded as the Q feature of the decoder, and then the encoded eigenvalue is used as the feature K and feature V of the decoder. Preferably, the dimensions of feature K, feature V and feature Q are the same; further, feature Q and feature K in the encoded eigenvalue are matrix multiplied, and the results of feature Q and feature K are scaled. The scaling method can be divided by a specific value, and then the scaled result is passed through the activation function softmax, and the eigenvalue after softmax is matrix multiplied with feature V to obtain the second output feature, and then the above-mentioned second output feature is added point by point with the layer-normalized value, and the added second feature is layer-normalized, and then the layer-normalized value is passed through the fully connected layer, and finally the feature after passing the fully connected layer is added point by point with the above-mentioned second feature, so as to obtain the decoded eigenvalue. It should be noted that the number of decoding networks can be repeatedly superimposed, and the specific number of superpositions can be selected according to actual application requirements. For example, the number is set to N=6, and the number of self-attention modules can be set to M=12.
[0077] Step S14: Input the decoded feature value into the trained feedforward neural network to detect contraband in the current X-ray image, and obtain a contraband detection result including a target category, a target frame and a score.
[0078] In this embodiment, after decoding the merged eigenvalue to obtain the decoded eigenvalue, further, the decoded eigenvalue is input into a trained feed-forward neural network (FFN, Feed-Forward Neural Network) to detect contraband in the current X-ray image, and a contraband detection result including the target category, target box, and score is obtained.
[0079] It should be noted that before real-time object detection, it specifically further includes: collecting historical X-ray images to obtain an X-ray image dataset; training an initial feed-forward neural network using the X-ray image dataset to obtain the trained feed-forward neural network; wherein, the network structure of the feed-forward neural network is a fully connected network layer, a rectified linear unit layer, and a fully connected network layer. In this embodiment, historical X-ray images can be collected first to obtain an X-ray image dataset, and then the initial feed-forward neural network is trained using the X-ray image dataset to obtain the trained feed-forward neural network; wherein, the network structure of this feed-forward neural network is a fully connected network layer + rectified linear unit (ReLU) layer + fully connected network layer.
[0080] Further, it may also include: tagging the contraband in each historical X-ray image in the X-ray image dataset to obtain a true label dataset; matching the predicted value dataset generated after training the initial feed-forward neural network with the true label dataset to obtain a matching result; calculating a loss function based on the matching result to evaluate the performance of the trained feed-forward neural network. Specifically, when there are m datasets for the predicted targets and n datasets for the true labels, m >= n should be satisfied; when m < n, null filling is required for the elements in m to ensure m >= n; then, a cost matrix C is constructed, and the expression of C is:
[0081] ;
[0082] In the formula, represents the cost of matching the i-th element in the predicted target dataset A with the j-th element in the true dataset B, The calculation method of
[0083] includes , where represents the label number of the category, represents the x coordinate value of the center of the target box of the category, represents the y coordinate value of the center of the target box of the category, The target box width of the category, express The target box height of the category, Indicates the score of the target prediction;
[0084] include ,in express The label of the category, express The x-coordinate value of the center of the target box of the category, express The y coordinate value of the center of the target box of the category, express The target box width of the category, express The target box height of the category, Indicates the score of the target prediction, the default value is 1;
[0085] ;
[0086] In the formula, , , is the hyperparameter that controls the weight of each element;
[0087] Next, normalize:
[0088] ;
[0089] ;
[0090] Furthermore, we find the minimum number of lines k that cover all zeros if , then the optimal solution is obtained.
[0091] It should be noted that if no complete match is found, the minimum value of the uncovered elements is calculated and adjusted:
[0092] ;
[0093] ;
[0094] ;
[0095] Repeat the above steps until Finally, according to the adjusted cost matrix, the best matching pair is extracted , and calculate the Loss loss function of the corresponding matching pair:
[0096] ;
[0097] Among them, i and j are all matching pairs, where represents the position deviation loss, Represents the category loss, and the specific formula is:
[0098] ;
[0099] .
[0100] Through the calculation of the above loss function, the performance of the trained feedforward neural network can be evaluated based on the loss function, thereby ensuring the reliability of the network and improving the accuracy of contraband detection. In addition, the prediction sample and the real-time sample are matched through the cost matrix, and the loss function is calculated after matching, which improves the training efficiency of the model.
[0101] It can be seen that the embodiment of the present application first extracts features from the current X-ray image in the X-ray video stream received in real time, and inputs the extracted first eigenvalue into the optimized fast spatial pyramid pooling network for multi-scale feature fusion to obtain a second eigenvalue, and then inputs the second eigenvalue into a pre-created encoding network for encoding, and merges the encoded eigenvalue with the eigenvalue in the feature extraction process to obtain a merged eigenvalue, and then inputs the merged eigenvalue into a pre-created decoding network to decode the merged eigenvalue to obtain a decoded eigenvalue, and finally inputs the decoded eigenvalue into a trained feedforward neural network to detect contraband in the current X-ray image and obtain a contraband detection result including a target category, a target box, and a score. The embodiment of the present application performs multi-scale feature fusion on the X-ray image after feature extraction through a fast spatial pyramid pooling network, then encodes the fused feature values, and merges the encoded feature values with the sub-feature values in the feature extraction process, and decodes the merged feature values, and then inputs the decoded feature values into a feedforward neural network, thereby obtaining a contraband detection result including the category, location box and score. Through the above method, real-time detection of automated X-ray contraband is achieved, labor costs and time costs are saved, and detection efficiency is improved. In addition, the embodiment of the present application adopts feature extraction, multi-feature fusion, feature merging and other technologies, which can perform comprehensive analysis of contraband during the detection process, thereby improving the accuracy of contraband detection and reducing the false detection rate.
[0102] The present application discloses a specific method for real-time object detection. Fig. 9 As shown, the method includes:
[0103] Step S201: Acquire an X-ray image in the X-ray video stream received in real time to obtain a current X-ray image.
[0104] Step S202: Scale the current X-ray image to a preset size to obtain a scaled image, and input the scaled image into the feature extraction network to perform feature extraction on the scaled image to obtain a first eigenvalue; the feature extraction network is a network created based on a first number of convolutional networks and a second number of C3 networks, the number of channels corresponding to the first eigenvalue is greater than the number of channels of the scaled image, and the pixel value corresponding to the first eigenvalue is less than the pixel value of the scaled image.
[0105] In this embodiment, after obtaining the X-ray image in the X-ray video stream, it can be preprocessed, such as scaling it, and then the scaled image is input into a feature extraction network created by multiple convolutional networks and multiple C3 networks, so as to extract features from the scaled image and obtain a first eigenvalue. It should be noted that the number of channels corresponding to the first eigenvalue is greater than the number of channels of the scaled image, and the pixel value corresponding to the first eigenvalue is less than the pixel value of the scaled image.
[0106] Specifically, the X-ray image can be scaled to a specific size. Preferably, the specific size can be 640*640. It should be noted that in the process of scaling the image size, the aspect ratio of the image is not changed. The largest side is scaled to 640, and the small side is filled with grayscale. After scaling, the characteristic value of [1,3,640,640] can be obtained; wherein the four elements in [1,3,640,640] represent the number of images, the number of channels, and the length and width of pixel values, respectively. For further information, see Fig.10As shown in the figure, it contains 5 convolutional networks and 4 C3 networks. The processing flow of each network is as follows: input the feature value of [1, 3, 640, 640] into Conv network 1 to obtain the feature value of [1, 64, 320, 320]; input the feature value of [1, 64, 320, 320] into Conv network 2 to obtain the feature value of [1, 128, 160, 160]; input the feature value of [1, 128, 160, 160] into C3 network 1 to obtain the feature value of [1, 128, 160, 160]; input the feature value of [1, 128, 160, 160] into Conv network 3 to obtain the feature value of [1, 256, 80, 80]; input the feature value of [1, 256, 80, 80] into C3 network 2 , and get the eigenvalue of [1,256,80,80]; input the eigenvalue of [1,256,80,80] into Conv network 4, and get the eigenvalue of [1,512,40,40]; input the eigenvalue of [1,512,40,40] into C3 network 3, and get the eigenvalue of [1,512,40,40]; input the eigenvalue of [1,512,40,40] into Conv network 5, and get the eigenvalue of [1,1024,20,20]; input the eigenvalue of [1,1024,20,20] into C3 network 4, and get the eigenvalue of [1,1024,20,20].
[0107] Step S203: inputting the first eigenvalue into the optimized fast spatial pyramid pooling network to perform multi-scale feature fusion on the first eigenvalue to obtain a second eigenvalue.
[0108] Step S204: inputting the second eigenvalue into a pre-created encoding network to encode the second eigenvalue to obtain an encoded eigenvalue.
[0109] Step S205: splicing the encoded eigenvalue with the third eigenvalue output by the first C3 network in the feature extraction process to obtain a first spliced eigenvalue; the third eigenvalue has the same number of channels or pixel values as the encoded eigenvalue.
[0110] In this embodiment, see Fig.10 As shown, the encoded feature value can be The eigenvalue [1,512,40,40] obtained by entering the C3 network 3 is concatenated to obtain a first concatenated eigenvalue; wherein the eigenvalue [1,512,40,40] has the same number of channels or pixel values as the eigenvalue corresponding to the encoded eigenvalue.
[0111] Step S206: performing a convolution operation on the first concatenated eigenvalues using the pre-created first convolution network and the second convolution network respectively, to obtain first convolutional eigenvalues and second convolutional eigenvalues.
[0112] In this embodiment, see Fig.10 As shown, two convolutional networks can be used to perform convolution operations on the first concatenated eigenvalues to obtain two corresponding convolutional eigenvalues, which are the first convolutional eigenvalues And the eigenvalue after the second convolution .
[0113] Step S207: Add the first convolution eigenvalue and the second convolution eigenvalue point by point to obtain a first summed eigenvalue.
[0114] In this embodiment, see Fig.10 As shown, the above two convolution eigenvalues can be added point by point to obtain the first summed eigenvalue ,in, .
[0115] Step S208: splicing the first summed eigenvalue with the fourth eigenvalue output by the second C3 network in the feature extraction process to obtain a second spliced eigenvalue; the fourth eigenvalue has the same number of channels or pixel values as the first summed eigenvalue.
[0116] For further information, see Fig.10 As shown, the eigenvalue after the first summation can be It is concatenated with the eigenvalue of [1, 256, 80, 80] output by C3 network 2 in the above feature extraction process to obtain the second concatenated eigenvalue.
[0117] Step S209: performing convolution operations on the second concatenated eigenvalues using the pre-created third convolutional network and the fourth convolutional network respectively to obtain third convolutional eigenvalues and fourth convolutional eigenvalues.
[0118] In this embodiment, the third convolutional network and the fourth convolutional network created in advance can be used to perform convolution operations on the second concatenated eigenvalues to obtain the third convolutional eigenvalues. And the eigenvalue after the fourth convolution .
[0119] Step S210: adding the third convolution eigenvalue and the fourth convolution eigenvalue point by point to obtain a second summed eigenvalue, and merging the first summed eigenvalue, the second summed eigenvalue and the encoded eigenvalue to obtain a merged eigenvalue.
[0120] For further information, see Fig.10 As shown, the third convolution eigenvalue and the fourth convolution eigenvalue are added point by point to obtain the second summed eigenvalue. ,in ; Then, respectively and Flatten it and get the corresponding first flattened eigenvalue and the second flattened eigenvalue , and merge the first summed eigenvalue, the second summed eigenvalue and the encoded eigenvalue to obtain a merged eigenvalue ,in .
[0121] Step S211: input the merged feature value into a pre-created decoding network to decode the merged feature value to obtain a decoded feature value; the encoding network and the decoding network are both networks of the attention mechanism.
[0122] Step S212: Input the decoded feature value into the trained feedforward neural network to detect contraband in the current X-ray image, and obtain a contraband detection result including a target category, a target frame and a score.
[0123] Among them, for more specific processing procedures of the above steps S201, S203, S204, S211, and S212, reference may be made to the corresponding contents disclosed in the aforementioned embodiments, which will not be repeated here.
[0124] It can be seen that the embodiment of the present application abandons the traditional target detection network such as yolo or Faster-RCNN, and adopts NMS (non maximum suppression) to process the target frame, thereby improving the detection efficiency of the model, and further increases the feature fusion through the optimized SPPF network, and the pre-created encoding network and decoding network based on the attention mechanism, and only adds the decoding network to the highest dimension of the model framework, and only extracts the high-dimensional features of the smallest size, thereby increasing the execution efficiency of the model and solving the problems of slow detection speed and low detection accuracy in the process of X-ray contraband detection.
[0125] Correspondingly, the present application also discloses a real-time object detection device, see Fig.11 As shown, the device comprises:
[0126] The feature extraction module 11 is used to extract features of the current X-ray image in the X-ray video stream received in real time;
[0127] A feature fusion module 12 is used to input the extracted first eigenvalue into the optimized fast spatial pyramid pooling network to perform multi-scale feature fusion to obtain a second eigenvalue;
[0128] An encoding module 13, used for inputting the second characteristic value into a pre-created encoding network for encoding;
[0129] A feature merging module 14 is used to merge the encoded feature value with the feature value in the feature extraction process to obtain a merged feature value;
[0130] A decoding module 15 is used to input the merged feature value into a pre-created decoding network to decode the merged feature value to obtain a decoded feature value; the encoding network and the decoding network are both attention mechanism networks;
[0131] The contraband detection module 16 is used to input the decoded feature value into the trained feedforward neural network to detect the contraband in the current X-ray image and obtain a contraband detection result including a target category, a target frame and a score.
[0132] Among them, the specific working processes of the above-mentioned modules can refer to the corresponding contents disclosed in the aforementioned embodiments, which will not be repeated here.
[0133] It can be seen that in the embodiment of the present application, the feature extraction is first performed on the current X-ray image in the X-ray video stream received in real time, and the extracted first eigenvalue is input into the optimized fast spatial pyramid pooling network for multi-scale feature fusion to obtain the second eigenvalue, and then the second eigenvalue is input into the pre-created encoding network for encoding, and the encoded eigenvalue is merged with the eigenvalue in the feature extraction process to obtain a merged eigenvalue, and then the merged eigenvalue is input into the pre-created decoding network to decode the merged eigenvalue to obtain a decoded eigenvalue, and finally the decoded eigenvalue is input into the trained feedforward neural network to detect contraband in the current X-ray image to obtain a contraband detection result including a target category, a target box and a score. The embodiment of the present application performs multi-scale feature fusion on the X-ray image after feature extraction through a fast spatial pyramid pooling network, then encodes the fused feature values, and merges the encoded feature values with the sub-feature values in the feature extraction process, and decodes the merged feature values, and then inputs the decoded feature values into a feedforward neural network, thereby obtaining a contraband detection result including the category, location box and score. Through the above method, real-time detection of automated X-ray contraband is achieved, labor costs and time costs are saved, and detection efficiency is improved. In addition, the embodiment of the present application adopts feature extraction, multi-feature fusion, feature merging and other technologies, which can perform comprehensive analysis of contraband during the detection process, thereby improving the accuracy of contraband detection and reducing the false detection rate.
[0134] In some specific embodiments, the feature extraction module 11 may specifically include:
[0135] An image acquisition unit, used to acquire an X-ray image in the X-ray video stream received in real time to obtain a current X-ray image;
[0136] A first feature extraction unit, used for inputting the current X-ray image into a feature extraction network to perform feature extraction on the current X-ray image to obtain a first feature value; the feature extraction network is a network created based on a first number of convolutional networks and a second number of C3 networks;
[0137] Accordingly, the feature fusion module 12 may specifically include:
[0138] The feature fusion unit is used to input the first eigenvalue into the optimized fast spatial pyramid pooling network to perform multi-scale feature fusion on the first eigenvalue to obtain a second eigenvalue.
[0139] In some specific embodiments, the first feature extraction unit may specifically include:
[0140] An image scaling unit, used for scaling the current X-ray image to a preset size to obtain a scaled image;
[0141] A second feature extraction unit, used for inputting the scaled image into the feature extraction network to perform feature extraction on the scaled image to obtain a first feature value;
[0142] The number of channels corresponding to the first eigenvalue is greater than the number of channels of the scaled image, and the pixel value corresponding to the first eigenvalue is less than the pixel value of the scaled image.
[0143] In some specific embodiments, the encoding module 13 may specifically include:
[0144] an encoding unit, configured to input the second eigenvalue into a pre-created encoding network to encode the second eigenvalue to obtain an encoded eigenvalue;
[0145] Accordingly, the feature merging module 14 may specifically include:
[0146] A first feature value concatenation unit, configured to concatenate the encoded feature value with a plurality of feature values in the feature extraction process to obtain a plurality of concatenated feature values;
[0147] The first eigenvalue merging unit is used to merge the multiple concatenated eigenvalues with the encoded eigenvalue to obtain a merged eigenvalue.
[0148] In some specific embodiments, the first eigenvalue concatenation unit may specifically include:
[0149] A second eigenvalue concatenation unit is used to concatenate the encoded eigenvalue with the third eigenvalue output by the first C3 network in the feature extraction process to obtain a first concatenated eigenvalue; the third eigenvalue has the same number of channels or pixel values as the encoded eigenvalue;
[0150] A first convolution unit, used to perform a convolution operation on the first concatenated eigenvalues using a pre-created first convolution network and a pre-created second convolution network, respectively, to obtain a first convolution eigenvalue and a second convolution eigenvalue;
[0151] A first eigenvalue summing unit, used for adding the first convolution eigenvalue and the second convolution eigenvalue point by point to obtain a first summed eigenvalue;
[0152] A third eigenvalue concatenation unit is configured to concatenate the first summed eigenvalue with the fourth eigenvalue output by the second C3 network in the feature extraction process to obtain a second concatenated eigenvalue; the fourth eigenvalue has the same number of channels or pixel values as the first summed eigenvalue;
[0153] A second convolution unit, used to perform a convolution operation on the second concatenated eigenvalues using a pre-created third convolution network and a pre-created fourth convolution network, respectively, to obtain a third convolution eigenvalue and a fourth convolution eigenvalue;
[0154] A second eigenvalue summing unit, used for adding the third convolution eigenvalue and the fourth convolution eigenvalue point by point to obtain a second summed eigenvalue;
[0155] Accordingly, the first eigenvalue merging unit may specifically include:
[0156] The second eigenvalue merging unit is used to merge the first summed eigenvalue, the second summed eigenvalue and the encoded eigenvalue to obtain a merged eigenvalue.
[0157] In some specific embodiments, the real-time object detection device may further include:
[0158] An image acquisition unit, used for acquiring historical X-ray images to obtain an X-ray image data set;
[0159] A network training unit, used to train an initial feedforward neural network using the X-ray image data set to obtain the trained feedforward neural network;
[0160] Among them, the network structure of the feedforward neural network is a fully connected network layer, a linear rectification function layer and a fully connected network layer.
[0161] In some specific embodiments, the real-time object detection device may further include:
[0162] a labeling unit, used for labeling contraband in each historical X-ray image in the X-ray image data set to obtain a real label data set;
[0163] A matching unit, used to match the predicted value data set generated after the initial feedforward neural network training with the real label data set to obtain a matching result;
[0164] A loss function calculation unit is used to calculate the loss function according to the matching result, so as to evaluate the performance of the trained feedforward neural network based on the loss function.
[0165] Furthermore, the present application also discloses an electronic device. Fig.12 This is a structural diagram of an electronic device 20 according to an exemplary embodiment. The content in the diagram cannot be considered as any limitation on the scope of use of the present application.
[0166] Fig.12 The present invention provides a schematic diagram of the structure of an electronic device 20 provided in an embodiment of the present application. The electronic device 20 may specifically include: at least one processor 21, at least one memory 22, a power supply 23, a communication interface 24, an input / output interface 25, and a communication bus 26. The memory 22 is used to store a computer program, which is loaded and executed by the processor 21 to implement the relevant steps in the real-time object detection method disclosed in any of the aforementioned embodiments. In addition, the electronic device 20 in this embodiment may specifically be an electronic computer.
[0167] In this embodiment, the power supply 23 is used to provide working voltage for each hardware device on the electronic device 20; the communication interface 24 can create a data transmission channel between the electronic device 20 and the external device, and the communication protocol it follows is any communication protocol that can be applied to the technical solution of the present application, and is not specifically limited here; the input and output interface 25 is used to obtain external input data or output data to the outside world, and its specific interface type can be selected according to specific application needs and is not specifically limited here.
[0168] In addition, the memory 22, as a carrier for storing resources, can be a read-only memory, a random access memory, a disk or an optical disk, etc. The resources stored thereon can include an operating system 221, a computer program 222, etc., and the storage method can be temporary storage or permanent storage.
[0169] The operating system 221 is used to manage and control the hardware devices and computer programs 222 on the electronic device 20, and can be Windows Server, Netware, Unix, Linux, etc. In addition to including a computer program that can be used to complete the object real-time detection method performed by the electronic device 20 disclosed in any of the aforementioned embodiments, the computer program 222 can further include a computer program that can be used to complete other specific tasks.
[0170] Furthermore, the present application also discloses a computer-readable storage medium for storing a computer program; wherein the computer program, when executed by a processor, implements the aforementioned disclosed method for real-time object detection. The specific steps of the method may refer to the corresponding contents disclosed in the aforementioned embodiments, and will not be described in detail here.
[0171] Furthermore, an embodiment of the present application also discloses a computer program product, including a computer program / instruction, which, when executed by a processor, implements the steps of the real-time object detection method disclosed above.
[0172] In this specification, each embodiment is described in a progressive manner, and each embodiment focuses on the differences from other embodiments. The same or similar parts between the embodiments can be referred to each other. For the device disclosed in the embodiment, since it corresponds to the method disclosed in the embodiment, the description is relatively simple, and the relevant parts can be referred to the method part.
[0173] Professionals may further appreciate that the units and algorithm steps of each example described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, computer software, or a combination of the two. In order to clearly illustrate the interchangeability of hardware and software, the composition and steps of each example have been generally described in the above description according to function. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professionals and technicians may use different methods to implement the described functions for each specific application, but such implementation should not be considered to be beyond the scope of this application.
[0174] The steps of the method or algorithm described in conjunction with the embodiments disclosed herein may be implemented directly using hardware, a software module executed by a processor, or a combination of the two. The software module may be placed in a random access memory (RAM), a memory, a read-only memory (ROM), an electrically programmable ROM, an electrically erasable programmable ROM, a register, a hard disk, a removable disk, a CD-ROM, or any other form of storage medium known in the art.
[0175] Finally, it should be noted that, in this article, relational terms such as first and second, etc. are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Moreover, the terms "include", "comprise" or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, the elements defined by the sentence "comprise a ..." do not exclude the presence of other identical elements in the process, method, article or device including the elements.
[0176] The above is a detailed introduction to a real-time object detection method, device, equipment and storage medium provided by the present application. Specific examples are used in this article to illustrate the principles and implementation methods of the present application. The description of the above embodiments is only used to help understand the method of the present application and its core idea; at the same time, for general technical personnel in this field, according to the idea of the present application, there will be changes in the specific implementation method and application scope. In summary, the content of this specification should not be understood as a limitation on the present application.
Claims
1. A method for real-time object detection, characterized in that: include: Extract features of the current X-ray image in the real-time received X-ray video stream, and input the extracted first eigenvalue into the optimized fast spatial pyramid pooling network for multi-scale feature fusion to obtain the second eigenvalue; Inputting the second eigenvalue into a pre-created encoding network for encoding, and merging the encoded eigenvalue with the eigenvalue in the feature extraction process to obtain a merged eigenvalue; Inputting the merged feature value into a pre-created decoding network to decode the merged feature value to obtain a decoded feature value; the encoding network and the decoding network are both attention mechanism networks; The decoded feature value is input into a trained feedforward neural network to detect contraband in the current X-ray image, and a contraband detection result including a target category, a target frame and a score is obtained.
2. The method for real-time object detection according to claim 1, characterized in that: The method extracts features of the current X-ray image in the X-ray video stream received in real time, and inputs the extracted first feature value into the optimized fast spatial pyramid pooling network for multi-scale feature fusion to obtain the second feature value, including: Acquire the X-ray image in the X-ray video stream received in real time to obtain the current X-ray image; Inputting the current X-ray image into a feature extraction network to extract features of the current X-ray image and obtain a first feature value; the feature extraction network is a network created based on a first number of convolutional networks and a second number of C3 networks; The first eigenvalue is input into an optimized fast spatial pyramid pooling network to perform multi-scale feature fusion on the first eigenvalue to obtain a second eigenvalue.
3. The real-time object detection method according to claim 2, characterized in that: The step of inputting the current X-ray image into a feature extraction network to extract features of the current X-ray image and obtain a first feature value includes: Scaling the current X-ray image to a preset size to obtain a scaled image; Inputting the scaled image into the feature extraction network to perform feature extraction on the scaled image to obtain a first eigenvalue; The number of channels corresponding to the first eigenvalue is greater than the number of channels of the scaled image, and the pixel value corresponding to the first eigenvalue is less than the pixel value of the scaled image.
4. The method for real-time object detection according to claim 3, characterized in that: The step of inputting the second eigenvalue into a pre-created encoding network for encoding, and merging the encoded eigenvalue with the eigenvalue in the feature extraction process to obtain a merged eigenvalue comprises: Inputting the second eigenvalue into a pre-created encoding network to encode the second eigenvalue to obtain an encoded eigenvalue; The encoded feature value is feature-concatenated with multiple feature values in the feature extraction process to obtain multiple concatenated feature values, and the multiple concatenated feature values are merged with the encoded feature value to obtain a merged feature value.
5. The method for real-time object detection according to claim 4, characterized in that: The step of performing feature splicing on the encoded feature value and the plurality of feature values in the feature extraction process to obtain a plurality of spliced feature values, and merging the plurality of spliced feature values with the encoded feature value to obtain a merged feature value comprises: The encoded eigenvalue is concatenated with the third eigenvalue output by the first C3 network in the feature extraction process to obtain a first concatenated eigenvalue; the third eigenvalue has the same number of channels or pixel values as the encoded eigenvalue; Using a first convolutional network and a second convolutional network created in advance to perform a convolution operation on the first concatenated eigenvalues, respectively, to obtain a first convolutional eigenvalue and a second convolutional eigenvalue; Adding the first convolution eigenvalue and the second convolution eigenvalue point by point to obtain a first summed eigenvalue; Splicing the first summed eigenvalue with the fourth eigenvalue output by the second C3 network in the feature extraction process to obtain a second spliced eigenvalue; the fourth eigenvalue has the same number of channels or pixel values as the first summed eigenvalue; Using a third convolutional network and a fourth convolutional network created in advance to perform a convolution operation on the second concatenated eigenvalues, respectively, to obtain a third convolutional eigenvalue and a fourth convolutional eigenvalue; The third convolution eigenvalue and the fourth convolution eigenvalue are added point by point to obtain a second summed eigenvalue, and the first summed eigenvalue, the second summed eigenvalue and the encoded eigenvalue are merged to obtain a merged eigenvalue.
6. The real-time object detection method according to any one of claims 1 to 5, characterized in that: Also includes: Collect historical X-ray images to obtain an X-ray image data set; Using the X-ray image data set to train an initial feedforward neural network to obtain the trained feedforward neural network; Among them, the network structure of the feedforward neural network is a fully connected network layer, a linear rectification function layer and a fully connected network layer.
7. The method for real-time object detection according to claim 6, characterized in that: Also includes: Labeling contraband in each historical X-ray image in the X-ray image dataset to obtain a real label dataset; Matching the predicted value data set generated after the initial feedforward neural network training with the real label data set to obtain a matching result; A loss function is calculated according to the matching result to evaluate the performance of the trained feedforward neural network based on the loss function.
8. A real-time object detection device, characterized in that: include: A feature extraction module is used to extract features of a current X-ray image in the X-ray video stream received in real time; A feature fusion module is used to input the extracted first eigenvalue into the optimized fast spatial pyramid pooling network for multi-scale feature fusion to obtain a second eigenvalue; An encoding module, used for inputting the second eigenvalue into a pre-created encoding network for encoding; A feature merging module, used to merge the encoded feature value with the feature value in the feature extraction process to obtain a merged feature value; A decoding module, used for inputting the merged feature value into a pre-created decoding network to decode the merged feature value to obtain a decoded feature value; the encoding network and the decoding network are both attention mechanism networks; The contraband detection module is used to input the decoded feature value into the trained feedforward neural network to detect the contraband in the current X-ray image and obtain a contraband detection result including a target category, a target frame and a score.
9. An electronic device, characterized in that: It comprises a processor and a memory; wherein, when the processor executes the computer program stored in the memory, the real-time object detection method as claimed in any one of claims 1 to 7 is implemented.
10. A computer-readable storage medium, characterized in that: Used to store computer programs; wherein, when the computer program is executed by a processor, the real-time object detection method according to any one of claims 1 to 7 is implemented.
Citation Information
Patent Citations
Remote sensing image target detection method based on fusion convolution attention mechanism
CN116229295A
Water surface target detection method and system based on improved Deformable DETR
CN118015255A
Target detection method and device, electronic equipment and storage medium
CN118247629A
Target detection model training method and apparatus, and target detection method and apparatus
WO2023116507A1