An ultrasonic water removal method and system for a camera
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- 北京千哩科技有限公司
- Filing Date
- 2026-03-12
- Publication Date
- 2026-05-29
AI Technical Summary
Existing technology cannot accurately adjust ultrasonic cleaning parameters according to the actual contamination status of the camera lens surface, resulting in insufficient cleaning power for stubborn contaminants or wasted energy when there is only slight contamination, and frequent vibration may shorten the life of the device.
By collecting ultrasonic echo signals reflected from the lens surface, an improved ResNet50 deep learning model is used to identify the pollution status. Combined with multi-sensor data, adaptive ultrasonic driving parameters, including operating frequency, transmission power, and duration, are generated to achieve intelligent diagnosis and adaptive control.
It significantly improves cleaning efficiency and reliability, reduces ineffective energy consumption, enhances the system's adaptability under different working conditions and environments, and ensures the imaging quality of the camera in complex environments.
Smart Images

Figure CN122120579A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of ultrasonic water removal technology, and in particular to an ultrasonic water removal method and system for cameras. Background Technology
[0002] With the widespread adoption of visual perception technology across numerous fields, cameras have become an indispensable core sensor in modern intelligent systems. From advanced driver assistance systems and mobile robot navigation to security monitoring, industrial automation inspection, and even consumer electronics, cameras play a crucial role in capturing high-quality image data. However, cameras operating outdoors or in high-humidity environments are highly susceptible to the accumulation of moisture, water mist, frost, and other contaminants on their lens surfaces, leading to a significant decrease in image quality and a shortened effective viewing distance. Traditional methods for periodically wiping cameras that are difficult to clean manually or when unattended primarily rely on mechanical methods, which are not ideal and unsuitable for environments demanding high image quality.
[0003] Currently, some technical solutions apply ultrasonic cleaning to optical windows, mainly through a fixed timing controller that periodically or manually triggers the ultrasonic transducer. Its working logic is relatively simple: once triggered, the system drives the transducer to vibrate at a preset fixed frequency and power for a fixed duration to complete the cleaning task.
[0004] The aforementioned technology cannot detect the actual state of contamination on the lens surface. Regardless of whether the lens has a thin layer of fog, scattered water droplets, or a thick mixture of mud and water, it uses a fixed set of parameters for cleaning. This operating mode may not be effective enough for stubborn contaminants, while it may waste energy for slightly contaminated or clean surfaces, and may even shorten the lifespan of the device due to unnecessary frequent vibrations. Summary of the Invention
[0005] To address the issues of insufficient cleaning power for stubborn contaminants, while causing energy waste for slight contamination or clean conditions, and potentially shortening device lifespan due to unnecessary frequent vibrations, this application provides an ultrasonic water removal method and system for cameras.
[0006] Firstly, this application provides an ultrasonic water removal method for a camera, employing the following technical solution: including: The ultrasonic echo signal reflected from the surface of the camera lens is acquired, and the ultrasonic echo signal is preprocessed to extract features and obtain ultrasonic features. The preprocessed ultrasonic features are input into a pre-trained deep learning model, which outputs a classification result of the lens state, including clean, thin water mist, discrete water droplets, and thick water film. When the classification result indicates that the lens is in a contaminated state, multi-sensor data is acquired, and a cleaning decision instruction is generated in combination with the classification result. Based on the cleaning decision instruction and the classification result, ultrasonic driving parameters are generated, including working frequency, transmission power and working duration. The ultrasonic transducer is driven to perform a water removal operation according to the ultrasonic driving parameters. After the water removal operation is performed, the ultrasonic echo signal is re-acquired and the classification result is updated. If the updated classification result still indicates a contaminated state, the ultrasonic driving parameters are adjusted and the cleaning steps are repeated until the classification result indicates clean or the preset number of retries is reached.
[0007] Preferably, the step of acquiring the ultrasonic echo signal reflected from the surface of the camera lens and preprocessing the ultrasonic echo signal to extract features and obtain ultrasonic features includes: Control the ultrasonic transducer to emit detection pulses and simultaneously acquire the ultrasonic echo signal formed by the reflection from the lens surface to obtain the original time domain signal; The time-domain signal is subjected to noise reduction processing to eliminate environmental noise and system noise; The denoised time-domain signal is normalized to unify its amplitude range to a preset interval. Time-frequency analysis is performed on the normalized time-domain signal to convert it into a two-dimensional time-spectrum graph. The two-dimensional time-spectrum graph is adjusted to the input data format required by the deep learning model, and the adjusted time-spectrum graph is defined as the ultrasonic feature.
[0008] Preferably, the step of inputting the preprocessed ultrasonic features into a pre-trained deep learning model, and having the deep learning model output a classification result of the lens state, includes: The ultrasonic features are passed through multiple stages of the improved ResNet50 model, with at least one stage followed by a convolutional attention module. The convolutional attention module performs weighted optimization on the feature map by sequentially calculating channel attention weights and spatial attention weights. The feature maps extracted and optimized through the aforementioned multiple stages are then mapped to confidence levels corresponding to the classification of each shot state through a global average pooling layer and a fully connected layer. The category corresponding to the highest confidence level is output as the final classification result.
[0009] Preferably, the ultrasonic features are sequentially passed through multiple stages of an improved ResNet50 model, wherein at least one stage is followed by a convolutional attention module. The convolutional attention module performs weighted optimization on the feature map by sequentially calculating channel attention weights and spatial attention weights, including: The input feature map is received from the output of one stage of the improved ResNet50 model. Global average pooling and global max pooling are performed on the input feature map respectively to obtain two channel description vectors. The two channel description vectors are input into a shared multilayer perceptron, which includes a first layer and a second layer. The first layer compresses the channel dimension based on the original number of channels, and the second layer restores the channel dimension to the original number of channels, outputting two feature vectors. The two feature vectors output by the shared multilayer perceptron are added element-wise, and then normalized by the Sigmoid activation function to generate channel attention weights. The channel attention weights are multiplied element-wise with the input feature map to generate a channel-weighted feature map. Preferably, after multiplying the channel attention weights element-wise with the input feature map to generate a channel-weighted feature map, the method further includes: Based on the channel-weighted feature map, global average pooling and global max pooling are performed along the channel dimension to obtain two two-dimensional spatial feature maps. The two two-dimensional spatial feature maps are concatenated along the channel dimension, and a convolution operation with a kernel size of 7x7 is performed on the concatenated feature map to reduce the number of channels to 1. The dimensionality-reduced feature map is normalized using the Sigmoid activation function to generate spatial attention weights; The spatial attention weights are multiplied element-wise with the channel-weighted feature map to generate a weighted optimized feature map, which is then output to the next stage of the improved ResNet50 model.
[0010] Preferably, when the classification result indicates that the lens is in a contaminated state, acquiring multi-sensor data and generating a cleaning decision instruction based on the classification result, and generating ultrasonic drive parameters based on the cleaning decision instruction and the classification result, includes: When the classification result indicates a pollution state, multi-sensor data is acquired from the sensor node. The multi-sensor data includes inertial measurement unit data, positioning system data, and environmental sensor data. Based on the multi-sensor data, the current environmental context is determined. The environmental context includes motion state and external environmental conditions. The pollution type indicated by the classification results is fused and analyzed with the environmental context to generate a cleaning decision instruction, which includes a cleaning level and a targeted cleaning mode. Based on the cleaning decision instruction and the pollution type, a predefined parameter mapping table is queried to generate the corresponding ultrasonic drive parameters. The operating frequency is selected according to the pollution type: a first frequency range is used for thin water mist, a second frequency range higher than the first frequency range is used for discrete water droplets, and a third frequency range including the low frequency band is used for thick water films to excite a larger amplitude. The transmission power is set according to the cleaning urgency level; the higher the level, the greater the power. The working duration is set according to the pollution type and the cleaning mode.
[0011] Preferably, the step of fusing the pollution type indicated by the classification result with the environmental context to generate a clean decision instruction includes: The urgency of cleaning is determined based on the motion state in the environmental context, and then adjusted according to the type of pollution to generate a cleaning level. Based on the pollution type and the external environmental conditions in the environmental context, the corresponding cleaning mode is selected. When the pollution type is discrete water droplets and the ambient temperature is below freezing, the ice-breaking mode with periodic pulses is selected. When the pollution type is thin water mist and is in a high-speed moving state, the low-power continuous anti-condensation mode is selected. When the pollution type is thick water film and the ambient humidity is high, the high-power short-time enhanced strong cleaning mode is selected. The cleaning level and the cleaning mode are combined to generate the final cleaning decision instruction.
[0012] Secondly, this application discloses an ultrasonic water removal device for a camera, which adopts the following technical solution, including: The data acquisition module is used to acquire ultrasonic echo signals reflected from the surface of the camera lens, and to preprocess the ultrasonic echo signals to extract features and obtain ultrasonic features. The data classification module is used to input the preprocessed ultrasonic features into a pre-trained deep learning model, and the deep learning model outputs a classification result of the lens state, which includes clean, thin water mist, discrete water droplets and thick water film. The cleaning instruction module is used to acquire multi-sensor data when the classification result indicates that the lens is in a contaminated state, and generate a cleaning decision instruction based on the classification result. Based on the cleaning decision instruction and the classification result, ultrasonic driving parameters are generated, including working frequency, transmission power and working duration. The effect verification module is used to drive the ultrasonic transducer to perform a water removal operation according to the ultrasonic driving parameters. After the water removal operation is performed, the ultrasonic echo signal is re-acquired and the classification result is updated. If the updated classification result still indicates a polluted state, the ultrasonic driving parameters are adjusted and the cleaning steps are repeated until the classification result indicates clean or the preset number of retries is reached.
[0013] Thirdly, this application also provides a control device, the device comprising: It includes a memory and a processor, wherein the memory stores a computer program that can be loaded by the processor and executed, such as the ultrasonic water removal method for a camera described above.
[0014] Fourthly, this application also provides a computer-readable storage medium storing a computer program that can be loaded by a processor and executed as described above for an ultrasonic water removal method for a camera.
[0015] In summary, this application collects and preprocesses ultrasonic echo signals reflected from the lens surface, converting them into ultrasonic features that can be analyzed by a deep learning model. These features are then input into a pre-trained improved ResNet50 model, which integrates a CBAM attention mechanism to accurately identify and output classification results of the contamination state on the lens surface, such as clean, thin water mist, discrete water droplets, or thick water film. When contamination is detected, the system immediately integrates environmental context data from multiple sensors, including inertial navigation and GPS, and generates decision instructions containing cleanliness levels and cleaning modes through fusion analysis. Based on the cleaning instructions and the specific contamination type, the system adaptively maps and generates optimal ultrasonic driving parameters, including operating frequency, transmission power, and operating duration. Finally, after driving the transducer to perform cleaning, the system collects signals again to verify the effect. If the results are not satisfactory, the parameters are adjusted and the system cycles through cleaning until success or the retry limit is reached. Through intelligent diagnosis and adaptive control, a fundamental shift has been achieved from blindly applying a one-size-fits-all approach to precise and targeted solutions, significantly improving cleaning efficiency and reliability, reducing ineffective energy consumption, enhancing the system's adaptability and cleaning capabilities under different working conditions and environments, and ensuring the imaging quality of the camera in complex environments. Attached Figure Description
[0016] Figure 1 This is a schematic diagram of an ultrasonic water removal method for cameras.
[0017] Figure 2 This is a structural block diagram of an ultrasonic water removal device for cameras. Detailed Implementation
[0018] The following combination Figures 1-2 This application will be described in further detail.
[0019] Reference Figure 1 The embodiments of this application include at least steps S10 to S40.
[0020] S10: Acquire ultrasonic echo signals reflected from the surface of the camera lens, and preprocess the ultrasonic echo signals to extract features and obtain ultrasonic features. S20, the pre-processed ultrasonic features are input into the pre-trained deep learning model, and the deep learning model outputs the classification results of the lens state, including clean, thin water mist, discrete water droplets and thick water film. S30: When the classification result indicates that the lens is in a contaminated state, acquire multi-sensor data and generate a cleaning decision command based on the classification result. Based on the cleaning decision command and the classification result, generate ultrasonic drive parameters, including working frequency, transmission power and working duration. S40: Drive the ultrasonic transducer to perform water removal operation according to the ultrasonic drive parameters. After the water removal operation is performed, re-acquire the ultrasonic echo signal and update the classification result. If the updated classification result still indicates a contaminated state, adjust the ultrasonic drive parameters and repeat the cleaning steps until the classification result indicates clean or the preset number of retries is reached.
[0021] Specifically, the system acquires and preprocesses ultrasonic echo signals to obtain standardized features. Then, a deep learning model is used to intelligently diagnose these features, outputting a specific contamination status classification. When contamination is detected, multi-sensor data is fused to generate a cleaning decision, adaptively generating optimal ultrasonic drive parameters, including frequency, power, and duration. Finally, after the cleaning operation, the effect is immediately re-tested and verified. If the cleaning standard is not met, the parameters are automatically adjusted for a second cleaning, forming a continuously optimized closed-loop control until the lens is completely clean. Through intelligent diagnosis and adaptive control, a fundamental shift from indiscriminate, one-size-fits-all approaches to precise, targeted solutions is achieved, significantly improving cleaning efficiency and reliability, reducing ineffective energy consumption, enhancing the system's adaptability and cleaning capabilities under different operating conditions and environments, and ensuring the camera's imaging quality in complex environments. In some implementations, step S10 specifically includes the following steps: controlling the ultrasonic transducer to emit detection pulses and simultaneously acquiring ultrasonic echo signals formed by reflections from the lens surface to obtain the original time-domain signal; performing noise reduction processing on the time-domain signal to eliminate environmental noise and system noise; performing normalization processing on the noise-reduced time-domain signal to unify its amplitude range to a preset interval; performing time-frequency analysis on the normalized time-domain signal to convert it into a two-dimensional time-spectrum graph; adjusting the two-dimensional time-spectrum graph to the input data format required by the deep learning model, and defining the adjusted time-spectrum graph as an ultrasonic feature.
[0022] Specifically, the system controls the ultrasonic transducer to emit detection pulses and simultaneously acquires reflected signals to obtain the original time-domain signal. Subsequently, the time-domain signal is subjected to noise reduction processing to eliminate interference, normalization processing to unify the signal amplitude benchmark, and time-frequency analysis to convert it into a two-dimensional time-spectrum graph that can simultaneously display time-domain and frequency-domain characteristics. Finally, the time-spectrum graph is adjusted to the input format required by the deep learning model, thereby completing the entire preprocessing process from the original signal to standardized and structured feature data.
[0023] In some implementations, step S20 specifically includes the following steps: passing the ultrasonic features sequentially through multiple stages of the improved ResNet50 model, wherein at least one stage is followed by a convolutional attention module, and the convolutional attention module performs weighted optimization on the feature map by sequentially calculating channel attention weights and spatial attention weights; mapping the feature map extracted and optimized through multiple stages to a confidence level corresponding to each lens state classification by passing it through a global average pooling layer and a fully connected layer; and outputting the category corresponding to the highest confidence level as the final classification result.
[0024] The ultrasonic features are sequentially passed through multiple stages of an improved ResNet50 model, with at least one stage followed by a convolutional attention module. This convolutional attention module performs weighted optimization on the feature map by sequentially calculating channel attention weights and spatial attention weights. The process includes: receiving the input feature map output from one stage of the improved ResNet50 model; performing global average pooling and global max pooling on the input feature map to obtain two channel description vectors; inputting these two channel description vectors into a shared multilayer perceptron, which contains a first layer and a second layer. The first layer compresses the channel dimension based on the original number of channels, while the second layer restores the channel dimension to the original number of channels, outputting two feature vectors; adding the two feature vectors output from the shared multilayer perceptron element-wise, then normalizing them using a sigmoid activation function to generate channel attention weights; and multiplying these channel attention weights element-wise with the input feature map to generate a channel-weighted feature map. Based on the channel-weighted feature maps, global average pooling and global max pooling are performed along the channel dimension to obtain two two-dimensional spatial feature maps. The two two-dimensional spatial feature maps are concatenated along the channel dimension, and a 7x7 convolution operation is performed on the concatenated feature map to reduce the number of channels to 1. The dimensionality-reduced feature map is normalized by the Sigmoid activation function to generate spatial attention weights. The spatial attention weights are then multiplied element-wise with the channel-weighted feature maps to generate a weighted optimized feature map, which is then output to the next stage of the improved ResNet50 model.
[0025] In this embodiment, the deep learning model is an improved ResNet50 model.
[0026] Specifically, the system inputs the preprocessed ultrasonic features into an improved ResNet50 model for deep feature extraction. A convolutional attention module, introduced after multiple stages of the network, first performs global average pooling and max pooling on the input feature map to obtain channel description vectors. These vectors are then compressed and their channel dimensions restored using a shared multilayer perceptron to generate channel attention weights, thus optimizing the channel dimension features. Next, the optimized feature map undergoes global average pooling and max pooling along the channel dimension to obtain spatial feature maps. These are then concatenated and dimensionality reduced using 7×7 convolutions to generate spatial attention weights, enabling focus on important spatial regions. The feature maps optimized by this dual attention mechanism continue to propagate through the network, ultimately being transformed into confidence levels for each contamination state through a global average pooling layer and a fully connected layer. The category corresponding to the highest confidence level is then output as the final diagnostic result.
[0027] In some implementations, step S30 specifically includes the following steps: when the classification result indicates a pollution state, multi-sensor data is acquired from the sensor node, including inertial measurement unit data, positioning system data, and environmental sensor data; the current environmental context is determined based on the multi-sensor data, including motion state and external environmental conditions; the pollution type indicated by the classification result is fused and analyzed with the environmental context to generate a cleaning decision instruction, including a cleaning level and a targeted cleaning mode; according to the cleaning decision instruction and the pollution type, a predefined parameter mapping table is queried to generate corresponding ultrasonic drive parameters; the working frequency is selected according to the pollution type, using a first frequency range for thin water mist, a second frequency range higher than the first frequency range for discrete water droplets, and a third frequency range including low frequency bands to excite a larger amplitude for thick water films; the transmission power is set according to the cleaning urgency level, with higher levels requiring higher power; and the working duration is set according to the pollution type and cleaning mode.
[0028] Furthermore, the pollution type indicated by the classification results is fused with the environmental context to generate cleaning decision instructions, including: determining the cleaning urgency based on the movement state in the environmental context and modifying it according to the pollution type to generate a cleaning level; selecting the corresponding cleaning mode according to the pollution type and the external environmental conditions in the environmental context: when the pollution type is discrete water droplets and the ambient temperature is below freezing, an ice-breaking mode with periodic pulses is selected; when the pollution type is thin water mist and in a high-speed moving state, a low-power continuous anti-condensation mode is selected; when the pollution type is thick water film and the ambient humidity is high, a high-power short-time enhanced strong removal mode is selected; and combining the cleaning level and cleaning mode to generate the final cleaning decision instructions.
[0029] Specifically, when a contamination state is diagnosed, the system immediately acquires inertial navigation, positioning, and environmental sensor data to determine the environmental context, including motion state and external conditions. Then, it fuses and analyzes the contamination type with the environmental context. First, it determines the basic cleaning urgency based on the motion state and adjusts it according to the contamination type to generate a cleaning level. Simultaneously, it selects a targeted cleaning mode based on the contamination type and external conditions. For example, it activates an ice-breaking mode when discrete water droplets are detected and the temperature is low; an anti-condensation mode is used when encountering thin water mist and high-speed movement; and a powerful removal mode is activated when facing a thick water film and a high-humidity environment. Finally, it combines the cleaning level and cleaning mode into a decision command and uses this command to query a parameter mapping table to generate optimal ultrasonic drive parameters. The operating frequency is set differently according to the contamination type, the transmission power increases with the cleaning level, and the operating duration is determined comprehensively based on the contamination type and cleaning mode, thus achieving precise and adaptive cleaning strategy formulation.
[0030] The implementation principle of an ultrasonic water removal method for a camera according to an embodiment of this application is as follows: Ultrasonic echo signals reflected from the lens surface are collected and preprocessed, converting them into ultrasonic features that can be analyzed by a deep learning model. These features are then input into a pre-trained improved ResNet50 model, which integrates a CBAM attention mechanism to accurately identify and output classification results of the contamination state on the lens surface, such as clean, thin water mist, discrete water droplets, or thick water film. When contamination is detected, the system immediately integrates environmental context data from multiple sensors, including inertial navigation and GPS, and generates decision instructions containing cleaning levels and cleaning modes through fusion analysis. Based on the cleaning instructions and the specific type of contamination, the system adaptively maps and generates optimal ultrasonic driving parameters, including operating frequency, transmission power, and operating duration. Finally, after driving the transducer to perform cleaning, the system collects signals again to verify the effect. If the target is not met, the parameters are adjusted and the cleaning cycle continues until success is achieved or the retry limit is reached. Through intelligent diagnosis and adaptive control, a fundamental shift has been achieved from blindly applying a one-size-fits-all approach to precise and targeted solutions, significantly improving cleaning efficiency and reliability, reducing ineffective energy consumption, enhancing the system's adaptability and cleaning capabilities under different working conditions and environments, and ensuring the imaging quality of the camera in complex environments.
[0031] Figure 1 This is a schematic flowchart of an ultrasonic water removal method for a camera in one embodiment. It should be understood that, although... Figure 1 The steps in the flowchart are shown as indicated by the arrows, but these steps are not necessarily executed in the order indicated by the arrows; unless explicitly stated herein, there is no strict order requirement for the execution of these steps, and they can be executed in other orders; and Figure 1At least some of the steps in the process may include multiple sub-steps or multiple stages. These sub-steps or stages are not necessarily executed at the same time, but may be executed at different times. The execution order of these sub-steps or stages is not necessarily one, but may be executed in turn or alternately with other steps or at least some of the sub-steps or stages of other steps.
[0032] Based on the same technical concept, referring to Figure 2 This application also provides an ultrasonic water removal device for a camera, which adopts the following technical solution: the device includes: The data acquisition module is used to acquire ultrasonic echo signals reflected from the surface of the camera lens, and to preprocess the ultrasonic echo signals to extract features and obtain ultrasonic features. The data classification module is used to input the pre-processed ultrasonic features into a pre-trained deep learning model, and the deep learning model outputs the classification results of the lens state, including clean, thin water mist, discrete water droplets and thick water film. The cleaning instruction module is used to acquire multi-sensor data when the classification result indicates that the lens is in a contaminated state, and generate a cleaning decision instruction based on the classification result. Based on the cleaning decision instruction and the classification result, ultrasonic drive parameters are generated, including working frequency, transmission power and working duration. The effect verification module is used to drive the ultrasonic transducer to perform water removal operation according to the ultrasonic drive parameters. After the water removal operation is performed, the ultrasonic echo signal is re-acquired and the classification result is updated. If the updated classification result still indicates a contaminated state, the ultrasonic drive parameters are adjusted and the cleaning steps are repeated until the classification result indicates clean or the preset number of retries is reached.
[0033] In some embodiments, the data acquisition module is specifically used to control the ultrasonic transducer to emit detection pulses and simultaneously acquire the ultrasonic echo signal formed by the reflection of the lens surface to obtain the original time domain signal. Noise reduction processing is performed on the time-domain signal to eliminate environmental and system noise; The denoised time-domain signal is normalized to unify its amplitude range to a preset interval. Time-frequency analysis is performed on the normalized time-domain signal to convert it into a two-dimensional time-spectrum graph. The two-dimensional time-spectrum graph is adjusted to the input data format required by the deep learning model, and the adjusted time-spectrum graph is defined as an ultrasonic feature.
[0034] In some embodiments, the data classification module is specifically used to pass the ultrasonic features sequentially through multiple stages of the improved ResNet50 model, wherein at least one stage is followed by a convolutional attention module, which performs weighted optimization on the feature map by sequentially calculating channel attention weights and spatial attention weights. The feature maps extracted and optimized through multiple stages are mapped to confidence scores corresponding to the classification of each shot state through a global average pooling layer and a fully connected layer. The category corresponding to the highest confidence level is output as the final classification result.
[0035] In some embodiments, the data classification module is specifically used to receive the input feature map of a stage output of the improved ResNet50 model, and to perform global average pooling and global max pooling on the input feature map to obtain two channel description vectors. Two channel description vectors are input into a shared multilayer perceptron, which contains a first layer and a second layer. The first layer compresses the channel dimension based on the original number of channels, and the second layer restores the channel dimension to the original number of channels, outputting two feature vectors. The two feature vectors output by the shared multilayer perceptron are added element by element, and then normalized by the sigmoid activation function to generate channel attention weights. The channel attention weights are multiplied element-wise with the input feature map to generate a channel-weighted feature map. In some embodiments, the data classification module is specifically used to perform global average pooling and global max pooling along the channel dimension based on the channel-weighted feature map to obtain two two-dimensional spatial feature maps. Two two-dimensional spatial feature maps are concatenated along the channel dimension, and a 7x7 convolution operation is performed on the concatenated feature map to reduce the number of channels to 1. The dimensionality-reduced feature map is normalized using the Sigmoid activation function to generate spatial attention weights; The spatial attention weights are multiplied element-wise with the channel-weighted feature map to generate a weighted optimized feature map, which is then output to the next stage of the improved ResNet50 model.
[0036] In some embodiments, the cleaning instruction module is specifically used to acquire multi-sensor data from the sensor node when the classification result indicates a pollution state. The multi-sensor data includes inertial measurement unit data, positioning system data, and environmental sensor data. Based on the multi-sensor data, the module determines the current environmental context, which includes motion state and external environmental conditions. The pollution type indicated by the classification results is integrated with the environmental context to generate cleaning decision instructions, which include cleaning level and targeted cleaning mode. Based on the cleaning decision instructions and the type of contamination, the system queries a predefined parameter mapping table to generate corresponding ultrasonic drive parameters. The operating frequency is selected according to the type of contamination: a first frequency range is used for thin water mist, a second frequency range higher than the first frequency range is used for discrete water droplets, and a third frequency range including the low frequency band is used for thick water films to excite a larger amplitude. The transmission power is set according to the cleaning urgency level; the higher the level, the greater the power. The working duration is set according to the type of contamination and the cleaning mode.
[0037] In some embodiments, the cleaning instruction module is specifically used to determine the cleaning urgency based on the motion state in the environmental context, and to modify it in combination with the type of contamination to generate a cleaning level; Based on the type of pollution and the external environmental conditions in the context, select the corresponding cleaning mode. When the pollution type is discrete water droplets and the ambient temperature is below freezing, select the ice-breaking mode with periodic pulses. When the pollution type is thin water mist and is in a high-speed moving state, select the low-power continuous anti-condensation mode. When the pollution type is thick water film and the ambient humidity is high, select the high-power short-time enhanced strong cleaning mode. By combining cleaning levels and cleaning modes, the final cleaning decision instructions are generated.
[0038] This application also discloses a control device.
[0039] Specifically, the control device includes a memory and a processor, the memory storing a computer program that can be loaded by the processor and executed as described above for an ultrasonic water removal method for a camera.
[0040] This application also discloses a computer-readable storage medium.
[0041] Specifically, the computer-readable storage medium stores a computer program that can be loaded by a processor and executed, such as the ultrasonic water removal method for a camera described above. The computer-readable storage medium includes, for example, various media capable of storing program code, such as a USB flash drive, a portable hard drive, a read-only memory (ROM), a random access memory (RAM), a magnetic disk, or an optical disk.
[0042] The above are all preferred embodiments of this application, and are not intended to limit the scope of protection of this application. Therefore, all equivalent changes made in accordance with the structure, shape and principle of this application should be covered within the scope of protection of this application.
Claims
1. An ultrasonic water removal method for a camera, characterized in that, include: The ultrasonic echo signal reflected from the surface of the camera lens is acquired, and the ultrasonic echo signal is preprocessed to extract features and obtain ultrasonic features. The preprocessed ultrasonic features are input into a pre-trained deep learning model, which outputs a classification result of the lens state, including clean, thin water mist, discrete water droplets, and thick water film. When the classification result indicates that the lens is in a contaminated state, multi-sensor data is acquired, and a cleaning decision instruction is generated in combination with the classification result. Based on the cleaning decision instruction and the classification result, ultrasonic driving parameters are generated, including working frequency, transmission power and working duration. The ultrasonic transducer is driven to perform a water removal operation according to the ultrasonic driving parameters. After the water removal operation is performed, the ultrasonic echo signal is re-acquired and the classification result is updated. If the updated classification result still indicates a contaminated state, the ultrasonic driving parameters are adjusted and the cleaning steps are repeated until the classification result indicates clean or the preset number of retries is reached.
2. The ultrasonic water removal method for a camera according to claim 1, characterized in that, The process of acquiring ultrasonic echo signals reflected from the surface of the camera lens and preprocessing the ultrasonic echo signals to extract features and obtain ultrasonic features includes: Control the ultrasonic transducer to emit detection pulses and simultaneously acquire the ultrasonic echo signal formed by the reflection from the lens surface to obtain the original time domain signal; The time-domain signal is subjected to noise reduction processing to eliminate environmental noise and system noise; The denoised time-domain signal is normalized to unify its amplitude range to a preset interval. Time-frequency analysis is performed on the normalized time-domain signal to convert it into a two-dimensional time-spectrum graph. The two-dimensional time-spectrum graph is adjusted to the input data format required by the deep learning model, and the adjusted time-spectrum graph is defined as the ultrasonic feature.
3. The ultrasonic water removal method for a camera according to claim 1, characterized in that, The step of inputting the preprocessed ultrasonic features into a pre-trained deep learning model, and having the deep learning model output a classification result of the lens state, includes: The ultrasonic features are passed through multiple stages of the improved ResNet50 model, with at least one stage followed by a convolutional attention module. The convolutional attention module performs weighted optimization on the feature map by sequentially calculating channel attention weights and spatial attention weights. The feature maps extracted and optimized through the aforementioned multiple stages are then mapped to confidence levels corresponding to the classification of each shot state through a global average pooling layer and a fully connected layer. The category corresponding to the highest confidence level is output as the final classification result.
4. The ultrasonic water removal method for a camera according to claim 3, characterized in that, The ultrasonic features are sequentially passed through multiple stages of an improved ResNet50 model, with at least one stage followed by a convolutional attention module. The convolutional attention module performs weighted optimization of the feature map by sequentially calculating channel attention weights and spatial attention weights, including: The input feature map is received from the output of one stage of the improved ResNet50 model. Global average pooling and global max pooling are performed on the input feature map respectively to obtain two channel description vectors. The two channel description vectors are input into a shared multilayer perceptron, which includes a first layer and a second layer. The first layer compresses the channel dimension based on the original number of channels, and the second layer restores the channel dimension to the original number of channels, outputting two feature vectors. The two feature vectors output by the shared multilayer perceptron are added element-wise, and then normalized by the Sigmoid activation function to generate channel attention weights. The channel attention weights are multiplied element-wise with the input feature map to generate a channel-weighted feature map.
5. The ultrasonic water removal method for a camera according to claim 4, characterized in that, After multiplying the channel attention weights element-wise with the input feature map to generate a channel-weighted feature map, the method further includes: Based on the channel-weighted feature map, global average pooling and global max pooling are performed along the channel dimension to obtain two two-dimensional spatial feature maps. The two two-dimensional spatial feature maps are concatenated along the channel dimension, and a convolution operation with a kernel size of 7x7 is performed on the concatenated feature map to reduce the number of channels to 1. The dimensionality-reduced feature map is normalized using the Sigmoid activation function to generate spatial attention weights; The spatial attention weights are multiplied element-wise with the channel-weighted feature map to generate a weighted optimized feature map, which is then output to the next stage of the improved ResNet50 model.
6. The ultrasonic water removal method for a camera according to claim 1, characterized in that, When the classification result indicates that the lens is in a contaminated state, multi-sensor data is acquired, and a cleaning decision instruction is generated based on the classification result. Based on the cleaning decision instruction and the classification result, ultrasonic drive parameters are generated, including: When the classification result indicates a pollution state, multi-sensor data is acquired from the sensor node. The multi-sensor data includes inertial measurement unit data, positioning system data, and environmental sensor data. Based on the multi-sensor data, the current environmental context is determined. The environmental context includes motion state and external environmental conditions. The pollution type indicated by the classification results is fused and analyzed with the environmental context to generate a cleaning decision instruction, which includes a cleaning level and a targeted cleaning mode. Based on the cleaning decision instruction and the pollution type, a predefined parameter mapping table is queried to generate the corresponding ultrasonic drive parameters. The operating frequency is selected according to the pollution type: a first frequency range is used for thin water mist, a second frequency range higher than the first frequency range is used for discrete water droplets, and a third frequency range including the low frequency band is used for thick water films to excite a larger amplitude. The transmission power is set according to the cleaning urgency level; the higher the level, the greater the power. The working duration is set according to the pollution type and the cleaning mode.
7. The ultrasonic water removal method for a camera according to claim 6, characterized in that, The step of fusing the pollution type indicated by the classification results with the environmental context to generate a clean-up decision instruction includes: The urgency of cleaning is determined based on the motion state in the environmental context, and then adjusted according to the type of pollution to generate a cleaning level. Based on the pollution type and the external environmental conditions in the environmental context, the corresponding cleaning mode is selected. When the pollution type is discrete water droplets and the ambient temperature is below freezing, the ice-breaking mode with periodic pulses is selected. When the pollution type is thin water mist and is in a high-speed moving state, the low-power continuous anti-condensation mode is selected. When the pollution type is thick water film and the ambient humidity is high, the high-power short-time enhanced strong cleaning mode is selected. The cleaning level and the cleaning mode are combined to generate the final cleaning decision instruction.
8. An ultrasonic dehydration device for a camera, characterized in that, The device includes: The data acquisition module is used to acquire ultrasonic echo signals reflected from the surface of the camera lens, and to preprocess the ultrasonic echo signals to extract features and obtain ultrasonic features. The data classification module is used to input the preprocessed ultrasonic features into a pre-trained deep learning model, and the deep learning model outputs the classification results of the lens state, including clean, thin water mist, discrete water droplets and thick water film. The cleaning instruction module is used to acquire multi-sensor data and generate a cleaning decision instruction in combination with the classification result when the classification result indicates that the lens is in a contaminated state. Based on the cleaning decision instruction and the classification result, ultrasonic driving parameters are generated, including working frequency, transmission power and working duration. The effect verification module is used to drive the ultrasonic transducer to perform a water removal operation according to the ultrasonic driving parameters. After the water removal operation is performed, the ultrasonic echo signal is re-acquired and the classification result is updated. If the updated classification result still indicates a polluted state, the ultrasonic driving parameters are adjusted and the cleaning steps are repeated until the classification result indicates clean or the preset number of retries is reached.
9. A control device, characterized in that, The device includes: A memory and a processor, wherein the memory stores a computer program that can be loaded by the processor and executed as described in any one of claims 1 to 7.
10. A computer-readable storage medium, characterized in that, The computer program is stored that can be loaded by a processor and executed as described in any one of claims 1 to 7.