A sonar-based model training method, estimation method, device, equipment and storage medium
By obtaining real sonar image data sets and training a composite pose detection network, the problem of low target recognition accuracy in underwater scenes is solved, efficient target pose and trajectory estimation is achieved, computing resource requirements are reduced, and the system can adapt to complex underwater environments.
Patent Information
- Application Number
- CN202410525266.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-04-29
- Publication Date
- 2024-09-13
- Estimated Expiration
- 2044-04-29
AI Technical Summary
In underwater scenes, it is difficult for existing technologies to effectively identify and locate targets, especially due to poor sonar image processing and low recognition accuracy. In addition, existing deep learning models have large data requirements, high computing resources, and interpretation problems during the training process. Due to problems such as poor performance, it is difficult to adapt to complex underwater environments.
By acquiring real sonar image data sets and generating simulated image data sets, we train the composite pose detection network and trajectory neural network, and use the CNN-4QuadPoseNet structure to estimate target pose parameters and driving trajectories, reducing the difficulty of data acquisition and improving model training accuracy and recognition. Accuracy.
It improves the estimation accuracy of target attitude parameters and driving trajectories, reduces computing resource requirements, enhances the model's interpretability and ability to adapt to complex environments, and improves the accuracy and real-time performance of underwater target recognition.
Smart Images

Figure CN118097342B
Abstract
Description
Technical Field
[0001] The present application relates to the field of deep learning, and in particular to a sonar-based model training method, estimation method, device, equipment and storage medium. Background Art
[0002] In recent years, deep learning (DL) technology has been used in image processing to identify and locate objects in images, such as pedestrians or traffic signs in self-driving cars, and to accurately classify and identify many different types of targets contained in images and classify them into corresponding target categories, such as disease identification in medical images. However, in the case of sonar images acquired for diverse and complex underwater scenes, such as acquiring sonar images by mounting sonar equipment on ships (such as underwater robots) and using sonar images for target posture detection, there are still problems of low recognition accuracy and poor image processing effects. Summary of the invention
[0003] The embodiments of the present application provide a sonar-based model training method, estimation method, device, equipment, and storage medium to solve at least one problem existing in the related art. The technical solution is as follows:
[0004] In a first aspect, an embodiment of the present application provides a sonar-based model training method, comprising:
[0005] Acquire a real sonar image data set, and generate a simulated image data set through a sonar simulator, wherein the simulated image data set includes a plurality of first simulated images of different underwater rock scenes and a plurality of second simulated images of different underwater scenes at the bottom of the ship, wherein the real sonar image data set, the first simulated images, and the second simulated images all have label information, and the label information includes attitude information and motion information;
[0006] Classifying and combining a plurality of first simulation images of different underwater rock scenes and a plurality of second simulation images of different underwater scenes at the bottom of a ship, respectively, to obtain a plurality of simulation image groups;
[0007] Training a composite posture detection network and a trajectory neural network using the real sonar image data set and the simulated image group;
[0008] The composite posture detection network is used to estimate the posture parameters of the target, and the trajectory neural network is used to estimate the driving trajectory of the target.
[0009] In one embodiment, generating a simulated image dataset by a sonar simulator comprises one of the following:
[0010] First sensor data of different underwater rock scenes and second sensor data of different underwater scenes at the bottom of the ship collected in real time by a sonar sensor are input into a sonar simulator to generate a simulated image data set;
[0011] Generate a first sonar image of different underwater rock scenes and a second sonar image of different underwater scenes at the bottom of the ship by using a sonar model, input the first sonar image and the second sonar image into a sonar simulator to generate a simulated image data set;
[0012] Acquire first historical sensor data of different underwater rock scenes and second historical sensor data of different underwater scenes at the bottom of a ship, input the first historical sensor data and the second historical sensor data into a sonar simulator to generate a simulated image data set.
[0013] In one embodiment, the plurality of first simulated images of different underwater rock scenes and the plurality of second simulated images of different underwater scenes at the bottom of the ship are classified and combined to obtain the plurality of simulated image groups, including:
[0014] Arranging a plurality of first simulation images corresponding to each underwater rock scene in time or space order, and arranging a plurality of second simulation images corresponding to each underwater scene at the bottom of the ship in time or space order;
[0015] Performing first grouping on a plurality of first simulation images sequentially arranged in each underwater rock scene, and performing second grouping on a plurality of second simulation images sequentially arranged in each underwater scene of the bottom of the ship;
[0016] A number of simulated image groups are determined according to the first grouping result and the second grouping result.
[0017] In one embodiment, the method further comprises:
[0018] Acquire pixel information of each real sonar image in the real sonar image data set, wherein the pixel information includes fan angle information of each pixel;
[0019] According to the fan angle information of each pixel point, the pixel points of the real sonar image are sorted according to the angle;
[0020] Based on the sectors, the pixels in each real sonar image are spliced using the sorting results to obtain several new real sonar images.
[0021] In one embodiment, the composite posture detection network includes a CNN network, a preset number of quadruple networks, a preset number of first fully connected layers, and a second fully connected layer. Training the composite posture detection network through the real sonar image data set and the simulated image group includes:
[0022] Generate a training set according to the real sonar image data set and the simulated image data set, wherein the training set includes a plurality of training images, and the training images include real sonar images and images in the simulated image group;
[0023] By means of the CNN network, each of the training images is divided into a preset number of sub-images, and corresponding quadrants of each sub-image are connected through the spatial coordinates of the pixel points;
[0024] The sub-images are respectively input into the quadruple network for processing, the output result of each quadruple network is input into the corresponding first fully connected layer, and the output result of each first fully connected layer is input into the second fully connected layer to obtain the posture parameters of the target;
[0025] Determining a first loss value according to the posture parameter, the posture information and the loss function;
[0026] The composite posture detection network is trained according to a first loss value until a first termination condition is reached.
[0027] In one embodiment, training a trajectory neural network using the real sonar image dataset and the simulated image group includes:
[0028] Generate a training set according to the real sonar image data set and the simulated image data set, wherein the training set includes a plurality of training images, and the training images include real sonar images and images in the simulated image group;
[0029] Segmenting each of the training images according to the trajectory neural network to obtain a preset number of sub-images corresponding to each of the training images;
[0030] Performing compression and filtering processing on the sub-images, and splicing a preset number of sub-images after the compression and filtering processing to obtain a spliced training image;
[0031] Performing inference operations on all the spliced training images to obtain the driving trajectory of the target;
[0032] Calculating a second loss value according to the motion information and the driving trajectory;
[0033] The trajectory neural network is trained according to the second loss value until a second termination condition is reached.
[0034] In a second aspect, an embodiment of the present application provides an estimation method:
[0035] Collect real-time sonar images;
[0036] The real-time sonar image is input into a composite posture detection network and a trajectory neural network to estimate the posture parameters of the target and the driving trajectory of the target.
[0037] In a third aspect, an embodiment of the present application provides a sonar-based model training device, comprising:
[0038] An acquisition module is used to acquire a real sonar image data set, and generate a simulated image data set through a sonar simulator, wherein the simulated image data set includes a plurality of first simulated images of different underwater rock scenes and a plurality of second simulated images of different underwater scenes at the bottom of the ship, and the real sonar image data set, the first simulated images and the second simulated images all have label information, and the label information includes posture information and motion information;
[0039] A combination module, used for classifying and combining a plurality of first simulation images of different underwater rock scenes and a plurality of second simulation images of different underwater scenes at the bottom of the ship, to obtain a plurality of simulation image groups;
[0040] A training module, used for training a composite posture detection network and a trajectory neural network through the real sonar image data set and the simulated image group;
[0041] The composite posture detection network is used to estimate the posture parameters of the target, and the trajectory neural network is used to estimate the driving trajectory of the target.
[0042] In a fourth aspect, an embodiment of the present application provides an electronic device, comprising: a processor and a memory, wherein the memory stores instructions, and the instructions are loaded and executed by the processor to implement a method in any one of the above-mentioned embodiments.
[0043] In a fifth aspect, an embodiment of the present application provides a computer-readable storage medium, which stores a computer program. When the computer program is executed, the method in any one of the above-mentioned embodiments is implemented.
[0044] The beneficial effects of the above technical solution include at least:
[0045] By acquiring a real sonar image data set and generating a simulated image data set through a sonar simulator, it is helpful to reduce the difficulty of data acquisition and conveniently obtain more image data for subsequent training; several first simulated images of different underwater rock scenes and several second simulated images of different underwater scenes at the bottom of the ship are classified and combined respectively to obtain several simulated image groups, which is helpful to provide richer image information for model training. Therefore, by using the real sonar image data set and the simulated image group, the composite posture detection network and the trajectory neural network are trained, which can improve the accuracy of network training and the recognition accuracy of the network, which is helpful to improve the estimation accuracy of the target's posture parameters and the target's driving trajectory.
[0046] The above summary is for illustrative purposes only and is not intended to be limiting in any way. In addition to the illustrative aspects, embodiments and features described above, further aspects, embodiments and features of the present application will be readily apparent by reference to the accompanying drawings and the following detailed description. BRIEF DESCRIPTION OF THE DRAWINGS
[0047] In the accompanying drawings, unless otherwise specified, the same reference numerals throughout the multiple drawings represent the same or similar parts or elements. These drawings are not necessarily drawn to scale. It should be understood that these drawings only depict some embodiments disclosed in the present application and should not be regarded as limiting the scope of the present application.
[0048] Figure 1 This is a schematic diagram of the steps of a sonar-based model training method according to an embodiment of the present application;
[0049] Figure 2 This is a schematic diagram of sonar parameters in different scenarios according to an embodiment of the present application;
[0050] Figure 3 Another schematic diagram of sonar parameters in different scenarios according to an embodiment of the present application;
[0051] Figure 4 A schematic diagram of a composite posture detection network according to an embodiment of the present application;
[0052] Figure 5 A schematic diagram of a quadruple network according to an embodiment of the present application;
[0053] Figure 6 A schematic diagram of confidence according to an embodiment of the present application;
[0054] Figure 7 A schematic diagram of an accuracy confidence curve according to an embodiment of the present application;
[0055] Figure 8 A schematic diagram of the test results of an embodiment of the present application;
[0056] Fig. 9 A schematic diagram of the steps of an estimation method according to an embodiment of the present application;
[0057] Fig.10 A schematic diagram of a trajectory of an embodiment of the present application;
[0058] Fig.11 This is a structural block diagram of a sonar-based model training device according to an embodiment of the present application;
[0059] Fig.12 This is a structural block diagram of an electronic device according to an embodiment of the present application. DETAILED DESCRIPTION
[0060] In the following, only some exemplary embodiments are briefly described. As those skilled in the art will appreciate, the described embodiments may be modified in various ways without departing from the spirit or scope of the present application. Therefore, the drawings and descriptions are considered to be exemplary and non-restrictive in nature.
[0061] Glossary:
[0062] Trajectory estimation: Trajectory estimation is to infer the trajectory of an observed target or object in time and space through an algorithm model based on some known observation data. This process usually involves analyzing and processing sensor data (such as radar, camera, GPS, etc.) to predict its possible location and movement path when the target is not directly observed.
[0063] Underwater micro-navigation: Underwater micro-navigation refers to the process of using various sensors and navigation technologies to enable underwater robots or underwater vehicles to accurately navigate and perform tasks in a limited underwater space. This navigation system is usually used in underwater detection, marine research, resource exploration, underwater engineering and other fields.
[0064] In the related art, there are the following defects and deficiencies in the process of generating, processing and using the image itself:
[0065] 1. Limiting the authenticity of simulation: Simulation data may not fully capture the complexity and diversity of real underwater environments. Therefore, after the model is trained on simulation data, it may face generalization problems in real scenarios.
[0066] 2. Data distribution mismatch. Due to the distribution difference between simulation data and real data, the training model may lead to performance degradation in the real environment. In actual applications, the characteristics of sonar images may change due to factors such as underwater conditions and water quality, which are difficult to fully simulate in simulation. The model overfits the simulation scene. The model may tend to overfit to the specific scene and noise distribution in the simulation, and cannot adapt well to the changes in the real scene. This may lead to performance degradation in actual underwater operation tasks.
[0067] 3. Lacking the complexity of the real world, sonar simulators may not be able to accurately simulate the various complex conditions in the underwater environment, such as ocean currents, tides, seabed topography, etc. These factors have an important impact on navigation trajectory estimation, and simulations may not be able to fully consider these factors.
[0068] 4. It is difficult to simulate sensor noise. In a real underwater environment, the sonar system may be subject to various interferences and noises, such as multipath effects, uncertainty in underwater propagation, etc. It is difficult for sonar simulators to accurately simulate these complex sensor noises, thus affecting the robustness of the model to real noise.
[0069] 5. Computational complexity: Generating high-quality sonar simulation data may require a lot of computing resources and time. This may become a bottleneck in the training process, especially in deep learning tasks that require large-scale data.
[0070] 6. Lack of diversity. Simulation data may tend to be fixed in scenes and conditions and lack diversity. In real underwater missions, robots may face various unknown situations, and the limitations of simulation data may make it difficult for the model to cope with these situations.
[0071] In the related art, underwater robot visual image processing encounters long calculation time, lack of real-time performance, and inability to calculate image data sets in real time to estimate the posture and trajectory of the underwater platform. The embodiment of the present application introduces an underwater robot sonar image processing framework based on an advanced DL architecture - a composite posture detection network, which estimates the navigation trajectory of the robot (platform) and performs real-time motion estimation of the underwater platform from continuous simulator-generated image sonar images.
[0072] In order to deal with the problem of monochrome and low resolution of real sonar images in related technologies, a combined sonar image annotation was constructed through an annotation method based on reconstructed trajectories. To overcome this challenge, the deep learning (DL) framework was improved to improve the sonar image processing performance and trajectory estimation accuracy.
[0073] In the related art, the existing CNN-4b network has the following disadvantages:
[0074] (1) Large data requirements: CNN-4b networks usually require large-scale labeled data sets for training to ensure that the network can learn feature representations with broad generalization. In the case of limited or unbalanced data, the performance of the network may be affected;
[0075] (2) Challenges in processing quadrant boundaries: In the quadrant segmentation task, the network needs to process the boundaries of the quadrants, which may be limited by the fixed receptive field size of the convolution operation, resulting in inaccurate positioning of the quadrant edges. Additional boundary processing mechanisms are needed to improve accuracy;
[0076] (3) Computational resource requirements: Deep CNN models, such as CNN-4b, usually require a lot of computing resources for training and inference. This may cause challenges in resource-limited environments and limit the practical usability of the network in certain application scenarios;
[0077] (4) Poor interpretability: Due to the deep structure and complexity of the CNN model, its internal feature representation is usually difficult to interpret.
[0078] The existing GeoNet-PoseNet has the following disadvantages:
[0079] (1) High computing resource requirements: Since GeoNet-PoseNet uses a deep hierarchical structure, its training and inference computing resource requirements are relatively high. This may limit the application of the model in resource-limited environments, especially on embedded systems or mobile devices.
[0080] (2) Large data volume requirements: Deep models usually require large-scale labeled data sets for training to obtain sufficient generalization capabilities. For some specific fields or tasks, the cost of data collection and labeling may become a limiting factor.
[0081] (3) Poor interpretability: Due to the complexity of deep learning models, the internal decision-making process of GeoNet-PoseNet is difficult to explain. This may be insufficient in some scenarios that require high model interpretability.
[0082] (4) Generalization ability for specific scenarios: Deep learning models may overfit in certain scenarios, resulting in reduced generalization ability. In particular, when faced with scenes or lighting conditions that are significantly different from the training dataset, the performance of the model may be challenged.
[0083] When applying GeoNet-PoseNet in practice, it is necessary to fully consider these advantages and disadvantages, and make appropriate adjustments and optimizations based on the requirements of specific application scenarios and tasks to maximize the advantages of the model. Future research can focus on improving the efficiency of the model, reducing dependence on computing resources, and exploring more interpretable deep learning models.
[0084] Reference Figure 1 , a flow chart of a sonar-based model training method according to an embodiment of the present application is shown, and the sonar-based model training method may at least include steps S100-S300:
[0085] S100: Acquire a real sonar image dataset, and generate a simulated image dataset through a sonar simulator.
[0086] Optionally, a real sonar image data set is collected by sonar equipment, including several real sonar images. For example, after selecting and confirming a specific experimental site according to pre-set test requirements, specific target objects (such as dummies, etc.) are pre-equipped in the experimental site, and the sonar equipment is mounted on an underwater robot to carry out sonar image collection. During the test, the sonar equipment can capture real sonar images of specific target objects (underwater dummies, etc.).
[0087] Optionally, the simulated image dataset includes an underwater rock scene dataset ("Rocky Field" dataset) and a ship dataset, the underwater rock scene dataset includes a plurality of first simulated images of different underwater rock scenes, and the ship dataset includes a plurality of second simulated images of different underwater scenes at the bottom of the ship. The real sonar image, the first simulated image, and the second simulated image in the real sonar image dataset all have label information.
[0088] S200: Classify and combine a plurality of first simulation images of different underwater rock scenes and a plurality of second simulation images of different underwater scenes at the bottom of a ship to obtain a plurality of simulation image groups.
[0089] S300, trains a composite posture detection network and a trajectory neural network through real sonar image data sets and simulated image groups.
[0090] Among them, the composite posture detection network is used to estimate the posture parameters of the target, and the trajectory neural network is used to estimate the driving trajectory of the target.
[0091] The sonar-based model training method of the embodiment of the present application can be executed by an electronic control unit, a controller, a processor, etc. of a terminal such as a computer, a mobile phone, a tablet, a vehicle-mounted terminal, etc., or it can be executed by a cloud server.
[0092] The technical solution of the embodiment of the present application, by acquiring a real sonar image data set and generating a simulated image data set through a sonar simulator, is conducive to reducing the difficulty of data acquisition and conveniently obtaining more image data for subsequent training; a number of first simulated images of different underwater rock scenes and a number of second simulated images of different underwater scenes at the bottom of the ship are classified and combined respectively to obtain a number of simulated image groups, which is conducive to providing richer image information for model training. Therefore, by training the composite posture detection network and the trajectory neural network through the real sonar image data set and the simulated image group, the accuracy of network training can be improved, the recognition accuracy of the network can be improved, and it is conducive to improving the estimation accuracy of the target's posture parameters and the target's driving trajectory.
[0093] In one embodiment, generating a simulated image dataset by a sonar simulator in step S100 includes at least one of steps S110-S130:
[0094] S110, collecting first sensor data of different underwater rock scenes and second sensor data of different underwater scenes at the bottom of the ship in real time through a sonar sensor, inputting the first sensor data and the second sensor data into a sonar simulator to generate a simulated image data set.
[0095] In the embodiments of the present application, different underwater rock scenes include but are not limited to rocks of different shapes, sizes and densities present in the underwater environment, and different changes in factors such as water quality, lighting, water depth, transparency, reflection, scattering, underwater vegetation, sand and mud, rocky bottom, underwater structures, such as caves, grooves or other terrain features; different underwater scenes of the bottom of the ship include multiple scene types constructed based on different factors such as shoal areas, rocky bottoms, seagrass areas, deep water areas, structure simulation, bottom diversity, tidal changes, etc.
[0096] Optionally, first sensor data of different underwater rock scenes and second sensor data of different underwater scenes at the bottom of the ship can be collected in real time by a sonar sensor, and the first sensor data and the second sensor data can be input into a sonar simulator. After processing, the sonar simulator generates an underwater rock scene data set ("Rocky Field" data set) and a ship data set to form a simulated image data set, thereby generating more data that can be used for training.
[0097] S120, generating first sonar images of different underwater rock scenes and second sonar images of different underwater scenes at the bottom of the ship through a sonar model, inputting the first sonar image and the second sonar image into a sonar simulator to generate a simulated image data set.
[0098] Optionally, the working principle of the sonar sensor can be simulated by a pre-trained sonar model, and the relevant parameters of different underwater rock scenes and different underwater scenes at the bottom of the ship can be input into the sonar model to generate a first sonar image of different underwater rock scenes and a second sonar image of different underwater scenes at the bottom of the ship. The first sonar image and the second sonar image are then input into a sonar simulator for processing to generate a simulated image data set.
[0099] S130, obtaining first historical sensor data of different underwater rock scenes and second historical sensor data of different underwater scenes at the bottom of the ship, inputting the first historical sensor data and the second historical sensor data into a sonar simulator to generate a simulated image data set.
[0100] Optionally, first historical sensor data of different underwater rock scenes acquired by the sonar device and second historical sensor data of different underwater scenes at the bottom of the ship can be collected, and then the first historical sensor data and the second historical sensor data can be input into the sonar simulator for processing to finally generate a simulated image data set.
[0101] Optionally, the posture information includes but is not limited to rotation matrix, translation vector (displacement vector) and scaling parameters, rotation axis, rotation angle, translation vector and scaling parameters, etc., the motion information includes but is not limited to the level and degree of freedom of x, y, and z axes, such as the information of motion samples such as the angle offset of x, y, and z axes, and the label information can also include image information, such as the category labels of different underwater rock scenes, different underwater scenes at the bottom of the ship, or the object labels of the objects in the scene, as well as the image depth range, blur, focus position and other information. Among them, the label information can be manually annotated to obtain the model automatically generated according to the obtained image information. Among them, the distance, displacement, etc. in the label information can be in meters, the rotation angle is in degrees, and the motion information can be roughly annotated manually according to the running path, and then sent to the neural network model in the sonar simulator environment to generate more detailed and dense path labels, thereby guiding the underwater running path.
[0102] It should be noted that since the path labels generated by the labels are discontinuous, which is not conducive to the operation of underwater equipment, a linear transformation is used to convert the three parameter labels into parameters measured in the same unit, that is, the minimum and maximum values of each type of label are quantified, and the original values are mapped to a new range, thereby forming a continuous path. For example, the input image label conversion operation can be performed as follows:
[0103] First, get the minimum and maximum values. Get the minimum and maximum values of displacement and rotation from the label information generated by the simulator. Then, transform the displacement parameters. For the displacement parameters, use the minimum and maximum values for linear normalization. Finally, perform a linear transformation of the rotation parameters. Transform, for the rotation parameters, use the minimum and maximum values for linear normalization:
[0104]
[0105] in, is the normalized value, is the original value, and are the minimum and maximum values of the original values respectively.
[0106] If the above label conversion process has unfavorable factors for model establishment and training, the quantized label information can be fuzzy classified and divided into three levels of small, medium and large according to the size of the final value after the above label quantization, thereby reducing the amount of calculation.
[0107] like Figure 2 and Figure 3 As shown, in the embodiment of the present application, in this study, when processing the sonar image, it is pre-set that the movement of the sonar sensor requires six degrees of freedom X, Y and Z to represent the horizontal and rotational degrees of freedom. They correspond to the translation on the X, Y and Z axes and the rotation around each axis. During the sonar detection, it is assumed that the height from the seabed is constant, and the rotation around and The rotation of can be ignored, and DL technology is used to estimate the motion of the sonar image in three degrees of freedom. :
[0108]
[0109] in, : Indicates the x-axis offset, : Indicates the y-axis offset, : Indicates the z-axis angle offset:
[0110]
[0111] in, Indicates winding The angle of axis rotation, such as Figure 2 and Figure 3 As shown, the forward / backward movement of the platform corresponds to the y-axis, while the sideways movement corresponds to the x-axis. The height above the seafloor is constant. The rotation about the z-axis corresponds to the parameter . Figure 2The sonar height and pitch angle are 2.5 m and 35° respectively, which are used in different underwater rock scenes. Figure 3 The sonar height and pitch are 0.32 m and 0.4° respectively, which are used for different underwater scenes at the bottom of the ship. That is, different height and angle parameters are used to generate simulated images in different scenes.
[0112] In one implementation, step S200 includes steps S210-S230:
[0113] S210, arranging a plurality of first simulation images corresponding to each underwater rock scene in time or space order, and arranging a plurality of second simulation images corresponding to each underwater scene at the bottom of the ship in time or space order.
[0114] Optionally, each underwater rock scene will have a certain number of first simulated images, each underwater scene at the bottom of the ship will have a certain number of second simulated images, and the first simulated images and the second simulated images have specific generation times when they are generated, and the first simulated images at each underwater rock scene and the second simulated images at each underwater scene at the bottom of the ship will have spatial features, such as sorting, coordinate relationships, etc. Therefore, the first simulated images corresponding to each underwater rock scene can be arranged in time or space order, and the second simulated images corresponding to each underwater scene at the bottom of the ship can be arranged in time or space order, which is conducive to maintaining the continuity of the first simulated images and the second simulated images, and is conducive to improving the training effect of the network.
[0115] S220, respectively performing first grouping on a plurality of first simulation images sequentially arranged in each underwater rock scene, and respectively performing second grouping on a plurality of second simulation images sequentially arranged in each underwater scene of the bottom of the ship.
[0116] Optionally, after sorting, a first grouping is performed on a plurality of first simulated images arranged sequentially in each underwater rock scene, and a second grouping is performed on a plurality of second simulated images arranged sequentially in each underwater scene at the bottom of the ship. It should be noted that the number of images in the first grouping result and the second grouping result can be set as needed, and both the first grouping result and the second grouping result can have multiple groups of images. For example, there will be 5 first simulated images in each underwater rock scene, and there will be 5 second simulated images in each underwater scene at the bottom of the ship. Five images form a sequence, and a sequence is grouped to form 4 pairs of images, i.e., 4 groups of images.
[0117] S230: Determine a number of simulation image groups according to the first grouping result and the second grouping result.
[0118] Therefore, based on the first grouping result and the second grouping result, multiple groups of images can be constructed, each group of images is recorded as a simulated image group, and several simulated image groups can be obtained.
[0119] In one implementation, the method of the embodiment of the present application may further include steps S200A-S200C:
[0120] S200A: Obtain pixel information of each real sonar image in the real sonar image data set, where the pixel information includes fan angle information of each pixel.
[0121] S200B, sorting the pixels of the real sonar image according to the angle according to the fan angle information of each pixel.
[0122] S200C, based on the fan shape, the pixel points in each real sonar image are spliced using the sorting result to obtain a plurality of new real sonar images.
[0123] Optionally, when processing each real sonar image in the real sonar image data set, pixel information of the real sonar image, such as fan angle information of each pixel, is obtained, and then the pixels of the real sonar image are sorted according to angles based on the fan angle information of a pixel. Finally, based on the shape of the sonar image, such as a fan, and based on the layout of the fan, the pixels in each real sonar image are spliced using the sorting result to obtain several new real sonar images, i.e., new fan-shaped sonar images. In this way, if a real sonar image only captures the sonar image data of an object or target, the overall image of the object or target can be spliced.
[0124] It should be noted that stitching and forming simulated image groups are beneficial to information fusion and multimodal learning. Stitching images from different perspectives or channels can provide richer information, thereby enhancing the understanding of the target, which is very useful for identifying complex scenes or objects and adapting to changing environments, thereby improving the training effect of the network.
[0125] It should be noted that, before step S200A or after step S200C, the obtained real sonar image can be preprocessed, including but not limited to using algorithms such as median filtering and Gaussian filtering to remove stray signals and abnormal points in the collected real sonar image, and after processing, a sonar image with high-quality features is extracted. During the processing, an average of 80% of the noise can be removed, and the image is made clearer by adjusting the contrast and brightness. The final real sonar image data set has an average availability and clarity of 97%.
[0126] like Figure 4 and Figure 5As shown, in one embodiment, the composite posture detection network is a CNN-4QuadPoseNet network that is an improvement on the existing CNN and PoseNet, including a CNN network (including a Split Layer segmentation layer), a preset number of quad networks (QuadPoseNet subnets, such as QuadPoseNet1, QuadPoseNet2, QuadPoseNet3, QuadPoseNet4), a preset number of first fully connected layers, and a second fully connected layer.
[0127] In one embodiment, in step S300, training the composite posture detection network using the real sonar image dataset and the simulated image group includes steps S310-S350:
[0128] S310: Generate a training set based on the real sonar image data set and the simulated image data set.
[0129] Optionally, the real sonar image data set and the simulated image data set are divided into a training set, a validation set, and a test set according to a certain ratio, such as a ratio of 9:0.5:0.5. The training set includes a number of training images, and the training images include real sonar images and images in the simulated image group. During training, a part of the data can be selected as a mini-batch or batch size. The goal is to reduce the value of the loss function of the mini-batch, and the data is selected from this part during training. The completion of the training of this part of the data can be regarded as one iteration.
[0130] It should be noted that the role of the training set in the model generation process is to update the parameters (weights and biases) of the model to obtain better performance. Its behavior is manifested as the model mastering the knowledge and rules related to the data; validation set: used to correct and strengthen the knowledge learned during the training process, and to check whether the effect of model training is going in a bad direction. The purpose of the validation set is to select the best performing model from a bunch of possible models. It can be used to select hyperparameters and evaluate the performance of hyperparameters. Test set: used to finally evaluate the learning effect. The test set is used to evaluate the final performance of the model and the generalization ability of the final model. However, it cannot be used as a basis for algorithm-related choices such as parameter adjustment and feature selection. The role of the test set is reflected in the testing process.
[0131] S320, using a CNN network, dividing each training image into a preset number of sub-images, and connecting corresponding quadrants of each sub-image through the spatial coordinates of the pixel points.
[0132] In an embodiment of the present application, each training image is divided into a preset number of sub-images through a CNN network. For example, taking the preset number as 4 as an example, each training image is divided into 4 sub-images, and then the corresponding quadrants of each sub-image are vertically connected through the spatial coordinates of the pixel points, for example, to obtain a sub-image of 320×320 pixels, namely, Input.
[0133] S330, input the sub-images into the quadruple network for processing respectively, input the output result of each quadruple network into the corresponding first fully connected layer, and input the output result of each first fully connected layer into the second fully connected layer to obtain the posture parameters of the target.
[0134] Optionally, the quad network is a QuadPoseNet subnet, such as QuadPoseNet1, QuadPoseNet2, QuadPoseNet3, and QuadPoseNet4, and each QuadPoseNet subnet includes 8 convolutional layers arranged in sequence (recorded as the first convolutional layer, the second convolutional layer, the third convolutional layer, the fourth convolutional layer, the fifth convolutional layer, the sixth convolutional layer, the seventh convolutional layer, the eighth convolutional layer, the first average pooling layer, the second average pooling layer, the third fully connected layer, and the fourth fully connected layer. For example, the filter size of the first convolutional layer is 5×5, the number of convolution kernels is 6, and the activation function uses Sigmoid. The first average pooling layer can be maximum pooling, the filter size is 2×2, the stride is 2, the first average pooling layer uses a 4×4 average pooling layer, the filter size of the second convolutional layer to the eighth convolutional layer can be 5×5, the number of convolution kernels is 16 or 6, and the activation function of the third fully connected layer and the fourth fully connected layer uses Sigmoid.
[0135] Therefore, the sub-images are respectively input into the quadruple network. After being processed by the first convolution layer, the ReLU function is output to the first average pooling layer, and then output to the third fully connected layer (FC1) to obtain the first result. After being processed by the first convolution layer, the second convolution layer, the third convolution layer, the fourth convolution layer, the fifth convolution layer, the sixth convolution layer, the seventh convolution layer, and the eighth convolution layer are processed. The output of the eighth convolution layer is input into the second average pooling layer, and then the output of the second average pooling layer is input into the second average pooling layer (FC2) to obtain the second result. Therefore, the output result of the quadruple network includes the first result and the second result. Then, the first result and the second result are input into the first fully connected layer (2×1024) to obtain the Output, and the output result of each first fully connected layer is input into the second fully connected layer (8×1024, regression layer) to obtain the posture parameters and classification results of the target (such as whether it contains a certain scene or an object, which is the segmentation mask of the object in the image-a binary image whose pixel value indicates whether the image contains the object. Formally, the segmentation output is usually a matrix of the same size as the input image, in which each pixel is marked as being part of the object or not). Optionally, the target's attitude parameters may include three degrees of freedom (Motion 3 DoF) in the three directions of the x, y, and z axes. The degrees of freedom may include the object's translation, rotation, and scaling parameters. Formally, these parameters may be represented as a attitude matrix or attitude vector. The attitude matrix may include a rotation matrix, a translation vector, and a scaling parameter, providing a comprehensive description of the object's attitude transformation in three-dimensional space. The attitude vector may include three degrees of freedom (Motion 3 DoF) in the three directions of the x, y, and z axes. The degrees of freedom may include a rotation axis, a rotation angle, a translation vector, a scaling parameter, etc.
[0136] S340: Determine a first loss value according to the posture parameters, posture information and loss function.
[0137] Optionally, the regression output layer of the (MSE) loss function can be used to measure the estimation error during training. Since the traditional regression layer may not take into account the physical constraints of the motion parameters during training, in some extreme cases, the estimation results may deviate from the actual motion range. In order to address this problem, the present invention introduces a first loss value by modifying the regression layer to introduce a penalty mechanism for the predefined range of motion parameters. The calculation is as follows:
[0138]
[0139] in, is the estimate of each degree of freedom in the posture parameters, is the kth degree of freedom on the x-axis, is the kth degree of freedom on the y-axis, is the z-th degree of freedom, is the quantization of the kth (x-axis, y-axis, z-axis) degree of freedom in the posture information, k represents the index of the training sample in the mini-batch, S is the mini-batch size, R is the number of parameters to be estimated, R=3.
[0140] It should be noted that motion penalty (Weight Decay) is a regularization technique used to constrain the weights of the model during the neural network training process. Its purpose is to prevent overfitting and improve the generalization performance of the model by adding additional terms to the loss function to limit the value of the network parameters. It can effectively prevent overfitting, control model complexity, and increase robustness to shared features. Motion penalty is an effective regularization method that helps balance the complexity and generalization performance of the model and improve the performance of the model on unseen data.
[0141] Additionally, the regression layer is modified to penalize the estimation of motion parameters outside a predefined range. Each degree of freedom can be penalized individually. Describe the penalty for each degree of freedom The equation is:
[0142]
[0143] in, is the penalty parameter set to 100. B1 and B2 are the boundaries that define the non-penalized interval and are set to -10 and 10, respectively. Then, The loss equation is:
[0144]
[0145] Wherein, the value of j is x, y or z, representing the penalty of the degree of freedom of the j-th coordinate axis. That is to say, in some embodiments, the above The loss equation is used as the loss function to calculate the first loss value.
[0146] S350. Training the composite posture detection network according to the first loss value until a first termination condition is reached.
[0147] Optionally, assuming that training all training images once is one iteration, the first termination condition may be a loss threshold. For example, when the first loss value is not less than the loss threshold, all training images are continued to be used for a second iteration until the first loss value is less than the loss threshold. Based on the network parameters at this time, the trained composite posture detection network can be determined.
[0148] It should be noted that when optimizing network parameters such as hyperparameters during training, a range can be roughly set, and a hyperparameter can be randomly selected (sampled) from this range, and the sampled value can be used to evaluate the recognition accuracy; then, this operation is repeated many times, the results of the recognition accuracy are observed, and the hyperparameter is narrowed down to the required range based on this result. By repeating this operation, the appropriate range of the hyperparameter can be gradually determined to obtain the optimal model.
[0149] like Figure 6 and Figure 7 , taking the underwater human body as an example, the training images include human bodies in different scenes. Figure 6 and Figure 7 The following are the schematic diagrams of the confidence output by the trained composite posture detection network and the schematic diagram of the accuracy confidence curve. These two curves are the visualization results of the target recognition model evaluation indicators, which are used to analyze the performance of the model under different confidence levels. The difference between them lies in the different evaluation indicators.
[0150] (1) F1-Confidence Curve (output confidence curve):
[0151] Among them, the F1 score is the harmonic mean of precision and recall, which takes into account both the accuracy and completeness of the model. The formula is:
[0152]
[0153] Confidence in target detection indicates the confidence of the model in the detection results. Usually, the model gives a confidence score when predicting a target, which represents the probability that the model believes the prediction is correct.
[0154] The F1-Confidence curve uses confidence as the horizontal axis and F1 score as the vertical axis, showing the changes in the F1 score of the model at different confidence levels. By observing this curve, you can understand the overall performance of the model at different confidence levels, and you can choose an appropriate confidence threshold to balance precision and recall according to your needs.
[0155] On the curve, there may be some fluctuations at the beginning, then gradually flatten out, and finally may decrease. This shape usually indicates that at higher confidence levels, the performance of the model may begin to decline because the model will filter out some true targets and cause a decrease in recall.
[0156] (2) Precision-Confidence Curve:
[0157] The precision rate refers to how many samples predicted by the model as positive examples are actually positive examples. It is one of the important indicators for evaluating the accuracy of the model. The calculation formula is:
[0158]
[0159] The Precision-Confidence curve uses confidence as the horizontal axis and precision as the vertical axis, showing the change in the precision of the model at different confidence levels. By observing this curve, you can understand the prediction accuracy of the model at different confidence levels and help choose the appropriate confidence threshold to achieve the required precision requirements. The curve usually rises rapidly and then levels off. In this case, the model tends to have higher precision at higher confidence levels. Eventually, the precision may approach 1, which means that the model has almost no false positives at high confidence levels.
[0160] To sum up, the F1-Confidence Curve (output confidence curve) focuses more on balancing the accuracy and completeness of the model (the combination of Precision and Recall), while the Precision-Confidence Curve (accuracy confidence curve) focuses more on the accuracy of the model (Precision).
[0161] In an embodiment of the present application, in order to improve the robustness of the model, some noise is introduced into the training set, such as 10% partial occlusion and 20% background complexity, to simulate complex situations in the real world to ensure that the model has good generalization ability.
[0162] In the embodiments of the present application, appropriate evaluation indicators such as accuracy, precision, recall, F1 score, etc. are selected according to the nature of the task. Other possible parameters are set, such as batch size or whether to enable evaluation mode. Test data is input into the neural network, and the output of the model is calculated through forward propagation. Make sure that no gradient updates are performed during testing. The selected evaluation indicators are calculated using the true labels of the test data and the prediction results of the model. These indicators provide a quantitative evaluation of the performance of the model. Depending on the nature of the task, the prediction results of the model can be visualized, which helps to have a more comprehensive understanding of the performance of the model on different categories. Figure 8The figure shows the test results. Taking the recognition of human body as an example, the average confidence of recognition is 80%. The test results show that the network has a high accuracy rate in recognizing sonar image target images and has a good recognition effect. The test results show that the use of CNN-4QuadPoseNet network model has a significant effect in sonar image target recognition. The model can accurately locate and identify the position of underwater targets in complex environments. It is found that CNN-4QuadPoseNet has achieved significant improvements in accuracy and robustness.
[0163] In one embodiment, in step S300, the trajectory neural network is trained by using a real sonar image data set and a simulated image group, including steps S301-S306:
[0164] S301, generating a training set according to a real sonar image data set and a simulated image data set.
[0165] It should be noted that the training set includes a number of training images, and the training images include real sonar images and images in the simulation image group.
[0166] S302 , segmenting each training image according to the trajectory neural network to obtain a preset number of sub-images corresponding to each training image.
[0167] For example, the preset number is 4, and each training image is segmented into 4 sub-images through the trajectory neural network.
[0168] It should be noted that the self-designed PoseNet-Normx10 network is used as the trajectory neural network in the embodiment of the present application to improve performance. The new network model may achieve better performance on specific tasks through design improvements or innovations, and can better adapt to the reasoning of images acquired by underwater sonar, and increase the accuracy of target detection and posture estimation. The introduction of the PoseNet-Normx10 network is more efficient, helps to accelerate the training or inference process, and is suitable for applications with high real-time requirements.
[0169] At the same time, the PoseNet-Normx10 neural network can supplement the functions of the CNN-4QuadPoseNet neural network proposed earlier. The CNN-4QuadPoseNet neural network has low efficiency and low accuracy in estimating the underwater three-dimensional environment. The PoseNet-Normx10 neural network is introduced to perform inference estimation on the underwater three-dimensional environment and obtain typical label points for underwater motion.
[0170] Among them, PoseNet-Normx10 consists of neurons, hierarchical structures, and weights. The PoseNet-Normx10 neural network performs tasks by learning the mapping relationship from input to output. The main components are as follows: Input Layer: The layer that accepts the original input data. Each neuron corresponds to a feature of the input data. Hidden Layer: The layer between the input layer and the output layer. Each layer contains multiple neurons, which are connected to the neurons of the previous layer through weights. The depth of the hidden layer determines the depth of the network. Output Layer: Produces the final output result. The number of neurons in the output layer usually corresponds to the number of categories of the task or the dimension of the regression target. Weights: Each connection has an associated weight, which determines the strength of the signal transmitted in the network. During training, these weights are updated by the back-propagation algorithm. Activation Function: Located after each neuron, it introduces nonlinear characteristics. Common activation functions include ReLU, Sigmoid, and Tanh.
[0171] S303 , performing compression filtering processing on the sub-images, and splicing a preset number of sub-images after the compression filtering processing to obtain a spliced training image.
[0172] S304: Perform inference operations on all the spliced training images to obtain the target's driving trajectory.
[0173] In an embodiment of the present application, the sub-images are compressed and filtered by PoseNet-Normx10, and a preset number of sub-images after the compression and filtering are spliced. For example, 4 sub-images are processed by an image compression algorithm and a filtering algorithm, and then the 4 sub-images are spliced to obtain a spliced training image. Then, the spliced training image is inferred to obtain motion data of the target moving underwater, including but not limited to the angular offset of the x, y, and z axes, and then the target's driving trajectory is generated based on the motion data. It should be noted that the target can be an object in the training image, or, since the sonar device is installed on the underwater robot (platform), and since the installation positions of the sonar device and the underwater robot are fixed, the target can also be an underwater robot. Based on the information in the acquired image, the robot's motion data can be inferred, thereby estimating the robot's driving trajectory.
[0174] S305: Calculate a second loss value according to the motion information and the driving trajectory.
[0175] Similarly, taking the target as a robot as an example, the actual driving trajectory of the robot can be obtained based on the motion information of different images, and the actual driving trajectory is combined with the estimated driving trajectory of the robot to calculate the second loss value.
[0176] S306. Training the trajectory neural network according to the second loss value until a second termination condition is reached.
[0177] Similarly, the second termination condition can be a loss threshold. It is assumed that training all the spliced training images once is an iteration. For example, when the second loss value does not meet the loss threshold, all the spliced training images are continuously used for a second iteration until the second loss value is less than the loss threshold. Based on the network parameters at this time, the trained trajectory neural network (PoseNet-Normx10) can be determined.
[0178] In the embodiment of the present application, the trained PoseNet-Normx10 network is simulated and verified:
[0179] Using a sonar simulator, a new dataset is generated for validating the trajectory estimator.
[0180] The scene was selected to create a trajectory of 904 noise-free images, maintaining the same pitch angle and altitude from the seabed. The sonar was moving sideways, with a constant acceleration of 0.105-0.378m / s2 along the trajectory. Each point of the trajectory was represented by a global Cartesian coordinate (x i ,y i ), and the platform direction relative to the global scene direction , i=1,2,3,...,M-1 is the index of the image pair when facing the y-axis, and M is the number of images obtained on the trajectory. The first point of the trajectory is placed at the origin (x1=0,y1=0,θ1=0). The coordinates are assumed to be on a plane parallel to the seafloor. The trajectory points are calculated as follows:
[0181]
[0182]
[0183] in, , , For each pair of images, and Translation and Rotation estimation, The platform direction relative to the global scene direction, i and i+1 represent indices.
[0184] Based on the reconstructed trajectory, the images are mapped to global coordinates. To generate the annotations, the pixel intensity of each point is interpolated from the image pixels, and when the images overlap, the intensities of the pixels in the images are averaged. For clarity, only the pixels corresponding to the 24 central beams of each image are used for interpolation, except for the first and last images.
[0185] A ship bottom dataset obtained with real sonar was used to validate the performance of DL methods for pose and trajectory estimation. The PoseNet-Normx10 network was trained using a simulated ship hull. The network was trained three times, applying different levels of noise to the images: no noise, low level noise, and high level noise, the same level measured in the real dataset.
[0186] like Fig. 9 As shown, the embodiment of the present application also provides an estimation method, including steps S410-S420:
[0187] S410, collecting real-time sonar images.
[0188] For example, sonar images are collected in real time through the sonar equipment on the underwater robot.
[0189] S420, inputting the real-time sonar image into the composite posture detection network and the trajectory neural network to estimate the posture parameters of the target and the driving trajectory of the target.
[0190] It should be noted that the composite posture detection network and the trajectory neural network are trained by the method in the above step S300.
[0191] By using the method of the embodiment of the present application, at least the following effects can be achieved:
[0192] 1) Use images generated by the sonar simulator to participate in the training of the deep learning model. In this process, the model learns the characteristics of the synthetic data set to extract information from the sonar image and accurately estimate the platform's navigation trajectory. The trajectory estimation and reconstruction process is critical for actual navigation tasks, especially in complex environments and limited observation conditions;
[0193] 2) After estimating and restoring the navigation trajectory, the sonar image can be further annotated to further improve the interpretability of the sonar image and the accuracy of the navigation information, thereby enhancing the ability to understand and analyze sonar data in real scenes;
[0194] 3) The method of this application has significant academic and application value in processing monochrome and low-resolution sonar images. Unlike previous estimations using optical images, sonar images are monochrome and have low resolution, which means that the sonar has less motion estimation information. A new architecture is established to process sonar images. This algorithm improves the safety and reliability of autonomous underwater navigation and remotely operated underwater vehicles.
[0195] 4) Aiming at the shortcomings of the existing CNN and GeoNet-PoseNet, the CNN-4QuadPoseNet structure is proposed. Compared with the CNN-4b network, the CNN-4QuadPoseNet network model proposed in this study has the advantages of occupying fewer computing and reasoning resources, significantly improving data processing and computing speed, and higher accuracy in identifying underwater targets. In general, CNN-4QuadPoseNet first reduces the complexity of the model by reducing the number of network layers, reducing the number of parameters, or using smaller convolution kernels, thereby reducing the amount of calculation and achieving a lightweight network structure design; second, using parallel computing technology, the calculation process of the model is decomposed into multiple parts in parallel to improve computing efficiency; third, in view of the characteristics of the underwater environment, a feature extraction method that is more suitable for underwater target recognition is designed, such as considering the impact of underwater lighting, water quality and other factors on the characteristics of the target, and performing corresponding data enhancement processing. Its specific improvements are as follows:
[0196] ① Network structure design principles
[0197] CNN-4QuadPoseNet is a deep neural network based on a four-branch QuadPose structure, which is designed to make full use of the spatial position and posture information of the target object to improve the accuracy of posture estimation. The QuadPose structure contains four parallel convolutional neural network branches, which are used to extract the position (P), rotation (R), scale (S) and features (F) of the target. This design aims to effectively learn and represent the position and posture information of the target object respectively, so as to estimate the target's posture more accurately.
[0198] ②Choice of optimization algorithm
[0199] When training CNN-4QuadPoseNet, we selected the optimization algorithm suitable for deep neural networks, stochastic gradient descent with momentum (SGD with momentum), to accelerate the convergence of the model and avoid falling into local minima. In addition, we also adopted the learning rate scheduling strategy, learning rate decay, to better balance the training speed and model performance.
[0200] ③ Improvement of feature extraction method
[0201] CNN-4QuadPoseNet uses an improved feature extraction method to better capture the position and posture information of underwater targets. These improvements include the introduction of multi-scale convolution kernels and nonlinear activation functions (such as Leaky ReLU) for underwater target object features to enhance the network's ability to represent complex targets. At the same time, by introducing residual connections and attention mechanisms, the network can better focus on important parts of the target object, thereby improving the accuracy of posture estimation.
[0202] 5) The PoseNet-Normx10 network can infer the posture and trajectory of underwater robots in noise-free, low-level noise, and high-level noise environments, improving the safety and reliability of autonomous underwater navigation and remotely operated underwater vehicles. Fig.10 As shown. It can be seen that using a trained network, it is possible to produce a good annotation even if the sonar features of the training set are different. The underwater robot follows the pre-set route, records the path of the underwater robot every 1m forward, and then generates a trajectory curve. It should be noted that the sonar is designed to remain facing forward when moving along the trajectory to ensure a consistent sonar direction in a continuous image sequence. This design helps to maintain consistency in observations. The data of the sonar acquisition environment is used as the data of the PoseNet-Normx10 inference network, and the inference result of the PoseNet-Normx10 network is used as the path of the underwater robot's movement. Fig.10 The connecting line in the figure is the predicted motion path of the underwater robot, and the black arrows indicate the sonar direction of every 50 images.
[0203] Table 1
[0204]
[0205] As shown in Table 1, the improved recognition rate and accuracy have been significantly improved compared to those before the improvement, by 10% and 13% respectively. This shows that the improved algorithm has effectively improved the system's ability to accurately identify underwater targets. The improved recognition speed has been significantly accelerated, from 5 seconds per image to 3 seconds per image. This not only improves real-time performance, but also makes the system more suitable for underwater sonar monitoring in complex environments. The improved video frame rate has increased from 12 fps to 18 fps, indicating that the system is more responsive and can process continuous sonar image streams more quickly.
[0206] Reference Fig.11, shows a structural block diagram of a sonar-based model training device according to an embodiment of the present application, and the device may include:
[0207] An acquisition module is used to acquire a real sonar image data set, and generate a simulated image data set through a sonar simulator, wherein the simulated image data set includes a plurality of first simulated images of different underwater rock scenes and a plurality of second simulated images of different underwater scenes at the bottom of the ship, wherein the real sonar image data set, the first simulated images and the second simulated images all have label information, and the label information includes posture information and motion information;
[0208] A combination module, used for classifying and combining a plurality of first simulation images of different underwater rock scenes and a plurality of second simulation images of different underwater scenes at the bottom of the ship, to obtain a plurality of simulation image groups;
[0209] A training module for training a composite pose detection network and a trajectory neural network using a real sonar image dataset and a simulated image set;
[0210] Among them, the composite posture detection network is used to estimate the posture parameters of the target, and the trajectory neural network is used to estimate the driving trajectory of the target.
[0211] In the embodiment of the present application, the training module is also used for:
[0212] Obtain pixel information of each real sonar image in the real sonar image data set, where the pixel information includes fan angle information of each pixel;
[0213] According to the fan angle information of each pixel point, the pixel points of the real sonar image are sorted according to the angle;
[0214] Based on the sectors, the pixels in each real sonar image are spliced using the sorting results to obtain several new real sonar images.
[0215] The functions of each module in each device in the embodiments of the present application can be found in the corresponding description in the above method, and will not be repeated here.
[0216] Reference Fig.12 , shows a structural block diagram of an electronic device according to an embodiment of the present application, the electronic device includes: a memory 310 and a processor 320, the memory 310 stores instructions that can be run on the processor 320, and the processor 320 loads and executes the instructions to implement the sonar-based model training method or estimation method in the above embodiment. The number of the memory 310 and the processor 320 can be one or more.
[0217] In one embodiment, the electronic device further includes a communication interface 330 for communicating with external devices and performing data exchange transmission. If the memory 310, the processor 320 and the communication interface 330 are implemented independently, the memory 310, the processor 320 and the communication interface 330 can be interconnected through a bus and communicate with each other. The bus can be an Industry Standard Architecture (ISA) bus, a Peripheral Component Interconnect (PCI) bus or an Extended Industry Standard Architecture (EISA) bus, etc. The bus can be divided into an address bus, a data bus, a control bus, etc. For ease of representation, Fig.12 Only one thick line is used in the diagram, but this does not mean that there is only one bus or only one type of bus.
[0218] Optionally, in a specific implementation, if the memory 310, the processor 320 and the communication interface 330 are integrated on a chip, the memory 310, the processor 320 and the communication interface 330 can communicate with each other through an internal interface.
[0219] An embodiment of the present application provides a computer-readable storage medium storing a computer program, which, when executed by a processor, implements the sonar-based model training method or estimation method provided in the above-mentioned embodiment.
[0220] An embodiment of the present application also provides a chip, which includes a processor for calling and executing instructions stored in the memory from the memory, so that a communication device equipped with the chip executes the method provided by the embodiment of the present application.
[0221] An embodiment of the present application also provides a chip, including: an input interface, an output interface, a processor and a memory, wherein the input interface, the output interface, the processor and the memory are connected via an internal connection path, and the processor is used to execute the code in the memory. When the code is executed, the processor is used to execute the method provided in the embodiment of the application.
[0222] It should be understood that the processor may be a central processing unit (CPU), or other general-purpose processors, digital signal processors (DSP), application specific integrated circuits (ASIC), field programmable gate arrays (FPGA) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. A general-purpose processor may be a microprocessor or any conventional processor, etc. It is worth noting that the processor may be a processor supporting the advanced RISC machines (ARM) architecture.
[0223] Further, optionally, the above-mentioned memory may include a read-only memory and a random access memory, and may also include a non-volatile random access memory. The memory may be a volatile memory or a non-volatile memory, or may include both volatile and non-volatile memories. Among them, the non-volatile memory may include a read-only memory (ROM), a programmable read-only memory (PROM), an erasable programmable read-only memory (EPROM), an electrically erasable programmable read-only memory (EEPROM), or a flash memory. The volatile memory may include a random access memory (RAM), which is used as an external cache. By way of example but not limitation, many forms of RAM are available. For example, static RAM (SRAM), dynamic random access memory (DRAM), synchronous DRAM (SDRAM), double data rate synchronous dynamic random access memory (DDR SDRAM), enhanced synchronous dynamic random access memory (ESDRAM), synchronous link dynamic random access memory (SLDRAM) and direct rambus RAM (DR RAM).
[0224] In the above embodiments, it can be implemented in whole or in part by software, hardware, firmware or any combination thereof. When implemented using software, it can be implemented in whole or in part in the form of a computer program product. The computer program product includes one or more computer instructions. When the computer program instructions are loaded and executed on a computer, the process or function according to the present application is generated in whole or in part. The computer can be a general-purpose computer, a special-purpose computer, a computer network, or other programmable device. The computer instructions can be stored in a computer-readable storage medium, or transmitted from one computer-readable storage medium to another computer-readable storage medium.
[0225] In the description of this specification, the description with reference to the terms "one embodiment", "some embodiments", "example", "specific example" or "some examples" means that the specific features, structures, materials or characteristics described in conjunction with the embodiment or example are included in at least one embodiment or example of the present application. Moreover, the described specific features, structures, materials or characteristics may be combined in any one or more embodiments or examples in a suitable manner. In addition, those skilled in the art may combine and combine different embodiments or examples described in this specification and the features of different embodiments or examples, unless they are contradictory.
[0226] In addition, the terms "first" and "second" are used for descriptive purposes only and should not be understood as indicating or implying relative importance or implicitly indicating the number of technical features indicated. Therefore, a feature defined as "first" or "second" may explicitly or implicitly include at least one of the features. In the description of this application, the meaning of "plurality" is two or more, unless otherwise clearly and specifically defined.
[0227] Any process or method description in the flow chart or otherwise described herein can be understood to represent a module, fragment or portion of a code including one or more executable instructions for implementing the steps of a specific logical function or process. And the scope of the preferred embodiment of the present application includes other implementations, in which the functions may not be performed in the order shown or discussed, including in a substantially simultaneous manner or in a reverse order according to the functions involved.
[0228] The logic and / or steps represented in the flowchart or otherwise described herein, for example, can be considered as an ordered list of executable instructions for implementing logical functions, which can be embodied in any computer-readable medium for use by an instruction execution system, apparatus or device (such as a computer-based system, a system including a processor or other system that can fetch instructions from an instruction execution system, apparatus or device and execute instructions), or used in combination with these instruction execution systems, apparatuses or devices.
[0229] It should be understood that the various parts of the present application can be implemented with hardware, software, firmware or a combination thereof. In the above embodiments, multiple steps or methods can be implemented with software or firmware stored in a memory and executed by a suitable instruction execution system. All or part of the steps of the above embodiment method can be completed by instructing the relevant hardware through a program, which can be stored in a computer-readable storage medium, and when the program is executed, it includes one of the steps of the method embodiment or a combination thereof.
[0230] In addition, each functional unit in each embodiment of the present application can be integrated into a processing module, or each unit can exist physically separately, or two or more units can be integrated into one module. The above-mentioned integrated module can be implemented in the form of hardware or in the form of a software functional module. If the above-mentioned integrated module is implemented in the form of a software functional module and sold or used as an independent product, it can also be stored in a computer-readable storage medium. The storage medium can be a read-only memory, a disk or an optical disk, etc.
[0231] The above is only a specific implementation of the present application, but the protection scope of the present application is not limited thereto. Any technician familiar with the technical field can easily think of various changes or substitutions within the technical scope disclosed in the present application, which should be included in the protection scope of the present application. Therefore, the protection scope of the present application should be based on the protection scope of the claims.
Claims
1. A sonar-based model training method, characterized in that: include: Acquire a real sonar image data set, and generate a simulated image data set through a sonar simulator, wherein the simulated image data set includes a plurality of first simulated images of different underwater rock scenes and a plurality of second simulated images of different underwater scenes at the bottom of the ship, wherein the real sonar image data set, the first simulated images, and the second simulated images all have label information, and the label information includes attitude information and motion information; Classifying and combining a plurality of first simulation images of different underwater rock scenes and a plurality of second simulation images of different underwater scenes at the bottom of a ship, respectively, to obtain a plurality of simulation image groups; Training a composite posture detection network and a trajectory neural network using the real sonar image data set and the simulated image group; Wherein, the composite posture detection network is used to estimate the posture parameters of the target, and the trajectory neural network is used to estimate the driving trajectory of the target; The composite posture detection network includes a CNN network, a preset number of quadruple networks, a preset number of first fully connected layers, and a second fully connected layer. Training the composite posture detection network through the real sonar image data set and the simulated image group includes: Generate a training set according to the real sonar image data set and the simulated image data set, wherein the training set includes a plurality of training images, and the training images include real sonar images and images in the simulated image group; By means of the CNN network, each of the training images is divided into a preset number of sub-images, and corresponding quadrants of each sub-image are connected through the spatial coordinates of the pixel points; The sub-images are respectively input into the quadruple network for processing, the output result of each quadruple network is input into the corresponding first fully connected layer, and the output result of each first fully connected layer is input into the second fully connected layer to obtain the posture parameters of the target; Determine a first loss value according to the posture parameter, the posture information and the loss function, the first loss value The calculation formula is: in, is the estimate of each degree of freedom in the posture parameters, is the kth degree of freedom on the x-axis, is the kth degree of freedom on the y-axis, is the z-th degree of freedom, is the quantization of the kth (x-axis, y-axis, z-axis) degree of freedom in the posture information, k represents the index of the training examples in the mini-batch, S is the mini-batch size, and R is the number of parameters to be estimated; The composite posture detection network is trained according to a first loss value until a first termination condition is reached.
2. The sonar-based model training method according to claim 1, characterized in that: The generating of the simulated image data set by the sonar simulator comprises one of the following: First sensor data of different underwater rock scenes and second sensor data of different underwater scenes at the bottom of the ship collected in real time by a sonar sensor are input into a sonar simulator to generate a simulated image data set; Generate a first sonar image of different underwater rock scenes and a second sonar image of different underwater scenes at the bottom of the ship by using a sonar model, input the first sonar image and the second sonar image into a sonar simulator to generate a simulated image data set; Acquire first historical sensor data of different underwater rock scenes and second historical sensor data of different underwater scenes at the bottom of a ship, input the first historical sensor data and the second historical sensor data into a sonar simulator to generate a simulated image data set.
3. The sonar-based model training method according to claim 1, characterized in that: The plurality of first simulation images of different underwater rock scenes and the plurality of second simulation images of different underwater scenes at the bottom of the ship are classified and combined to obtain the plurality of simulation image groups, including: Arranging a plurality of first simulation images corresponding to each underwater rock scene in time or space order, and arranging a plurality of second simulation images corresponding to each underwater scene at the bottom of the ship in time or space order; Performing first grouping on a plurality of first simulation images sequentially arranged in each underwater rock scene, and performing second grouping on a plurality of second simulation images sequentially arranged in each underwater scene of the bottom of the ship; A number of simulated image groups are determined according to the first grouping result and the second grouping result.
4. The sonar-based model training method according to any one of claims 1 to 3, characterized in that: The method further comprises: Acquire pixel information of each real sonar image in the real sonar image data set, wherein the pixel information includes fan angle information of each pixel; According to the fan angle information of each pixel point, the pixel points of the real sonar image are sorted according to the angle; Based on the sectors, the pixels in each real sonar image are spliced using the sorting results to obtain several new real sonar images.
5. The sonar-based model training method according to any one of claims 1 to 3, characterized in that: Training the trajectory neural network by using the real sonar image data set and the simulated image group includes: Generate a training set according to the real sonar image data set and the simulated image data set, wherein the training set includes a plurality of training images, and the training images include real sonar images and images in the simulated image group; Segmenting each of the training images according to the trajectory neural network to obtain a preset number of sub-images corresponding to each of the training images; Performing compression and filtering processing on the sub-images, and splicing a preset number of sub-images after the compression and filtering processing to obtain a spliced training image; Performing inference operations on all the spliced training images to obtain the driving trajectory of the target; Calculating a second loss value according to the motion information and the driving trajectory; The trajectory neural network is trained according to the second loss value until a second termination condition is reached.
6. An estimation method, characterized in that include: Collect real-time sonar images; The real-time sonar image is input into a composite posture detection network and a trajectory neural network trained according to any one of claims 1 to 5, and the posture parameters of the target and the driving trajectory of the target are estimated.
7. A sonar-based model training device, characterized in that: include: An acquisition module is used to acquire a real sonar image data set, and generate a simulated image data set through a sonar simulator, wherein the simulated image data set includes a plurality of first simulated images of different underwater rock scenes and a plurality of second simulated images of different underwater scenes at the bottom of the ship, and the real sonar image data set, the first simulated images and the second simulated images all have label information, and the label information includes posture information and motion information; A combination module, used for classifying and combining a plurality of first simulation images of different underwater rock scenes and a plurality of second simulation images of different underwater scenes at the bottom of the ship, to obtain a plurality of simulation image groups; A training module, used for training a composite posture detection network and a trajectory neural network through the real sonar image data set and the simulated image group; Wherein, the composite posture detection network is used to estimate the posture parameters of the target, and the trajectory neural network is used to estimate the driving trajectory of the target; The composite posture detection network includes a CNN network, a preset number of quadruple networks, a preset number of first fully connected layers, and a second fully connected layer. Training the composite posture detection network through the real sonar image data set and the simulated image group includes: Generate a training set according to the real sonar image data set and the simulated image data set, wherein the training set includes a plurality of training images, and the training images include real sonar images and images in the simulated image group; By means of the CNN network, each of the training images is divided into a preset number of sub-images, and corresponding quadrants of each sub-image are connected through the spatial coordinates of the pixel points; The sub-images are respectively input into the quadruple network for processing, the output result of each quadruple network is input into the corresponding first fully connected layer, and the output result of each first fully connected layer is input into the second fully connected layer to obtain the posture parameters of the target; Determine a first loss value according to the posture parameter, the posture information and the loss function, the first loss value The calculation formula is: in, is the estimate of each degree of freedom in the posture parameters, is the kth degree of freedom on the x-axis, is the kth degree of freedom on the y-axis, is the z-th degree of freedom, is the quantization of the kth (x-axis, y-axis, z-axis) degree of freedom in the posture information, k represents the index of the training examples in the mini-batch, S is the mini-batch size, and R is the number of parameters to be estimated; The composite posture detection network is trained according to a first loss value until a first termination condition is reached.
8. An electronic device, characterized in that: include: A processor and a memory, wherein the memory stores instructions, and the instructions are loaded and executed by the processor to implement the method according to any one of claims 1 to 6.
9. A computer-readable storage medium, wherein a computer program is stored in the computer-readable storage medium, and when the computer program is executed, the method according to any one of claims 1 to 6 is implemented.
