Automobile emission detection method

By combining video image recognition and OBD data, a personalized emission prediction model is established, which solves the problem of low vehicle exhaust emission detection accuracy in the existing technology and achieves more accurate and efficient emission monitoring.

CN118675122AActive Publication Date: 2024-09-20平邑县交通运输事业服务中心

Patent Information

Application Number
CN202410994927.5
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-07-24
Publication Date
2024-09-20
Estimated Expiration
2044-07-24

AI Technical Summary

Technical Problem

Existing vehicle exhaust emission monitoring methods have low detection accuracy and cannot fully reflect the emission status of all vehicles in the urban environment. Moreover, traditional methods are costly and difficult to distinguish the emission contributions of different types of vehicles.

Method used

By obtaining video images and road information of the detected road section, image recognition technology is used to obtain vehicle brand and model information, and combined with OBD port data and machine learning models, a personalized emission prediction model is established to distinguish different vehicle types and conduct accurate detection.

Benefits of technology

It improves the accuracy and efficiency of vehicle exhaust emission detection, can more accurately reflect the actual emission levels of each vehicle, expands the detection range, and reduces detection costs.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118675122A
    Figure CN118675122A
Patent Text Reader

Abstract

The invention discloses an automobile emission detection method, and belongs to the technical field of energy emission, and the method comprises the steps: obtaining a video image and road information of vehicle monitoring of a detection road section; vehicle information in the video image is obtained through image recognition; according to the obtained vehicle information, the vehicle is divided into a first detection vehicle and a second detection vehicle according to a preset OBD port configuration database, the first detection vehicle is a vehicle configured with an OBD port, and the second detection vehicle is a vehicle not configured with an OBD port; for the first detected vehicle, vehicle instantaneous emission data are obtained through wireless communication with the vehicle-mounted OBD equipment, and the emission within the preset time period is calculated to serve as first predicted emission; for the second detection vehicle, using a vehicle emission prediction model trained based on a machine learning algorithm to obtain a second predicted emission amount; according to the obtained road information, the predicted emission amount is corrected through a correction coefficient; in order to solve the problem of low emission detection precision, the detection precision is improved through vehicle fine classification and the like.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The invention relates to the technical field of energy emission, and in particular to a method for detecting automobile emission. Background Art

[0002] With the rapid development of economy, the expansion of urban scale, and the rapid increase of automobile ownership. Various emissions in automobile exhaust, such as nitrogen oxides and hydrocarbons, are one of the main sources of urban air pollution. Automobile exhaust emissions cause serious harm to human health and ecological environment. How to accurately monitor and evaluate automobile exhaust emissions in urban environment has become an important task for environmental protection departments.

[0003] At present, automobile exhaust emission monitoring often uses portable emission testers to measure sample vehicles on site. However, this method has limited test samples and cannot fully reflect the overall emission status of all vehicles in use in the urban environment. Another monitoring method is to set up roadside emission monitoring stations and make inferences by monitoring vehicle emissions on the road section. However, traditional monitoring station equipment is expensive and it is difficult to distinguish the emission contributions of vehicles of different models. Some video image detection systems based on simple matching models can distinguish emissions based on vehicle models, but the recognition accuracy is limited, and differences such as vehicle age and OBD ports are not considered, resulting in large emission prediction errors. Therefore, how to use image technology to accurately obtain vehicle information and establish an accurate emission prediction model is a current technical problem to improve the accuracy of automobile emission monitoring.

[0004] In the related art, for example, Chinese patent document CN116704761A provides a method, system, device and medium for detecting automobile emissions, including the following steps: obtaining road information of the detection section and vehicle monitoring video in the detection section within the detection time scale; obtaining vehicle information of the detection vehicle according to the vehicle monitoring video; classifying the detection vehicle according to the vehicle information, and dividing the detection vehicle into a first detection vehicle and a second detection vehicle; calculating the first vehicle emissions of the first detection vehicle based on the first emission detection method; calculating the second vehicle emissions of the second detection vehicle based on the second emission detection method; determining the total vehicle emissions of the detection section within the detection time scale based on the first vehicle emissions and the second vehicle emissions. However, this application only determines the vehicle type from the monitoring video for simple classification, which cannot accurately reflect the actual emission level of each vehicle, and the emission detection accuracy needs to be further improved. Summary of the invention

[0005] 1. Technical issues to be solved In view of the problem of low emission detection accuracy in the prior art, the present invention provides a method for detecting automobile emissions, which improves the detection accuracy of automobile emissions by subclassifying vehicles and adopting different detection methods.

[0006] 2. Technical solution The embodiment of this specification provides a method for detecting automobile emissions, including: obtaining a video image and road information of vehicle monitoring on a detection section, the road information including the number of lanes, road speed limit, traffic conditions, and ambient temperature and humidity; Image recognition is used to obtain vehicle information in video images. Vehicle information includes vehicle brand and vehicle model. Vehicles of different brands and models have different engines and emission systems, and their emission characteristics are also different. By obtaining accurate brand and model information through image recognition, personalized emission prediction models for different models can be established. Compared with simple model matching methods, image recognition can obtain richer vehicle information and improve the accuracy of information acquisition. Convolutional neural networks using attention mechanisms can improve the accuracy of brand recognition. Combining year information can distinguish the differences between vehicles of the same model and different ages, and improve model recognition effects. The application of cutting-edge image recognition technologies such as deep learning can improve the accuracy of vehicle information extraction. Obtaining refined vehicle brand and model information helps to establish a high-precision emission prediction model and achieve personalized prediction. Image recognition can perform contactless and dynamic vehicle detection, expand the detection range, and improve detection efficiency. Using the image recognition vehicle brand and model technical solution, rich and accurate vehicle information can be obtained, and a refined emission prediction model can be established, thereby improving the detection accuracy and effect of automobile emission monitoring.

[0007] According to the acquired vehicle information, the vehicles on the detection section are divided into the first detection vehicle and the second detection vehicle according to the preset OBD port configuration database, wherein the first detection vehicle is a vehicle configured with an OBD port, and the second detection vehicle is a vehicle not configured with an OBD port; the OBD port can directly obtain various operating data of the vehicle-mounted electronic control system, which is an important means of detecting vehicle emissions. However, not all vehicle models are equipped with an OBD port. Different detection methods can be applied in a targeted manner by distinguishing vehicles according to the OBD port. For the first detection vehicle configured with an OBD port, the real-time emission data of the vehicle can be directly obtained through the OBD port. For the second detection vehicle not configured with an OBD port, it is necessary to detect it through video image recognition and emission prediction models. The classification of vehicle types clarifies the detection strategies of different vehicles, which is conducive to improving the detection accuracy. The preset OBD port configuration database can accurately determine the OBD port status of the vehicle and perform accurate classification. This application combines the two methods of OBD emission data and model prediction, expands the detection range, and improves the detection accuracy. Personalized detection strategies are adopted for different types of vehicles, which conforms to the design ideas of refinement and intelligence. This application can apply the optimal detection method in combination with the actual situation of the vehicle to improve the overall monitoring effect. In summary, the present application can perform targeted emission detection according to the configuration of the vehicle's OBD port and improve accuracy by combining different detection methods.

[0008] For the first detected vehicle, the instantaneous emission data of the vehicle is obtained through wireless communication with the on-board OBD device, and the emission within a preset time period is calculated as the first predicted emission; a wireless communication protocol that meets international standards is adopted, such as the DSRC protocol designed specifically for the Internet of Vehicles, to ensure the security and reliability of the communication process; a number of communication base stations are set up on the detection section, and the on-board OBD device automatically connects to the base station after entering the communication range; the OBD device has a built-in unique ID, which is bound and registered with the vehicle VIN to ensure that the data source is authentic and reliable; the OBD device collects engine operating parameters at a certain frequency and calculates the instantaneous emission; the base station collects the instantaneous emission within the time period and calculates the total emission according to the preset algorithm model; the total emission calculation algorithm takes into account the influence of factors such as vehicle speed, load, and idling, and adopts a verified emission mapping relationship; in order to reduce the communication volume, the OBD device can perform preliminary data filtering and integration locally, and upload the streamlined results; the base station adopts data caching and redundancy mechanisms to ensure that the original data uploaded by the OBD is not lost; the instantaneous emission data is securely encrypted to avoid illegal modification during wireless transmission.

[0009] For the second detected vehicle, the vehicle emission prediction model trained based on the machine learning algorithm is used to obtain the second predicted emission. Static and dynamic data of the vehicle including multi-dimensional information such as vehicle model, vehicle age, driving speed, and road conditions are collected to construct a sample data set. The data set is preprocessed to remove abnormal data, one hot encode the classified data, and normalize the data. An end-to-end deep learning emission prediction model based on a convolutional neural network is constructed. The model includes structures such as convolutional layers, pooling layers, and fully connected layers. The Adam optimization algorithm is used to train the model, and the early stopping method is used to avoid overfitting. At the same time, L2 regularization is used to prevent the model from being too complex. The k-fold cross validation is used to evaluate the model training effect, and the model with the smallest cross validation loss is selected. The test set is used to evaluate the model accuracy, and the indicators used include R2Score, mean absolute error, etc. When the model accuracy reaches the preset threshold requirement, the model is saved for prediction. For the second detected vehicle, feature information is extracted and input into the trained emission prediction model to obtain the emission prediction results of indicators such as CO2, HC, and NOx. A confidence interval is set for the model prediction results, and prediction samples with insufficient confidence are filtered out. The filtered samples are accumulated over time to calculate the total emission prediction of the second detection vehicle.

[0010] According to the acquired road information, the first predicted emissions and the second predicted emissions are respectively corrected by the correction coefficient; the first predicted emissions come from the vehicle OBD system, and the data is accurate and reliable, but there may be systematic deviations. The second predicted emissions come from the model prediction, which may be affected by the environment and have errors. Road information reflects the actual operating environment of the vehicle and can be used to correct the prediction deviation. The correction coefficient can be calculated based on factors such as road speed limit and traffic conditions. Correcting the two types of emissions separately can make the correction more accurate and targeted. The corrected emissions can better reflect the emission level under actual road conditions. Correction with the help of road information can reduce the systematic error of the predicted emissions. This application combines the car's own data and operating environment data to make the prediction results more accurate. The correction technology is in line with the design idea of ​​using multi-source heterogeneous data to improve detection accuracy. This application combines detection and correction technology, which can effectively improve the accuracy of emission prediction. In summary, this application follows the idea of ​​data fusion and improves the accuracy of emission prediction through correction.

[0011] The total emissions of the detected road section are calculated based on the corrected first predicted emissions and the second predicted emissions; the first predicted emissions (vehicles equipped with OBD ports) and the second predicted emissions (vehicles not equipped with OBD ports) have been adjusted by the correction coefficient and have high accuracy. The predicted emissions of the two types of vehicles are combined to evaluate the overall emission level of the entire road section. Compared with the detection of only one type of vehicle, the detection range can be expanded and the representativeness can be improved. Combined with personalized detection of different types of vehicles, the total emission calculation can be more accurate. Calculating vehicle flow based on video images can accurately reflect the actual number of vehicles on the road section. Combined with flow parameters, the absolute amount of overall emissions of the road section can be quantified. Compared with existing detection that only obtains instantaneous emissions in a certain period of time, this application can comprehensively evaluate the overall emission contribution of the road section. Calculating the total emissions of the road section meets the monitoring objectives of evaluating regional emission pollution. This application integrates multi-source data for overall detection, expands the scope of monitoring, and improves the systematic nature of detection. Calculating total emissions is a key output indicator for accurate and dynamic emission monitoring. In summary, this application can make full use of images, models and corrected prediction results to comprehensively calculate the total emissions of road sections and improve the accuracy and effectiveness of emission monitoring.

[0012] Among them, the road speed limit is the speed limit of the detection section; the traffic condition is the traffic flow and average speed of the detection section. The road speed limit directly affects the actual operating speed of the vehicle and is a necessary parameter for establishing an accurate emission prediction model. The traffic flow determines the number of vehicles on the road section and is the basis for calculating the total emissions. The average speed reflects the actual operating status of the vehicle and is highly correlated with the emission characteristics. The combination of speed limit and average speed can accurately infer the acceleration and deceleration of the vehicle. By mastering the detailed traffic conditions of the road section, an emission prediction model can be established in a targeted manner. Obtaining the parameters of the traffic conditions is the supervisory information for model training. The traffic conditions directly determine the working state of the vehicle, and obtaining relevant data can reduce the state judgment error. Accurate parameters can improve the environmental adaptability and robustness of the emission prediction model. Obtaining key influencing factors as model input is an important part of building an accurate model. Full consideration of parameters helps to improve the detection accuracy of the model on actual roads. In summary, obtaining parameters such as speed limit and traffic conditions is the basis for establishing a refined emission prediction model and a necessary means to improve the actual detection accuracy.

[0013] Furthermore, the vehicle information in the video image is obtained by using image recognition. The vehicle information includes the vehicle brand and vehicle model, and includes the following steps: for the obtained video image, an interpretable instance segmentation algorithm is used to obtain a vehicle picture containing the entire vehicle; instance segmentation can accurately extract the image area containing the complete vehicle. Compared with the bounding box, instance segmentation can provide richer whole vehicle feature information. The attention mechanism can output the explanation of the vehicle area extraction to improve the transparency of the algorithm. Obtaining the whole vehicle image can more comprehensively represent the vehicle features. The whole vehicle image is conducive to the subsequent extraction of large-scale features, such as body lines. Extracting the complete vehicle image can significantly improve the recognition effect of vehicle model details.

[0014] High-quality vehicle images are conducive to the accuracy of subsequent vehicle model and brand recognition. Extracting the overall vehicle image is an important pre-processing step to obtain detailed vehicle information. Improving the quality of vehicle area extraction will directly affect the subsequent feature extraction and recognition effects. In summary, this application lays a data foundation for building a refined emission prediction model by improving the integrity of vehicle image acquisition. Advanced instance segmentation algorithms such as Mask RCNN can achieve accurate vehicle extraction, and can also be: PN (Feature Pyramid Network) FPN uses multi-scale features for instance segmentation, which can detect objects of different sizes and is suitable for vehicle extraction; YOLACT is a fast instance segmentation algorithm with fast speed and high accuracy, suitable for real-time vehicle segmentation; Polar Mask converts instance segmentation into a multi-classification problem in polar coordinates, which improves the segmentation speed; Blend Mask fuses semantic segmentation network and instance segmentation network to achieve high-quality instance segmentation; Center Mask uses center point detection to assist instance segmentation to improve the segmentation effect of small targets; YOLACT Edge is a lightweight real-time instance segmentation algorithm suitable for edge computing.

[0015] The acquired vehicle images are filtered and denoised using an image defogging algorithm based on deep learning; the deep learning defogging algorithm can directly remove fog from the image through an end-to-end network structure. Multi-scale feature extraction and long-distance skip connection design can capture the features affected by fog at different distances. The end-to-end defogging and restoration can be achieved by using an encoding and decoding structure containing a residual network. Median filtering can effectively suppress Gaussian noise and smooth vehicle images. The deep learning denoising network performs image denoising through an autoencoder structure to extract clear vehicle features. High-quality vehicle images will significantly improve the effects of subsequent vehicle model recognition and vehicle body information extraction. Extracting refined vehicle body and brand features can establish a more accurate emission prediction model. Clear vehicle images can restore more effective details, which is conducive to feature extraction. Image enhancement can enhance contrast and contours, further highlighting vehicle differences. Image filtering and denoising are key steps in obtaining an ideal vehicle information source. In summary, this application improves image quality through deep learning, provides a reliable source for obtaining refined vehicle information, and will help improve the accuracy of subsequent emission predictions.

[0016] The processed vehicle image is input into a convolutional neural network based on the attention mechanism to obtain the vehicle brand; the feature extraction model based on networks such as ResNet is used to learn global and local features from the vehicle image. The spatial and frequency domain attention mechanisms are used to make the network focus on the key features of the vehicle logo area. The attention mechanism can enhance the expressiveness of the vehicle logo features through weight distribution. The global and local features are integrated and input into the brand classification network for multi-label classification. Anchor frames are set for the vehicle logo area and the vehicle body area to improve the positioning ability of the vehicle logo. Angle classification is used to improve the detection of vehicle logos in different directions. The network outputs the vehicle logo area frame and classification results to represent the detected brand information. A large amount of vehicle brand data is used for network training to improve the detection robustness. The relationship between vehicle logos is mined as prior knowledge to guide more accurate brand detection. Deep learning improves brand recognition capabilities in complex environments. Accurate brand information is obtained and refined emission prediction models for different brands are constructed. In summary, this application can effectively obtain vehicle brand information and provide possibilities for improving subsequent emission predictions.

[0017] Input the processed vehicle image into the convolutional neural network combined with the model year classification to obtain the vehicle model containing year information; build a model feature extraction model based on VGG, Inception and other networks to learn features such as body lines. Set the classification head of model data of different years and perform multi-task joint learning. Use the year classification head to predict the age of the vehicle and obtain the production time information. The year classification head can adopt the CNN structure based on time series. Incorporate the year prediction into the model classification head as auxiliary information. The model classification head outputs the specific model classification result. When training the network, optimize the two tasks of model classification and year classification at the same time. Model data of different ages can better construct time-related features. Obtain model data containing accurate year information. Establish a model that associates vehicle age and emissions to improve prediction accuracy. Distinguish the emission differences between vehicles of the same model and different ages. In summary, this application can obtain rich vehicle model and year information, providing strong support for building a refined emission prediction model.

[0018] The obtained vehicle brand and vehicle model are input into the convolutional neural network based on the confidence fusion algorithm to obtain the vehicle information recognition result. The prediction results and confidence of vehicle brand recognition and vehicle model recognition are obtained respectively. The confidence of the two recognition tasks is analyzed and the confidence weight is set. When the confidence of a task is low, a higher weight is given to the other task. The two recognition results and weights are input into the fusion module. The fusion module contains a cascade structure of a convolutional network and a fully connected network. The network learns the associated features of the brand and model results and performs confidence fusion. The final vehicle information recognition result of the two tasks is output. Confidence fusion improves recognition robustness through weight adjustment. The combination of the two types of information can be mutually verified and corrected. The cascade network gradually adjusts the weights for deep fusion. Finally, the accurate brand and model information of the vehicle is output. Detailed vehicle information can establish a highly targeted emission prediction model. In summary, this application improves recognition stability and obtains detailed vehicle information through confidence fusion, providing support for subsequent improvement of emission detection accuracy.

[0019] Furthermore, for the acquired video images, an interpretable instance segmentation algorithm is used to obtain a vehicle image containing the entire vehicle, including the following steps: jointly training the Mask RCNN instance segmentation model using a real vehicle image sample dataset and a fake vehicle sample dataset generated based on a generative adversarial network; collecting and annotating a large number of real vehicle images to build a high-quality sample dataset. Using generative models such as Style GAN, learn the distribution of real samples and generate fake vehicle images. The generated samples maintain the consistency of vehicle texture and color style and enhance sample diversity. The real samples and generated samples are mixed in a certain proportion and then batch trained. The generated samples are used as negative samples and the real samples are used as positive samples for adversarial training. The MaskRCNN model includes RPN, RoI Align and other modules for vehicle extraction scoring. Adversarial training strengthens the model's recognition ability for real vehicles. Mixed sample training improves the model's robustness to complex scenes. Diverse training samples avoid model overfitting and improve generalization. Obtain more accurate and stable vehicle instance segmentation results. Improve the effect of subsequent vehicle feature extraction and brand recognition. Accurate vehicle segmentation is conducive to building an efficient emission prediction model. In summary, the adversarial training and data enhancement of this application can improve the effect of instance segmentation and provide stable support for subsequent emission prediction. Among them, Generative Adversarial Networks (GAN) is a generative model that can learn the distribution characteristics of training data through adversarial training and generate new samples. In this scheme, GAN is used to generate fake vehicle images as additional training samples. The specific steps include: collecting real vehicle images as real samples, including images of various models and scenes. Use generative models such as variational autoencoders (VAE) to learn the feature distribution of real samples. Establish a GAN model structure including a generator and a discriminator. The generator attempts to generate realistic fake vehicle samples, and the discriminator attempts to distinguish between real and fake samples. Through adversarial training, the generator produces high-quality fake vehicle images with feature distribution consistent with real samples. Mix the fake samples generated by GAN with real samples as training data for Mask RCNN. Increase the number and diversity of samples and improve the generalization ability of the model. Synthesize data enhancement technology to expand the model's adaptability and enhance the model's robustness. In summary, the fake vehicle samples generated by GAN are a simulation of the real distribution, and as supplementary samples, they can improve the effect of the instance segmentation model.

[0020] An attention mechanism is added to the Mask RCNN instance segmentation model to extract images of the target vehicle area; an attention branch is added after the Feature Pyramid Network (FPN) module of Mask RCNN. The attention module learns the attention weights of each area and outputs an attention map. The FPN feature map is weighted with attention to enhance the feature expression of the target vehicle. Spatial attention and channel attention are set to focus on key positions and semantic features respectively. The attention mechanism provides model segmentation explanation and increases the interpretability of the results. Mask RCNN extracts target area features based on RoI Align. Outputs a picture containing a complete vehicle based on the Mask prediction result. Attention strengthens the target vehicle features and improves the segmentation effect of small targets and occluded targets. Extracting high-quality and complete vehicle images is beneficial for subsequent vehicle model recognition. Clear whole vehicle images provide a richer source of feature information. Improve instance segmentation accuracy and obtain more accurate vehicle information. It is conducive to building an efficient vehicle emission prediction model. In summary, the present application can enhance the segmentation effect of the target vehicle and obtain better vehicle area images. Among them, the target vehicle area refers to the image area of ​​a single vehicle obtained after instance segmentation by the Mask RCNN model. In this application, in order to improve the feature extraction capability of key areas, an attention mechanism is introduced in Mask RCNN. Specifically, an attention module similar to CBAM or ECA is added to the backbone feature extraction network of the model. These modules can learn to focus on key features in spatial position or channel direction, thereby enhancing the feature expression of the target area. When performing vehicle instance segmentation, the attention module will produce a higher activation coefficient for the area containing the vehicle. In subsequent operations such as RoI Align, the vehicle target area will obtain more focused feature extraction. In the end, Mask RCNN can segment out a target area image with obvious vehicle features. This instance segmentation network with integrated attention mechanism can significantly improve the recognition and positioning capabilities of specific targets, thereby improving the effects of subsequent vehicle model recognition and VIN code reading.

[0021] The trained Mask RCNN instance segmentation model is used to perform instance segmentation on the input video image to obtain the segmentation result image containing the target vehicle; the ImageNet pre-trained model is used to extract spatial semantic features for the input vehicle video image. Multi-scale semantic feature maps are obtained based on the feature pyramid network (FPN). The attention module learns the attention of each region to enhance the characteristics of the target vehicle. Potential vehicle proposals are generated based on the anchor box and the Proposal network. The RoI Align module accurately extracts the proposed region features. The prediction subnetwork outputs the instance segmentation Mask result. The target vehicle region image is extracted according to the Mask. The model is trained end-to-end to achieve vehicle instance segmentation. The Mask RCNN integrated framework improves real-time performance. The attention mechanism improves the segmentation effect of small targets and occluded vehicles. Extracting high-definition whole vehicle images is conducive to the subsequent acquisition of detailed features. High-quality vehicle segmentation images are conducive to the construction of accurate emission prediction models. In summary, the present application can achieve accurate video vehicle segmentation and obtain key vehicle region images.

[0022] The obtained segmentation result image is semantically segmented to obtain a binary vehicle body mask image containing vehicle body, window and light pixels as the vehicle image. Semantic segmentation is performed using a fully convolutional network based on an encoder-decoder. The encoder extracts semantic features through networks such as ResNet. The decoder upsamples to restore the resolution and outputs the semantic prediction results. The network performs multi-category predictions for categories such as vehicle body, window, and light. Image cascading is used to improve the segmentation effect of small targets such as lights. The prediction results are post-processed to generate a binary mask of the vehicle body. The mask retains the contour features of the vehicle body, which is conducive to vehicle model recognition. The position of windows and lights indicates the body structure, which is conducive to detail analysis. Accurate binary vehicle body masks are conducive to efficient background removal. Extract key vehicle components and construct refined features. A high-quality vehicle body area map will improve the subsequent brand recognition effect. It is conducive to establishing a fine-grained emission prediction model that considers more factors. In summary, this application can obtain key vehicle body features. Among them, after obtaining the vehicle area image output by the Mask RCNN instance segmentation network, further semantic segmentation can extract the main components of the vehicle. The semantic segmentation model based on the fully convolutional network is used here, which can classify each pixel and obtain images of different semantic categories. The model will identify key parts such as "body", "window", and "headlight" in the vehicle image. Then, based on the semantic masks of these parts, a binary mask image representing the main area of ​​the vehicle is generated. The specific method is to superimpose the semantic masks of the vehicle components such as "body", "window", and "headlight" to obtain the pixel distribution of the main features of the vehicle. Based on this pixel distribution, a binary mask image is generated, and only the area with significant main features of the vehicle is retained, and irrelevant background is removed. The binary vehicle main body mask image obtained in this way can fully contain the main identification feature information of the vehicle. It provides more accurate positioning support for subsequent model and brand recognition and VIN code detection, and improves the processing effect. The introduction of this additional semantic segmentation processing link can further improve the accuracy of vehicle information recognition.

[0023] Furthermore, the obtained vehicle image is filtered and denoised using an image defogging algorithm based on deep learning, including the following steps: using a deep neural network defogging algorithm based on dark channel prior to defog the fog component in the vehicle image; constructing an end-to-end multi-scale convolutional neural network, and inputting the fogged image for defogging. The network includes a detail enhancement module to learn local image features and restore vehicle details. The network predicts dark channel prior to estimate the atmospheric light value. The network predicts a transmission map to represent the transmittance of each area of ​​the image. The image is defogged and restored according to the atmospheric light and the transmission map. The interpretable attention module outputs a defogging explanation to improve the credibility of the algorithm. Fog causes loss of vehicle edge and detail fusion, and defogging can restore clear features. A clear vehicle outline is conducive to accurate recognition of vehicle models and logos. Removing fog can restore the true color of the vehicle body and facilitate the extraction of color features. Restoring windows and lights can indicate the vehicle body structure and obtain additional features. High-quality defogging images will greatly improve the effect of subsequent vehicle information extraction. Extracting more accurate vehicle features can establish a more reliable emission prediction model.

[0024] The defogging vehicle image is filtered and preprocessed using the median filter algorithm; the median filter calculates the median of the pixels in the image area and replaces the central pixel value. The median filter can smoothly remove the salt and pepper noise and retain the edge details. Calculate the median of the local window of the image, and the parameter can adjust the window size. Perform a sliding window median filter on the entire defogging vehicle image. Remove image noise points and improve the clarity and continuity of the vehicle contour and lines. The median filter retains the edge features of the vehicle body and does not blur the texture of the vehicle logo. Restore the boundaries of the lights and windows to indicate the vehicle body structure information. Ensure that the key texture features of the vehicle are not interfered by noise and improve feature expression. Smooth the body color to help extract the main color of the body. Preprocessing improves the robustness of the subsequent vehicle model recognition algorithm. Clear and continuous edges are conducive to establishing contour features such as find Contours. The main steps of the findContours function are: find contour points in the element, which form a closed curve. Classify all contour points and identify which contour points form the boundary of the same object. Extract the contour features of the object, including contour area, perimeter, center point coordinates, etc. The extracted contours are optimized and redundant points are removed. The APPROXPOLY method can achieve polygonal approximation of the contours. The final output includes the organizational information (point set list) of each independent contour. High-quality pre-processed images will improve the vehicle detail analysis effect.

[0025] The vehicle images pre-processed by filtering are denoised using a deep denoising neural network based on an encoder-decoder structure; the encoder uses a network such as ResNet to extract global semantic information of the vehicle image. The decoder module gradually upsamples to restore the high-resolution image. Skip connections are set to retain the low-level detail features of the encoder. The network is trained end-to-end to learn the prior knowledge of denoising. The autoencoder network structure reconstructs the denoised vehicle image. The noise is predicted and removed using residual learning. The attention mechanism focuses on the denoising of the key areas of the logo and contour. After denoising, the clear continuity of the logo and the edges of the vehicle body can be restored. The contours of the windows and lights are clearer to indicate the vehicle body structure. The original details of the vehicle body color and paint are restored. Clear detail features are conducive to constructing the feature expression of the vehicle model. High-quality vehicle images can improve the subsequent brand recognition effect. Denoising improves the stability of feature extraction, which is beneficial to the accuracy of emission prediction.

[0026] The image enhancement algorithm based on adaptive Gamma correction is used to enhance the vehicle image after denoising. The global Gamma value of the image is calculated, and the Gamma adjustment is performed on the area with too low contrast. The contrast of the dark logo and contour area is enhanced only by using local Gamma mapping. The calculation of the Gamma value is combined with the image histogram analysis results. The enhancement strength is adaptively determined to avoid the distortion of the vehicle body color. Gamma correction can restore the edge gradient of the vehicle logo and enhance its texture characteristics. The significance of the contour, window and light boundary is improved, which is conducive to structural analysis. The global and local enhancements are integrated to enhance the image layering. The main body color and logo details are enhanced to facilitate feature expression. The original visual effect of the vehicle is retained to ensure the authenticity of the enhancement. The enhanced fine features are conducive to the construction of the vehicle model discrimination model. The clear vehicle details are conducive to subsequent brand recognition. Image enhancement improves stability and provides high-quality visual sources for emission prediction. In summary, this image enhancement technology can improve the expression of vehicle features and provide support for the subsequent improvement of emission detection accuracy.

[0027] Furthermore, the filtering preprocessing of the defogging vehicle images by using the median filtering algorithm includes the following steps: collecting noise-free vehicle images and vehicle image samples with different degrees of Gaussian noise added; collecting a large number of high-definition vehicle images as noise-free samples. Adding Gaussian noise with different parameters to the sample images to simulate different degrees of noise. Gaussian noise parameters include mean, standard deviation, etc. to control the noise size. The added noise type can be extended to salt and pepper noise, etc., to increase sample diversity. Noise samples focus on key areas such as vehicle logos, vehicle body edges, and contours. Constructing image pairs with different noise levels as training data for the image denoising network. The training network learns the prior knowledge and mapping relationship of denoising. Noise data enhances the robustness of the network and improves the denoising ability under different environments. Clear vehicle images provide richer features, such as edges and contours. It is conducive to building a more stable vehicle model recognition and vehicle detection model. Reduce the interference of environmental noise on subsequent feature extraction. Improve the quality of vehicle information acquisition, which is conducive to improving the accuracy of emission prediction. In summary, constructing a sample set of noisy data will improve the denoising performance.

[0028] Train the convolutional neural network model to determine the image noise type and noise point density, output the noise type and the corresponding noise point distribution characteristics; construct an image data set containing different noise types, such as Gaussian noise, salt and pepper noise, etc. Use a convolutional neural network, including structures such as convolution layers and pooling layers. The network inputs an image and outputs a multi-classification judgment of the noise type. Add sub-branches to predict the noise point density distribution feature map. The feature map retains the spatial distribution information of the noise points. Jointly judge the noise type and density distribution to obtain fine-grained noise information. Noise type judgment guides the use of different denoising algorithm strategies. Noise distribution prompts spatial attention for targeted denoising. Improve the model's adaptability to different types of noise. Fine-grained noise analysis can make denoising more accurate. Reduce the impact of noise on subsequent vehicle feature extraction. Improve vehicle image quality and provide support for improving emission prediction accuracy. In summary, the present application can judge noise information, which is conducive to accurate and targeted image denoising, thereby improving the quality of subsequent vehicle feature analysis and emission prediction.

[0029] When the noise is detected as Gaussian noise and the noise point density is greater than the threshold T1, a median filter kernel with a size of M1×M1 is selected; when the noise is detected as salt and pepper noise and the noise point density is less than the threshold T2, a median filter kernel with a size of M2×M2 is selected; Gaussian noise points are smoother and more continuous, so a larger filter kernel M1 is selected to remove them. Salt and pepper noise points are smaller and more abrupt, so a smaller filter kernel M2 is selected for processing. Set the corresponding threshold according to the noise density and dynamically adjust the filter kernel. T1 is set to the maximum acceptable density of Gaussian noise, and T2 is the minimum density of salt and pepper noise. M1 and M2 are customized according to the noise type and vehicle image resolution. The median filter retains the vehicle contour without over-smoothing. Adaptive filtering is performed according to different noise types and density division strategies. Targeted filtering reduces the loss of vehicle details. Restore key texture features of the vehicle to facilitate subsequent vehicle model recognition. Improve the continuity of the edges and contours of the vehicle body. Adaptive preprocessing enhances the robustness of the model and adapts to more scenarios. It is conducive to building a more stable and efficient vehicle emission prediction model. In summary, the present application can perform adaptive filtering according to the noise situation, and adopt the optimal strategy for different noise types to improve the expression quality of vehicle features. Among them, Gaussian noise: It is a statistical noise whose mathematical model conforms to the Gaussian distribution, also known as normal distribution noise. It is manifested in the image as a smooth change in the overall color and brightness of the image. Salt and pepper noise: It is a randomly appearing white and black point noise, similar to sprinkling pepper salt on the image, hence the name salt and pepper noise. It is manifested as randomly scattered white and black points in digital images. In this application: Detect the image noise type to determine whether it is Gaussian noise or salt and pepper noise. Count the proportion of noise points to the number of pixels in the entire image to obtain the noise point density. According to the noise type and density threshold, select median filter kernels of different sizes. Use median filtering to smooth different types of noise points and remove noise. Adaptively select the filter kernel to effectively process various types of noise and improve image quality.

[0030] The vehicle image is filtered and denoised using the selected median filter kernel; M1 is greater than M2; the filter kernel is a square structure. Calculate the values ​​of all pixels in the square filter window and take the median to replace the central pixel. Gaussian noise takes a larger window M1, which contains more peripheral pixel information. Salt and pepper noise takes a smaller window M2 to avoid losing details. The sizes of M1 and M2 are customized according to the noise distribution and image details. The square kernel has a small amount of calculation and is easy to optimize and implement. The sliding square kernel traverses all positions of the image to achieve full-image filtering. Median filtering can effectively suppress Gaussian noise and retain vehicle edges. Median filtering can repair pixels damaged by salt and pepper noise. Restore the coherent contours of areas such as the body, windows, and lights. Balance the denoising effect and detail retention through adaptive filter kernels. Improve image quality and provide source materials for subsequent vehicle feature extraction. Reduce the impact of environmental noise on vehicle detection and recognition. It is conducive to building a more accurate and robust vehicle emission prediction model. In summary, the present application can perform adaptive filtering for different noise types, improve vehicle image quality, and provide support for subsequent improvement of emission prediction accuracy.

[0031] Furthermore, a deep neural network defogging algorithm based on dark channel prior is used to defog the fog components in the vehicle image, which includes the following steps: the deep neural network based on dark channel prior includes a feature extraction module and a defogging module; the feature extraction module uses a convolutional network to extract global and local features of the image. The convolution kernel size and step size are reasonably designed to retain the detailed features of the vehicle. Multi-scale parallel convolution is set to obtain multi-scale features of the vehicle. An attention mechanism is added to focus on the key areas of the vehicle logo and contour. The defogging module predicts the global atmospheric light value, which indicates the background light intensity. The defogging module also predicts the transmission rate of each pixel, which indicates the distance of the image. According to the atmospheric light and transmission rate, a clear vehicle image is restored. End-to-end network training is used to learn defogging and image prior knowledge. The fog shadows in the window and light area are removed to judge the vehicle body structure. The continuity of the vehicle logo and contour boundary is restored to facilitate feature expression. The clarity of the vehicle color and detail features is improved. Image defogging can restore the real vehicle visual effect. It is conducive to building a more accurate and robust vehicle emission prediction model.

[0032] The feature extraction module is used to extract the dark channel prior features of the input vehicle image to obtain the dark channel prior feature map. The feature extraction module includes multi-layer convolution and pooling operations; a small convolution kernel is used to extract the local dark channel prior features of the vehicle image. The step size is set reasonably to ensure the resolution and text information of the feature map. The features of different receptive fields are extracted through multi-layer convolution. The pooling operation obtains the features of the local area of ​​the road sign and the vehicle body. The multi-layer convolution extracts semantic features at different levels. The output feature map retains the dark channel prior information of the key area of ​​the vehicle. The high response area in the feature map corresponds to the dark channel area of ​​the image. The dark channel prior can determine the distance relationship between the vehicle body and the glass. It is used to guide the subsequent image transmission rate prediction. The dark channel feature map is extracted to provide a basis for image defogging and reconstruction. The finer color and texture features of the vehicle are restored. It is conducive to building a more accurate and robust vehicle feature expression. It provides a high-quality visual source for subsequent vehicle model recognition and emission prediction. In summary, the extraction of the dark channel prior feature map can provide guidance for subsequent defogging, thereby improving the quality of vehicle images.

[0033] The extracted dark channel prior feature map is input into the defogging module for defogging. The defogging module includes a conditional generative adversarial network based on prior features. The extracted dark channel prior features are used for conditional constraints. A generator is set to predict a clear vehicle image based on the prior features. A discriminator is set to judge the authenticity of the generated image. The generator and the discriminator are trained adversarially. The dark channel prior is used to guide the generator to pay attention to the relationship between the car body and the glass. Clear windows, lights and car body edges are generated. Key texture features of the car logo and car body are retained. Selective image generation is performed based on the prior features. The adversarial process makes the generated image more realistic. The conditional adversarial network can avoid image color shift. The original visual effect of the vehicle is restored. High-quality vehicle images are provided, which is conducive to subsequent feature expression. Provide support for building more accurate vehicle model recognition and emission prediction models. In summary, the defogging module performs conditional generation based on the dark channel prior, which can improve the image realism and quality, and provide support for subsequent improvement of emission prediction accuracy.

[0034] In the conditional generative adversarial network, the dark channel prior feature map is used as a conditional input to the generator, and the generator learns the distribution of vehicle images after defogging; the generator adopts an encoder-decoder structure. The encoder extracts the global features of the dark channel prior. The decoder gradually upsamples and outputs a high-resolution defogging image. Skip connections are set to retain the detailed features of the encoding end. The prior features are injected into each layer through skip connections to guide the generation process. The generator outputs a realistic defogging vehicle image. Learn to map the foggy image to the defogging image space. Retain the key contours and color texture features of the vehicle. Clear the window and light areas to facilitate the judgment of the body structure. Restore the continuity of the logo and the body edge. Provide high-quality vehicle visual source information. It is conducive to building a more robust model recognition and emission prediction model. Improve the robustness of the model in handling different haze weather. In summary, the generator uses prior features to perform constrained defogging generation, which can improve the authenticity and quality of the image. Among them, the generator (Generator): as a generation model in the conditional adversarial network, inputs the foggy image and prior features. The distribution characteristics of fog-free vehicle images are learned through the convolutional network. Output the generated simulated defogging vehicle image. The purpose is to deceive the discriminator into judging the output image as a real fog-free image. Discriminator: As a discriminant model in the adversarial network, it inputs the generator output image or a real sample. It uses the convolutional network to determine whether the input image is a real fog-free sample or the generator output. Output the result of distinguishing the authenticity of the input image. The purpose is to distinguish the generated samples from the real samples as much as possible. Through continuous confrontation, the generator output is made more realistic. The adversarial interaction between the generator and the discriminator promotes the training of the defogging model.

[0035] The defogging vehicle image distribution output by the generator is input into the discriminator, which determines the similarity between the generated defogging vehicle image and the non-fogging vehicle image; the discriminator uses a convolutional network to extract features to determine authenticity. The quality of the generated image is judged locally and globally. The key area features in the vehicle image are compared. The clarity of the vehicle logo, window, and contour area is judged. The consistency between the color level of the generated image and the real image is analyzed. The degree of continuity of edges and contours is detected. The similarity of detailed texture features is compared. Learn to distinguish the difference between the original non-fogging image and the generated defogging image. The generator gradually improves the generation quality according to the feedback of the discriminator. The adversarial process enhances the realism of the generator output. Provide realistic high-quality vehicle images. It is conducive to building a more robust vehicle feature expression. Provide high-quality visual sources for subsequent vehicle model recognition and emission prediction. In summary, the discriminator judges the quality of the generated image and guides the generator to produce more realistic results, thereby improving the quality of vehicle images.

[0036] According to the discriminant results output by the discriminator, the parameters of the generator are updated through the back propagation of the loss function; in which, the defogging algorithm is trained using vehicle images with different fog concentrations to learn the defogging mapping relationship. Construct a dataset containing vehicle images with different concentrations of haze. The loss function includes adversarial loss and pixel reconstruction loss. The adversarial loss minimizes the probability that the generated image is identified as a real sample. The pixel reconstruction loss maintains the consistency of the detailed features of the generated image. Back propagation updates the parameters of the generator to approximate the real vehicle distribution. Train on samples with different fog concentrations to improve the generalization ability of the model. Learn the influence of fog on the visual effects of vehicles. Master the defogging mapping relationship under different fog concentrations. Generate clear and identifiable key vehicle components. Improve the robustness of the model in different haze weather. Provide high-quality visual sources for subsequent vehicle structure analysis. It is conducive to building a powerful vehicle model recognition and emission prediction model. Improve the application scope of the model in complex environments. In summary, learning defogging knowledge with different fog concentrations can improve the generalization ability of the model and improve the environmental adaptability for subsequent emission prediction. Among them, the defogging mapping relationship refers to the mapping function from the foggy image to the fog-free clear image learned by the defogging algorithm. When using the generative adversarial network to train the defogging algorithm, the defogging mapping relationship specifically refers to: the generator learns the mapping conversion function from the foggy input image to the fog-free target image. This is a mapping relationship from the fogged image space to the clear image space. The generator gradually learns the parameters of this mapping conversion through differentiable network layers. The discriminator determines whether the generated image is realistic and clear enough. The defogging mapping relationship is continuously approached through the adversarial mechanism, and a clear and fog-free result is output. Fog samples of different concentrations expand the scope of application of the mapping relationship. The learned defogging mapping relationship can convert foggy input into a fog-free image with better enhancement effect. Provide clear input for subsequent vehicle image processing algorithms and improve performance. This defogging mapping relationship learning mechanism is the key to enhancing the defogging ability of the model.

[0037] Further, according to the acquired vehicle information, dividing the vehicles on the detection section into the first detection vehicle and the second detection vehicle according to the preset OBD port configuration database includes the following steps: establishing an OBD port configuration database, the database includes vehicle model string information, vehicle model corresponding year information, vehicle model corresponding VIN code range and vehicle model corresponding OBD port configuration information; collecting vehicle OBD port information of different brands, different models and different years. OBD port configuration information includes port location, connector model, communication protocol, etc. Constructing the correspondence between vehicle model string and year, VIN code range. The vehicle model string accurately locates the vehicle model, and the VIN code determines the individual vehicle. The OBD port configuration information is associated with the vehicle model string and VIN code and stored. Constructing a standardized and structured database table structure. Providing a database interface to query the OBD port configuration according to the vehicle model or VIN code. The database can be expanded to include OBD port data of more vehicle models. Reducing the access trial and error cost of the OBD acquisition device. It is conducive to improving the efficiency of OBD data acquisition. Providing a stable and accurate underlying data source for subsequent emission detection algorithms. Improving the effectiveness and consistency of emission prediction. Providing support for applications such as emission excess warning. In summary, building an OBD port configuration database can provide an accurate reference for collecting OBD signals, thereby improving the efficiency and quality of subsequent emission detection. Among them, the full name of the VIN code is the Vehicle Identification Number, which is a unique code used to identify a single car. The VIN code is formulated according to international standards, and the same VIN code is used for the same model around the world. The VIN code is generally composed of 17 letters and numbers. The first 3 digits represent the manufacturer and manufacturer information, the middle 6 digits are the model information, and the last 8 digits are the serial number information. The VIN code can be traced to determine the specific brand, manufacturer, year, model and other information of the car. The VIN code label is generally pasted on the upper right corner of the vehicle's air intake grille, and can also be printed on the inside of the engine cover. By identifying and parsing the VIN code, the specific information of the car can be obtained for OBD configuration matching. The VIN code is a unique identifier for determining the information of a single vehicle and plays a key role in the vehicle detection system. Establishing an OBD configuration database with VIN code range mapping is an important link in achieving accurate identification.

[0038] Using the Levenshtein edit distance algorithm, set the edit distance threshold of the vehicle type string; the Levenshtein edit distance algorithm is an algorithm used to measure the difference between two sequences. Its main idea is to calculate the minimum number of edit operations required to convert one string into another. Edit operations include insertion, deletion, and replacement. For example: string 1 kitten; string 2 sitting. Converting "kitten" to "sitting" requires 3 edit operations; replace "k" with "s"; insert "i" between "e" and "t"; replace "n" with "g", so the Levenshtein distance of these two strings is 3. Usually, the steps to calculate the Levenshtein distance of two strings are as follows: initialize a matrix to a two-dimensional matrix of the length of the two strings plus 1, and initialize the values ​​of the 0th column and the 0th row to 0 to the length of the string. Starting from the upper left corner of the matrix, calculate the value of each position one by one: if the two characters are equal, the value of the matrix position is equal to the value of the upper left; if the two characters are not equal, the value of the matrix position is the minimum value of the three positions on the left, top and upper left plus; the value in the lower right corner of the matrix is ​​the edit distance of the two strings. Therefore, the Levenshtein edit distance algorithm mainly uses the method of dynamic programming to calculate the minimum number of edit operations required to convert one string into another, thereby reflecting the difference between the two strings.

[0039] Use the maximum allowable error range parameter to set the allowable error range of the model year; match the model according to the edit distance threshold and the model year error range; read the database and load the model string, corresponding year and other data into the memory. Get the model string entered by the user. Traverse all the model strings in the database and calculate the edit distance. For the results with an edit distance less than the preset threshold, further determine whether the year error is within the allowable range. Compare the edit distance and year error of different candidate results one by one, and select the best match. Return the model information and OBD port configuration of the best match to the user. Edit distance calculation can use dynamic programming to solve the string comparison problem. Year error judgment can be simplified to integer comparison operations. Indexes, hashes, etc. can be used to optimize string search speed. Multi-process and distributed computing can handle large-scale matching in parallel. The model string can be preprocessed to improve the matching efficiency. The algorithm and parameters can be adjusted and optimized according to the actual situation to balance accuracy and efficiency. Modular design facilitates code maintenance and optimization and upgrade.

[0040] When the vehicle model matching fails, the vehicle image is matched with VIN; according to the matching results, the vehicle is divided into the first detection vehicle and the second detection vehicle; the vehicle image is obtained, and the VIN information in the image is identified using OCR technology. The identified VIN is searched in the database to determine the matching result. If the VIN matching is successful, the corresponding OBD configuration is queried according to the matched VIN information. If the VIN matching fails, the vehicle is divided into the second detection vehicle. For the first detection vehicle, the corresponding OBD configuration is directly called to start the detection. For the second detection vehicle, the parameters are automatically identified first to determine the communication protocol and hardware line sequence. Image processing can improve the OCR recognition accuracy. Optimize the OCR algorithm to improve the robustness of VIN code recognition. The database can establish an index from VIN code to vehicle model to speed up the search speed. The classification results can be saved to the database to avoid repeated recognition. Modular design, decoupling of OCR recognition, VIN matching, vehicle classification and other functions. The classification results can be used as feedback for data training and model optimization. It is conducive to improving the detection coverage and algorithm accuracy. In summary, OCR recognizes VIN and uses the results to classify vehicles, which can expand the scope of detection and thus improve the coverage and effectiveness of emission detection.

[0041] Among them, the vehicle model matching failure means that the edit distance of the vehicle model string exceeds the distance threshold or the difference between the identified year information and the year in the OBD port configuration database exceeds the allowable error range. Calculate the edit distance between the input vehicle model string and all strings in the database. Determine whether the edit distance exceeds the preset threshold. If it exceeds, the vehicle model matching fails. If the edit distance is within the threshold, further obtain the corresponding year of the input vehicle model. Find the best matching vehicle model year information in the database. Calculate the absolute value of the difference between the two years. If the year difference exceeds the preset allowable error range, the match fails. Optimize the edit distance algorithm to improve the calculation efficiency. The year information can be simplified to integer comparison to reduce the calculation requirements. Preprocess the vehicle model string to reduce unnecessary comparisons. Optimize the database index to speed up the access to key information. Setting the failure condition threshold parameter can flexibly adjust the matching strategy. Modularize the vehicle model matching and year verification, and the code structure is clear. The failure reason record can be used to analyze and optimize the subsequent matching strategy. In summary, parsing the definition of matching failure from the execution process is conducive to guiding algorithm optimization and improving the efficiency and success rate of vehicle model and OBD information matching.

[0042] Furthermore, VIN matching for vehicle images includes the following steps: using the Faster RCNN target detection algorithm to identify the VIN code area of ​​the vehicle image; constructing a VIN code area dataset and marking the VIN code position. Training the Faster RCNN model to learn to detect the VIN code area. Inputting a vehicle image and extracting the basic feature map. Generating region proposals and predicting possible VIN region candidate boxes. Using ROI pooling to obtain the regional features of each candidate box. Based on the regional features, classifying and regressing to predict the VIN code area. Further selecting high-confidence detection boxes as VIN areas. Optimizing the network structure to improve detection accuracy. Data enhancement to increase the number of vehicle image training samples. Online difficult sample mining to further improve the detection effect. Reducing the candidate box to speed up the detection speed. Using prior position information to filter unreasonable detection results. The extracted VIN code area is used for subsequent OCR recognition. In summary, Faster RCNN can effectively detect the VIN code position, provide support for subsequent improvement of OCR recognition effect, and thus improve vehicle model matching and emission detection quality.

[0043] The sequence image recognition model with CTC loss function is used to identify the VIN code sequence; in this application, multi-scene vehicle VIN code images with different models and different shooting angles are collected, and the training set, validation set and test set are divided into training set, validation set and test set in a ratio of 7:2:1. The VIN code area is annotated using the object detection algorithm based on YOLOv5 to obtain a data set containing the VIN code image and the corresponding annotation box coordinates. A convolutional neural network based on ResNet is used as the feature extractor of the sequence image recognition model, followed by two fully connected layers to output the text sequence. The CTC loss function is connected to the last fully connected layer to measure the edit distance between the predicted output sequence and the target sequence. The model is trained using the Adam optimizer, and the initial value of the learning rate is set to 0.001, and it is decayed by a factor of 0.1 every 10 epochs. The training batch size is set to 64. Using the early stopping method, the training is stopped in advance when the validation set loss does not decrease for 3 consecutive epochs, and the best model is saved. For the input vehicle image, the VIN code area is identified using the trained YOLOv5 object detection model, and the VIN code sub-image is cropped. The VIN code sub-image is cut into appropriate sizes, input into the sequence image recognition model, and the text sequence is output. According to the composition structure of the VIN code, the recognition result is parsed. Check whether the recognition result conforms to the VIN code rules. If it passes the check, find the matching VIN code and the corresponding OBD port configuration information in the established OBD configuration database. Collect more VIN code scene images of various types to continue to optimize the model, such as using more efficient network structures such as Efficient Net, increasing the model capacity to improve the recognition ability, and using image enhancement and other methods to improve the generalization ability of the model. In this way, the comprehensive use of target detection and sequence image recognition models can effectively improve the accurate recognition rate of VIN codes, thereby improving the accuracy of subsequent acquisition of OBD configuration information, and providing support for improving the overall vehicle emission detection accuracy. Among them, CTC loss function, CTC (Connectionist Temporal Classification) is a loss function for sequence recognition tasks, which is usually used in fields such as speech recognition and scene text recognition. The full name of CTC loss function is Connectionist Temporal Classification. It can directly train input sequences of variable length without alignment and annotation. Introduce blank labels to allow output of symbols that do not correspond to the input. Calculate the matching cost of all possible output sequences and target sequences. Take the negative logarithm of the cumulative sum of all path costs as the final CTC loss. Aims to solve the problem of annotation alignment and reduce the difficulty of sequence learning. The use of this loss function greatly simplifies the training process of sequence prediction tasks. In VIN code image recognition, end-to-end learning can be done directly without accurately locating and cropping each character. It avoids the complex character segmentation, recognition and splicing process, making model training simpler and more effective.

[0044] According to the VIN code specification, the VIN code sequence obtained by parsing and identification is matched with the VIN in the established OBD port configuration database. In this application, according to the international standard ISO3779 and the national standard GB / T29791, the composition structure of the VIN code is parsed, which includes 3 areas: World Manufacturer Identifier (WMI): to identify the manufacturer, Vehicle Description IDENTIFIER: to describe the brand, model and other information, and Checksum: to verify the correctness of the VIN code; for the recognition results, the WMI information is extracted using regular expressions to determine the car manufacturer, and the bidirectional LSTM model with speech rhythm features is used to identify the Chinese model information contained in the vehicle descriptor, calculate the checksum, and verify whether the recognition sequence is correct; in the established OBD configuration database, the VIN code range information of different models under each manufacturer is included, and the parsed WMI and vehicle descriptor information, match it in the database, and if the match is successful, return the corresponding OBD port configuration information; try to connect to the returned OBD port configuration, read real-time data, compare the read OBD data with the vehicle information in the picture, if they are consistent, confirm that the match is successful; if they are inconsistent, re-identify the VIN code; collect more VIN code scene data, continue to train the model to improve recognition robustness, expand the database to include more comprehensive VINOBD corresponding information, use explainable AI technology to analyze recognition errors, and adjust the model to improve accuracy; by parsing the VIN composition structure, database matching and OBD information verification, it can ensure that the VIN recognition result is correct, thereby accurately obtaining the OBD port configuration information, providing protection for subsequent vehicle emission detection, and improving the overall accuracy of automobile emission detection.

[0045] Furthermore, according to the acquired road information, respectively correcting the first predicted emission and the second predicted emission by correction coefficients includes the following steps: calculating the vehicle traffic volume of the detected section according to the number of lanes; calculating the average speed of the vehicle according to the road speed limit and traffic conditions; calculating the number of lanes and vehicle traffic volume, in the video image, using semantic segmentation technology to identify each lane area, performing vehicle detection and tracking on each lane area separately, counting the number of vehicles passing through each lane per unit time, that is, the vehicle traffic volume, summarizing the traffic volume of each lane, and obtaining the total vehicle traffic volume of the section; determining the speed limit and traffic conditions, obtaining the speed limit sign through image recognition, determining the road speed limit, using the YOLO-based vehicle detection algorithm to count the number of vehicles per unit time, and determining the congestion state , judge the traffic conditions according to the congestion status, headway time, etc.; average vehicle speed calculation, track the same vehicle in the video image, calculate the time t to pass the road section, count the passing time of a large number of vehicles, remove outliers, calculate the average passing time t_avg, and then divide it by the road section length L to get the average vehicle speed V_avg; model optimization, collect data sets of various traffic scenarios, improve the adaptability of the model to complex environments, use machine learning model fusion strategies to improve the robustness of vehicle detection and tracking, increase multi-source data such as meteorological sensors, and improve the accuracy of traffic condition judgment. Through the above technical means, the vehicle traffic volume and average speed information can be accurately obtained, which provides key input for subsequent emission calculations and model corrections, thereby improving the overall accuracy of automobile emission detection.

[0046] According to the calculated vehicle traffic volume and average driving speed, an emission mapping model based on vehicle power is established to calculate the corresponding vehicle emissions at different speeds; data collection: in a standardized test environment, the fuel consumption of different brands and models at different speeds is measured, converted into fuel consumption per kilometer and emissions per kilometer, and technical indicators such as vehicle power parameters are collected; model establishment: using vehicle fuel consumption and technical parameter data, a vehicle fuel consumption prediction model based on BP neural network is established, and a proportional relationship model between emissions and fuel consumption is established. The above models are combined to establish an emission prediction model based on vehicle power; emission calculation: input the detected vehicle traffic volume and average speed, calculate the proportion of brands and models according to the distribution of passing models, query the power parameters of each brand and model, substitute them into the emission prediction model, and calculate the corresponding emissions at different speeds; model optimization: collect more actual road detection data, expand the model training set, use deep learning methods, build more powerful prediction models such as convolutional neural networks, increase inputs such as models and environmental factors, and improve the applicability of the model. By building an emission prediction model and combining it with the measured traffic parameters, the emissions corresponding to different speeds can be accurately calculated, providing an accurate mapping relationship for subsequent model correction.

[0047] Obtain vehicle emission data on the test section, build a random forest regression model as a correction model, input average driving speed, vehicle model, ambient temperature and humidity, and vehicle emissions output by the emission mapping model; Emission data collection Emission monitoring equipment is set up on the detection section to obtain actual vehicle emission data. At the same time, the average speed, brand model, ambient temperature and humidity data of the corresponding vehicles are recorded, the data is cleaned and processed, outliers are removed, and a training set for the correction model is constructed; Random forest model construction, using average speed, model, temperature and humidity as feature input, emission mapping model output as additional input features, setting the number of trees, selecting the maximum number of features and samples, and using the training set data to train the random forest regression model; Model correction, for the first vehicle, according to its speed and model, use the model to predict the correction coefficient. For the second vehicle, substitute the average speed and corresponding brand into the model to predict the correction coefficient, and multiply the predicted emissions by the correction coefficient to obtain the correction result; Model optimization, collect more road section emission data, expand the sample size, improve the model robustness, use popular regression algorithms such as GBDT for comparative testing, select the model with the best effect, and optimize model hyperparameters, such as the number of trees, the maximum number of features, etc., to prevent overfitting. By constructing an accurate correction model and combining it with the actual collected data, the correction coefficient can be accurately predicted, thereby improving the accuracy of automobile emission prediction and providing support for subsequent emission monitoring work.

[0048] For the first predicted emissions, the correction model is used to obtain the first correction coefficient according to the speed and vehicle model of the corresponding vehicle, and the first predicted emissions are corrected; the first predicted emissions are obtained, for vehicles equipped with OBD ports, real-time emission data is obtained through the OBD device, and the emissions corresponding to each vehicle are calculated as the first predicted emissions; correction coefficient calculation, using parameters such as the average speed of the vehicle and the brand model, these parameters are input into a pre-trained random forest regression model, and the model outputs the first correction coefficient; emissions correction, the first predicted emissions are multiplied by the corresponding first correction coefficient to obtain the corrected first predicted emissions; correction evaluation, compare the difference in emissions before and after correction, analyze the correction effect, such as the correlation before and after correction, error distribution, etc., and evaluate the effectiveness of the correction model; model optimization, collect more actual vehicle emission data and parameters, expand the training samples of the correction model, adjust the parameters to optimize the random forest model, improve the regression accuracy, try ensemble learning and other algorithms, and build a more powerful correction model. By correcting the model of the real-time emission data of the first vehicle group, the accuracy of the data collected by OBD can be improved.

[0049] For the second predicted emission, the correction model is used to obtain the second correction coefficient according to the average driving speed of the corresponding vehicle model, and the second predicted emission is corrected. For the second predicted emission calculation, for vehicles that are not equipped with OBD ports, the emission mapping model is used to predict emissions, and the predicted emissions corresponding to each vehicle are calculated as the second predicted emissions; the correction coefficient calculation, using the average speed parameters of the corresponding vehicle model, the parameters are input into the pre-trained random forest regression model, and the model outputs the second correction coefficient; emission correction, the second predicted emission is multiplied by the corresponding second correction coefficient to obtain the corrected second predicted emission; correction evaluation, compare the second predicted emissions before and after correction, analyze the effect of correction on the second vehicle, and evaluate the applicability of the correction model on the second vehicle; model optimization, collect more actual emission data and speed parameters of the second vehicle as samples, optimize the structure and hyperparameters of the regression model, improve the fitting effect of the second vehicle, try different model combinations, and build a more powerful second vehicle correction model. By correcting the model of the second vehicle group, the prediction effect based on the mapping model can be improved, making it closer to the actual situation, thereby improving the overall quality of automobile emission monitoring.

[0050] Furthermore, the emission mapping model is a recursive neural network model. The measured emission data of vehicles of different models and ages at different speeds are collected as training data sets. The vehicle speed is encoded as a one hot vector as the model input. A recursive neural network model with a bidirectional LSTM network architecture is adopted. The input layer is the one hot vector of the speed. The speed time series features are extracted through the bidirectional LSTM, and finally the emission prediction of the corresponding speed is obtained through the fully connected layer. The number of hidden nodes in the LSTM layer is set to 128, and the regularization method is early stopping to avoid overfitting. The mean square error is used as the loss function, and the Adam Optimizer is used as the optimizer. After the training is completed, the RMSE and R2 score of the model prediction emission are evaluated using the test set. The Grid Search method is used to adjust the parameters to determine the hyperparameters such as the number of LSTM layers and the number of nodes. Case analysis is performed on samples with large test errors to find the reasons for the model's missed fitting, and then the model structure is optimized. The model integration method is used to combine the random forest model for prediction to improve the generalization ability. An automatic model performance monitoring and update mechanism is established to automatically retrain the model after detecting model performance degradation.

[0051] 3. Beneficial effects Compared with the prior art, the advantages of the present invention are: (1) Identify vehicle brands and models through video images, and classify vehicles according to the preset OBD port configuration database. Obtain OBD emission data for vehicles with OBD ports, and use machine learning models to predict emissions for vehicles without OBD ports. This combination of OBD data and machine learning prediction can improve the accuracy of emission detection for different types of vehicles; (2) In terms of vehicle information recognition, we use a convolutional neural network with an attention mechanism to identify the brand, a convolutional neural network with year classification to identify the model, and a variety of deep learning technologies such as VIN code recognition. The use of these technologies can effectively improve the accuracy of vehicle information extraction, reduce the misjudgment rate, and thus improve the accuracy of subsequent emission predictions; (3) An emission mapping model that takes speed and environmental factors into consideration was established, and the correction coefficient was obtained using the random forest model to correct the predicted emissions. This emission correction approach that combines physical models with data-driven models can make the final emission prediction results more accurate and reliable, effectively improving the detection accuracy. BRIEF DESCRIPTION OF THE DRAWINGS

[0052] This specification will be further described in the form of exemplary embodiments, which will be described in detail by the accompanying drawings. These embodiments are not restrictive, and in these embodiments, the same number represents the same structure, wherein: Figure 1 is an exemplary flow chart of a method for detecting automobile emissions according to some embodiments of this specification; Figure 2 is an exemplary flow chart for obtaining vehicle information according to some embodiments of this specification; Figure 3 is an exemplary flow chart of dividing and detecting vehicle types according to some embodiments of this specification; Figure 4 is an exemplary flow chart of obtaining correction coefficients according to some embodiments of the present specification. DETAILED DESCRIPTION

[0053] In order to more clearly illustrate the technical solutions of the embodiments of this specification, the following is a brief introduction to the drawings required for the description of the embodiments. Obviously, the drawings described below are only some examples or embodiments of this specification. For ordinary technicians in this field, this specification can also be applied to other similar scenarios based on these drawings without creative work. Unless it is obvious from the language environment or otherwise explained, the same reference numerals in the figures represent the same structure or operation.

[0054] The method and system provided by the embodiments of this specification are described in detail below with reference to the accompanying drawings.

[0055] Figure 1 is an exemplary flow chart of a method for detecting vehicle emissions according to some embodiments of this specification, such as Figure 1 As shown, a method for detecting automobile emissions includes: S110 obtaining video images and road information of vehicle monitoring on a detection section, the road information including the number of lanes, road speed limit, traffic conditions and ambient temperature and humidity; the video image can accurately identify the vehicle brand and model, and is a key source for obtaining vehicle information. Compared with simple model matching, image recognition can improve the accuracy of information acquisition. The number of lanes reflects the traffic flow of the section and is a necessary parameter for calculating the total emissions of the section. The speed limit and traffic conditions determine the average driving speed of the vehicle, and the vehicle speed is an important factor affecting emissions. These data are helpful in establishing an accurate emission prediction model. Ambient temperature and humidity can affect the engine combustion efficiency and thus affect emissions. Considering these factors can improve the environmental adaptability of the prediction model. Obtaining refined vehicle information and road parameters can establish a personalized emission prediction model for different models, speeds and environments. Video images collect vehicle data without stopping the vehicle for testing, and can detect all passing vehicles with a wide coverage. With the help of image recognition and intelligent algorithms, the problems of small sample size and limited detection range of existing vehicle emission monitoring can be effectively solved. In summary, the present application can comprehensively obtain information on various factors affecting emissions, build a refined emission prediction model, and thus improve the accuracy and scope of automobile emission monitoring. S120 uses image recognition to obtain vehicle information in the video image, and the vehicle information includes the vehicle brand and vehicle model; S130 divides the vehicles in the detection section into a first detection vehicle and a second detection vehicle according to the preset OBD port configuration database based on the obtained vehicle information, wherein the first detection vehicle is a vehicle configured with an OBD port, and the second detection vehicle is a vehicle not configured with an OBD port; S140 obtains the instantaneous emission data of the vehicle for the first detection vehicle through wireless communication with the on-board OBD device, and calculates the emission within a preset time period as the first predicted emission; for the second detection vehicle, obtains the second predicted emission using a vehicle emission prediction model trained based on a machine learning algorithm; S150 corrects the first predicted emission and the second predicted emission respectively by a correction coefficient based on the obtained road information; S160 calculates the total emission of the detection section based on the corrected first predicted emission and the second predicted emission; wherein the road speed limit is the speed limit of the detection section; and the traffic condition is the traffic flow and average vehicle speed of the detection section.

[0056] Among them, video images and road information are obtained, and image recognition is used to obtain the vehicle brand and model. According to the vehicle information, the vehicle is divided into a first detection vehicle with an OBD port configured and a second detection vehicle without an OBD port configured according to the OBD port configuration database. For the first detection vehicle, real-time emission data is obtained through the OBD device to calculate the first predicted emission. For the second detection vehicle, a machine learning model is used to predict the second predicted emission. According to the road information, a correction coefficient is obtained to correct the first and second predicted emissions respectively. The sum of the two sets of corrected predicted emissions is calculated to obtain the total emission of the detection section. The accuracy of vehicle information recognition is improved by using algorithms such as image segmentation, defogging, filtering, and enhancement. An OBD port configuration database is established, and the vehicle OBD configuration is determined by matching the vehicle model and VIN. An emission mapping model based on vehicle power and speed is established as a correction model to correct the predicted emissions. Using a recursive neural network as an emission mapping model can improve the detection accuracy. In general, this method realizes the detection and calculation of automobile emissions in complex environments by combining technical means such as image recognition, vehicle-mounted sensor acquisition, and machine learning prediction, and uses multiple models for correction to improve the detection accuracy.

[0057] In summary, the emission data of different types of vehicles can be obtained more accurately by dividing the vehicles on the detection section into vehicles with OBD ports and vehicles without OBD ports. For vehicles with OBD ports, the instantaneous emission data can be obtained through real-time communication of the on-board OBD device, so that the actual emission of the vehicle can be directly obtained, which is not affected by the vehicle model and usage, thereby improving the detection accuracy. For vehicles without OBD ports, the emission can be predicted by a machine learning-based model. The model can be trained according to factors such as vehicle model and usage to improve the prediction accuracy. Introducing the correction coefficient of road information to correct the predicted emission can reduce the impact of road conditions on emissions and improve the accuracy of the corrected results. Considering more influencing factors, such as the number of lanes, speed limit, traffic flow, ambient temperature and humidity, etc., the deviation of emission prediction can be compensated from more dimensions to improve the accuracy. The emission of the two types of vehicles can be detected and predicted separately, the deviation can be corrected, and the total emission can be calculated comprehensively, which can improve the overall accuracy and reliability of automobile emission detection. Through the above improvement measures, the emission data of a single vehicle can be obtained more accurately, and the results can be corrected according to the actual road conditions, thereby improving the overall accuracy of the automobile emission detection method and obtaining more accurate and reliable emission statistical results.

[0058] In a specific embodiment of the present application, a detection section is set up on a certain highway, equipped with a high-definition camera to obtain vehicle video images, the detection section is 20 kilometers long, with 6 lanes in both directions and a speed limit of 120km / h. Through image recognition, 500 electric vehicles of BYD e6 are detected. According to the preset OBD port configuration database, BYD e6 is configured with an OBD port. These 500 vehicles are determined as the first detection vehicles. Through the wireless communication module of the on-board OBD device, the instantaneous speed, motor output power, battery voltage and other data of these 500 electric vehicles are collected every 5 minutes, and the instantaneous emissions of each vehicle are calculated by the detection algorithm. For the other 2,000 fuel vehicles detected, after determining the model and displacement through image recognition, the machine learning emission prediction model trained for different models is used to obtain the predicted emissions of each fuel vehicle. According to the traffic flow and ambient temperature data during the detection period, the correction coefficient is introduced to correct the detection and prediction results of the first detection vehicle and the second detection vehicle. The total emissions of the detection section are calculated by combining the corrected emissions of the two types of vehicles. By using technical means such as OBD direct communication, machine learning prediction, and correction coefficients, the accuracy and effectiveness of vehicle emission detection can be improved, and more accurate road emission statistics can be obtained.

[0059] Figure 2 is an exemplary flow chart for obtaining vehicle information according to some embodiments of this specification, such as Figure 2 As shown, the vehicle information in the video image is obtained by using image recognition, and the vehicle information includes the vehicle brand and vehicle model, and includes the following steps: S121 For the obtained video image, an explainable instance segmentation algorithm is used to obtain a vehicle picture containing the whole vehicle; the obtained vehicle picture is filtered and denoised using an image defogging algorithm based on deep learning; S122 The processed vehicle picture is input into a convolutional neural network based on an attention mechanism to obtain the vehicle brand; S123 The processed vehicle picture is input into a convolutional neural network combined with vehicle model year classification to obtain the vehicle model containing the year information; S124 The obtained vehicle brand and vehicle model are input into a convolutional neural network based on a confidence fusion algorithm to obtain a vehicle information recognition result.

[0060] Among them, the use of an interpretable instance segmentation algorithm can more accurately extract images containing the entire vehicle from video images, laying the foundation for subsequent recognition processing. The use of an image defogging filter algorithm can reduce the impact of environmental haze on vehicle images and improve the robustness of subsequent recognition. Using a convolutional neural network based on an attention mechanism to identify vehicle brands can improve the accuracy of vehicle identification. Using a convolutional neural network that considers the classification of vehicle models can increase the recognition ability of models of different years and improve the accuracy of vehicle model recognition. Using a multi-network collaboration based on confidence fusion can combine the advantages of different networks to perform reliability screening on vehicle model brand recognition results and reduce recognition errors. Obtaining vehicle model information including the year can provide a basis for the subsequent determination of the vehicle OBD configuration and improve the accuracy of obtaining vehicle configuration information. The overall process combines interpretative segmentation, image enhancement, attention mechanism, multi-network fusion and other technologies, which can effectively improve the recognition accuracy of vehicle brands and models, lay the foundation for subsequent emission detection, and improve the overall effect of automobile emission detection. By using advanced computer vision and deep learning technologies, the ability to automatically extract vehicle information from video images can be greatly improved, and more accurate and reliable vehicle brand and model information can be obtained, which is beneficial for subsequent emission detection and calculation.

[0061] Specifically, using real vehicle images and fake vehicle image samples generated by generative adversarial networks can improve the model's adaptability to complex actual scenes and enhance the model's robustness. Adding an attention mechanism to Mask RCNN can focus on the target vehicle area and improve the accuracy of vehicle extraction. Using Mask RCNN trained after enhancement for instance segmentation of video images can effectively improve the accuracy of regional segmentation containing the entire vehicle. Performing semantic segmentation to obtain the vehicle body mask can eliminate irrelevant background interference and obtain higher quality vehicle images. The entire process makes full use of technologies such as generative adversarial networks, attention mechanisms, instance segmentation, and semantic segmentation, which can significantly improve the ability to accurately extract vehicle images from complex scenes. Obtaining high-quality vehicle images provides reliable guarantees for the identification of subsequent models and brands, thereby improving the overall effect of automobile emission detection. This vehicle image extraction scheme can provide an input source for the automobile emission detection system and is an important link in improving detection accuracy. In summary, using a variety of advanced deep learning technologies to collaboratively improve the vehicle image extraction effect is the key to enhancing the performance of the entire automobile emission detection system.

[0062] Specifically, the defogging algorithm based on dark channel prior can effectively remove fog components in vehicle pictures and improve image quality. Median filtering as a preprocessing can smooth the image, effectively reduce sampling noise, and prepare for denoising. The deep denoising network based on the encoder-decoder can efficiently remove burrs, spots and other noise in the image and improve image quality. Adaptive Gamma correction as a post-processing can enhance image contrast and details and enhance vehicle features. The entire process combines classic image processing and deep learning defogging and denoising technology, which can significantly improve the quality of vehicle pictures and provide high-quality input for subsequent recognition tasks. High-quality vehicle pictures are conducive to improving the accuracy of brand and model recognition, thereby improving the accuracy of automobile emission detection. Image enhancement is an important preprocessing module of the automobile emission detection system and has a direct impact on system performance. It is crucial to choose the right algorithm process.

[0063] More specifically, collecting vehicle image samples without noise and with different noises can improve the accuracy of the model for judging the noise type and noise point distribution. Using a convolutional neural network to judge the noise type and noise point density distribution can accurately obtain the noise characteristics of the image and provide a basis for selecting the filter kernel. Using filter kernels of different sizes according to different types and densities of noise can specifically smooth noise points of different degrees to prevent filtering from causing image blur. For the case of high density of Gaussian noise points, a filter kernel of larger size M1 is selected to more effectively smooth high-density noise points. For the case of low density of salt and pepper noise points, a filter kernel of smaller size M2 is selected to avoid over-smoothing of image details. The square filter kernel structure is simple and efficient, suitable for hardware implementation, and can reduce the amount of algorithm calculation. The adaptive median filter scheme can effectively smooth different types of density noise and retain vehicle features, providing higher quality images for subsequent recognition. Improving the quality of vehicle images is an important part of improving the effect of automobile emission detection, and the filtering algorithm is of great significance. In summary, the median filter preprocessing scheme is mature and reliable, and plays an important role in improving the accuracy of automobile emission detection.

[0064] Specifically, in this embodiment, for Gaussian noise, when the noise point density is greater than 0.01 (that is, the proportion of noise points in the picture exceeds 1%), a median filter kernel with a size of 5×5 is selected. For salt and pepper noise, when the noise point density is less than 0.005 (that is, the proportion of noise points in the picture is less than 0.5%), a median filter kernel with a size of 3×3 is selected. In practical applications, 100 vehicle image samples containing different degrees of noise were collected for testing. A convolutional neural network is used to determine the noise type and noise point density for the sample images. According to the judgment results, a filter kernel of the corresponding size is automatically selected for filtering. A 5×5 filter kernel is used for samples containing Gaussian noise, and a 3×3 filter kernel is used for samples containing salt and pepper noise. The noise of the processed sample images is significantly reduced, and the vehicle characteristics are effectively retained. Through this implementation example, the effectiveness of adaptively selecting the filter kernel size according to the noise characteristics is verified. This application can effectively smooth different noises and improve the quality of vehicle images, which has positive significance for the subsequent improvement of the accuracy of automobile emission detection.

[0065] More specifically, the dark channel prior feature extraction module can efficiently obtain the fog distribution information of the image, providing important prior knowledge for the defogging module. Taking the dark channel features as conditions and introducing the conditional generative adversarial network for defogging can effectively utilize the prior constraints for image defogging. The generator learns the distribution of the image after defogging, and the discriminator judges the defogging effect, which can continuously approach the ideal defogging mapping relationship. By continuously updating the generator parameters through adversarial learning, it is possible to learn defogging directly from unlabeled data without relying on a large number of matching pair data sets. Using fog pictures of different concentrations for training can improve the model's generalization ability to defog different degrees of haze. This defogging framework fully integrates the capabilities of classic image priors and generative adversarial networks, and can effectively improve the image defogging effect. Improving the quality of vehicle pictures has a direct effect on improving the accuracy of automobile emission detection and has important technical value.

[0066] In a specific embodiment of the present application: a detection section is set up on a certain road section, and a high-definition camera is used to obtain a video image of the vehicle on the road section. The Mask RCNN instance segmentation model is used to process the video image and extract the picture containing the target vehicle. The instance segmentation model used is pre-trained on a vehicle picture data set. A deep neural network based on a dark channel prior is used to defog the segmented vehicle picture. The defogging model is trained on haze pictures of different concentrations. A convolutional neural network is used to determine the noise type and distribution of the defogged picture, and a median filter kernel is selected to adaptively filter different noises. The deep learning denoising of the encoder-decoder structure is used to automatically remove the noise. An enhancement algorithm is used to enhance the contrast and details of the filtered and denoised picture. The enhanced picture is input into the convolutional neural network with an attention mechanism designed for the vehicle brand to identify the brand. The enhanced picture is input into the convolutional neural network considering the model year to identify the model containing the year information. The two recognition results are input into the confidence fusion convolutional neural network to obtain the final vehicle information. According to the vehicle information, vehicles equipped with OBD are distinguished and different detection methods are adopted. This example shows that the automobile emission detection solution combines image processing with multiple deep learning models to effectively obtain accurate vehicle information, thereby improving the accuracy of subsequent emission predictions.

[0067] Figure 3 is an exemplary flow chart of dividing and detecting vehicle types according to some embodiments of this specification, such as Figure 3 As shown, according to the acquired vehicle information, the vehicles on the detection section are divided into the first detection vehicle and the second detection vehicle according to the preset OBD port configuration database, including the following steps: S131 establishes an OBD port configuration database, the database includes vehicle model string information, vehicle model corresponding year information, vehicle model corresponding VIN code range and vehicle model corresponding OBD port configuration information; S132 uses the Levenshtein edit distance algorithm to set the vehicle model string edit distance threshold; S133 uses the maximum allowable error range parameter to set the vehicle model year allowable error range; S134 performs vehicle model matching according to the edit distance threshold and the vehicle model year error range; S135 when the vehicle model matching fails, performs VIN matching on the vehicle image; S136 divides the vehicle into the first detection vehicle and the second detection vehicle according to the matching result; wherein, the vehicle model matching failure means that the vehicle model string edit distance exceeds the distance threshold or the difference between the identified year information and the year in the OBD port configuration database exceeds the allowable error range.

[0068] Building a database containing rich information about vehicle models, years, VIN codes, and OBD configurations can provide a reliable basis for vehicle type classification. Using the edit distance algorithm for vehicle model string matching can improve matching accuracy and reduce the probability of false matching. Setting the edit distance threshold can control the flexibility of matching. Setting the allowable error range for the model year can tolerate small errors in the identification of model year information and improve matching robustness. Prioritizing fast matching judgment based on the model string and year, and then using the VIN code image for accurate matching when it fails, can make the matching process more robust and reliable. Classifying the detection vehicle type is the basis for implementing different detection strategies and is crucial to improving the detection accuracy in the future. This vehicle determination scheme makes full use of the associated information of the model, year, and VIN code, and uses the edit distance algorithm and error tolerance setting to improve the accuracy and robustness of matching.

[0069] The Faster RCNN detection algorithm can be used to quickly and accurately locate the VIN code area in the image, improving the efficiency of subsequent recognition. The sequence image recognition model combined with the CTC loss function can directly learn the character sequence in the VIN code end-to-end without the need for single-word segmentation. The VIN code complies with the unified specification, and the recognition result can be parsed according to the specification and converted into a standardized VIN code. By searching for the VIN code in the constructed OBD configuration database, the OBD port information of the target vehicle can be quickly obtained. The VIN code contains the unique identification information of the vehicle. Using VIN code matching, the vehicle configuration can be accurately determined and the detection accuracy can be improved. The VIN matching technology process fully integrates the advantages of multiple deep learning and digital image processing algorithms, which can significantly improve the matching accuracy. Improving the recognition and matching accuracy of the VIN code is of great significance to the performance improvement of the automobile emission detection system.

[0070] In a specific embodiment of the present application, an OBD configuration database containing 100,000 records is constructed to record the year, VIN code range, and OBD port type information of different models of mainstream brands. Detection equipment is set up at a highway toll station in Beijing to obtain video images of passing vehicles. Mask RCNN instance segmentation is used for video images to obtain pictures of single vehicles. A CNN model based on an attention mechanism is used to identify brands and models containing year information. The recognition results are compared with the database, the edit distance threshold is set to 3, and the year error range is set to 2 years. When the model information comparison fails, Faster RCNN is used to detect the VIN code area, and the sequence recognition model trained by CTC loss identifies the VIN code. According to the VIN code specification parsing results, the matching VIN code range is searched in the database to obtain the OBD port information. According to the matching results, the passing vehicles are divided into detection vehicles with OBD ports and detection vehicles without OBD ports. Different emission detection equipment and algorithms are used for detection of the two types of vehicles.

[0071] Figure 4 is an exemplary flow chart of obtaining correction coefficients according to some embodiments of this specification, such as Figure 4 As shown, according to the acquired road information, respectively correcting the first predicted emission and the second predicted emission by correction coefficients includes the following steps: S151 calculating the vehicle traffic volume of the detection section according to the number of lanes; calculating the average speed of the vehicle according to the road speed limit and traffic conditions; S152 establishing an emission mapping model based on vehicle power according to the calculated vehicle traffic volume and average speed, and calculating the corresponding vehicle emissions at different speeds; S153 acquiring vehicle emission data of the detection section, constructing a random forest regression model as a correction model, inputting the average speed, vehicle model, ambient temperature and humidity, and vehicle emissions output by the emission mapping model; S154 for the first predicted emission, according to the speed and vehicle model of the corresponding vehicle, using the correction model to obtain a first correction coefficient, and correcting the first predicted emission; S155 for the second predicted emission, according to the average speed of the corresponding vehicle model, using the correction model to obtain a second correction coefficient, and correcting the second predicted emission.

[0072] Among them, the traffic volume of the road section is calculated according to the number of lanes, and the average speed is estimated in combination with the speed limit and traffic conditions. Based on the traffic volume and average speed, an emission mapping model is established to predict the emission level at different speeds. The emission mapping model is a recursive neural network model. The measured emission data of the road section is collected, and the random forest regression model is trained as a correction model. For vehicles equipped with OBD, the preliminary emission is predicted based on the vehicle speed, vehicle model, etc., and the first correction coefficient is obtained through correction by the correction model for correction. For vehicles without OBD, the preliminary emission is predicted based on the average speed and vehicle model information, and the second correction coefficient is obtained through the correction model for correction. The emission mapping model reasonably sets the emission level at different speeds. The correction model is trained with big data to perform detailed individual corrections. The two-stage prediction + correction process greatly improves the accuracy of the results. It is suitable for unified emission detection of various types of vehicles to obtain accurate and reliable results. Provides an accurate basis for subsequent vehicle emission supervision.

[0073] In a specific embodiment of the present application, an automatic detection device is set up in a 6-lane road section of a certain detection section, and the traffic volume in a week is counted as an average of 2,000 vehicles per hour. The speed of the road section in different time periods within a week is counted, and the average speed is calculated to be 45km / h. Use a recursive neural network to establish an emission mapping model, input a flow of 2,000 vehicles / h, an average speed of 45km / h, and predict preliminary emissions. The measured emission data and parameters such as speed, model, temperature and humidity of 5,000 vehicles of different models were collected on this road section. The collected data is used to train a random forest regression model as a correction model. For cars with OBD installed, the emission mapping model predicts preliminary emissions based on their 60km / h speed and Audi A6 model, input speed, model and other parameters, and the correction model outputs a first correction coefficient of 0.9 to obtain the corrected emissions. For trucks without OBD, an average speed of 45km / h and a Jiefang brand CA6 model are input, and the emission mapping model predicts preliminary emissions, and the correction model outputs the second correction coefficient to obtain the corrected emissions. The revised emission prediction results for the two types of vehicles are consistent with the measured values, verifying the validity of this application.

Claims

1. A method for detecting automobile emissions, characterized in that: include: Obtain video images and road information from vehicle monitoring on the detection section. The road information includes the number of lanes, road speed limit, traffic conditions, and ambient temperature and humidity; Using image recognition to obtain vehicle information in the video image, the vehicle information includes vehicle brand and vehicle model; According to the acquired vehicle information, the vehicles on the detection section are divided into first detection vehicles and second detection vehicles according to the preset OBD port configuration database, wherein the first detection vehicle is a vehicle configured with an OBD port, and the second detection vehicle is a vehicle not configured with an OBD port; For the first detection vehicle, the instantaneous emission data of the vehicle is obtained by wirelessly communicating with the vehicle-mounted OBD device, and the emission amount within a preset time period is calculated as the first predicted emission amount; For the second detected vehicle, using a vehicle emission prediction model trained based on a machine learning algorithm to obtain a second predicted emission amount; According to the acquired road information, respectively correct the first predicted emission and the second predicted emission by using a correction coefficient; Calculating the total emission of the detection section according to the corrected first predicted emission and the second predicted emission; Among them, the road speed limit is the speed limit of the detection section; the traffic condition is the traffic flow and average vehicle speed of the detection section.

2. The method for detecting vehicle emissions according to claim 1, characterized in that: Using image recognition to obtain vehicle information in a video image, the vehicle information includes the vehicle brand and vehicle model, and includes the following steps: For the acquired video images, an explainable instance segmentation algorithm is used to obtain a vehicle image containing the entire vehicle; The acquired vehicle images are filtered and denoised using an image defogging algorithm based on deep learning; Input the processed vehicle image into the convolutional neural network based on the attention mechanism to obtain the vehicle brand; Input the processed vehicle images into the convolutional neural network combined with the model year classification to obtain the vehicle model containing the year information; The acquired vehicle brand and vehicle model are input into the convolutional neural network based on the confidence fusion algorithm to obtain the vehicle information recognition result.

3. The method for detecting vehicle emissions according to claim 2, characterized in that: For the acquired video image, an explainable instance segmentation algorithm is used to obtain a vehicle image containing the entire vehicle, including the following steps: The Mask RCNN instance segmentation model is jointly trained using a real vehicle image sample dataset and a fake vehicle sample dataset generated based on a generative adversarial network. Add an attention mechanism to the Mask RCNN instance segmentation model to extract images of the target vehicle area; Use the trained Mask RCNN instance segmentation model to perform instance segmentation on the input video image to obtain a segmentation result image containing the target vehicle; The obtained segmentation result image is semantically segmented to obtain a binary vehicle body mask image containing vehicle body, window and headlight pixels as the vehicle image.

4. The method for detecting vehicle emissions according to claim 2, characterized in that: The processing of filtering and denoising the acquired vehicle images using the image defogging algorithm based on deep learning includes the following steps: A deep neural network defogging algorithm based on dark channel prior is used to defog the fog components in vehicle images; Use the median filter algorithm to filter and pre-process the vehicle image after defogging; The vehicle images pre-processed by filtering are denoised using a deep denoising neural network based on an encoder-decoder structure. An image enhancement algorithm based on adaptive Gamma correction is used to enhance the denoised vehicle images.

5. The method for detecting automobile emissions according to claim 4, characterized in that: The filtering preprocessing of the defogging vehicle image using the median filtering algorithm includes the following steps: Collect noise-free vehicle images and vehicle image samples with different degrees of Gaussian noise added; Train the convolutional neural network model to determine the image noise type and noise point density, and output the noise type and corresponding noise point distribution characteristics; When the detection is Gaussian noise and the noise point density is greater than the threshold T1, a median filter kernel with a size of M1×M1 is selected; when the detection is salt and pepper noise and the noise point density is less than the threshold T2, a median filter kernel with a size of M2×M2 is selected; Use the selected median filter kernel to filter and denoise the vehicle image; M1 is greater than M2; the filter kernel has a square structure.

6. The method for detecting automobile emissions according to claim 4, characterized in that: Using a deep neural network defogging algorithm based on dark channel prior, the defogging process for the fog component in the vehicle image includes the following steps: The deep neural network based on dark channel prior includes a feature extraction module and a dehazing module; A feature extraction module is used to extract dark channel prior features from the input vehicle image to obtain a dark channel prior feature map, wherein the feature extraction module includes multi-layer convolution and pooling operations; The extracted dark channel prior feature map is input into the defogging module for defogging. The defogging module includes a conditional generative adversarial network based on prior features. In the conditional generative adversarial network, the dark channel prior feature map is used as a conditional input to the generator, and the generator learns the distribution of vehicle images after defogging; The distribution of defogging vehicle images output by the generator is input into the discriminator, and the discriminator determines the similarity between the generated defogging vehicle images and the non-fogging vehicle images; According to the discrimination result output by the discriminator, the parameters of the generator are updated through back propagation of the loss function; Among them, the defogging algorithm is trained using vehicle pictures with different fog concentrations to learn the defogging mapping relationship.

7. The method for detecting automobile emissions according to claim 2, characterized in that: According to the acquired vehicle information, dividing the vehicles on the detection section into first detection vehicles and second detection vehicles according to the preset OBD port configuration database includes the following steps: Establish an OBD port configuration database, which contains vehicle model string information, vehicle model corresponding year information, vehicle model corresponding VIN code range and vehicle model corresponding OBD port configuration information; Use the Levenshtein edit distance algorithm to set the edit distance threshold of the vehicle type string; Use the maximum allowable error range parameter to set the allowable error range for the model year; Car models are matched based on the edit distance threshold and the car model year error range; When the vehicle model matching fails, VIN matching is performed on the vehicle image; According to the matching result, the vehicle is divided into a first detection vehicle and a second detection vehicle; Among them, the vehicle model matching failure means that the edit distance of the vehicle model string exceeds the distance threshold or the difference between the recognized year information and the year in the OBD port configuration database exceeds the allowable error range.

8. The method for detecting automobile emissions according to claim 7, characterized in that: VIN matching of vehicle images includes the following steps: Use the Faster RCNN target detection algorithm to identify the VIN code area of ​​the vehicle image; Use the CTC loss function to recognize the VIN code sequence. According to the VIN code specification, the VIN code sequence obtained by parsing and identifying is performed, and VIN matching is performed in the established OBD port configuration database.

9. The method for detecting automobile emissions according to claim 1, characterized in that: According to the acquired road information, respectively correcting the first predicted emission amount and the second predicted emission amount by using the correction coefficient comprises the following steps: Calculate the vehicle traffic volume of the detection section according to the number of lanes; Calculate the average speed of vehicles based on road speed limits and traffic conditions; According to the calculated vehicle traffic volume and average driving speed, an emission mapping model based on vehicle power is established to calculate the corresponding vehicle emissions at different speeds; Obtain vehicle emission data on the detected road section, build a random forest regression model as a correction model, and input the average driving speed, vehicle model, ambient temperature and humidity, and vehicle emissions output by the emission mapping model; For the first predicted emission, according to the speed and vehicle model of the corresponding vehicle, a first correction coefficient is obtained by using a correction model to correct the first predicted emission; For the second predicted emission, the second correction coefficient is obtained by using the correction model according to the average driving speed of the corresponding vehicle model, and the second predicted emission is corrected.

10. The method for detecting automobile emissions according to claim 9, characterized in that: The emission mapping model is a recurrent neural network model.

Citation Information

Patent Citations

  • Vehicle state detection method and device, server and inspection system

    CN111127897A

  • Pollutant discharge monitoring, preventing and controlling system, method and device and medium

    CN111340280A

  • Image-based road raised dust dynamic monitoring method and system

    CN113936260A

  • Carbon emission measuring method, device and equipment applied to large construction equipment

    CN116165334A

  • Motorcade emission accounting method based on road monitoring video, medium and equipment

    CN116665141A

Cited By

  • Mobile source off-site supervision method and system based on Internet of Things

    CN118916716A

  • Highway video retrieval method and system based on feature matching

    CN120953881A

  • Vehicle emission identification system and method based on artificial intelligence

    CN121505553A