A vehicle detection method based on compressed video DCT coefficients

By extracting and preprocessing the H.264 compressed code stream video, the second DCT coefficient is obtained and a vehicle detection model is constructed for detection, which solves the problems of large consumption of video vehicle detection and low accuracy in the prior art, and achieves a high-precision and low resource consumption vehicle detection effect.

CN114866784BActive Publication Date: 2025-04-01SOUTHEAST UNIV
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202210411306.0
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-04-19
Publication Date
2025-04-01
Estimated Expiration
2042-04-19

AI Technical Summary

Technical Problem

The existing video vehicle detection method based on pixel domain requires the complete decoding of the video, which consumes a lot of computing resources, while the vehicle detection method that directly uses video compression domain information is not very accurate.

Method used

A vehicle detection method based on compressed video DCT coefficient is proposed. By extracting and preprocessing the H.264 compressed code stream video, the second DCT coefficient is obtained, and a vehicle detection model is constructed to detect it, so as to identify the vehicle position, type and confidence.

Benefits of technology

High-precision vehicle detection is realized, high computing resource consumption for fully decoded videos is avoided, and resource consumption during the detection process is reduced.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114866784B_ABST
    Figure CN114866784B_ABST
Patent Text Reader

Abstract

The present invention discloses a vehicle detection method based on compressed video DCT coefficients, comprising the steps of: extracting a compressed bitstream video and obtaining a first DCT coefficient corresponding to the compressed bitstream video; performing preprocessing based on the first DCT coefficient and obtaining a second DCT coefficient; constructing a vehicle detection model; obtaining an image sample set based on an open source image data set UA‑DETRAC, and then using the image sample set to train the vehicle detection model and obtain a vehicle detection network; obtaining a vehicle detection result based on the compressed bitstream video, the second DCT coefficient and the vehicle detection network. The present invention utilizes the characteristic that feature information can be obtained without complete decoding of compressed format data, and combines deep learning to reduce the complexity of the vehicle detection model, reduce the computing power required for vehicle detection, and meet the requirements of edge computing.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The invention relates to the field of vehicle detection, and in particular to a vehicle detection method based on video compression DCT coefficients. Background Art

[0002] With the rapid development of the national economy, the number of motor vehicles in my country has continued to increase. The increase in motor vehicles has brought about a series of problems such as traffic congestion. Therefore, it is necessary to develop an intelligent transportation system. As an important technology in the intelligent transportation system, road vehicle detection has been vigorously developed. The video-based vehicle detection method has the characteristics of containing a large amount of information and having little interference with traffic facilities.

[0003] The current video detection work first needs to be transmitted over the network, and the transmitted video uses a compressed format. The current pixel-domain based video vehicle detection method requires the video to be fully decoded, and then the vehicle detection is achieved through the current mainstream deep learning method. The pixel-domain based deep learning detection method can currently achieve real-time end-to-end detection with high accuracy, but the model is relatively complex and requires the video to be fully decoded, which consumes a lot of computing resources.

[0004] The vehicle detection method that directly uses the video compression domain information does not need to fully decode the video. It only needs partial decoding to obtain the compression domain information. Vehicle detection can be achieved based on the feature information contained in the compression domain, but the accuracy is often not high. Summary of the invention

[0005] In view of the above problems, the present invention proposes a vehicle detection method based on compressed video DCT coefficients.

[0006] To achieve the purpose of the present invention, a vehicle detection method based on compressed video DCT is provided, comprising the following steps:

[0007] S1: extracting a compressed bitstream video and obtaining a first DCT coefficient corresponding to the compressed bitstream video;

[0008] S2: preprocessing the first DCT coefficient to obtain a second DCT coefficient;

[0009] S3: construct vehicle detection model;

[0010] S4: obtaining an image sample set based on the open source image dataset UA-DETRAC, and then using the image sample set to train the vehicle detection model to obtain a vehicle detection network;

[0011] S5: Input the second DCT coefficient into the vehicle detection network for detection, and obtain the vehicle's position, type and confidence information, and then draw the vehicle's detection box, type and confidence in the decoded compressed code stream video frame based on the vehicle's position, type and confidence information. The vehicle's detection box, type and confidence are the vehicle's detection result.

[0012] Furthermore, the compressed code stream video is H.264 compressed code stream video.

[0013] Furthermore, in step S1, the H.264 compressed code stream video is extracted to obtain the first DCT coefficient corresponding to the compressed code stream video, and the specific process includes the following:

[0014] Convert the size of the H.264 compressed code stream video to 416x416;

[0015] The image frames of the H.264 compressed code stream video include: I frame, P frame and B frame;

[0016] Using a JM decoder to obtain residual DCT coefficients of a 4x4 block of an I frame of the H.264 compressed code stream video and a prediction value in an intra-frame prediction mode of the I frame, then performing a 4x4 block DCT transform on the prediction value in the intra-frame prediction mode of the I frame, and finally adding the transform result to the residual DCT coefficients of the 4x4 block of the I frame of the H.264 compressed code stream video to obtain the DCT coefficients of the 4x4 block of the I frame;

[0017] Obtaining the residual DCT coefficients of the P frame and the B frame of the H.264 compressed code stream video and the DCT coefficients of the reference frames, and then obtaining the positions of the reference coding blocks and the DCT coefficients of the reference coding blocks according to the DCT coefficients of the reference frames of the P frame and the B frame and the motion vectors of the P frame and the B frame, and obtaining the DCT coefficients of the 4x4 blocks of the P frame and the B frame based on the obtained residual DCT coefficients of the P frame and the B frame, the positions of the reference coding blocks and the DCT coefficients of the reference coding blocks;

[0018] The DCT coefficients of the 4x4 blocks of the I frame, P frame and B frame are collectively referred to as first DCT coefficients;

[0019] The first DCT coefficient of the 4x4 block is converted into the first DCT coefficient of the 8x8 block according to the block space relationship of the DCT coefficient, so as to obtain the first DCT coefficient corresponding to the compressed code stream video.

[0020] Furthermore, in step S1, based on the obtained residual DCT coefficients of the P frame and the B frame, the positions of the reference coding blocks and the DCT coefficients of the reference coding blocks, the specific process of obtaining the DCT coefficients of the 4x4 blocks of the P frame and the B frame includes the following:

[0021] When the reference coding blocks of the P frame and the B frame are located at integer positions that are multiples of 4 pixels of the reference frame, directly adding the residual DCT coefficients of the P frame or the B frame to the DCT coefficients of the reference coding blocks of the P frame and the B frame to obtain the DCT coefficients of the 4x4 blocks of the P frame and the B frame;

[0022] When the respective reference coding blocks of the P frame and the B frame are located at integer positions that are not multiples of the reference frame pixel 4, the DCT coefficients of the respective reference coding blocks of the P frame and the B frame are obtained based on the DCT coefficients of four blocks adjacent to the respective reference coding blocks and located at integer positions that are multiples of the reference frame pixel 4, and then the respective residual DCT coefficients of the P frame and the B frame are added to the DCT coefficients of the respective reference coding blocks of the P frame and the B frame to obtain the DCT coefficients of the respective 4x4 blocks of the P frame and the B frame.

[0023] Furthermore, in step S2, the specific process of preprocessing the first DCT coefficient to obtain the second DCT coefficient includes:

[0024] Eliminate the DCT coefficients of the Cb component and the Cr component in the first DCT coefficient, retain the DCT coefficient of the Y component in the first DCT coefficient in the 416x416 format, and convert it into a 52x52x64 format, then sort the converted DCT coefficients according to ZigZag, and finally take the first 24 DCT coefficients in the sorting result, which are the second DCT coefficients.

[0025] Furthermore, in step S3, the specific process of constructing the vehicle detection model includes:

[0026] A backbone feature extraction network is constructed based on the DarkNet-53 model. The backbone feature extraction network is combined with a residual network, and features are extracted by stacking convolution and residual structures, and the size of the feature map is reduced.

[0027] Construct a regression detection network based on feature pyramid and detect vehicles on feature maps of three scales: 52x52, 26x26, and 13x13;

[0028] Determine a loss function, where the loss function includes: detection box coordinate loss, confidence loss, and classification loss.

[0029] Furthermore, in step s4, the process of acquiring the image sample set includes:

[0030] The image sizes in the open source image dataset UA-DETRAC are uniformly scaled to 416x416, and then the DCT coefficients of the compressed format images are extracted based on the Libjpeg library. The extracted DCT coefficients are then processed and the DCT coefficients of the Y component of 52x52x24 are output, which is the image sample set.

[0031] Furthermore, in step S4, the specific process of using the image sample set to train the vehicle detection model includes:

[0032] Initializing the network weights of the vehicle detection model, using normal distribution to initialize the initial network weights;

[0033] The initial learning rate of the vehicle detection model is set to 1e-4, and the Adam algorithm is used to obtain an adaptive learning rate in subsequent training;

[0034] The size of the anchor frame is set according to the label data of the image sample set using the K-means clustering method, and the idea of ​​YOLOv3 is used to set three sizes of anchor frames on the feature maps of the three scales of 52x52, 26x26, and 13x13 respectively;

[0035] Set the parameter values ​​of the vehicle detection model: detection category, batch size and number of iterations;

[0036] The vehicle detection model is trained using the image sample set.

[0037] Compared with the prior art, the present invention has the following beneficial technical effects:

[0038] This solution combines the vehicle detection method based on deep learning in the pixel domain with the method based on video compression domain information. On the one hand, it can achieve high-precision end-to-end detection, and on the other hand, it does not need to fully decode the image, greatly reducing resource consumption. BRIEF DESCRIPTION OF THE DRAWINGS

[0039] Figure 1 is a flow chart of a vehicle detection method based on compressed video DCT coefficients according to an embodiment;

[0040] Figure 2 is a schematic diagram of obtaining DCT coefficients based on a reference coding block and an adjacent block in an embodiment;

[0041] Figure 3 is a schematic diagram of the spatial relationship between a DCT block and a sub-block in an embodiment;

[0042] Figure 4 is a schematic diagram of a Zigzag arrangement of an embodiment;

[0043] Figure 5 is a backbone feature extraction network structure diagram of an embodiment;

[0044] Figure 6 A diagram showing the overall architecture of a vehicle detection model according to an embodiment;

[0045] Figure 7 A test video frame for an embodiment;

[0046] Figure 8 A vehicle detection result of an embodiment. DETAILED DESCRIPTION

[0047] In order to make the purpose, technical solution and advantages of the present application more clearly understood, the present application is further described in detail below in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present application and are not used to limit the present application.

[0048] Reference to "embodiments" herein means that a particular feature, structure, or characteristic described in conjunction with the embodiments may be included in at least one embodiment of the present application. The appearance of the phrase in various locations in the specification does not necessarily refer to the same embodiment, nor is it an independent or alternative embodiment that is mutually exclusive with other embodiments. It is explicitly and implicitly understood by those skilled in the art that the embodiments described herein may be combined with other embodiments.

[0049] The data set used in the specific implementation of the present invention is the UA-DETRAC vehicle detection data set, which contains 8250 vehicles and 1.21 million target detection frames. According to the DCT feature information extracted from the data set pictures, the vehicle detection model is trained, and then the vehicle detection of the H.264 compressed code stream is realized, and the vehicle detection of the compressed format video is realized. The specific implementation method is as follows.

[0050] like Figure 1 As shown, a vehicle detection method based on compressed video DCT coefficients includes the following steps:

[0051] S1: extracting a compressed bitstream video and obtaining a first DCT coefficient corresponding to the compressed bitstream video;

[0052] S2: preprocessing the first DCT coefficient to obtain a second DCT coefficient;

[0053] S3: construct vehicle detection model;

[0054] S4: obtaining an image sample set based on the open source image dataset UA-DETRAC, and then using the image sample set to train the vehicle detection model to obtain a vehicle detection network;

[0055] S5: Input the second DCT coefficient into the vehicle detection network for detection, and obtain the vehicle's position, type and confidence information, and then draw the vehicle's detection box, type and confidence in the decoded compressed code stream video frame based on the vehicle's position, type and confidence information. The vehicle's detection box, type and confidence are the vehicle's detection result.

[0056] In one embodiment, in step S1, the H.264 compressed code stream video is extracted to obtain the first DCT coefficient corresponding to the compressed code stream video, and the specific process includes the following:

[0057] Convert the size of the H.264 compressed code stream video to 416x416;

[0058] The image frames of the H.264 compressed code stream video include: I frame, P frame and B frame;

[0059] Using a JM decoder to obtain residual DCT coefficients of a 4x4 block of an I frame of the H.264 compressed code stream video and a prediction value in an intra-frame prediction mode of the I frame, then performing a 4x4 block DCT transform on the prediction value in the intra-frame prediction mode of the I frame, and finally adding the transform result to the residual DCT coefficients of the 4x4 block of the I frame of the H.264 compressed code stream video to obtain the DCT coefficients of the 4x4 block of the I frame;

[0060] Obtaining the residual DCT coefficients of the P frame and the B frame of the H.264 compressed code stream video and the DCT coefficients of the reference frames, and then obtaining the positions of the reference coding blocks and the DCT coefficients of the reference coding blocks according to the DCT coefficients of the reference frames of the P frame and the B frame and the motion vectors of the P frame and the B frame, and obtaining the DCT coefficients of the 4x4 blocks of the P frame and the B frame based on the obtained residual DCT coefficients of the P frame and the B frame, the positions of the reference coding blocks and the DCT coefficients of the reference coding blocks;

[0061] The DCT coefficients of the 4x4 blocks of the I frame, P frame and B frame are collectively referred to as first DCT coefficients;

[0062] The first DCT coefficient of the 4x4 block is converted into the first DCT coefficient of the 8x8 block according to the block space relationship of the DCT coefficient, so as to obtain the first DCT coefficient corresponding to the compressed code stream video.

[0063] In one embodiment, in step S1, based on the obtained residual DCT coefficients of the P frame and the B frame, the positions of the reference coding blocks, and the DCT coefficients of the reference coding blocks, the specific process of obtaining the DCT coefficients of the 4x4 blocks of the P frame and the B frame includes the following:

[0064] When the reference coding blocks of the P frame and the B frame are located at integer positions that are multiples of 4 pixels of the reference frame, directly adding the residual DCT coefficients of the P frame or the B frame to the DCT coefficients of the reference coding blocks of the P frame and the B frame to obtain the DCT coefficients of the 4x4 blocks of the P frame and the B frame;

[0065] When the respective reference coding blocks of the P frame and the B frame are located at integer positions that are not multiples of the reference frame pixel 4, the DCT coefficients of the respective reference coding blocks of the P frame and the B frame are obtained based on the DCT coefficients of four blocks adjacent to the respective reference coding blocks and located at integer positions that are multiples of the reference frame pixel 4, and then the respective residual DCT coefficients of the P frame and the B frame are added to the DCT coefficients of the respective reference coding blocks of the P frame and the B frame to obtain the DCT coefficients of the respective 4x4 blocks of the P frame and the B frame.

[0066] set up is the reference coding block, x1, x2, x3, x4 are The DCT coefficients of the four intersecting blocks are as follows: Figure 2 shown. I n Represents the identity matrix, and the formula for obtaining the DCT coefficients of the reference coding block is as follows:

[0067]

[0068] When the reference coding block is located at a fractional position, the extracted prediction value is subjected to a 4x4 block DCT transform and then added to the residual DCT coefficient to obtain the DCT coefficient.

[0069] In one embodiment, in step S1, the DCT coefficient conversion process is:

[0070] The DCT coefficients extracted from the H.264 bitstream are in 4x4 blocks, while the vehicle detection model uses 8x8 block DCT as input and converts the 4x4 block DCT coefficients into 8x8 block DCT coefficients based on the block space relationship of the DCT coefficients.

[0071] Let Y2 represent the 4x4 block DCT coefficients, represents the 8th-order DCT transform matrix, express Where T4 represents the 4th-order DCT transformation matrix, Y2 represents the 8x8 block DCT coefficients, and the schematic diagram of DCT transformation of different sizes is as follows Figure 3 As shown. The conversion relationship between 4x4 block DCT coefficients and 8x8 block DCT coefficients is as follows:

[0072]

[0073] In one embodiment, in step S2, the specific process of preprocessing the first DCT coefficient to obtain the second DCT coefficient includes:

[0074] Eliminate the DCT coefficients of the Cb component and the Cr component in the first DCT coefficient, retain the DCT coefficients of the Y component in the first DCT coefficient in the 416x416 format, and convert them into a 52x52x64 format, and then sort the converted DCT coefficients according to ZigZag, the sorting method is as follows: Figure 4 As shown, the DC coefficient in the upper left corner and 23 AC coefficients are retained, that is, one DC coefficient and the first 23 AC coefficients sorted by ZigZag in (2-3), to obtain DCT coefficients in 52x52x24 format; finally, the first 24 DCT coefficients are taken from the sorting result, which are the second DCT coefficients.

[0075] In one embodiment, in step S3, the process of constructing a vehicle detection model includes:

[0076] Construct a backbone feature extraction network based on the DarkNet-53 model. The feature extraction network structure is as follows: Figure 5 As shown in the figure, a lightweight backbone feature extraction network is constructed, and then the residual network idea is combined to extract features through convolution and stacking of residual structures to reduce the size of the feature map.

[0077] Construct a regression detection network based on feature pyramid, and detect vehicles on feature maps of three scales: 52x52, 26x26, and 13x13. Use the anchor frame idea to set anchor frames of different sizes on feature maps of different sizes, and detect vehicles based on the regression of anchor frames. The overall structure of the vehicle detection model is as follows: Figure 6 As shown, Figure 6 The DBL in the model consists of a convolutional layer, a batch normalization layer (BN) and an activation function, which realizes downsampling and feature extraction; the Resn residual module consists of a DBL and multiple residual components stacked together; the residual component consists of a DBL and a residual edge, which prevents the gradient from disappearing and improves the learning accuracy. The input is a DCT coefficient of size 52x52x24. After the feature extraction network detects vehicles on feature maps of different sizes, the final output results are 13x13x18, 26x26x18, and 52x52x18. The output results include the location of the vehicle detection frame, the type of vehicle, and the confidence information of the vehicle.

[0078] Determine the loss function, which includes: detection box coordinate loss, confidence loss and classification loss.

[0079] In one embodiment, in step s4, the process of acquiring the image sample set includes:

[0080] The image sizes in the open source image dataset UA-DETRAC are uniformly scaled to 416x416, and then the DCT coefficients of the compressed format images are extracted based on the Libjpeg library. The extracted DCT coefficients are then processed and the DCT coefficients of the Y component of 52x52x24 are output, which is the image sample set.

[0081] In one embodiment, in step S4, the specific process of using the image sample set to train the vehicle detection model includes:

[0082] Initializing the network weights of the vehicle detection model, using normal distribution to initialize the initial network weights;

[0083] The initial learning rate of the vehicle detection model is set to 1e-4, and the Adam algorithm is used to obtain an adaptive learning rate in subsequent training;

[0084] The size of the anchor frame is set according to the label data of the image sample set using the K-means clustering method, and the idea of ​​YOLOv3 is used to set three sizes of anchor frames on the feature maps of the three scales of 52x52, 26x26, and 13x13 respectively;

[0085] Set the parameter values ​​of the vehicle detection model: detection category, batch size and number of iterations;

[0086] The vehicle detection model is trained using the image sample set.

[0087] like Figure 7 As shown in FIG. 1 , a picture of a test video frame is extracted during decoding, and its DCT coefficients are processed and sent to the trained vehicle detection model. The prediction result obtained by mapping on the decoded video frame is as follows: Figure 8 As shown, the detection results include the vehicle's detection frame, type and confidence level. Figure 8 It can be seen that the present invention can utilize the information in compressed format images combined with deep learning to achieve good detection effects.

[0088] The technical features of the above embodiments may be arbitrarily combined. To make the description concise, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.

[0089] It should be noted that the terms "first\second\third" involved in the embodiments of the present application are only used to distinguish similar objects, and do not represent a specific order for the objects. It is understandable that the specific order or sequence of "first\second\third" can be interchanged where permitted. It should be understood that the objects distinguished by "first\second\third" can be interchanged where appropriate, so that the embodiments of the present application described herein can be implemented in an order other than those illustrated or described herein.

[0090] The terms "including" and "having" and any variations thereof in the embodiments of the present application are intended to cover non-exclusive inclusions. For example, a process, method, device, product, or equipment that includes a series of steps or modules is not limited to the listed steps or modules, but may optionally include steps or modules that are not listed, or may optionally include other steps or modules that are inherent to these processes, methods, products, or equipment.

[0091] The above-mentioned embodiments only express several implementation methods of the present application, and the descriptions thereof are relatively specific and detailed, but they cannot be understood as limiting the scope of the invention patent. It should be pointed out that, for a person of ordinary skill in the art, several variations and improvements can be made without departing from the concept of the present application, and these all belong to the protection scope of the present application. Therefore, the protection scope of the patent of the present application shall be subject to the attached claims.

Claims

1. A vehicle detection method based on compressed video DCT coefficients, characterized in that: The steps include: S1: extracting a compressed bitstream video and obtaining a first DCT coefficient corresponding to the compressed bitstream video; S2: preprocessing the first DCT coefficient to obtain a second DCT coefficient; S3: construct vehicle detection model; S4: obtaining an image sample set based on the open source image dataset UA-DETRAC, and then using the image sample set to train the vehicle detection model to obtain a vehicle detection network; S5: inputting the second DCT coefficient into the vehicle detection network for detection, and obtaining the position, type and confidence information of the vehicle, and then drawing the detection frame, type and confidence of the vehicle in the decoded compressed code stream video frame based on the position, type and confidence information of the vehicle, wherein the detection frame, type and confidence of the vehicle are the detection result of the vehicle; The compressed code stream video is an H.264 compressed code stream video; In the step S1, the H.264 compressed code stream video is extracted to obtain the first DCT coefficient corresponding to the compressed code stream video. The specific process includes the following: Convert the size of the H.264 compressed code stream video to 416x416; The image frames of the H.264 compressed code stream video include: I frame, P frame and B frame; Using a JM decoder to obtain residual DCT coefficients of a 4x4 block of an I frame of the H.264 compressed code stream video and a prediction value in an intra-frame prediction mode of the I frame, then performing a 4x4 block DCT transform on the prediction value in the intra-frame prediction mode of the I frame, and finally adding the transform result to the residual DCT coefficients of the 4x4 block of the I frame of the H.264 compressed code stream video to obtain the DCT coefficients of the 4x4 block of the I frame; Obtaining the residual DCT coefficients of the P frame and the B frame of the H.264 compressed code stream video and the DCT coefficients of the reference frames, and then obtaining the positions of the reference coding blocks and the DCT coefficients of the reference coding blocks according to the DCT coefficients of the reference frames of the P frame and the B frame and the motion vectors of the P frame and the B frame, and obtaining the DCT coefficients of the 4x4 blocks of the P frame and the B frame based on the obtained residual DCT coefficients of the P frame and the B frame, the positions of the reference coding blocks and the DCT coefficients of the reference coding blocks; The DCT coefficients of the 4x4 blocks of the I frame, P frame and B frame are collectively referred to as first DCT coefficients; Converting the first DCT coefficient of the 4x4 block into the first DCT coefficient of the 8x8 block according to the block space relationship of the DCT coefficient, that is, obtaining the first DCT coefficient corresponding to the compressed bitstream video; In step S1, based on the obtained residual DCT coefficients of the P frame and the B frame, the positions of the reference coding blocks, and the DCT coefficients of the reference coding blocks, the specific process of obtaining the DCT coefficients of the 4x4 blocks of the P frame and the B frame includes the following: When the reference coding blocks of the P frame and the B frame are located at integer positions that are multiples of 4 pixels of the reference frame, directly adding the residual DCT coefficients of the P frame or the B frame to the DCT coefficients of the reference coding blocks of the P frame and the B frame to obtain the DCT coefficients of the 4x4 blocks of the P frame and the B frame; When the reference coding blocks of the P frame and the B frame are located at integer positions that are not multiples of the reference frame pixel 4, the DCT coefficients of the reference coding blocks of the P frame and the B frame are obtained according to the DCT coefficients of four blocks adjacent to the respective reference coding blocks and located at integer positions that are multiples of the reference frame pixel 4, and then the residual DCT coefficients of the P frame and the B frame are respectively added to the DCT coefficients of the reference coding blocks of the P frame and the B frame to obtain the DCT coefficients of the 4x4 blocks of the P frame and the B frame; In step S2, the specific process of preprocessing the first DCT coefficient to obtain the second DCT coefficient includes: Eliminate the DCT coefficients of the Cb component and the Cr component in the first DCT coefficient, retain the DCT coefficients of the Y component in the first DCT coefficient in a 416x416 format, and convert them into a 52x52x64 format, and then sort the converted DCT coefficients according to ZigZag, and finally take the first 24 DCT coefficients in the sorting result, which are the second DCT coefficients; In step S3, the specific process of constructing the vehicle detection model includes: A backbone feature extraction network is constructed based on the DarkNet-53 model. The backbone feature extraction network is combined with a residual network, and features are extracted by stacking convolution and residual structures, and the size of the feature map is reduced. Construct a regression detection network based on feature pyramid and detect vehicles on feature maps of three scales: 52x52, 26x26, and 13x13; Determine a loss function, where the loss function includes: detection box coordinate loss, confidence loss, and classification loss; In step s4, the process of acquiring the image sample set includes: The image sizes in the open source image dataset UA-DETRAC are uniformly scaled to 416x416, and then the DCT coefficients of the compressed format images are extracted based on the Libjpeg library. Then, the extracted DCT coefficients are processed and the DCT coefficients of the Y component of the image are output as 52x52x24, which is the image sample set. In step S4, the specific process of using the image sample set to train the vehicle detection model includes: Initializing the network weights of the vehicle detection model, using normal distribution to initialize the initial network weights; The initial learning rate of the vehicle detection model is set to 1e-4, and the Adam algorithm is used to obtain an adaptive learning rate in subsequent training; The size of the anchor frame is set according to the label data of the image sample set using the K-means clustering method, and the idea of ​​YOLOv3 is used to set three sizes of anchor frames on the feature maps of the three scales of 52x52, 26x26, and 13x13 respectively; Set the parameter values ​​of the vehicle detection model: detection category, batch size and number of iterations; The vehicle detection model is trained using the image sample set.