Underwater laser speckle surface roughness identification method based on lightweight neural network
By making lightweight improvements to the EfficientNetV2 network architecture and introducing SE and CBAM attention mechanisms, combined with the 'classification + conditional regression' strategy, the problems of low efficiency and unstable accuracy in underwater surface roughness measurement are solved, and high-precision, low-complexity underwater surface roughness detection is achieved.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- XIAN UNIV OF TECH
- Filing Date
- 2025-12-31
- Publication Date
- 2026-05-01
AI Technical Summary
Existing underwater surface roughness measurement methods suffer from low efficiency in underwater environments, unstable speckle mapping with traditional Gaussian light sources, poor generalization due to reliance on manual statistical features, and difficulty in deploying deep networks at the edge.
An underwater laser speckle recognition method based on a lightweight neural network is adopted. The EfficientNetV2 network architecture is used for structural pruning and channel sparsification. Combined with SE and CBAM attention mechanisms and a 'classification + conditional regression' strategy, LG beams with topological charge numbers of 0/1/3/5 are generated through Laguerre-Gaussian beams. An underwater speckle image dataset is constructed and features are extracted and selected.
It achieves high-precision, low-computational-complexity non-contact surface roughness measurement in underwater environments, suitable for rapid inspection of subsea pipelines and ship hull components, possessing high detection accuracy and low computational complexity, and adaptable to underwater inspection environments.
Smart Images

Figure CN121962873A_ABST
Abstract
Description
A Lightweight Neural Network-Based Method for Identifying Surface Roughness Using Underwater Laser Speckle Technical Field
[0001] This invention belongs to the field of artificial intelligence-assisted optical measurement technology, specifically relating to a method for identifying surface roughness using underwater laser speckle based on a lightweight neural network. Background Technology
[0002] Surface roughness refers to the spacing between the tiny peaks and valleys of a target surface, and is an important parameter for measuring the microscopic three-dimensional morphology of the target surface. In underwater engineering, marine equipment, and support applications, the roughness level determines the surface flow friction and fouling tendency, and reflects the service quality of the coating. Traditional roughness measurement methods include contact measurement using stylus profilometers and non-contact interferometric methods that are highly sensitive to the stability of the medium. While these methods offer considerable accuracy in free space, they are significantly limited in underwater environments: firstly, the probe and sealing components are prone to corrosion, resulting in high maintenance costs and poor long-term stability; secondly, the irregularity of the measured surface and deposits introduce contact disturbances and pose errors; and thirdly, underwater operational safety constraints make manual contact operation inefficient and difficult to support online, remote, and large-scale inspections.
[0003] To overcome the limitations of contact-based detection, non-contact surface roughness measurement methods based on optical principles have emerged. Existing research largely employs traditional Gaussian light sources, characterizing the speckle pattern and intensity distribution variations induced on the target surface to achieve rapid, non-destructive assessment applicable to complex surfaces. However, these methods often rely on manually calculated statistical features of the speckle image, making them susceptible to light source and environmental disturbances, thus limiting their generalization across different scenarios and their accuracy. Furthermore, absorption and scattering in underwater media lead to light intensity attenuation, and refractive index fluctuations cause wavefront distortion, further weakening the stable mapping of roughness by the speckle pattern.
[0004] To improve the stability of underwater speckle measurements, a Laguerre-Gaussian (LG) vortex beam carrying orbital angular momentum can be used. Its annular intensity distribution and central phase singularity can suppress the interference of paraxial backscattering on the imaging surface, maintaining higher speckle contrast and clearer structural details under conditions of equal power and path. Under conditions of short propagation distance and weak refractive index fluctuations, its annular energy and azimuth phase structure help maintain angular texture consistency. Simultaneously, the different azimuth phase gradient amplitudes corresponding to different topological charges form resolvable modal priors, thereby improving the discriminability of roughness-related textures.
[0005] To achieve stable characterization and prediction in complex underwater channels, deep learning methods can be used to automatically learn the multi-scale, nonlinear characteristics of speckle, replacing environmentally sensitive manual statistics. However, general network structures are complex and computationally and storage-intensive, making them unsuitable for deployment at the underwater end. Therefore, there is an urgent need for a non-contact roughness measurement technology that combines high detection accuracy with low computational complexity and adaptability to underwater detection environments. Summary of the Invention
[0006] The purpose of this invention is to provide a method for identifying surface roughness using underwater laser speckle based on lightweight neural networks, which solves the problems of low efficiency of contact roughness measurement in underwater environments, unstable speckle mapping of traditional Gaussian light sources, poor generalization due to reliance on manual statistical features, and difficulty in deploying deep networks at the edge.
[0007] To achieve the above objectives, the technical solution adopted in this invention is as follows: an underwater laser speckle identification surface roughness method based on a lightweight neural network, which performs structural pruning and channel sparsification on the EfficientNetV2 network architecture, introduces SE and CBAM attention mechanisms into the shallow and deep modules of the EfficientNetV2 network structure respectively to achieve efficient feature extraction and selection, and combines the output strategy of "classification + conditional regression" to complete the roughness numerical prediction.
[0008] As a preferred technical solution of the present invention, it is implemented according to the following steps: Step 1: Construct an underwater speckle image dataset; Step 2: After preprocessing and labeling all underwater speckle images in the underwater speckle image dataset obtained in Step 1, the dataset is divided to obtain a training set, a validation set, and a test set; Step 3: Build a lightweight LightEfficientNetV2 network; Step 4: Train the lightweight LightEfficientNetV2 network obtained in Step 3 using the training set and validation set obtained in Step 2 to obtain the optimal deep learning model; Step 5: Input the test set obtained in Step 2 into the optimal deep learning model obtained in Step 4 to identify the processing methods and roughness of different workpieces.
[0009] As a preferred technical solution of the present invention, in step 1, the constructed underwater speckle image dataset includes workpieces with different processing methods and roughness, different topological loads, and different water conditions.
[0010] As a preferred technical solution of the present invention, in step 1, specifically: a 532nm continuous laser is used and, after beam expansion and polarization control, incident on a spatial light modulator to generate an LG beam with a topological charge of 0 / 1 / 3 / 5, which is then guided by a reflector to the sample under test behind the water tank; the speckle pattern is captured at an imaging distance of 0.5m in the water tank along the normal direction of the sample using a telecentric lens and a CCD camera to obtain a measured underwater speckle dataset; the workpiece under test is processed by planing, milling, grinding, and lapping, and a dataset is constructed with 15 categories of labels for roughness calibration; simultaneously, data is collected in both still water and dynamic water conditions created by a water pump to simulate channel disturbances caused by flow field and small refractive index fluctuations in the engineering site and to verify cross-scene stability; finally, 20 sampling points are taken for each sample at equal intervals, and 10 images are collected at each point, resulting in a total of 24,000 labeled underwater speckle images.
[0011] As a preferred technical solution of the present invention, step 2 specifically involves: firstly, completing grayscale processing and binarization operations, as well as necessary morphological processing, to clearly separate the speckle pattern region and the background region; then, locating the speckle centroid and centering and cropping the effective speckle region; and using Gaussian filtering for noise reduction to effectively remove high-frequency noise from the speckle image and retain useful information as much as possible; subsequently, generating "processing method + roughness" labels based on the sample calibration information recorded in step S1; and finally, dividing the dataset into a training set, a validation set, and a test set in a 7:2:1 ratio.
[0012] As a preferred technical solution of the present invention, step 3 specifically comprises: a lightweight network consisting of one initial module, two FusedMBConv-SE modules, two MBConv-CBAM modules, one feature convergence and feature transformation module, and one conditional regression module; the initial module is the starting part of the network, which performs preliminary feature extraction and downsampling on the input speckle through 3×3 convolution with a stride of 2, normalization, and nonlinear activation, providing a stable low-level texture representation for the subsequent FusedMBConv-SE module; the FusedMBConv-SE module uses FusedMBConv in the shallow layers to reduce memory access and latency, and introduces SE channel attention for channel recalibration, suppressing unstable or redundant channel responses, improving signal-to-noise ratio and feature effectiveness, and is suitable for rapid screening of high-resolution shallow features; the MBConv-CBAM module uses M in the deep layers BConv maintains computational efficiency with a high number of channels and introduces CBAM attention for joint emphasis and suppression after feature aggregation, improving discriminativity and robustness, and facilitating stable learning of classification and regression heads. The feature aggregation and transformation module first integrates channel information through 1×1 convolution and aggregates spatial dimensions with global average pooling to obtain compact feature vectors with global semantics. Then, consisting of two fully connected layers and normalization / activation, the aggregated features undergo nonlinear transformation and dimensionality compression to form the final representation for prediction. The conditional regression module first maps the feature vectors to the classification label space of "processing method + roughness" through a fully connected layer to obtain the probability distribution of each category. Then, the classification probability vector is concatenated with the feature vector of the previous layer, and the roughness residual is output through the regression branch of two fully connected layers. Finally, the roughness is corrected and calibrated using the residual to obtain the final roughness value for processing method classification and prediction.
[0013] As a preferred technical solution of the present invention, step 4 specifically involves: inputting the preprocessed speckle image dataset obtained in step 2 into the LightEfficientNetV2 network obtained in step 3 for training to obtain the optimal deep learning model; the process of training the network using the dataset includes data cleaning, data labeling, data partitioning, data preprocessing, defining network layers, activation functions, loss functions and optimizers, forward propagation, loss calculation, backpropagation, batch training, model validation, and hyperparameter tuning.
[0014] As a preferred technical solution of the present invention, step 5 specifically involves: inputting the test set divided in step 2 into the optimal deep learning model obtained in step 4, identifying the sample processing method and roughness in an unknown underwater environment, calculating the accuracy and loss on the test set, and evaluating the performance of the final model.
[0015] The beneficial effects of this invention are: (1) The underwater laser speckle identification surface roughness method based on a lightweight neural network of this invention is the first to apply a Laguerre-Gaussian beam with orbital angular momentum to underwater roughness detection. By modulating the light field, the spatial structural characteristics of the speckle pattern are enhanced. Compared with the statistical feature scheme based on Gaussian light source, it obtains input with higher contrast and clearer structure under the conditions of equal power and equal path, and is suitable for non-contact measurement in underwater environment. (2) The underwater laser speckle identification surface roughness method based on a lightweight neural network of this invention has been improved with lightweight design on the EfficientNetV2 network architecture. It introduces a layered attention configuration of shallow SE and deep CBAM, and adopts a conditional regression head of "classification and calibration first, then residual correction". The proposed LightEfficientNetV2 network still has high numerical prediction accuracy and stability while maintaining a low number of parameters and a high inference speed, which is convenient for edge and embedded deployment. Attached Figure Description
[0016] The accompanying drawings, which are included to provide a further understanding of the invention and constitute a part of this invention, illustrate exemplary embodiments of the invention and are used to explain the invention, but do not constitute an undue limitation of the invention. In the drawings: Figure 1 is a flowchart illustrating a method for identifying surface roughness using underwater laser speckle based on a lightweight neural network according to an embodiment of the invention; Figure 2 is a schematic diagram of the optical path for underwater laser speckle acquisition experiments; Figure 3 is a diagram of the LightEfficientNetV2 network structure used for roughness identification in this invention; Figure 4 is a comparative experimental diagram of the roughness identification method of the model proposed in this invention; Figure 5 is a classification performance test diagram of the model proposed in this invention for identifying workpieces with different roughnesses under four different processing methods; Figure 6 is a regression performance test diagram of the model proposed in this invention for identifying workpieces with different roughnesses under four different processing methods. Detailed Implementation
[0017] The technical solution of the present invention will be further described in detail below with reference to the accompanying drawings and specific embodiments.
[0018] Example 1, as shown in Figure 1, addresses the problems of low efficiency in contact roughness measurement in underwater environments, instability of traditional Gaussian light source speckle mapping, poor generalization of reliance on manual statistical features, and difficulty in deploying deep networks at the edge. This invention provides a method for underwater laser speckle identification of surface roughness based on a lightweight neural network. Structural pruning and channel sparsification are performed on the EfficientNetV2 network architecture. SE and CBAM attention mechanisms are introduced into the shallow and deep modules of the EfficientNetV2 network structure, respectively, to achieve efficient feature extraction and selection. A "classification + conditional regression" output strategy is then combined to complete roughness numerical prediction. The specific implementation steps are as follows: Step 1: Construct an underwater speckle image dataset containing workpieces with different processing methods and roughnesses, different topological loads, and different water conditions; Step 2: After preprocessing and labeling all underwater speckle images in the dataset obtained in Step 1, divide the dataset to obtain a training set, a validation set, and a test set; Step 3: Build a lightweight LightEfficientNetV2 network; Step 4: Train the lightweight LightEfficientNetV2 network obtained in Step 3 using the training set and validation set obtained in Step 2 to obtain the optimal deep learning model; Step 5: Input the test set obtained in Step 2 into the optimal deep learning model obtained in Step 4 to identify the processing methods and roughnesses of different workpieces.
[0019] Through the above steps, the underwater laser speckle identification surface roughness method based on lightweight networks disclosed in this invention can be realized. Only the speckle image of the sample to be tested needs to be input into the optimal model to identify its processing method and roughness. This method features simple implementation, stable training, and fast inference, and can be used for non-contact rapid inspection of subsea pipelines, ship hull components, and underwater workpieces.
[0020] The difference between Example 2 and Example 1 is that in Example 2, step 1 of the underwater laser speckle identification surface roughness method based on a lightweight neural network of the present invention is as follows: The experimental light source is selected as a Laguerre-Gaussian vortex beam. A continuous laser is used to generate a fundamental mode Gaussian beam with an emission power of 0.75W, providing incident light with stable power, good spatial coherence, and good temporal coherence as the reference light source for generating vortex light and forming speckle. A laser with a wavelength of 532nm is selected to obtain lower absorption and scattering losses in clean water. The beam passes through a 4f beam expander and an aperture to improve the beam wavefront flatness and illumination uniformity, suppress high-frequency noise and sidelobes caused by the laser cavity or optical surface, purify the beam quality, and ensure that the beam has a uniform, clean, and approximately planar wavefront before phase modulation. A polarizer directs the expanded beam to the working polarization of the spatial light modulator (SLM) to ensure pure phase modulation rather than amplitude crosstalk. The SLM loads a spiral phase hologram onto the beam, and the experiment modulates the incident Gaussian light into an LG beam with a topological charge l = 0 / 1 / 3 / 5.
[0021] The modulated LG beam was guided into the water tank via a reflector at the desired incident angle, controlled within the range of 0° to 10°. The incident angle was kept constant during data acquisition. The experiment was conducted at a 5° angle to the surface normal of the roughness specimen to ensure the scattering surface remained at the same angle and position relative to the laser, maintaining a constant laser spot size. The water tank was 0.5m long. Speckle images were acquired under both still and flowing water conditions (flow rate of 1.8–2.5 m / s provided by a 60W circulating water pump) to simulate channel disturbances caused by flow field and minute refractive index fluctuations in an engineering setting and to verify cross-scenario stability.
[0022] The imaging end uses a telecentric lens and a CCD camera to record the speckle pattern on the target surface. The telecentric lens reduces image distortion and chromatic aberration, enabling better exposure and detail capture in low-light environments. The CCD camera with the lens is positioned along the normal direction of the measured surface and close to the water tank surface, ensuring a consistent observation plane throughout the experiment. Furthermore, the camera receives less specular reflection, effectively preventing signal saturation. The telecentric lens used in the experiment had an object distance of 110 mm, a numerical aperture of 0.025, and a focal length of 76.35 mm. The industrial camera CCD had a resolution of 1920 pixels × 1200 pixels, a maximum frame rate of 40 fps, and an acquisition interval of 10 ms.
[0023] The test samples were selected from those machined by planing, milling, grinding, and lapping. The roughness of the planed and milled samples included four grades: 0.8, 1.6, 3.2, and 6.3 μm; the grinding samples included four grades: 0.1, 0.2, 0.4, and 0.8 μm; and the lapping samples included three grades: 0.025, 0.05, and 0.1 μm. Fifteen labels were designed using the "machining method + roughness" approach. The samples were vertically fixed to a fixture on a 3D gimbal, with the gimbal in close contact with the water tank surface. The position of the tested surface was adjusted by changing the height of the gimbal and the lateral position of the fixture. During speckle image acquisition, both the gimbal and the sample were kept stationary. Finally, 20 sampling points were taken from each sample at equal intervals. For each topological charge and water state, 10 images were collected at each sampling point, resulting in a total of 24,000 labeled underwater speckle images. The difference between Example 3 and Example 2 is that in Example 3, step 2 of the underwater laser speckle identification surface roughness method based on lightweight neural networks of the present invention specifically involves: uniformly preprocessing and labeling the 24,000 underwater speckle images acquired in step S1. In addition to the target speckle region, the underwater laser speckle images also contain background regions, therefore it is necessary to extract the effective region of the laser speckle images. Furthermore, due to the influence of experimental conditions, the acquired laser speckle images may contain noise, so denoising processing is also required.
[0024] First, the original image needs to be converted to grayscale and subjected to maximum inter-class variance thresholding to transform it into a binary image, which is then used to coarsely separate the background region within the speckle pattern area. Let the pixel coordinates be... grayscale is The threshold is The pixels in a laser speckle image can be converted into two values: (1) Subsequently Morphological dilation and hole filling are applied to connect broken boundaries and eliminate internal voids, making the foreground contour continuous and closed, which facilitates subsequent connected component analysis and localization. This dilation and filling operation is widely used in speckle effective region truncation, which can significantly improve the separability of speckle patterns and backgrounds, thereby reducing the interference of invalid backgrounds on computational load and downstream learning. In this invention, a fixed threshold of 127 is selected, and the dilated convolution kernel is set to 5.
[0025] In binary foreground The centroid of the main connected component is calculated using the centroid method. Locate the geometric center of the speckle pattern: (2) with A square effective area is cropped around the center, and the unlit background around the edges is removed. The experiment selects an effective speckle area with a fixed side length of 500 pixels × 500 pixels, which can maintain the input scale in different samples and shooting conditions, while retaining sufficient speckle details for feature learning.
[0026] Underwater imaging is affected by sensor and channel disturbances, and speckle images often contain Gaussian and impulse noise. Considering that speckle information is mainly concentrated in low-frequency and mid-frequency components, isotropic Gaussian smoothing is first applied to the effective area to suppress high-frequency noise, while avoiding damage to the macroscopic texture and contrast of the speckle as much as possible.
[0027] After speckle preprocessing, the dataset was divided into a training set (16800 images), a validation set (4800 images), and a test set (2400 images) in a 7:2:1 ratio. Images from the training, validation, and test subdirectories were automatically read and labeled according to their categories using ImageFolder. The cropped images were then uniformly scaled to the network input resolution of 224 pixels × 224 pixels, and data augmentation was performed. The data format was then converted to tensor type, the mean and variance of the training set were calculated, and each channel of the image was standardized. This yielded the corresponding Dataset objects, which were then loaded in batches using DataLoader for subsequent training and evaluation.
[0028] The difference between Example 4 and Example 3 is that in Example 4, the underwater laser speckle identification surface roughness method based on lightweight neural network of the present invention is as follows: Step 3 is as follows: The lightweight network proposed in this invention consists of 1 initial module, 2 FusedMBConv-SE modules, 2 MBConv-CBAM modules, 1 feature convergence and feature transformation module, and 1 conditional regression module: The initial module is the starting part of the network. Stage 0 performs preliminary feature extraction and downsampling on the input speckle through 3×3 convolution with a stride of 2, normalization and nonlinear activation operations, so as to provide a stable low-level texture representation for the subsequent FusedMBConv-SE module.
[0029] The FusedMBConv-SE module is placed in the shallow layers of the network to perform local feature extraction and channel recalibration with low computational overhead. This module sequentially includes a fusion convolutional unit, normalization and non-linear activation, SE channel attention, and projective convolution and regularization. Specifically, the fusion convolutional unit uses a 3×3 convolution to simultaneously perform spatial feature extraction and channel transformation within a single branch, followed by batch normalization and SiLU activation to stabilize the training process and improve non-linear representation. Then, SE channel attention is introduced, compressing and re-expanding the global response of each channel. The resulting channel weights are used to adaptively scale features by channel, thereby suppressing redundant responses and emphasizing effective information. After recalibration, a 1×1 projective convolution integrates the channel dimensions to the target size and is normalized again for integration with subsequent stages. A Dropout layer with a dropout rate of 0.2 is configured at the end of the module to enhance generalization ability. To balance resolution preservation and multi-scale modeling, the network uses the FusedMBConv-SE module twice. Stage 1 is a resolution-preserving unit with a stride of 1, which is suitable for fast filtering of shallow features and channel recalibration without changing the feature map size. Stage 2 is a downsampling unit with a stride of 2, which completes the orderly reduction of spatial resolution by setting the stride at the fusion convolution, and at the same time, it is combined with projection convolution to achieve a moderate increase in the number of channels, so as to control the amount of computation and reserve capacity for subsequent deep representation.
[0030] The MBConv-CBAM module is deployed deep within the network to perform feature aggregation and discriminative enhancement with low computational overhead under conditions of high channel count. From front to back, this module includes channel expansion, depthwise separable convolution, normalization and non-linear activation, CBAM attention, and channel projection and regularization. Specifically, channel expansion is first performed using 1×1 convolutions to carry richer high-level semantics in subsequent stages. Then, 3×3 depthwise separable convolutions are used for efficient local feature extraction in the spatial dimension, combined with batch normalization and non-linear activation to stabilize the training process and improve expressive power. Building upon this, a CBAM attention structure is introduced. Channel attention is first applied to features to achieve selective emphasis and suppression at the channel level, followed by spatial attention for weighted fusion at two-dimensional locations. This allows for joint filtering of information after deep aggregation, improving the discriminative power and robustness of the features. After attention weighting, 1×1 channel projection convolutions integrate the features to the target channel scale, and a Dropout layer with a dropout rate of 0.2 is configured to enhance generalization ability and alleviate overfitting. To balance representational capability and computational efficiency, the network uses the MBConv-CBAM module twice. Stage 3 is a downsampling setting with a stride of 2, which is used to orderly reduce spatial resolution and control computational load before entering higher semantic layers. Stage 4 is a resolution-preserving setting (which can be used when needed), which is used to further aggregate and filter deep features without changing the feature map size, providing a stable and compact high-level representation for subsequent modules.
[0031] The feature aggregation and transformation module, located after the backbone network, is used to compress deep features into compact and stable representations, preparing them for subsequent conditional regression modules. The process is as follows: First, the channel information output from the backbone is integrated using 1×1 convolutions, with normalization and SiLU activation used to improve numerical stability and nonlinear expression. Then, global average pooling is used to aggregate features in the spatial dimension, obtaining intermediate feature vectors containing only the channel dimension. Based on this, a two-layer fully connected structure is used to perform progressive feature transformation and dimensionality compression. Normalization and SiLU activation are applied between layers to ensure controllable training, and Dropout is used for regularization to obtain the final low-dimensional representation for prediction.
[0032] The conditional regression module is located at the end of the network and adopts an integrated output approach of "classification anchoring and residual refinement": First, the feature vector obtained from the previous module is mapped to the label space of "processing method + roughness level" through a fully connected layer to obtain the corresponding probability distribution, and the roughness is determined based on the pre-established labels; then, the classification probability vector is concatenated with the feature vector from the previous layer, and the input is a lightweight regression branch composed of two fully connected layers, nonlinear activation, and Dropout, outputting the roughness residual; finally, the processing method classification and predicted roughness values are obtained through "roughness calibration and residual correction". This integrated design reduces the span of direct regression without increasing the complexity of the structure, and improves the stability of numerical prediction and the efficiency of edge inference.
[0033] The difference between Example 5 and Example 4 is that in Example 5, step 4 of the underwater laser speckle identification surface roughness method based on a lightweight neural network of the present invention specifically involves: inputting the speckle image samples processed in step S2 into the lightweight network described in step S3 for training. First, network initialization is performed, defining the activation function, loss function, and optimizer. During training, the batch size is set to 128, and the AdamW optimization algorithm is used to optimize the model parameters with weight decay. The initial learning rate is 1×10⁻⁶. -4 The learning rate is adaptively reduced if the validation set accuracy fails to improve for several consecutive rounds. A labeled, smoothed cross-entropy loss function is used for classification, while a mean squared error loss function is used for regression; both are weighted and optimized together. In each training round, the network first calculates the classification result and regression residuals through forward propagation, then uses backpropagation to calculate the gradient and update the parameters. To suppress gradient explosion, the gradient norm is limited to no more than 1 during backpropagation. The model simultaneously calculates classification accuracy and regression error on the validation set to monitor the training status. An early stopping mechanism is introduced to prevent overfitting; model weights are saved when the validation accuracy improves compared to the previous round; otherwise, the number of rounds without improvement is accumulated. A total of 50 iterations are performed during the entire training process. After each round, the average loss and accuracy of the training and validation sets are calculated and recorded in the training history file. Simultaneously, each round is evaluated based on classification metrics (accuracy, precision, recall, and F1-score) and regression metric (MAPE). Finally, the optimal deep learning model is saved based on the validation set performance metrics.
[0034] The difference between Example 6 and Example 5 is that in Example 6, step 5 of the underwater laser speckle identification surface roughness method based on lightweight neural networks of the present invention specifically involves: loading the optimal deep learning model trained in step 4, inputting the test set into the network for inference, identifying the processing methods of different workpieces and predicting their surface roughness values to evaluate the performance of the final model, calculating the test loss and accuracy, and verifying the model's generalization ability. During the testing phase, network parameters are not updated; only forward propagation is performed to output classification results and regression prediction values. The preprocessed speckle images of the test set are input one by one into the trained LightEfficientNetV2 model. The model's classification branch outputs the probability distribution of each category, and the regression branch calculates the residual under the prior conditions of the classification results to correct the roughness and obtain the final prediction result. Subsequently, the predicted processing method label and roughness value are compared with the true values to evaluate the model's classification performance and regression accuracy.
[0035] In terms of performance evaluation, the classification task uses four metrics—accuracy, precision, recall, and F1 score—to comprehensively evaluate the model's ability to identify different processing methods and roughness levels. The regression task uses the mean absolute percentage error (MAPE) metric to measure the model's accuracy in numerical prediction. The confusion matrix visually reflects the model's recognition results and error distribution across multiple classes of samples. By inputting underwater laser speckle data collected in the same manner into the pre-trained model, the processing method and roughness value of the target object can be predicted.
[0036] To make the objectives, technical solutions, and advantages of the embodiments of the present invention clearer, the technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings.
[0037] Experimental Example 1: Comparative experiment of the underwater laser speckle identification surface roughness method based on the present invention using lightweight neural networks.
[0038] The LightEfficientNetV2 network of this invention is a lightweight improvement on the EfficientNetV2 network architecture. It introduces a layered attention configuration of shallow SE and deep CBAM, and adopts a conditional regression head of "classification and labeling first, then residual correction". To verify the effectiveness of the proposed lightweight network in underwater roughness recognition tasks, it was compared with several mainstream network structures, including lightweight networks (MobileNetV3-small, ShuffleNetV2, GhostNet) and classic convolutional neural networks (ResNet18, EfficientNetV2s). Each model was trained independently on the same dataset and training configuration. Figure 4 shows the performance and complexity metrics of the six comparison networks in the underwater speckle roughness prediction task. In terms of accuracy, LightEfficientNetV2 and ResNet18 both achieved a classification accuracy of 99.98%, which is the best level. In the regression task, their MAPE is only 0.49%, which is the lowest among all comparison networks, indicating that their numerical prediction accuracy is higher. In terms of model complexity, it has only 0.21M parameters and a model size of less than 1MB, far lower than other networks. While its 0.23G FLOPs are slightly higher than the lightweight network in comparison, it is still significantly lower than classic networks overall. Regarding efficiency, the training time per epoch is 13.80s, and the inference speed reaches 200.10fps, second only to ResNet18 and better than the lightweight network in comparison. Therefore, this model achieves a significant reduction in model complexity and computational cost while maintaining high accuracy, balancing predictive performance with the advantages of lightweight design.
[0039] Experimental Example 2: The lightweight network model proposed in this invention is used to test the roughness recognition generalization performance on the test set.
[0040] To verify the model's classification performance on the test set, a confusion matrix was plotted, as shown in Figure 5. The confusion matrix shows that the model's classification accuracy across all 15 categories is close to saturation, with only one misclassification at the 0.025 μm grinding level, indicating that LightEfficientNetV2 has high reliability in distinguishing between different processing methods and roughness. To verify the model's regression performance on the test set, Figure 6 shows the average relative error of the roughness of samples with four processing methods under different water conditions and topological loads. The model's predictions at each roughness level maintained small biases, and the error distribution was concentrated without significant systematic shifts. The average absolute percentage errors for the planer, milling, grinding, and lapping samples were 0.29%, 0.55%, 0.15%, and 2.10%, respectively.
[0041] Experimental Examples 1 and 2 demonstrate that the present invention can accurately and rapidly identify the processing methods of 15 types of samples involved in the training and predict their roughness.
[0042] The foregoing description illustrates and describes several preferred embodiments of the invention. However, as previously stated, it should be understood that the invention is not limited to the forms disclosed herein and should not be construed as excluding other embodiments. It can be used in various other combinations, modifications, and environments, and can be altered within the scope of the inventive concept described herein through the foregoing teachings or techniques or knowledge in related fields. Any modifications and variations made by those skilled in the art that do not depart from the spirit and scope of the invention should be within the protection scope of the appended claims.
Claims
1. A method for identifying surface roughness using underwater laser speckle based on a lightweight neural network, characterized in that, Structural pruning and channel sparsification are performed on the EfficientNetV2 network architecture. SE and CBAM attention mechanisms are introduced into the shallow and deep modules of the EfficientNetV2 network structure to achieve efficient feature extraction and selection. The roughness numerical prediction is completed by combining the output strategy of "classification + conditional regression".
2. The underwater laser speckle identification method for surface roughness based on a lightweight neural network according to claim 1, characterized in that, The specific implementation steps are as follows: Step 1: Construct an underwater speckle image dataset; Step 2: After preprocessing and labeling all underwater speckle images in the dataset obtained in Step 1, divide the dataset to obtain a training set, a validation set, and a test set; Step 3: Build a lightweight LightEfficientNetV2 network; Step 4: Train the lightweight LightEfficientNetV2 network obtained in Step 3 using the training set and validation set obtained in Step 2 to obtain the optimal deep learning model; Step 5: Input the test set obtained in Step 2 into the optimal deep learning model obtained in Step 4 to identify the processing methods and roughness of different workpieces.
3. The underwater laser speckle identification method for surface roughness based on a lightweight neural network according to claim 2, characterized in that, In step 1, the constructed underwater speckle image dataset includes workpieces with different processing methods and roughness, different topological loads, and different water conditions.
4. The underwater laser speckle identification method for surface roughness based on a lightweight neural network according to claim 3, characterized in that, In step 1, specifically: a 532nm continuous laser is used and, after beam expansion and polarization control, is incident on a spatial light modulator to generate an LG beam with a topological charge of 0 / 1 / 3 / 5, which is then guided by a reflector to the sample under test behind the water tank; the speckle pattern is captured at an imaging distance of 0.5m from the water tank along the normal direction of the sample using a telecentric lens and a CCD camera to obtain the measured underwater speckle data set. The tested workpieces were processed using planing, milling, grinding, and lapping methods, and a dataset was constructed with 15 categories of labels for roughness calibration. Simultaneously, data was collected in both still water and dynamic water conditions created by a water pump to simulate channel disturbances caused by flow field and minute refractive index fluctuations in an engineering setting and to verify cross-scene stability. Finally, 20 sampling points were taken for each sample at equal intervals, with 10 images collected at each point, resulting in a total of 24,000 labeled underwater speckle images.
5. The underwater laser speckle identification method for surface roughness based on a lightweight neural network according to claim 4, characterized in that, Step 2 specifically involves: first, completing grayscale processing and binarization operations, as well as necessary morphological processing, to clearly separate the speckle pattern area and the background area; then, locating the speckle centroid and centering and cropping the effective speckle area; and finally, using Gaussian filtering for noise reduction to effectively remove high-frequency noise from the speckle image and retain useful information as much as possible. Then, based on the sample calibration information recorded in step S1, a "processing method + roughness" label is generated; finally, the dataset is divided into a training set, a validation set, and a test set in a 7:2:1 ratio.
6. The underwater laser speckle identification method for surface roughness based on a lightweight neural network according to claim 5, characterized in that, Step 3 specifically involves the following: The lightweight network consists of one initial module, two FusedMBConv-SE modules, two MBConv-CBAM modules, one feature convergence and transformation module, and one conditional regression module. The initial module is the starting part of the network, performing preliminary feature extraction and downsampling on the input speckle through 3×3 convolutions with a stride of 2, normalization, and nonlinear activation, providing a stable low-level texture representation for the subsequent FusedMBConv-SE module. The FusedMBConv-SE module uses FusedMBConv in the shallow layers to reduce memory access and latency, and introduces SE channel attention for channel recalibration, suppressing unstable or redundant channel responses, improving signal-to-noise ratio and feature effectiveness, making it suitable for rapid screening of high-resolution shallow features. The MBConv-CBAM module uses MBConv in the deeper layers to achieve higher performance in lower-resolution features. To maintain computational efficiency with a high number of channels, CBAM attention is introduced for joint emphasis and suppression after feature aggregation, improving discriminativity and robustness, and facilitating stable learning of classification and regression heads. The feature aggregation and transformation module first integrates channel information through 1×1 convolution and aggregates spatial dimensions with global average pooling to obtain compact feature vectors with global semantics. Then, consisting of two fully connected layers and normalization / activation, the aggregated features undergo nonlinear transformation and dimensionality compression to form the final representation for prediction. The conditional regression module first maps the feature vectors to the classification label space of "processing method + roughness" through a fully connected layer to obtain the probability distribution of each category. Then, the classification probability vector is concatenated with the feature vector of the previous layer, and the roughness residual is output through the regression branch of two fully connected layers. Finally, the roughness is corrected and calibrated using the residual to obtain the final roughness value for processing method classification and prediction.
7. The underwater laser speckle identification method for surface roughness based on a lightweight neural network according to claim 6, characterized in that, Step 4 specifically involves: inputting the preprocessed speckle image dataset obtained in step 2 into the LightEfficientNetV2 network obtained in step 3 for training to obtain the optimal deep learning model; the process of training the network using the dataset includes data cleaning, data labeling, data partitioning, data preprocessing, defining network layers, activation functions, loss functions and optimizers, forward propagation, loss calculation, backpropagation, batch training, model validation, and hyperparameter tuning.
8. The underwater laser speckle identification method for surface roughness based on a lightweight neural network according to claim 7, characterized in that, Step 5 specifically involves: inputting the test set divided in step 2 into the optimal deep learning model obtained in step 4, identifying the sample processing method and roughness in an unknown underwater environment, calculating the accuracy and loss on the test set, and evaluating the performance of the final model.