A road vehicle detection method, medium and system under complex weather conditions
Audio data is obtained through the microphone array and combined with edge detection of video data for multi-modal fusion. The load-balanced distributed CNN neural network is used to train the vehicle recognition model, which solves the problem of vehicle detection performance degradation under complex weather and achieves high-quality Feature extraction and accurate recognition.
Patent Information
- Application Number
- CN202410938824.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-07-15
- Publication Date
- 2024-09-20
- Estimated Expiration
- 2044-07-15
AI Technical Summary
Existing vehicle detection technology is difficult to handle data noise under complex weather conditions, resulting in reduced detection performance, and multi-modal fusion methods are highly complex and difficult to achieve high-quality feature extraction.
A microphone array is used to acquire audio data, noise is reduced through low-pass filtering and spectral subtraction, multi-modal fusion is performed based on edge detection and visual feature extraction of video data, and a load-balanced distributed CNN neural network is used for vehicle recognition model training.
Under complex weather conditions, the accuracy and robustness of vehicle detection are significantly improved, the preprocessing complexity is reduced, and the model training efficiency and generalization ability are improved.
Smart Images

Figure CN118470665B
Abstract
Description
Technical Field
[0001] The present invention belongs to the technical field of road vehicle detection, and in particular, relates to a road vehicle detection method, medium and system under complex weather conditions. Background Art
[0002] With the acceleration of urbanization and the rapid growth of motor vehicle ownership, road traffic management and monitoring has become one of the key issues of current social concern. Effective vehicle detection and monitoring technology can not only provide important basis for traffic planning, accident handling, etc., but also provide technical support for the construction of intelligent transportation systems.
[0003] At present, common vehicle detection technologies mainly include: video detection, radar detection, lidar detection, etc. Among them, video detection technology has been widely used in the field of road traffic monitoring due to its advantages of low cost and easy deployment. Traditional video detection technology usually uses background modeling, object tracking, vehicle classification and other methods to detect vehicles on the road more accurately. However, these methods are often greatly affected by environmental factors, and their detection performance will be significantly reduced under complex weather conditions such as heavy rain, heavy snow, and heavy fog. This is because under complex weather conditions, the quality of video images will deteriorate sharply, and serious noise interference will occur, making it difficult to extract vehicle features, thereby affecting subsequent vehicle detection and recognition.
[0004] In addition to video detection technology, radar detection and lidar detection are also common vehicle detection methods. These physical sensor-based methods can usually maintain high detection accuracy in complex environments. However, their main disadvantages are high cost and the need for specialized hardware equipment, which has high deployment and maintenance costs, which to some extent limits their promotion in practical applications.
[0005] In order to overcome the above technical bottlenecks, researchers have proposed a vehicle detection method based on multimodal fusion. This method can significantly improve the detection performance in complex environments by combining information from multiple sensors such as video, audio, and radar. The basic principle is that different types of sensors have their own advantages and disadvantages. By effectively fusing their information, the shortcomings of a single sensor can be compensated, thereby obtaining more robust and accurate detection results.
[0006] However, the existing multimodal vehicle detection methods have technical difficulties in data processing under complex weather conditions: under complex weather conditions, the raw data obtained by various sensors often have serious noise interference, and complex preprocessing is required to obtain high-quality features. How to minimize the complexity of preprocessing while ensuring data quality is an urgent problem to be solved. Summary of the invention
[0007] In view of this, the present invention provides a road vehicle detection method, medium and system under complex weather conditions, which can solve the technical problems of the prior art that the existing data is difficult to process and it is difficult to obtain high-quality features under complex weather conditions.
[0008] The present invention is achieved in that:
[0009] A first aspect of the present invention provides a method for detecting road vehicles under complex weather conditions, comprising the following steps:
[0010] S10, obtaining a monitoring video and a monitoring audio set of a road in a complex weather environment, and performing preprocessing to obtain a basic video and a basic audio set;
[0011] S20, dividing each basic audio according to energy or zero-crossing rate to obtain multiple audio segments, and time-aligning each basic audio according to the start and end time and amplitude characteristics of the audio segment of each basic audio to obtain an aligned basic audio set, recorded as a first audio set, including multiple first audios;
[0012] S30, using a low-pass filtering algorithm + a spectral subtraction noise reduction algorithm to perform noise reduction on each first audio to obtain a second audio, and correspondingly forming a second audio set;
[0013] S40, extracting audio features for each second audio, including time domain features and frequency domain features;
[0014] S50, performing the following steps on the video stream of the basic video: Canny edge detection, HoughLine detection, vehicle road positioning based on a frame difference method, and visual feature detection to obtain image features;
[0015] S60, performing multimodal fusion on the audio features and the image features according to the corresponding relationship in time and the geographical location information obtained by the RTK technology to obtain fusion features, and obtaining the vehicle artificial identification label in the video stream;
[0016] S70, repeating steps S10 to S60 to obtain multiple sets of fusion features and corresponding vehicle manual identification labels, training a CNN neural network, and obtaining a vehicle identification model;
[0017] S80. According to steps S10 to S60, a fusion model of the road to be tested is obtained, inputted into the vehicle recognition model, and a vehicle recognition result is outputted.
[0018] The CNN neural network is a distributed CNN neural network based on load balancing, and its specific structure includes:
[0019] Data segmentation module: evenly divides the training data into multiple computing nodes;
[0020] Parallel computing module: Each computing node uses local data to train the weight parameters of the neural network in parallel;
[0021] Parameter merging module: periodically summarizes the local model parameters of each node, performs global weighted averaging, and obtains new global model parameters;
[0022] Parameter distribution module: distributes the merged global model parameters to each computing node, replacing the original local parameters;
[0023] Load balancing module: Dynamically monitor the computing load of each node and dynamically allocate computing nodes to avoid long-term overload of some nodes and affect training efficiency.
[0024] The monitoring audio set is obtained from a microphone array arranged on both sides of the road, the monitoring audio set includes monitoring audios of multiple microphones in the microphone array, and the basic audio set includes basic audios obtained after preprocessing multiple monitoring audios.
[0025] The method for time-aligning each basic audio is to use a dynamic time stretching algorithm to perform time alignment.
[0026] The time domain features include short-time energy and short-time zero-crossing rate.
[0027] The frequency domain features include MFCC features and spectrum graph features.
[0028] Furthermore, the step of acquiring the MFCC features specifically includes: pre-emphasis, framing, windowing, fast Fourier transform, Mel filter filtering, logarithmic operation transformation, and discrete cosine transform.
[0029] Furthermore, the step of acquiring the spectrogram features includes processing the data of the second audio by using the short-time Fourier transform in the librosa library, and inputting the result of the data processing into the STFT to acquire the spectrogram features.
[0030] Wherein, the visual features include SIFT features, ORB features, and features extracted by AKAZE algorithm;
[0031] Wherein, the step S10 specifically includes:
[0032] Step 101, obtaining a surveillance video and surveillance audio set of a road in a complex weather environment. The surveillance video and surveillance audio set are from cameras and microphone arrays installed on both sides of the road, and the surveillance audio set includes multi-channel surveillance audio obtained from multiple microphones;
[0033] Step 102: Preprocess the monitoring video and monitoring audio set. For video preprocessing, common preprocessing operations such as denoising and color correction can be performed to obtain a basic video; for audio preprocessing, the multi-channel monitoring audio set is converted into a mono basic audio set to remove noise interference that may exist in a complex environment;
[0034] Step 103: Acquire the basic audio set to lay the foundation for subsequent audio processing.
[0035] The specific steps of step S20 include:
[0036] Step 201: Segment each basic audio according to its energy or zero crossing rate to obtain multiple audio segments, where the audio segment with large energy or high zero crossing rate is more likely to correspond to the time period when the vehicle passes by;
[0037] Step 202: Time-align each basic audio using a dynamic time stretching algorithm. The dynamic time stretching algorithm can perform nonlinear time scaling on the audio according to the start and end time and amplitude characteristics of the audio segment, so that the audio obtained by different recording devices is aligned on the time axis;
[0038] Step 203: Obtain an aligned basic audio set, recorded as a first audio set, which includes multiple first audios.
[0039] Wherein, the specific steps of step S30 include:
[0040] Step 301: Use a low-pass filtering algorithm to reduce the noise of each first audio, which can effectively remove high-frequency noise and retain the low-frequency signal generated when the vehicle passes by;
[0041] Step 302: further denoise each first audio by using a spectral subtraction noise reduction algorithm, and subtract the noise component from the original audio by estimating the power spectrum of the background noise, thereby improving the signal-to-noise ratio;
[0042] Step 303: Obtain the second audio after noise reduction, and form a corresponding second audio set.
[0043] The specific steps of step S40 include:
[0044] Step 401: extract time domain features and frequency domain features for each second audio signal. The time domain features include short-time energy and short-time zero-crossing rate, which reflect the energy change and periodicity characteristics of the audio signal;
[0045] Step 402, frequency domain features include MFCC features and spectrogram features. The MFCC feature extraction process includes: pre-emphasis, framing, windowing, fast Fourier transform, Mel filter filtering, logarithmic operation transformation, discrete cosine transform, effectively extracting the formant features of the audio signal;
[0046] Step 403, the process of extracting the features of the spectrum diagram includes: using the short-time Fourier transform in the librosa library to process the second audio to obtain a spectrum diagram, which reflects the energy distribution characteristics of the audio signal in the time-frequency domain.
[0047] The specific steps of step S50 include:
[0048] Step 501: Perform Canny edge detection on the video stream of the basic video to obtain road edge information;
[0049] Step 502: Use the HoughLine detection algorithm to perform straight line detection on the edge image to obtain the rough outline of the road;
[0050] Step 503: positioning the vehicle on the road of the video stream based on the frame difference method to detect the approximate position of the vehicle in the video;
[0051] Step 504: Use visual feature detection algorithms such as SIFT, ORB, AKAZE, etc. to extract the visual features of the vehicle in the video frame to provide valuable information for subsequent vehicle identification.
[0052] The specific steps of step S60 include:
[0053] Step 601, fusing the audio features extracted in step S40 and the visual features extracted in step S50 according to the time correspondence to obtain a fused feature;
[0054] Step 602: Use RTK technology to obtain the geographic location information of the vehicle in the video stream as a supplement to the fusion feature;
[0055] Step 603: Manually mark the vehicle identification label from the video stream as supervision information.
[0056] The specific steps of step S70 include:
[0057] Step 701, repeating steps S10 to S60 to obtain multiple sets of fusion features and corresponding vehicle identification labels;
[0058] Step 702: Use a distributed CNN neural network based on load balancing to perform model training. The specific structure of the distributed CNN neural network includes: a data segmentation module, a parallel computing module, a parameter merging module, a parameter distribution module and a load balancing module, which can realize efficient parallel training of the CNN neural network and improve training efficiency;
[0059] Step 703: Obtain a machine learning model that can accurately identify road vehicles in complex weather environments.
[0060] The specific steps of step S80 include:
[0061] Step 801, using the same method as steps S10 to S60, to obtain the fusion features of the road to be tested;
[0062] Step 802, the fusion feature is input into the vehicle recognition model trained in step S70;
[0063] Step 803: output the recognition result of the vehicle on the road to be tested.
[0064] The vehicle recognition result includes information such as the vehicle's location, speed, and driving direction. The complex weather environment includes various adverse weather conditions such as rainy days, snowy days, and foggy days. The monitoring video and monitoring audio are from cameras and microphone arrays installed on both sides of the road. The load balancing module can dynamically monitor the computing load of each node and dynamically allocate computing nodes to avoid long-term overload of certain nodes and affect training efficiency.
[0065] A second aspect of the present invention provides a computer-readable storage medium, wherein the computer-readable storage medium stores program instructions, and when the program instructions are executed, they are used to execute the above-mentioned road vehicle detection method under complex weather conditions.
[0066] A third aspect of the present invention provides a road vehicle detection system under complex weather conditions, which includes the above-mentioned computer-readable storage medium.
[0067] Compared with the prior art, the beneficial effects of the road vehicle detection method, medium and system provided by the present invention under complex weather conditions are:
[0068] 1. Data acquisition and preprocessing: The present invention uses a microphone array to acquire high-quality audio data, and uses low-pass filtering and spectral subtraction techniques to effectively reduce noise and retain key audio features when a vehicle passes by. At the same time, a series of preprocessing including edge detection and vehicle positioning is also performed on the video data to improve reliability in complex environments. This high-quality acquisition and preprocessing of multimodal data lays a solid foundation for subsequent feature extraction and fusion.
[0069] 2. Feature extraction and fusion: The present invention comprehensively extracts audio features from both the time domain and frequency domain, including short-time energy, short-time zero-crossing rate, MFCC features, and spectrogram features. At the same time, the edge, contour, and texture features of the vehicle in the video are extracted using a visual feature detection algorithm. Through the fusion of time alignment and geographic location information, these heterogeneous features are organically combined to form a fusion feature rich in multimodal information. This feature fusion method not only makes full use of the advantages of different sensors, but also has strong robustness.
[0070] 3. Model training and deployment: The present invention uses a distributed CNN neural network based on load balancing to train the vehicle detection model. The network structure can achieve efficient parallel computing, greatly improving the training efficiency. At the same time, through dynamic load balancing, it also avoids long-term overload of certain nodes and affects the overall performance. In addition, the detection model also has strong generalization ability and can accurately identify vehicles in new road environments, providing a strong guarantee for deployment in practical applications.
[0071] In general, the road vehicle detection method under complex weather conditions proposed in the present invention fully utilizes the advantages of multimodal information, and innovatively designs and optimizes key links such as data acquisition, feature extraction, and model training, thereby solving the technical problems of existing technologies in complex weather conditions, such as difficulty in processing data and difficulty in obtaining high-quality features. BRIEF DESCRIPTION OF THE DRAWINGS
[0072] In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the accompanying drawings required for use in the description of the embodiments of the present invention will be briefly introduced below. Obviously, the accompanying drawings in the following description are only some embodiments of the present invention. For ordinary technicians in this field, other accompanying drawings can be obtained based on these accompanying drawings without paying creative labor.
[0073] Figure 1 A flow chart of the method provided by the present invention;
[0074] Figure 2 This is the spectrum analysis diagram of environmental noise;
[0075] Figure 3 This is the spectrum analysis diagram of vehicle noise;
[0076] Figure 4 This is the original vehicle noise spectrum analysis diagram;
[0077] Figure 5 This is the spectrum analysis diagram of pure environmental noise after low-pass filtering;
[0078] Figure 6 This is the spectrum analysis diagram of pure vehicle noise after spectrum subtraction processing;
[0079] Figure 7 It is a convolutional neural network structure diagram;
[0080] Figure 8 The network structure diagram constructed in this embodiment;
[0081] Fig. 9 Flowchart of preprocessing input data for training;
[0082] Fig.10This is a schematic diagram of empty lane video image processing;
[0083] Fig.11 It is a schematic diagram of non-empty lane video image processing;
[0084] Fig.12 This is a schematic diagram of vehicle identification. DETAILED DESCRIPTION
[0085] In order to make the purpose, technical solution and advantages of the embodiments of the present invention more clear, the technical solution in the embodiments of the present invention will be clearly and completely described below in conjunction with the accompanying drawings in the embodiments of the present invention.
[0086] like Figure 1 FIG. 1 is a flow chart of a method for detecting road vehicles under complex weather conditions provided by the present invention. The method comprises the following steps:
[0087] S10, obtaining a monitoring video and a monitoring audio set of a road in a complex weather environment, and performing preprocessing to obtain a basic video and a basic audio set;
[0088] S20, dividing each basic audio according to energy or zero-crossing rate to obtain multiple audio segments, and time-aligning each basic audio according to the start and end time and amplitude characteristics of the audio segment of each basic audio to obtain an aligned basic audio set, recorded as a first audio set, including multiple first audios;
[0089] S30, using a low-pass filtering algorithm + a spectral subtraction noise reduction algorithm to perform noise reduction on each first audio to obtain a second audio, and correspondingly forming a second audio set;
[0090] S40, extracting audio features for each second audio, including time domain features and frequency domain features;
[0091] S50, performing the following steps on the video stream of the basic video: Canny edge detection, HoughLine detection, vehicle road positioning based on a frame difference method, and visual feature detection to obtain image features;
[0092] S60, multi-modally fusing the audio features and the image features according to the corresponding relationship in time and the geographic location information obtained by the RTK technology to obtain fused features, and obtaining the vehicle artificial identification label in the video stream;
[0093] S70, repeating steps S10 to S60 to obtain multiple sets of fusion features and corresponding vehicle manual identification labels, training a CNN neural network, and obtaining a vehicle identification model;
[0094] S80. According to the method of steps S10 to S60, a fusion model of the road to be tested is obtained, input into a vehicle recognition model, and a vehicle recognition result is output.
[0095] The specific implementation methods of the above steps are described in detail below:
[0096] The specific implementation method of step S10 is: first, obtain the monitoring video and monitoring audio set of the road in a complex weather environment. The monitoring video and monitoring audio set come from the cameras and microphone arrays installed on both sides of the road. For the monitoring audio set, it is necessary to obtain audio data from multiple microphones in the microphone array to form a multi-channel monitoring audio set. Then, the obtained monitoring video and monitoring audio set are preprocessed. For video preprocessing, common preprocessing operations such as denoising and color correction can be performed to obtain a basic video. For audio preprocessing, it is necessary to convert the multi-channel monitoring audio set into a mono basic audio set. The purpose of this step is to remove the noise interference that may exist in a complex environment and lay the foundation for subsequent audio processing.
[0097] The specific implementation of step S20 is: first, each basic audio is segmented according to its energy or zero crossing rate to obtain multiple audio segments. Audio segments with large energy or high zero crossing rate are more likely to correspond to the time period when the vehicle passes. Then, each basic audio is time-aligned using a dynamic time stretching algorithm. The dynamic time stretching algorithm can perform nonlinear time scaling on the audio according to the start and end time and amplitude characteristics of the audio segment, so that the audio obtained by different recording devices is aligned on the time axis. The purpose of this step is to eliminate the time difference between different recording devices and prepare for subsequent audio feature extraction.
[0098] The specific implementation method of step S30 is: first, a low-pass filtering algorithm is used to reduce the noise of each first audio. The low-pass filtering algorithm can effectively remove high-frequency noise and retain the low-frequency signal generated when the vehicle passes. Then, a spectral subtraction noise reduction algorithm is used to further reduce the noise of each first audio. The spectral subtraction noise reduction algorithm estimates the power spectrum of the background noise, thereby subtracting the noise component from the original audio and improving the signal-to-noise ratio. The purpose of this step is to further eliminate various noise interferences that may exist in a complex environment and create more favorable conditions for subsequent audio feature extraction.
[0099] The specific implementation method of step S40 is: for each second audio, extract time domain features and frequency domain features. Time domain features include short-time energy and short-time zero-crossing rate, which reflect the energy change and periodic characteristics of the audio signal. Frequency domain features include MFCC features and spectrogram features. The extraction process of MFCC features includes: pre-emphasis, framing, windowing, fast Fourier transform, Mel filter filtering, logarithmic operation transformation, and discrete cosine transform. These steps can effectively extract the resonance peak characteristics of the audio signal, reflecting the sound characteristics emitted when the vehicle passes. The extraction process of the spectrogram features includes: using the short-time Fourier transform in the librosa library to process the second audio to obtain a spectrogram. The spectrogram can intuitively reflect the energy distribution characteristics of the audio signal in the time and frequency domains, which is also very helpful for vehicle identification. The purpose of this step is to comprehensively extract audio features from both the time domain and the frequency domain to prepare for subsequent multimodal fusion.
[0100] The specific implementation method of step S50 is: first, perform Canny edge detection on the video stream of the basic video to obtain road edge information. Then, use the HoughLine detection algorithm to detect straight lines on the edge image to obtain the approximate outline of the road. Next, based on the frame difference method, the vehicle road positioning is performed on the video stream to detect the approximate position of the vehicle in the video. Finally, visual feature detection algorithms such as SIFT, ORB, AKAZE, etc. are used to extract the visual features of the vehicle in the video frame. These visual features can provide valuable information for subsequent vehicle identification. The purpose of this step is to extract feature information related to the vehicle from the visual level and prepare for multimodal fusion.
[0101] The specific implementation method of step S60 is: first, the audio features extracted in step S40 and the visual features extracted in step S50 are fused according to the time correspondence to obtain fused features. At the same time, the geographic location information of the vehicle in the video stream is obtained by using RTK technology as a supplement to the fused features. Then, the identification label of the vehicle is manually annotated from the video stream as supervision information. The purpose of this step is to make full use of audio, visual and location information through multimodal fusion to extract richer and more robust features, so as to prepare for the subsequent vehicle recognition model training.
[0102] The specific implementation method of step S70 is: repeating steps S10 to S60 to obtain multiple sets of fusion features and corresponding vehicle identification labels. Then, a distributed CNN neural network based on load balancing is used for model training. The specific structure of the distributed CNN neural network includes: a data segmentation module, a parallel computing module, a parameter merging module, a parameter distribution module and a load balancing module. Through the collaborative work of these modules, efficient parallel training of the CNN neural network can be achieved to improve training efficiency. The purpose of this step is to train a machine learning model that can accurately identify road vehicles in complex weather environments.
[0103] The specific implementation of step S80 is: first, the fusion features of the road to be tested are obtained by the same method as steps S10 to S60. Then, the fusion features are input into the vehicle recognition model trained in step S70 to output the recognition results of the vehicles on the road to be tested. The purpose of this step is to use the trained model to automatically recognize vehicles in the new road environment and complete the function of the entire vehicle detection.
[0104] A second aspect of the present invention provides a computer-readable storage medium, wherein the computer-readable storage medium stores program instructions, and when the program instructions are executed, they are used to execute the above-mentioned road vehicle detection method under complex weather conditions.
[0105] A third aspect of the present invention provides a road vehicle detection system under complex weather conditions, which includes the above-mentioned computer-readable storage medium and generally runs on a computer.
[0106] In order to better implement the present invention on a computer, a specific embodiment 1 implemented on a computer is provided below in combination with a specific formula: In the embodiment, first, in step S10, a monitoring video and a monitoring audio set of a road in a complex weather environment are obtained. For the monitoring audio set, multi-channel monitoring audio data is obtained from microphone arrays installed on both sides of the road, which can be expressed as:
[0107]
[0108] in, represents the audio signal collected by the i-th microphone, and n is the total number of microphones. In order to eliminate the noise interference that may exist in complex environments, the multi-channel monitoring audio set is converted into a mono basic audio set, which can be expressed as:
[0109]
[0110] Next, in step S20, each basic audio is segmented according to energy or zero crossing rate to obtain multiple audio segments. The energy feature can be defined as:
[0111]
[0112] in, is the short time window length. With the preset energy threshold By comparing, we can determine the start and end time of the audio segment. For the zero crossing rate feature, it can be defined as:
[0113]
[0114] in, is the signal length, is the unit pulse function. Similarly, The preset zero-crossing rate threshold By comparison, the start and end time of the audio segment can also be obtained.
[0115] Next, the dynamic time stretching algorithm is used to time align each basic audio. The dynamic time stretching algorithm can create a source audio sequence and the target audio sequence The mapping relationship between , so that the two sequences are aligned in time scale. This mapping function It can be solved by dynamic programming, and the objective function is:
[0116]
[0117] in, is the number of audio frames. By solving this optimization problem, we can get the basic audio set after time alignment, which is recorded as the first audio set.
[0118] In step S30, each first audio is subjected to noise reduction processing. First, a low-pass filtering algorithm is used, and its transfer function can be expressed as:
[0119]
[0120] in, is the cutoff frequency. Through this low-pass filter, high-frequency noise can be effectively removed, and the low-frequency signal generated by the vehicle passing by can be retained. Next, spectral subtraction is used for further noise reduction. The basic principle of spectral subtraction is to first estimate the power spectrum of the background noise. , and then from the power spectrum of the original audio signal Subtract the noise power spectrum from the denoised signal to obtain the denoised signal power spectrum ,Right now:
[0121]
[0122] in, is the empirical coefficient. In this way, the noise component can be effectively removed from the original audio and the signal-to-noise ratio can be improved.
[0123] In step S40, the time domain features and frequency domain features of the audio are extracted. The time domain features include short-time energy and short-time zero-crossing rate, which can be defined as:
[0124]
[0125]
[0126] Frequency domain features include MFCC and spectrogram features. The extraction process of MFCC features is as follows:
[0127] 1. Pre-emphasis:
[0128] 2. Framing: Divide the signal into A short time frame, Indicates the i-th frame
[0129] 3. Windowing: Using Hamming window function ,in Window length
[0130] 4. Fast Fourier Transform: Calculate for each frame
[0131] 5. Mel filter filtering: Use a set of triangular Mel filters , get the Mel spectrum
[0132] 6. Logarithmic transformation:
[0133] 7. Discrete Cosine Transform: , get MFCC features
[0134] The process of extracting the spectrogram features is to process the second audio using the short-time Fourier transform in the librosa library to obtain the spectrogram. ,in For time, is the frequency.
[0135] In step S50, a series of processing is performed on the video stream of the basic video. First, the Canny edge detection algorithm is used to extract the road edge information. The basic process is:
[0136] 1. Gaussian filter denoising:
[0137] 2. Calculate the gradient magnitude and direction: ,
[0138] 3. Non-maximum suppression: only retain the local maximum points of the gradient amplitude
[0139] 4. Hysteresis threshold: use high and low thresholds and , connect higher than The edge points of the The edge point
[0140] Then, the HoughLine detection algorithm is used to detect straight lines in the edge image to obtain the rough outline of the road. The basic principle of HoughLine is to transform the straight line equation into Discretize into a two-dimensional integral space , and then count each discrete point The voting value in the image, the point with the highest voting value corresponds to It is the detected straight line parameter.
[0141] Next, the vehicle road positioning is performed on the video stream based on the frame difference method. The principle of the frame difference method is to calculate the difference between two adjacent frames and set a threshold ,When the difference is larger than the threshold, it is judged that the area has changed, and it is likely that a vehicle has passed by.
[0142] Finally, visual feature detection algorithms such as SIFT, ORB, and AKAZE are used to extract the visual features of vehicles in video frames. Taking SIFT as an example, the extraction process is as follows:
[0143] 1. Gaussian pyramid construction: Gaussian blur and downsample the original image to construct a pyramid
[0144] 2. Scale space extreme point detection: Search for local extreme points in the pyramid as key point candidates
[0145] 3. Key point refinement: interpolate candidate key points and filter out points with low contrast and edge response
[0146] 4. Direction assignment: Assign a main direction to each key point to make the feature rotation invariant
[0147] 5. Feature descriptor generation: Construct a 128-dimensional SIFT descriptor based on the pixels around the key points
[0148] In step S60, the audio features extracted in step S40 and the visual features extracted in step S50 are fused according to the time correspondence to obtain a fused feature. ,in is the audio feature, For visual features, The geographic location information obtained by RTK.
[0149] In step S70, a distributed CNN neural network based on load balancing is used for model training. The training process of the distributed CNN network can be expressed as:
[0150] 1. Data segmentation: split the training data Evenly split into Compute nodes
[0151] 2. Parallel computing: Each node uses local data Independently train CNN network weights
[0152] 3. Parameter merging: Periodically merge the local model parameters of each node Perform global weighted averaging to obtain new global model parameters
[0153] 4. Parameter distribution: The merged global model parameters Distribute to each computing node, replacing the original local parameters
[0154] 5. Load balancing: Dynamically monitor the computing load of each node and dynamically allocate computing nodes to avoid long-term overload
[0155] Through these steps, efficient parallel training of CNN neural network can be achieved, improving training efficiency and generalization performance.
[0156] Finally, in step S80, the same method as the previous steps is used to obtain the fusion features of the road to be tested, and the fusion features are input into the trained vehicle recognition model to output the recognition results of the vehicles on the road to be tested.
[0157] Specifically, the principle of the present invention is that under complex weather conditions, it is difficult for a single video or audio information to provide sufficiently reliable clues for vehicle detection, and even through complex preprocessing, it is difficult to completely eliminate the influence of environmental noise. By adopting a multimodal information fusion method, the shortcomings of a single sensor can be effectively compensated, and the advantages of different information sources can be fully utilized, thereby achieving more robust and accurate vehicle detection in complex environments.
[0158] Specifically, the technical solution of the present invention includes the following key steps:
[0159] Obtain surveillance video and surveillance audio sets of roads in complex weather environments and perform preprocessing. For audio data, use microphone arrays to obtain multi-channel surveillance audio, and use low-pass filtering and spectral subtraction methods to reduce noise to obtain high-quality basic audio sets. For video data, edge detection, vehicle positioning and other methods are used for preprocessing to enhance reliability in complex environments.
[0160] 2. Segment and time-align the basic audio set to extract rich audio features including short-time energy, short-time zero-crossing rate, MFCC features, spectrogram features, etc. At the same time, visual feature detection algorithms are also used to extract the edge, contour and texture features of vehicles in video frames.
[0161] 3. Fuse the extracted audio features, visual features and geographic location information to form a feature set rich in multimodal information. This feature fusion method can make full use of the advantages of different sensors and overcome the limitations of a single sensor.
[0162] 4. Use a distributed CNN neural network based on load balancing to train the vehicle detection model. This network structure can achieve efficient parallel computing and improve training efficiency. At the same time, through dynamic load balancing, it avoids long-term overload of certain nodes and affects the overall performance. The trained model has strong generalization ability and can adapt to vehicle detection needs in different complex environments.
[0163] Based on the solution of the present invention, an embodiment 2 of a specific application scenario is designed below. In the embodiment, a city is located in a coastal area and is affected by the monsoon climate, and severe weather conditions such as heavy rain and fog often occur.
[0164] In the first step, high-definition surveillance cameras and microphone arrays were installed on both sides of the selected monitoring section. A total of 8 surveillance cameras were deployed, covering different areas of the road to ensure the continuity and integrity of video surveillance. The microphone array consists of 12 microphones, evenly distributed on both sides of the road, forming a full range of audio collection capabilities. The installation positions and angles of these devices have been carefully planned and debugged to obtain the best monitoring effect.
[0165] The second step is to preprocess the acquired surveillance video and surveillance audio data. First, common preprocessing operations such as denoising and color correction are performed on the video data to obtain the basic video. For audio data, multi-channel surveillance audio is extracted from the microphone array and then converted into a mono basic audio set. The purpose of this preprocessing process is to remove various noise interferences that may exist in complex environments and lay a good foundation for subsequent audio processing.
[0166] In the third step, the basic audio set was further processed. First, each basic audio was divided into multiple audio segments according to its energy or zero crossing rate. After analysis, it was found that audio segments with high energy or high zero crossing rate are more likely to correspond to the time period when the vehicle passed. Then, each basic audio was time-aligned using the dynamic time stretching algorithm. The purpose of this step is to eliminate the time differences between different recording devices and create good conditions for subsequent audio feature extraction.
[0167] Next, each time-aligned audio was subjected to noise reduction using a low-pass filter algorithm and spectral subtraction. The low-pass filter algorithm can effectively remove high-frequency noise and retain the low-frequency signal generated by the passing vehicle. The spectral subtraction noise reduction algorithm estimates the power spectrum of the background noise, thereby subtracting the noise component from the original audio and improving the signal-to-noise ratio. Through the combined application of these two methods, various noise interferences that may exist in complex environments were successfully eliminated, and a high-quality second audio set was obtained.
[0168] In terms of feature extraction, the features of each second audio are fully extracted from both the time domain and the frequency domain. The time domain features include short-time energy and short-time zero-crossing rate, which reflect the energy changes and periodic characteristics of the audio signal. The frequency domain features include MFCC features and spectrogram features. The MFCC feature extraction process includes: pre-emphasis, framing, windowing, fast Fourier transform, Mel filter filtering, logarithmic operation transformation, discrete cosine transform and other steps, which can effectively extract the resonance peak characteristics of the audio signal. The process of extracting the spectrogram features uses the short-time Fourier transform in the librosa library to obtain a spectrogram that intuitively reflects the time-frequency characteristics of the audio. These time domain and frequency domain features lay the foundation for subsequent multimodal fusion.
[0169] Specifically, by observing environmental noise and vehicle noise, we found that when applying spectral subtraction for filtering, direct use of spectral subtraction may lead to the loss of vehicle noise characteristics due to the similarity of some noise frequencies with vehicle noise frequencies. Therefore, we first use low-pass filtering to process environmental noise, and filter out the frequency parts of environmental noise that are similar to vehicle noise by setting a threshold to reduce the impact of spectral subtraction. First, perform spectral analysis on the original signal to understand the spectral characteristics of environmental noise. The spectrum diagram uses frequency as the horizontal axis in Hz and the amplitude spectrum as the vertical axis (dimensionless), which can intuitively display the signal amplitude at different frequencies. Figure 2-3As shown, we have determined the most concentrated frequency of the ambient noise, providing a basis for selecting an appropriate low-pass filter. The energy of the ambient noise signal is mainly concentrated below 1000Hz, so in the preprocessing of the ambient noise measured 5m away from the lane, this embodiment designs a 1000Hz low-pass filter. Considering that the Butterworth low-pass filter has a relatively flat response curve in the frequency domain, it can effectively suppress high-frequency noise while retaining low-frequency information. Therefore, selecting a Butterworth low-pass filter helps to accurately control ambient noise. The comparison results of low-pass filtering are shown in Figures 4-5. In the figure, the horizontal axis is time, in seconds, and the vertical axis is the amplitude ratio, which fluctuates between -1 and 1.
[0170] Spectral subtraction is an audio signal processing method that aims to reduce the impact of noise on the signal. Its basic principle is to use frequency domain analysis to compare the spectra of the signal and noise, and selectively reduce or remove the noise component. Compared with the traditional spectral subtraction technology, the improved spectral subtraction noise reduction technology of multi-window spectral estimation has only one data window, while the multi-window spectral estimation uses multiple orthogonal data windows to calculate the spectrum of the same data sequence, and then calculates the average value to obtain the spectrum estimate. This method can obtain a smaller estimation variance and is therefore more accurate. This study aims to obtain pure vehicle noise and use spectral subtraction to process vehicle noise and pure environmental noise. First, the audio signal is converted to the frequency domain through Fourier transform to obtain a spectral representation. Then, by comparing the signal spectrum and the background noise spectrum, a subtraction operation is performed to weaken the noise component in the spectrum, thereby achieving a noise reduction effect. The results of spectral subtraction processing are shown in the figure. Figure 6 As shown, Figure 6 In the figure, the horizontal axis is time in seconds, and the vertical axis is the amplitude ratio, which fluctuates between -1 and 1.
[0171] In order to more clearly reflect the change in signal-to-noise ratio, Table 1 shows the comparison data of signal-to-noise ratio before and after spectral subtraction filtering. It can be seen from the comparison table that the signal-to-noise ratio of vehicle noise calculated by the signal-to-noise ratio calculation formula is 32.497dB, and after spectral subtraction filtering, the signal-to-noise ratio is 43.529dB, which is 11.032dB higher than before filtering. At the same time, we perform low-pass filtering to denoise the environmental noise, and after spectral subtraction filtering, the signal-to-noise ratio is 48.823dB. A comparative analysis before and after filtering shows that after low-pass filtering the environmental noise and then performing spectral subtraction filtering on the vehicle noise, the signal-to-noise ratio before and after is increased by 16.326dB, which is the largest increase.
[0172] Table 1 Comparison of signal-to-noise ratio before and after vehicle noise spectrum subtraction filtering
[0173] Classification method Signal-to-Noise Ratio contrast Unfiltered 32.497 ---- Spectral Subtraction Filtering 43.529 11.032 Low pass filter + spectral subtraction filter 48.823 16.326
[0174] For the video data, a series of image processing methods were adopted. First, the Canny edge detection algorithm was used to extract the road edge information to prepare for the subsequent road contour detection. Then, the HoughLine detection algorithm was used to detect the straight lines on the edge image to obtain the approximate contour of the road. Next, the vehicle road positioning was performed on the video stream based on the frame difference method to detect the approximate position of the vehicle in the video. Figure 10-12 As shown in the figure. Finally, visual feature detection algorithms such as SIFT, ORB, and AKAZE are used to extract visual features such as texture and edge of the vehicle in the video frame. These visual features provide valuable information for subsequent vehicle recognition.
[0175] In terms of multimodal feature fusion, the audio features and visual features extracted in the step are fused according to the time correspondence to obtain the fused features. At the same time, the RTK technology is used to obtain the geographic location information of the vehicle in the video stream as a supplement to the fused features. This multimodal feature fusion method can make full use of the advantages of different sensors, overcome the limitations of a single sensor, and provide richer and more robust input for subsequent vehicle identification.
[0176] In order to train a machine learning model that can accurately identify road vehicles in complex weather environments, a distributed convolutional neural network (CNN) based on load balancing was used. First, the above steps were repeated to obtain multiple sets of fusion features and corresponding vehicle identification labels. Then, these data were divided into multiple computing nodes, and each node used local data to independently train the weight parameters of the CNN neural network. Next, the local model parameters of each node were periodically globally weighted averaged to obtain new global model parameters, which were distributed to each computing node. At the same time, a dynamic load balancing module was designed to dynamically allocate computing nodes to avoid long-term overload of some nodes and affect training efficiency. Through this distributed CNN neural network training method, an efficient and robust vehicle recognition model was finally obtained.
[0177] In practical applications, we can first use MATLAB and other software to extract the MFCC of the sound, and then input it into the neural network for training. In this way, we can not only reduce the amount of input data to ensure the convergence speed, but also ensure that the feature extraction is reasonable to achieve the best classification and recognition effect. The basic structure of the CNN neural network is as follows Figure 7 As shown; The convolutional neural network structure designed in this embodiment is as follows Figure 8As shown in the figure. The model consists of three convolution layers, three pooling layers, one flatten layer, and two fully connected layers. In this network, the convolution layer uses ReLU as the activation function, and the output layer uses Softmax. The Adam optimizer is selected as the updater of the weight parameter, the loss function uses cross entropy (Categorical_crossentropy), and the evaluation index of the model is determined based on the accuracy (Accuracy).
[0178] During the training process, first, the collected audio data was divided into 0.2 second segments, and the sound was resampled so that each segment contained 2000 sampling points. The frame length was 2048 sampling points and the frame shift was 512 sampling points. The Hanning window was applied to each frame. After processing, each 0.2 second audio segment was divided into 20 frames, and each frame was transformed by MFCC to obtain 13-dimensional MFCC features. Therefore, each audio segment obtained a data structure of size 13×20. The data processing process is as follows: Fig. 9 As shown. Then, these feature data are input into the convolutional neural network for training. In the architecture of the convolutional neural network, 32 5×5 convolution kernels are first used for convolution operation to generate 32 13×40 feature maps, and then the maximum pooling operation is performed to retain the maximum value in each 4×2 area, and 32 35×20 feature maps are obtained. This pooling operation helps to reduce the complexity of data processing, improve processing speed, and reduce the difference in image position to avoid overfitting. Subsequently, the data entered the second convolution layer, using 64 5×5 convolution kernels to obtain 64 31×16 feature maps, and then the 4×2 maximum pooling operation was performed again to obtain 64 7×8 feature maps. The third convolution layer continued to use 48 5×5 convolution kernels to obtain 64 3×4 feature maps. Next is a flat layer to convert the two-dimensional data into one dimension, with a total of 768 neurons. A fully connected layer with 64 neurons is connected after the flat layer, and finally the sound classification result is output through the softmax activation function to determine whether it is vehicle noise.
[0179] Example results and performance evaluation:
[0180] The 18,000 sound data in the dataset were randomly divided into 13,500 training sets, 9,000 validation sets, and 4,500 test sets for training. The network training used a batch size (batch_size) of 128 and set the training cycle (epochs) to 100. This study used the TensorFlow deep learning framework and used Keras as a front-end tool for model building, training, and prediction. PyCharm 2021 Professional Edition platform was used for development. The hardware environment for model building, training, and testing depends on NVIDIA GeForce RTX 3060 Ti GPU, AMD Ryzen 7 3700 X CPU, main frequency 1.6 GHZ, memory 32 GB, hard disk 512 GB.
[0181] The results of the embodiment are measured by the recognition accuracy (ACC). The higher the ACC, the higher the recognition accuracy and the better the effect. In order to verify the superiority of CNN in vehicle noise recognition, the results are input into the traditional BP neural network and deep belief network for classification and recognition, and all the above classification results are compared with CNN. The results of the embodiment for different lanes, whether there are vehicles, vehicle models and vehicle numbers are shown in the table.
[0182] Table 2 Comparison of different lane sound recognition by different classification methods
[0183] Classification method First lane recognition accuracy Second lane recognition accuracy The third lane recognition accuracy Fourth lane recognition accuracy BP 76.1% 76.8% 68.5% 74.0% DBN 80.4% 81.1% 72.4% 78.1% CNN 88.60% 89.40% 79.80% 86.10%
[0184] It can be seen that CNN performs better than the other two methods in identifying the lane position of the vehicle. It also shows a higher accuracy in identifying the sound in the first lane for vehicles in different lanes.
[0185] Table 3 Comparative implementation of sound recognition of different vehicle types using different classification methods
[0186] Classification method 0 Vehicle recognition accuracy Is it the car type recognition accuracy? BP 83.6% 69.2% DBN 88.3% 73.1% CNN 97.3% 80.6%
[0187] It can be seen that CNN outperforms the other two methods in identifying whether there is a car and the type of vehicle, and also shows a higher accuracy in identifying the vehicle type as a small car.
[0188] Table 4 Comparative implementation of vehicle number and sound recognition using different classification methods
[0189] Classification method 1 vehicle recognition accuracy 2 Vehicle Recognition Accuracy BP 80.8% 74.3% DBN 85.3% 78.8% CNN 94.1% 88.1%
[0190] It can be seen that CNN performs better than the other two methods in identifying the number of vehicles, and shows higher accuracy in sound recognition of a single vehicle for different numbers of vehicles.
[0191] In practical applications, the same method as the previous steps is first used to obtain the fusion features of the road to be tested. Then, the fusion features are input into the trained vehicle recognition model to output the recognition results of the vehicles on the road to be tested. These results include information such as the vehicle's location, speed, and driving direction, providing detailed monitoring data for the traffic management department.
[0192] The above description is only a specific implementation mode of the present invention, but the protection scope of the present invention is not limited thereto. Any technician familiar with the technical field can easily think of changes or substitutions within the technical scope disclosed by the present invention, which should be covered by the protection scope of the present invention.
Claims
1. A method for detecting road vehicles under complex weather conditions, characterized in that: The following steps are involved: S10, obtaining a monitoring video and a monitoring audio set of a road in a complex weather environment, and performing preprocessing to obtain a basic video and a basic audio set; S20, dividing each basic audio according to energy or zero crossing rate to obtain multiple audio segments, and time-aligning each basic audio according to the start and end time and amplitude characteristics of the audio segment of each basic audio to obtain an aligned basic audio set, recorded as a first audio set, including multiple first audios; S30, using a low-pass filtering algorithm + a spectral subtraction noise reduction algorithm to perform noise reduction on each first audio to obtain a second audio, and correspondingly forming a second audio set; S40, extracting audio features for each second audio, including time domain features and frequency domain features; S50, performing the following steps on the video stream of the basic video: Canny edge detection, HoughLine detection, vehicle road positioning based on a frame difference method, and visual feature detection to obtain image features; S60, performing multimodal fusion on the audio features and the image features according to the corresponding relationship in time and the geographical location information obtained by the RTK technology to obtain fusion features, and obtaining the vehicle artificial identification label in the video stream; S70, repeating steps S10 to S60 to obtain multiple sets of fusion features and corresponding vehicle manual identification labels, training a CNN neural network, and obtaining a vehicle identification model; S80, according to the method of steps S10 to S60, obtaining a fusion model of the road to be tested, inputting it into the vehicle recognition model, and outputting a vehicle recognition result; The CNN neural network is a distributed CNN neural network based on load balancing, and its specific structure includes: Data segmentation module: evenly divides the training data into multiple computing nodes; Parallel computing module: Each computing node uses local data to train the weight parameters of the neural network in parallel; Parameter merging module: periodically summarizes the local model parameters of each node, performs global weighted averaging, and obtains new global model parameters; Parameter distribution module: distributes the merged global model parameters to each computing node, replacing the original local parameters; Load balancing module: Dynamically monitor the computing load of each node and dynamically allocate computing nodes to avoid long-term overload of some nodes and affect training efficiency.
2. A method for detecting road vehicles under complex weather conditions according to claim 1, characterized in that: The monitoring audio set is obtained from a microphone array arranged on both sides of the road. The monitoring audio set includes monitoring audios of multiple microphones in the microphone array. The basic audio set includes basic audios obtained after preprocessing multiple monitoring audios.
3. The method for detecting road vehicles under complex weather conditions according to claim 1, characterized in that: The method for time-aligning each basic audio is to use a dynamic time stretching algorithm to perform time alignment.
4. The method for detecting road vehicles under complex weather conditions according to claim 1, characterized in that: The time domain features include short-time energy and short-time zero-crossing rate.
5. The method for detecting road vehicles under complex weather conditions according to claim 1, characterized in that: The frequency domain features include MFCC features and spectrum graph features.
6. A method for detecting road vehicles under complex weather conditions according to claim 5, characterized in that: The steps of acquiring the MFCC features specifically include: pre-emphasis, framing, windowing, fast Fourier transform, Mel filter filtering, logarithmic operation transformation, and discrete cosine transform.
7. The method for detecting road vehicles under complex weather conditions according to claim 5, characterized in that: The step of acquiring the spectrogram features includes processing the data of the second audio by using the short-time Fourier transform in the librosa library, and inputting the result of the data processing into the STFT to acquire the spectrogram features.
8. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores program instructions, which, when executed, are used to execute the method for detecting road vehicles under complex weather conditions as described in any one of claims 1 to 7.
9. A road vehicle detection system under complex weather conditions, characterized in that: Contains the computer-readable storage medium of claim 8.
