A method for inverting ocean wave height from CCD images based on convolutional neural network

Through the wave height inversion method of CCD images based on convolutional neural network, the CCD camera parameters and perspective transformation are used for image correction, and combined with the EfficientNet model, the problem of data processing complexity and high cost of wave height inversion in the open sea is solved. , achieving high-precision and efficient wave feature extraction and inversion.

CN118552599BActive Publication Date: 2024-09-24FIRST INSTITUTE OF OCEANOGRAPHY MNR
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411025263.8
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-07-30
Publication Date
2024-09-24
Estimated Expiration
2044-07-30

AI Technical Summary

Technical Problem

The existing technology has problems with data processing complexity, high cost and difficulty in image correction in wave height inversion. Especially in the open sea, the geometric distortion caused by the lack of control points and tilted images has a greater impact, making it difficult to achieve accurate wave characteristics. Extraction and inversion.

Method used

The sea wave height inversion method of CCD images based on convolutional neural network is used to correct the image through CCD camera parameters and perspective transformation. It is combined with the EfficientNet model for training and evaluation, and uses image data for inversion to reduce data storage and processing costs and improve Model performance.

Benefits of technology

It achieves accurate inversion of wave height in the open sea, reduces data processing complexity and cost, improves inversion accuracy, simplifies the data acquisition process, and reduces the complexity of traditional multi-sensor systems.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118552599B
    Figure CN118552599B
Patent Text Reader

Abstract

The present invention relates to the field of sea wave height inversion, and discloses a sea wave height inversion method of CCD images based on convolutional neural networks, comprising the following steps: matching image data taken by a CCD camera with wave height data measured by a wave measuring radar, eliminating and screening the image data, and preprocessing the image; correcting the image based on CCD camera parameters and perspective transformation methods, and then cutting and dividing it into a training set and a test set; inputting the training set images into an EfficientNet model for training, and using the test set images to evaluate the trained model; processing the image data taken by a CCD camera of an open sea area to be tested, and then inputting the image data into a qualified model for sea wave height inversion. The method disclosed by the present invention can effectively reduce data storage and processing costs; and after correcting the image, the model performance can be further improved, and the inversion accuracy can be improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The invention relates to the field of ocean wave height inversion, and in particular to a CCD image ocean wave height inversion method based on a convolutional neural network. Background Art

[0002] As an important ocean phenomenon, ocean waves play an important role in the prediction of ocean dynamics. As an important parameter to describe ocean waves, effective wave height provides a statistical measure of the distribution of ocean wave height. The measurement and analysis of effective wave height plays an extremely important role in marine engineering construction, marine disaster warning, safety of marine navigation and operations, etc. Therefore, how to accurately and quickly obtain effective wave height data is of great significance.

[0003] The main methods currently used to measure wave height include instrumented wave measurement and wave measurement technology based on radar or satellite remote sensing. Instrumented wave measurement usually covers equipment such as buoys and pressure wave meters, which can provide accurate single-point data, but require regular maintenance and calibration. In contrast, radar wave measurement and satellite remote sensing can provide wave height data over a wide area, but the data processing process is complex and the equipment installation and maintenance costs are high. If visible light band images (such as CCD images) are used for wave height inversion, it can not only ensure the wide range of monitoring, but also simplify the data acquisition process and reduce costs. However, existing technologies based on wave visible light band images, such as photogrammetric wave measurement and nearshore photogrammetric wave measurement, on the one hand, require control points to ensure accuracy, but there are often few control points in open waters; on the other hand, they all require a large number of complex derivation calculations in the data processing process, which limits the continuous monitoring of waves.

[0004] With the rapid development of deep learning technology, neural network models have been widely used in marine science research. The application of deep learning can alleviate the complex problems of the above data processing process to a certain extent. Many existing studies use images or videos in the visible light band to extract wave features and invert wave information. Video data has advantages in temporal continuity and dynamic information capture, but compared with image data, the use of video data will waste a lot of data storage space and increase the complexity of data processing and the burden of data transmission and processing. Most of the existing research based on image data focuses on the inversion of nearshore waves. On the one hand, the wave height range of nearshore waves is small, which is not conducive to the study of waves with large wave heights; on the other hand, the wave breaking phenomenon near the coast, especially on the shore, is more significant, making feature extraction more dependent on the width of the wave breaking zone, which is not conducive to extracting the characteristics of the wave itself. Therefore, it is very important to expand the research to the wave height inversion based on wave images in open waters.

[0005] However, most of the image data in the open sea are oblique images. Oblique shooting will cause geometric distortion of the image, which is not conducive to the model to extract image features. And unlike the nearshore, due to the small range of wave variation near the coast, geometric distortion may have little effect on image inversion. There are very few control points in the open sea, so traditional image correction methods are very difficult to implement. Summary of the invention

[0006] In order to solve the above technical problems, the present invention provides a CCD image wave height inversion method based on convolutional neural network. The inversion method uses image data to effectively reduce the data storage and processing costs. Moreover, the image can be corrected by camera parameters and perspective transformation to further improve the model performance. Based on the deep learning algorithm, the effective wave height is inverted using images of open sea areas, which has certain innovation and practical value.

[0007] To achieve the above object, the technical solution of the present invention is as follows:

[0008] A CCD image wave height inversion method based on convolutional neural network includes the following steps:

[0009] Step 1: Match the image data captured by the CCD camera and the wave height data measured by the wave radar to construct a preliminary data set;

[0010] Step 2, filtering out the image data in the preliminary data set, and then performing preliminary image preprocessing on the filtered data set;

[0011] Step 3, correcting the image based on CCD camera parameters and perspective transformation method, and then shearing the corrected image to remove invalid information caused by the transformation;

[0012] Step 4, divide the cut data set into a training set and a test set;

[0013] Step 5: Input the training set images into the improved EfficientNet model for training, where the image data taken by the CCD camera is used as the model input, and the wave height data measured by the wave radar is used as the label to compare with the wave height data output by the model; after the training is completed, the test set images are used to evaluate the trained model;

[0014] Step 6: After the image data captured by the CCD camera in the open sea area to be tested is processed according to the methods of steps 2 and 3, it is input into the model that has been evaluated as qualified to perform wave height inversion.

[0015] In the above scheme, in step 1, all images taken within 5 seconds after the wave radar measurement time are regarded as matching images of the wave height data.

[0016] In the above scheme, in step 2, the images in the preliminary data set that are not suitable for inverting wave heights are deleted, and then the original images are converted into grayscale images, and then the grayscale images are processed using the contrast-limited adaptive histogram equalization method.

[0017] In a further technical solution, the specific process of processing the grayscale image using the limited contrast adaptive histogram equalization method is as follows:

[0018] First, the original image is divided into 64 non-overlapping rectangular blocks;

[0019] Then, histogram equalization is applied to each rectangular block, and the contrast limit is set to 2. The histogram of each rectangular block is clipped so that it does not exceed the preset contrast limit threshold, and the excess frequencies are redistributed to other gray levels;

[0020] Finally, bilinear interpolation is performed on the boundaries between adjacent rectangular patches to synthesize the rectangular patches into the final enhanced image.

[0021] In the above scheme, in step 3, the method for correcting the image is as follows:

[0022] First, the field of view angle perpendicular to and parallel to the camera shooting direction is obtained based on the internal focal length f of the camera and the actual physical sizes a and b of the camera imaging element. , , the calculation formula is as follows:

[0023] ;

[0024] ;

[0025] Secondly, according to the imaging perspective theory, calculate the upper and lower lengths of the trapezoidal field of view in the oblique shooting. , bottom length And the height H of the trapezoid:

[0026] ;

[0027] ;

[0028] ;

[0029] in, To shoot the tilt angle, is the shooting height;

[0030] Then, taking the upper left corner of the trapezoidal field of view as the origin, find the relative coordinates of the four corner points of the trapezoid, and obtain the correspondence between the pixel coordinates of the four corner points in the original image and the relative coordinates of the four corner points of the trapezoidal field of view, and obtain four pairs of corresponding points; then bring the above four pairs of corresponding points into the following transformation matrix to solve the 8 unknown parameters of the transformation matrix arrive , thus obtaining the transformation matrix under this corresponding relationship;

[0031] ;

[0032] in, are the pixel coordinates of the four corner points in the original image, are the relative coordinates of the four corner points of the trapezoidal field of view;

[0033] Finally, this transformation matrix is ​​applied to all pixels of the image to correct the image.

[0034] In the above scheme, in step 4, when constructing the data set, it is first preliminarily divided according to the date, and the ratio of the training set and the test set after the division is 4:1; then, based on the date as a whole and according to the daily wave height range, part of the data is transferred from the training set to the test set or from the test set to the training set to ensure that the wave height distribution in the training set and the test set is basically the same, and the ratio is also 4:1.

[0035] In the above scheme, in step 5, the improved EfficientNet model includes two parts: a feature extraction layer and an output layer. The feature extraction layer extracts the features of the image through a convolution operation, and after a flattening operation, it becomes a one-dimensional feature vector input to the output layer, and the output layer outputs an inversion value; the feature extraction layer contains eight layers, the first layer is a convolution layer, and the remaining layers are stacked by MBConv modules; the output layer includes a global average pooling layer and three fully connected layers.

[0036] In a further technical solution, the MBConv module is a basic building block in EfficientNet, which includes an upper branch and a shortcut connection branch, the upper branch includes a 1×1 convolution layer for increasing dimension, a separable convolution layer, a BAM module, a 1×1 convolution layer for reducing dimension and a discard layer; the shortcut connection branch includes a 1×1 convolution layer;

[0037] Assume that the size of the input feature map is H×W×Ci, where H, W, Ci are the height, width, and number of channels of the input feature map, respectively, and i represents the input; the feature map first passes through a 1×1 convolutional layer with increased dimension to expand the number of channels to 6Ci, and then passes through a separable convolutional layer, a BAM module, a 1×1 convolutional layer with reduced dimension, and a dropout layer, respectively. Batch normalization and Mish activation function processing are performed between the 1×1 convolutional layer with increased dimension and the separable convolutional layer, and between the separable convolutional layer and the BAM module, and batch normalization is performed between the 1×1 convolutional layer with reduced dimension and the dropout layer;

[0038] Among them, batch normalization layer, Mish activation function, BAM module and dropout layer do not change the size of feature map, and shortcut connection and dropout layer are enabled only when the convolution step size is 1;

[0039] When the convolution step is 1, the height and width of the feature map remain unchanged after passing through the separable convolution layer. The feature map after adding the attention weight is calculated by the BAM module, and the size of the feature map itself remains unchanged. Then, after passing through the dimensionality reduction 1×1 convolution layer, the size of the feature map becomes H×W×Co, where o represents the output and Co represents the number of output channels. The shortcut connection branch converts the dimension of the input feature map through the 1×1 convolution layer, and then after batch normalization, the size of the input feature map directly becomes H×W×Co. In this way, the size and dimension of the output feature maps of the two branches are exactly the same. The corresponding elements of the two are added to obtain the final output feature map of the MBConv module.

[0040] When the convolution step is 2, after the feature map passes through the separable convolution layer, the height and width of the feature map are halved. At this time, the size of the feature map is H / 2×W / 2×6Ci; then the attention weight is calculated by the BAM module and added to the feature map accordingly. Finally, a dimensionality reduction 1×1 convolution layer is passed to reduce the channel dimension of the feature map to Co. At this time, the size of the feature map is H / 2×W / 2×Co, and it is directly output as the output feature map of the MBConv module.

[0041] In a further technical solution, the mathematical expression of the Mish activation function is as follows:

[0042] ;

[0043] in, Represents the value of each point in the feature map.

[0044] In the above scheme, the BAM module combines the channel attention mechanism and the spatial attention mechanism. These two parts run in parallel in the BAM module, respectively calculating the attention scores of the feature map in space and channels, and adding the two together through the broadcast mechanism to obtain the attention scores of each position on the feature map.

[0045] Through the above technical solution, the CCD image wave height inversion method based on convolutional neural network provided by the present invention has the following beneficial effects:

[0046] 1. Compared with the nearshore wave data commonly studied in existing research, the wave data of open sea areas used in this invention can provide more comprehensive and representative wave characteristics and has higher research value.

[0047] 2. Compared with the nearshore wave data commonly studied in existing research, the present invention uses wave images as data sets, which can effectively reduce data storage and processing costs. It uses a CCD camera to obtain image data, simplifies the data acquisition process, and does not require traditional complex sensor equipment, thereby improving the efficiency and convenience of data processing.

[0048] 3. Traditional methods usually rely on predefined control points to achieve perspective correction, while the method based on camera parameters and perspective transformation of the present invention can correct the image perspective without the need for control points, which can ensure the geometric accuracy of the image. This process allows the model to obtain more accurate and reliable information from the image. Existing studies all perform image correction based on control points to reduce the distortion of tilted images. If there are no control points, the tilted images are used directly, which is not conducive to the model's extraction and learning of wave features. However, if the camera parameters are known, the method of the present invention can be used to perform certain corrections on the image to improve the inversion accuracy.

[0049] 4. After comparing different models, EfficientNet was selected as the benchmark model. After the model was trained with the data set, the effective wave height in the open sea can be inverted using only a single CCD image. On the test data set, the root mean square error (RMSE) of the inversion result reached 0.321, showing sufficient accuracy and reliability. The implementation of this technology reduces the cost and complexity of traditional multi-sensor systems, and is a supplement and extension of the existing deep learning-based wave monitoring technology.

[0050] 5. The present invention replaces the Swish activation function of the convolutional layer of the original model with a more efficient Mish function. The Mish activation function introduces a nonlinear form, which helps the model learn complex data patterns and features. In addition, the Mish activation function has the characteristics of no upper bound and smoothness, which also helps the model to find the global optimal solution more easily.

[0051] 6. The present invention replaces the SE attention mechanism module with a BAM module based on a hybrid attention mechanism. The BAM module combines the channel attention mechanism and the spatial attention mechanism. In the BAM module, these two parts run in parallel, and the attention scores in the feature map space and channel are calculated respectively. By adding the two together through the broadcast mechanism, the attention scores at each position on the feature map can be obtained. BAM can understand and adjust the importance of feature maps in a wider context.

[0052] 7. The present invention replaces the final output layer of the model with an output layer of three fully connected layers. The original EfficientNet model usually uses a global average pooling layer and a fully connected layer as the output layer. The present invention changes a fully connected layer into a three-layer fully connected layer, which increases the expressive power of the model, especially when processing more complex tasks or extracting complex features. BRIEF DESCRIPTION OF THE DRAWINGS

[0053] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art are briefly introduced below.

[0054] Figure 1 A schematic flow chart of a method for inverting ocean wave height from a CCD image based on a convolutional neural network disclosed in an embodiment of the present invention;

[0055] Figure 2 It is a trapezoidal field of view diagram, (a) is a schematic diagram of the geometric relationship between the two bottom sides of the field of view and the parameters required for calculation, and (b) is a schematic diagram of the geometric relationship between the field of view height and the parameters required for calculation;

[0056] Figure 3 is a flowchart of image correction processing;

[0057] Figure 4 This is the structure diagram of the EfficientNet model;

[0058] Figure 5 This is the structure diagram of the MBConv module in the feature extraction layer. DETAILED DESCRIPTION

[0059] The technical solutions in the embodiments of the present invention will be described clearly and completely below in conjunction with the accompanying drawings in the embodiments of the present invention.

[0060] The present invention provides a CCD image wave height inversion method based on convolutional neural network, such as Figure 1 As shown, the following steps are included:

[0061] Step 1: Match the image data captured by the CCD camera and the wave height data measured by the wave radar to construct a preliminary data set.

[0062] The image data used in this embodiment comes from the CCD industrial camera installed on the Panyu 30-1 platform. The platform is located at 114°56'28.7"E, 20°14'41"N. The MV-VS078FM-L industrial CCD camera used has a hexahedral structure and is fixed on the outside of the 54-meter deck guardrail of the platform. It faces southeast and shoots from 6 am to 7 pm every day, every 5 seconds. The image format is bmp, the resolution is 1024×768, the camera angle is fixed, and the shooting inclination is about 61°. The effective wave height data is measured by the platform-related wave measurement radar, and the measurement time interval is 2 or 3 minutes.

[0063] The specific data matching method is as follows: Taking into account that the data measurement time of the wave measuring radar and the camera shooting time cannot be completely aligned, in order to obtain more matching valid data, a sufficiently large data set is constructed, and the images taken within 5 seconds after the wave measuring radar measurement time are regarded as matching images of the wave height data. For example, assuming that the data acquisition time of the wave measuring radar is A time B minute 00 seconds, the images taken between A time B minute 00 seconds and A time B minute 04 seconds are regarded as matching images. This is because the wave height is often not an instantaneous mutation, and the effective wave height value shows a smooth trend in the time series graph. Therefore, considering the image within 5 seconds as a wave height value has little effect on the experiment. Finally, the matching effective wave height data and the corresponding image save address are saved in a CSV file.

[0064] Step 2: Eliminate and filter the images in the preliminary data set, and then perform preliminary image preprocessing on the filtered data set.

[0065] This step mainly involves data screening, because some images in the data set are not suitable for inverting wave heights, such as images containing raindrops, ships, large-area flares, and other images that are difficult to extract features. Therefore, these images are deleted from the data set. The final screened data set contains 67,190 data, and the effective wave height range is 0.255m-5.62m.

[0066] After the image is screened, the original image in the data set needs to be processed. The original image is a three-channel color image of 1024×768. On the one hand, considering that the channel information in the wave image is not significant and convenient for subsequent operations, the original image is converted into a grayscale image; on the other hand, considering that the wave features are not obvious under natural light conditions and the image is affected by the reflection of sunlight, the screened image also has slight flare and uneven distribution of pixel values ​​in the whole image. The present invention uses CLAHE to alleviate the above two problems. CLAHE is a contrast-limited adaptive histogram equalization method. The specific process is as follows:

[0067] First, the original image is divided into 64 non-overlapping rectangular blocks;

[0068] Then, histogram equalization is applied to each rectangular block, and the contrast limit is set to 2. The histogram of each rectangular block is clipped so that it does not exceed the preset contrast limit threshold, and the excess frequencies are redistributed to other gray levels;

[0069] Finally, bilinear interpolation is performed on the boundaries between adjacent rectangular patches to synthesize the rectangular patches into the final enhanced image.

[0070] Step 3: Correct the image based on the CCD camera parameters and the perspective transformation method, and then cut the corrected image to remove invalid information caused by the transformation.

[0071] The known camera parameters in this embodiment are: focal length f is 5 mm, shooting angle β is 61.435°, shooting height h is 54 m, and the actual physical size a×b of the camera imaging element is 4.7616×3.5712 mm 2 .

[0072] The method to correct the image is as follows:

[0073] First, the field of view angle perpendicular to and parallel to the camera shooting direction is obtained based on the internal focal length f of the camera and the actual physical sizes a and b of the camera imaging element. , , the calculation formula is as follows:

[0074] ;

[0075] ;

[0076] The viewing angle calculated in this embodiment =50.924°, =39.305°.

[0077] Secondly, according to the imaging perspective theory, the field of view in oblique shooting should actually be a trapezoid, such as Figure 2 As shown, calculate the upper and lower lengths of the trapezoidal field of view in oblique shooting , bottom length And the height H of the trapezoid:

[0078] ;

[0079] ;

[0080] ;

[0081] in, To shoot the tilt angle, is the shooting height;

[0082] The calculation shows that the upper base length of the trapezoidal field of view is B1=68m, the lower base length is B2=311m, and the height is H=296m.

[0083] Then, take the upper left corner of the trapezoidal field of view as the origin (0,0), and find the relative coordinates of the four corner points of the trapezoid. Assuming that the resolution of a pixel is 2m, the relative coordinates of the upper right corner are (663,0), the lower left corner is (263, 591), and the lower right corner is (399,591). The corresponding relationship between the pixel coordinates of the four corner points in the original image and the relative coordinates of the four corner points of the trapezoidal field of view is obtained, and four pairs of corresponding points are obtained: (0,0) corresponds to (0,0), (1023,0) corresponds to (663,0), (0,767) corresponds to (263,591), and (1023,767) corresponds to (399,591).

[0084] Then bring the above four pairs of corresponding points into the following transformation matrix and solve the 8 unknown parameters of the transformation matrix: arrive , thus obtaining the transformation matrix under this corresponding relationship;

[0085] ;

[0086] in, are the pixel coordinates of the four corner points in the original image, namely (0,0), (1023,0), (0,767), (1023,767); are the relative coordinates of the four corner points of the trapezoidal field of view, namely (0,0), (663,0), (263,591), and (399,591).

[0087] Finally, this transformation matrix is ​​applied to all pixels of the image to achieve image correction. The corrected image size is 592×664. The corrected image is cut to ensure the overall clarity of the image and remove some information-free areas. The size is: 300×400. The image correction process is as follows: Figure 3 shown.

[0088] Step 4, divide the cut data set into a training set and a test set;

[0089] In terms of dividing the data set, considering that there is at least a 2-minute time interval between images in the data set, the independence of the images is guaranteed. However, images taken on the same day have similar environmental conditions. If the images on the same day are assigned to the training set and the test set respectively, the prediction of the model on the test set may be oversimplified. To solve this problem, when constructing the data set, a preliminary division was first made according to the date, and the ratio of the training set to the test set after the division was approximately 4:1. Subsequently, the data set was transferred from the training set to the test set or from the test set to the training set according to the approximate wave height range of each day based on the date as a whole, ensuring that the wave height distribution in the training set and the test set is basically the same, and the ratio is also approximately 4:1. This adjustment helps to fairly evaluate the performance of the model on the training set and the test set under similar wave height distribution conditions. The divided training set contains 54,193 data and the test set contains 12,997 data.

[0090] Step 5: Input the training set images into the improved EfficientNet model for training, where the image data taken by the CCD camera is used as the model input, and the wave height data measured by the wave measuring radar is used as the label to be compared with the wave height data output by the model; after the training is completed, the test set images are used to evaluate the trained model.

[0091] like Figure 4 As shown in the figure, the improved EfficientNet model consists of two parts: feature extraction layer and output layer. The feature extraction layer extracts the features of the image through convolution operation, and after flattening operation, it becomes a one-dimensional feature vector input to the output layer, and the output layer outputs the inversion value. The feature extraction layer contains eight layers. Except for the first layer which is a normal convolution layer (Conv3×3), the remaining layers are stacked by different numbers of MBConv modules. Starting from the second layer, each layer contains 4, 7, 7, 10, 10, 13, and 4 MBConv modules. The output layer includes a global average pooling layer (GAP) and three fully connected layers (Dense).

[0092] MBConv module is the basic building block in EfficientNet, such as Figure 5 As shown, it includes an upper branch and a shortcut connection branch. The upper branch includes a 1×1 convolution layer for dimension increase, a separable convolution layer, a BAM module, a 1×1 convolution layer for dimension reduction, and a discard layer; the shortcut connection branch includes a 1×1 convolution layer.

[0093] Assume that the size of the input feature map is H×W×Ci, where H, W, Ci are the height, width, and number of channels of the input feature map, respectively, and i represents the input; the feature map first passes through a dimensionality-increasing 1×1 convolutional layer to expand the number of channels to 6Ci, and then passes through a separable convolutional layer, a BAM module, a dimensionality-reducing 1×1 convolutional layer, and a discard layer, respectively. Batch normalization and Mish activation function processing are performed between the dimensionality-increasing 1×1 convolutional layer and the separable convolutional layer, as well as between the separable convolutional layer and the BAM module, and batch normalization is performed between the dimensionality-reducing 1×1 convolutional layer and the discard layer.

[0094] Among them, the batch normalization layer, Mish activation function, BAM module and discard layer do not change the size of the feature map, and the shortcut connection and discard layer are only enabled when the convolution step size is 1.

[0095] When the convolution step is 1, the height and width of the feature map remain unchanged after passing through the separable convolution layer. The feature map after adding the attention weight is calculated through the BAM module, and the size of the feature map itself remains unchanged. Then, after passing through the dimensionality reduction 1×1 convolution layer, the size of the feature map becomes H×W×Co, where o represents the output and Co represents the number of output channels. The shortcut connection branch converts the dimension of the input feature map through the 1×1 convolution layer, and then after batch normalization, the size of the input feature map directly becomes H×W×Co. In this way, the size and dimension of the output feature maps of the two branches are exactly the same. The corresponding elements of the two are added to obtain the final output feature map of the MBConv module.

[0096] When the convolution step is 2, after the feature map passes through the separable convolution layer, the height and width of the feature map are halved. At this time, the size of the feature map is H / 2×W / 2×6Ci; then the attention weight is calculated by the BAM module and added to the feature map accordingly. Finally, a dimensionality reduction 1×1 convolution layer is passed to reduce the channel dimension of the feature map to Co. At this time, the size of the feature map is H / 2×W / 2×Co, and it is directly output as the output feature map of the MBConv module.

[0097] Specifically, in order to improve the performance of the model, the present invention makes three improvements based on the original EfficientNet model:

[0098] First, replace the Swish activation function in the MBConv module with the Mish activation function. The mathematical expression of the Mish activation function is as follows:

[0099] ;

[0100] in, Represents the value of each point in the feature map.

[0101] By combining the hyperbolic tangent function and the logarithmic function, the Mish activation function introduces a nonlinear form, which helps the model learn complex data patterns and features. In addition, the unbounded and smooth characteristics of the Mish activation function also help the model to find the global optimal solution more easily, and the Mish activation function added in this implementation example does improve the performance of the model.

[0102] Secondly, the SE attention mechanism module is replaced with a BAM module based on a hybrid attention mechanism. The BAM module combines the channel attention mechanism and the spatial attention mechanism. In the BAM module, these two parts run in parallel to calculate the attention scores in the feature map space and channel respectively. By adding the two together through the broadcast mechanism, the attention scores at each position on the feature map can be obtained. BAM can understand and adjust the importance of feature maps in a wider context.

[0103] Finally, the last output layer of the model is replaced with an output layer of three fully connected layers. The original EfficientNet model usually uses a global average pooling layer and a fully connected layer as the output layer. The present invention changes a fully connected layer into three fully connected layers, which increases the expressive power of the model, especially when processing more complex tasks or extracting complex features.

[0104] Model Evaluation:

[0105] The model evaluation uses the preprocessed 300×400 images in the test set to input the model trained in step 5. The image is processed through the pre-encoded hard-coded layer. The evaluation mode of the model is used, and the batch normalization layer and the discard layer are fixed. The last layer of the model outputs a single value, which is the effective wave height corresponding to the inversion of the image.

[0106] The improved EfficientNet of the present invention is compared with models such as ResNet152, DenseNet264 and InceptionV3 using the test set through regression task evaluation indicators such as RMSE, MAE, MSE, MPAE, and R2. The results are shown in Table 1.

[0107] Table 1 Evaluation indicators of each model

[0108]

[0109] The results show that the improved EfficientNet performs best in these key indicators, which indicates that the model structure and design concept can effectively improve the computational efficiency while maintaining good inversion performance. The results prove that the method used in the present invention is indeed feasible and effective.

[0110] Step 6: After the image data captured by the CCD camera in the open sea area to be tested is processed according to the methods of steps 2 and 3, it is input into the model that has been evaluated as qualified to perform wave height inversion.

[0111] The above description of the disclosed embodiments enables one skilled in the art to implement or use the present invention. Various modifications to these embodiments will be apparent to one skilled in the art, and the general principles defined herein may be implemented in other embodiments without departing from the spirit or scope of the present invention. Therefore, the present invention will not be limited to the embodiments shown herein, but rather to the widest scope consistent with the principles and novel features disclosed herein.

Claims

1. A CCD image wave height inversion method based on convolutional neural network, It is characterized in that The steps include: Step 1: Match the image data captured by the CCD camera and the wave height data measured by the wave radar to construct a preliminary data set; Step 2, filtering out the image data in the preliminary data set, and then performing preliminary image preprocessing on the filtered data set; Step 3, correcting the image based on CCD camera parameters and perspective transformation method, and then shearing the corrected image to remove invalid information caused by the transformation; Step 4, divide the cut data set into a training set and a test set; Step 5: Input the training set images into the improved EfficientNet model for training, where the image data taken by the CCD camera is used as the model input, and the wave height data measured by the wave radar is used as the label to be compared with the wave height data output by the model; After training is completed, use the test set images to evaluate the trained model; Step 6: After the image data captured by the CCD camera in the open sea area to be tested is processed according to the methods of steps 2 and 3, it is input into the model that has been evaluated as qualified to perform wave height inversion.

2. According to the CCD image wave height inversion method based on convolutional neural network according to claim 1, It is characterized in that In step 1, all images taken within 5 seconds after the wave radar measurement time are regarded as matching images of the wave height data.

3. The CCD image wave height inversion method based on convolutional neural network according to claim 1, It is characterized in that In step 2, the images in the preliminary data set that are not suitable for inverting wave heights are deleted, and then the original images are converted into grayscale images, which are then processed using the contrast-constrained adaptive histogram equalization method.

4. The method for inverting ocean wave height from CCD images based on convolutional neural network according to claim 3, It is characterized in that The specific process of processing grayscale images using the limited contrast adaptive histogram equalization method is as follows: First, the original image is divided into 64 non-overlapping rectangular blocks; Then, histogram equalization is applied to each rectangular block, and the contrast limit is set to 2. The histogram of each rectangular block is clipped so that it does not exceed the preset contrast limit threshold, and the excess frequencies are redistributed to other gray levels; Finally, bilinear interpolation is performed on the boundaries between adjacent rectangular patches to synthesize the rectangular patches into the final enhanced image.

5. The method for inverting ocean wave height from CCD images based on convolutional neural network according to claim 1, It is characterized in that In step 3, the method for correcting the image is as follows: First, the field of view angle perpendicular to and parallel to the camera shooting direction is obtained based on the internal focal length f of the camera and the actual physical sizes a and b of the camera imaging element. , , the calculation formula is as follows: ; ; Secondly, according to the imaging perspective theory, calculate the upper and lower lengths of the trapezoidal field of view in the oblique shooting. , bottom length And the height H of the trapezoid: ; ; ; in, To shoot the tilt angle, is the shooting height; Then, taking the upper left corner of the trapezoidal field of view as the origin, find the relative coordinates of the four corner points of the trapezoid, and obtain the correspondence between the pixel coordinates of the four corner points in the original image and the relative coordinates of the four corner points of the trapezoidal field of view, and obtain four pairs of corresponding points; then bring the above four pairs of corresponding points into the following transformation matrix to solve the 8 unknown parameters of the transformation matrix arrive , thus obtaining the transformation matrix under this corresponding relationship; ; in, are the pixel coordinates of the four corner points in the original image, are the relative coordinates of the four corner points of the trapezoidal field of view; Finally, this transformation matrix is ​​applied to all pixels of the image to correct the image.

6. The method for inverting ocean wave height from CCD images based on convolutional neural network according to claim 1, It is characterized in that In step 4, when constructing the data set, it is first divided preliminarily according to the date, and the ratio of the training set to the test set after the division is 4:1; then, based on the date as a whole and the wave height range of each day, part of the data is transferred from the training set to the test set or from the test set to the training set to ensure that the wave height distribution in the training set and the test set is basically the same, and the ratio is also 4:

1.

7. The method for inverting ocean wave height from CCD images based on convolutional neural network according to claim 1, It is characterized in that In step 5, the improved EfficientNet model includes two parts: a feature extraction layer and an output layer. The feature extraction layer extracts the features of the image through a convolution operation, and after a flattening operation, it becomes a one-dimensional feature vector input to the output layer, and the output layer outputs the inversion value; the feature extraction layer contains eight layers, the first layer is a convolution layer, and the remaining layers are stacked by MBConv modules; the output layer includes a global average pooling layer and three fully connected layers.

8. The method for inverting ocean wave height from CCD images based on convolutional neural network according to claim 7, It is characterized in that The MBConv module is a basic building block in EfficientNet, which includes an upper branch and a shortcut connection branch. The upper branch includes a 1×1 convolution layer for increasing dimension, a separable convolution layer, a BAM module, a 1×1 convolution layer for reducing dimension, and a discard layer; the shortcut connection branch includes a 1×1 convolution layer; Assume that the size of the input feature map is H×W×Ci, where H, W, Ci are the height, width, and number of channels of the input feature map, respectively, and i represents the input; the feature map first passes through a 1×1 convolutional layer with increased dimension to expand the number of channels to 6Ci, and then passes through a separable convolutional layer, a BAM module, a 1×1 convolutional layer with reduced dimension, and a dropout layer, respectively. Batch normalization and Mish activation function processing are performed between the 1×1 convolutional layer with increased dimension and the separable convolutional layer, and between the separable convolutional layer and the BAM module, and batch normalization is performed between the 1×1 convolutional layer with reduced dimension and the dropout layer; Among them, batch normalization layer, Mish activation function, BAM module and dropout layer do not change the size of feature map, and shortcut connection and dropout layer are enabled only when the convolution step size is 1; When the convolution step is 1, the height and width of the feature map remain unchanged after passing through the separable convolution layer. The feature map after adding the attention weight is calculated by the BAM module, and the size of the feature map itself remains unchanged. Then, after passing through the dimensionality reduction 1×1 convolution layer, the size of the feature map becomes H×W×Co, where o represents the output and Co represents the number of output channels. The shortcut connection branch converts the dimension of the input feature map through the 1×1 convolution layer, and then after batch normalization, the size of the input feature map directly becomes H×W×Co. In this way, the size and dimension of the output feature maps of the two branches are exactly the same. The corresponding elements of the two are added to obtain the final output feature map of the MBConv module. When the convolution step is 2, after the feature map passes through the separable convolution layer, the height and width of the feature map are halved. At this time, the size of the feature map is H / 2×W / 2×6Ci; then the attention weight is calculated by the BAM module and added to the feature map accordingly. Finally, a dimensionality reduction 1×1 convolution layer is passed to reduce the channel dimension of the feature map to Co. At this time, the size of the feature map is H / 2×W / 2×Co, and it is directly output as the output feature map of the MBConv module.

9. The method for inverting ocean wave height from CCD images based on convolutional neural network according to claim 8, It is characterized in that The mathematical expression of the Mish activation function is as follows: ; in, Represents the value of each point in the feature map.

10. The method for inverting ocean wave height from CCD images based on convolutional neural network according to claim 8, It is characterized in that The BAM module combines the channel attention mechanism and the spatial attention mechanism. In the BAM module, these two parts run in parallel, respectively calculating the attention scores of the feature map in space and channels, and adding the two together through the broadcast mechanism to obtain the attention scores of each position on the feature map.