Sonar image target automatic recognition method and related device
By preprocessing sonar monitoring images and extracting features from multi-layer convolutional residual structures, combined with target detection models and training with combined loss functions, the problems of poor generalization ability and single target category in underwater target recognition schemes are solved, and real-time accurate detection of multiple categories is achieved in complex underwater environments.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- GUANGZHOU MARINE GEOLOGICAL SURVEY
- Filing Date
- 2026-01-19
- Publication Date
- 2026-06-02
AI Technical Summary
Existing deep learning-based underwater target recognition schemes rely on specific datasets, have poor generalization ability, and are difficult to achieve real-time and accurate detection in complex and ever-changing real underwater environments. Furthermore, they can only identify a single target category and cannot meet the needs for multi-category and refined target recognition.
By acquiring and preprocessing sonar monitoring images, feature extraction is performed using multi-layer convolution and residual structures to construct multi-scale feature maps. These maps are then trained using a target detection model and a combined loss function to optimize the target recognition model and achieve adaptive detection of targets at different scales.
It improves the accuracy and robustness of target recognition algorithms in complex underwater environments, enables real-time and accurate detection of multiple types of targets, and solves the problem of poor universality in existing technologies.
Smart Images

Figure CN122135189A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of image processing technology, and in particular to an automatic target recognition method and related equipment for sonar images. Background Technology
[0002] The underwater environment poses significant challenges to traditional detection technologies based on electromagnetic waves and optical signals, mainly due to severe signal attenuation and susceptibility to water turbidity and lighting conditions, resulting in insufficient stability and reliability of sensing and imaging. In contrast, acoustic sensors (especially sonar), with their advantages of long underwater propagation distance and strong anti-interference capabilities, have become a key technology for underwater target detection and identification.
[0003] Currently, commonly used active sonars (such as side-scan sonar, forward-looking sonar, and synthetic aperture sonar) can generate images that reflect seabed topography, structure, and targets. A typical sonar image consists of bright areas (strong reflection), shadow areas (occlusion), and background areas (noise), providing a basic basis for image-based automatic target recognition.
[0004] In recent years, the tremendous success of deep learning technology in the field of optical image processing has spurred attempts to apply it to automatic target recognition tasks in sonar images. However, sonar images generally suffer from problems such as blurred texture and shape details, high noise interference, and relatively low image quality, which pose serious challenges to the feature learning and generalization capabilities of deep learning models, resulting in a late start and relatively lagging development in this field.
[0005] Existing deep learning-based underwater target recognition schemes suffer from the following limitations: First, the training and validation of most algorithms heavily rely on specific and limited public datasets, resulting in poor model generalization and universality, making it difficult to directly transfer to complex and ever-changing real-world underwater operational scenarios for real-time and accurate detection. Second, current research can only identify a relatively limited range of target categories (e.g., mainly focusing on shipwreck identification), lacking coverage of diverse targets in the real marine environment, and failing to fully meet the needs of practical marine exploration and underwater unmanned systems for multi-category, refined target recognition. Summary of the Invention
[0006] The main objective of this invention is to provide an automatic target identification method, apparatus, electronic device, storage medium, and program product for sonar images, aiming to solve at least one problem of the prior art.
[0007] To achieve the above objectives, one aspect of this invention proposes an automatic target identification method for sonar images, the method comprising: Acquire sonar surveillance footage of the target area as the raw image; The original image is preprocessed to convert it into the target size to obtain the target image; Based on the target image, feature extraction is performed through multi-layer convolution and residual structures to obtain multi-scale feature maps; Multi-scale feature maps are input into a preset target recognition model, processed to obtain target recognition results at different scales, and then filtered to obtain the final recognition result; The target recognition model is based on the target detection model and is trained using sonar images labeled with target bounding boxes and target categories.
[0008] In some embodiments, preprocessing of the original image includes at least one of the following steps: Convert the original image into a preset image data format; The original image is subjected to size mapping processing based on the preset size specifications; Perform pixel normalization on the original image.
[0009] In some embodiments, feature extraction is performed based on the target image using multi-layer convolution and residual structures to obtain a multi-scale feature map, including the following steps: Use the target image as input data; The input data is processed by convolutional layers based on preset weight parameters and bias terms to obtain the output of the convolutional layers; The output of the convolutional layer is processed sequentially through batch normalization and activation functions to obtain the output data; The input data and the residual concatenation of the output data are used as new input data. The process then returns to the previous step of performing convolutional processing on the input data through convolutional layers based on preset weight parameters and bias terms, until all layers of convolutional and residual structures are processed. Finally, a multi-scale feature map is obtained based on the output data of the last layer of the multi-layer convolutional and residual structures.
[0010] In some embodiments, the method further includes the following steps: A dataset was constructed based on sonar imagery with labeled bounding boxes and target categories; Feature extraction is performed using multi-layer convolution and residual structures to transform sonar images in the dataset into multi-scale training feature maps. Multi-scale training feature maps are used as input data for the model, and bounding boxes and target categories are used as label data. The target detection model is trained and optimized by combining loss functions to obtain the target recognition model. The combined loss function includes the coordinate loss function, the confidence loss function, and the classification loss function.
[0011] In some embodiments, a dataset is constructed based on sonar imagery labeled with target bounding boxes and target categories, including the following steps: The collected data set is obtained by extracting data from a preset dataset; Each raw sonar image in the acquired dataset is preprocessed to obtain the actual acquired dataset; the image preprocessing includes seabed line tracking calibration, projection calibration, and gain correction. In response to the annotation instructions, the target bounding boxes and target category labels are annotated in each real sonar image in the real-world data set using a labeling tool, thus obtaining the dataset; When the data volume of the dataset is less than a preset threshold, image enhancement processing is performed on the dataset to increase the data volume.
[0012] In some embodiments, the target detection model includes a feature pyramid network and a prediction layer function. The target detection model is trained and optimized by combining loss functions to obtain a target recognition model, including the following steps: The input data is fed into the target detection model, and the prediction output vectors corresponding to the training feature maps at each scale are obtained through the feature pyramid network. The prediction output vector includes a prediction bounding box vector, a prediction confidence vector, and a prediction class vector. The prediction bounding box vector includes a prediction x-coordinate vector, a prediction y-coordinate vector, a prediction width vector, and a prediction height vector. The prediction class vector includes a class sub-vector for each class. Based on the predicted horizontal and vertical coordinate vectors, the predicted coordinates are obtained by using the activation function of the prediction layer function to offset and adjust the coordinates of the upper left corner of the grid of the training feature map. Based on the predicted width vector and the predicted height vector, the predicted size is obtained by exponentially transforming the preset anchor frame size through the prediction layer function; The prediction box is determined based on the predicted coordinates and predicted size, and the true confidence level is adaptively determined based on whether the target is present in the prediction box. Based on the prediction confidence vector, the prediction confidence is obtained by processing it with an activation function through the prediction layer function; Based on all category subvectors in the predicted category vector, the predicted category probability of each category is obtained by processing with a normalized exponential function through the prediction layer function; A coordinate loss function is constructed based on the predicted bounding box and the target bounding box; a confidence loss function is constructed based on the true confidence and the predicted confidence; and a classification loss function is constructed based on the predicted class probability and the target class. The combined loss function is constructed by weighted summing of the coordinate loss function, confidence loss function, and classification loss function. Based on the combined loss function, the target detection model is updated through backpropagation to obtain the target recognition model.
[0013] In some embodiments, the target recognition model includes a feature pyramid network and a prediction layer function. Multi-scale feature maps are input into a preset target recognition model, processed to obtain target recognition results at different scales, and then filtered to obtain the final recognition result, including the following steps: The multi-scale feature maps are input into the target recognition model, and the target output vector corresponding to each scale feature map is obtained by processing through the feature pyramid network. The target output vector includes a target bounding box vector, a target confidence vector, and a target category vector. The target bounding box vector includes a target x-coordinate vector, a target y-coordinate vector, a target width vector, and a target height vector. The target category vector includes a target category sub-vector for each category. Based on the target's horizontal and vertical coordinate vectors, the target coordinates are obtained by adjusting the coordinates of the top-left corner of the feature map grid using an activation function through a prediction layer function. Based on the target width vector and the target height vector, the target size is obtained by exponentially transforming the preset anchor frame size through the prediction layer function; Determine the target prediction bounding box for each scale based on the target coordinates and target size; Based on the target confidence vector, the target confidence is obtained by processing it with an activation function through the prediction layer function; Based on all target category subvectors in the target category vector, the target category probability of each category is obtained by using the normalized exponential function through the prediction layer function; The confidence score for each category of the target prediction box at all scales is determined by multiplying the target confidence score by the target category probability. The target prediction box with the highest confidence score and its corresponding category are used as the final recognition result.
[0014] To achieve the above objectives, another aspect of the present invention provides an automatic target identification device for sonar images, the device comprising: The first module is used to acquire sonar surveillance footage of the target area as the raw image; The second module is used to preprocess the original image, converting it into the target size to obtain the target image; The third module is used to extract features from the target image through multi-layer convolution and residual structures to obtain multi-scale feature maps; The fourth module is used to input multi-scale feature maps into a preset target recognition model, process them to obtain target recognition results at different scales, and then filter them to obtain the final recognition result. The target recognition model is based on the target detection model and is trained using sonar images labeled with target bounding boxes and target categories.
[0015] In some embodiments, the apparatus further includes a fifth module for performing the following operations: A dataset was constructed based on sonar imagery with labeled bounding boxes and target categories; Feature extraction is performed using multi-layer convolution and residual structures to transform sonar images in the dataset into multi-scale training feature maps. Multi-scale training feature maps are used as input data for the model, and bounding boxes and target categories are used as label data. The target detection model is trained and optimized by combining loss functions to obtain the target recognition model. The combined loss function includes the coordinate loss function, the confidence loss function, and the classification loss function.
[0016] To achieve the above objectives, another aspect of the present invention provides an electronic device, which includes a memory and a processor. The memory stores a computer program, and the processor executes the computer program to implement the aforementioned method.
[0017] To achieve the above objectives, another aspect of the present invention provides a computer-readable storage medium storing a computer program that, when executed by a processor, implements the aforementioned method.
[0018] To achieve the above objectives, another aspect of the present invention provides a computer program product, including a computer program that, when executed by a processor, implements the aforementioned method.
[0019] The embodiments of this invention include at least the following beneficial effects: This invention provides an automatic target recognition method, device, electronic device, storage medium, and program product for sonar images. This solution acquires sonar monitoring footage of the target area as the original image; preprocesses the original image to convert it into a target image of the target size; based on the target image, it extracts features through multi-layer convolution and residual structures to obtain multi-scale feature maps; inputs the multi-scale feature maps into a preset target recognition model, processes them to obtain target recognition results at different scales, and then filters them to obtain the final recognition result; wherein, the target recognition model is based on a target detection model and is trained on sonar images labeled with target bounding boxes and target categories. The embodiments of this invention construct a complete and automated process from sonar image acquisition to final target recognition. First, by introducing "multi-layer convolution and residual structures" for feature extraction, deep, abstract, and robust feature information in sonar images can be effectively mined, overcoming the problems of insufficient detail and noise sensitivity in sonar images caused by traditional methods or shallow models; further, the extracted "multi-scale feature maps" are input into a preset, specially trained target recognition model for processing, achieving adaptive detection of targets of different sizes. The embodiments of this invention systematically integrate advanced deep learning architecture and sonar image characteristics, which improves the accuracy, robustness and practicality of target recognition algorithms in complex underwater environments, and provides a feasible path to solve the problems of "poor universality and difficulty in real-time application" in existing technologies. Attached Figure Description
[0020] Figure 1 This is a schematic diagram of an implementation environment for the automatic target identification method for sonar images provided in this embodiment of the invention; Figure 2 This is a flowchart illustrating an automatic target identification method for sonar images provided in an embodiment of the present invention; Figure 3 This is a schematic diagram of the overall application process of automatic target recognition in sonar images provided in an embodiment of the present invention; Figure 4 This is a schematic diagram illustrating an example of data tag creation provided in an embodiment of the present invention; Figure 5 This is a schematic diagram of the model training unfolding process provided in the embodiments of the present invention; Figure 6 This is a schematic diagram of an unfolding process provided by an embodiment of the present invention for real-time capture of screen information and output as an image to be recognized; Figure 7 This is a schematic diagram of another unfolding process provided by an embodiment of the present invention for real-time capture of screen information and output as an image to be recognized; Figure 8 This is a schematic diagram of the unfolding process for automatic sonar image recognition provided in an embodiment of the present invention; Figure 9 This is a schematic diagram of the Darknet-53 network processing flow provided in an embodiment of the present invention; Figure 10 This is a schematic diagram of the process for obtaining the final output based on post-processing, provided by an embodiment of the present invention. Detailed Implementation
[0021] To make the objectives, technical solutions, and advantages of this invention clearer, the invention will be further described in detail below with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative of the invention and are not intended to limit the invention. In the following description, when referring to the accompanying drawings, unless otherwise indicated, the same numbers in different drawings represent the same or similar elements. The embodiments described in the following exemplary embodiments do not represent all embodiments consistent with the embodiments of this invention; they are merely examples of apparatuses and methods consistent with some aspects of the embodiments of this invention as detailed in the appended claims.
[0022] It is understood that the terms “first,” “second,” etc., used in this invention may be used herein to describe various concepts, but unless specifically stated otherwise, these concepts are not limited by these terms. These terms are used only to distinguish one concept from another. For example, first information may also be referred to as second information without departing from the scope of embodiments of the invention, and similarly, second information may also be referred to as first information. Depending on the context, the words “if,” “when,” or “in response to determination” as used herein may be interpreted as “when…” or “when…” or “in response to determination.”
[0023] The terms “at least one,” “multiple,” “each,” “any,” etc., used in this invention, “at least one” includes one, two, or more than two; “multiple” includes two or more than two; “each” refers to each of the corresponding multiple; and “any” refers to any one of the multiple.
[0024] Unless otherwise defined, all technical and scientific terms used herein have the same meaning as commonly understood by one of ordinary skill in the art to which this invention pertains. The terminology used herein is for the purpose of describing embodiments of the invention only and is not intended to limit the invention.
[0025] To facilitate understanding of the technical solution of this invention, the technical skills that may be involved in the technical solution of this invention will first be explained: Deep learning: specifically refers to machine learning based on deep neural network models and methods. Deep learning is a branch of machine learning that uses multi-layered neural networks to analyze and process data by simulating the structure and function of the human brain's neural networks.
[0026] YOLO algorithm: an abbreviation for You Only Look Once, is a target detection system based on a single neural network proposed by Joseph Redmon, Ali Farhadi, and others in 2015. It is a real-time target detection system that predicts the bounding box and class of a target using a single neural network.
[0027] Sonar (SONAR): is a technology and device that uses sound waves to measure distance and detect underwater objects.
[0028] Darknet-53 network: a deep neural network architecture used as the backbone network in the YOLOv3 object detection algorithm.
[0029] OpenCV: Open Source Computer Vision Library is an open-source computer vision and image processing library that is widely used in image and video processing, machine learning, and computer vision.
[0030] Among related technologies, existing deep learning-based underwater target recognition schemes mainly suffer from the following limitations: First, the training and validation of most algorithms heavily rely on specific and limited public datasets, resulting in poor model generalization ability and universality, making it difficult to directly transfer to complex and ever-changing real-world underwater operation scenarios to achieve real-time and accurate detection. Second, current research can only identify a relatively limited range of target categories (e.g., mainly focusing on shipwreck identification), lacking coverage of diverse targets in the real marine environment, and failing to fully meet the needs of practical marine exploration and underwater unmanned systems for multi-category, refined target recognition.
[0031] In view of this, this invention provides an automatic target recognition method and related equipment for sonar images. This method acquires sonar monitoring footage of the target area as the original image; preprocesses the original image to convert it into a target image of the target size; based on the target image, it extracts features through multi-layer convolution and residual structures to obtain multi-scale feature maps; the multi-scale feature maps are input into a preset target recognition model to obtain target recognition results at different scales, and then filtered to obtain the final recognition result; wherein, the target recognition model is based on a target detection model and is trained on sonar images labeled with target bounding boxes and target categories. This invention constructs a complete and automated process from sonar image acquisition to final target recognition. First, by introducing "multi-layer convolution and residual structures" for feature extraction, deep, abstract, and robust feature information in sonar images can be effectively mined, overcoming the problems of insufficient detail and noise sensitivity in sonar images caused by traditional methods or shallow models; further, the extracted "multi-scale feature maps" are input into a preset, specially trained target recognition model for processing, achieving adaptive detection of targets of different sizes. The embodiments of this invention systematically integrate advanced deep learning architecture and sonar image characteristics, which improves the accuracy, robustness and practicality of target recognition algorithms in complex underwater environments, and provides a feasible path to solve the problems of "poor universality and difficulty in real-time application" in existing technologies.
[0032] It is understood that the automatic target identification method for sonar images provided by this invention can be applied to any computer device with data processing and computing capabilities, and this computer device can be various terminals or servers. When the computer device in the embodiment is a server, the server is an independent physical server, or a server cluster or distributed system composed of multiple physical servers, or a cloud server that provides basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communication, middleware services, domain name services, security services, CDN (Content Delivery Network), and big data and artificial intelligence platforms. Optionally, the terminal can be a smartphone, tablet computer, laptop computer, or desktop computer, but it is not limited to these.
[0033] like Figure 1 The diagram shown is a schematic representation of an implementation environment provided by an embodiment of the present invention. (Refer to...) Figure 1 The implementation environment includes at least one terminal 102 and a server 101. The terminal 102 and the server 101 can be connected via a network, either wirelessly or via a wired connection, to complete data transmission and exchange.
[0034] Server 101 can be a standalone physical server, a server cluster or distributed system consisting of multiple physical servers, or a cloud server that provides basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communication, middleware services, domain name services, security services, CDN (Content Delivery Network), and big data and artificial intelligence platforms.
[0035] Additionally, server 101 can also be a node server in a blockchain network. Blockchain is a novel application model of computer technologies such as distributed data storage, peer-to-peer transmission, consensus mechanisms, and encryption algorithms.
[0036] Terminal 102 can be a smartphone, tablet computer, laptop computer, desktop computer, smart speaker, smartwatch, etc., but is not limited to these. Terminal 102 and server 101 can be directly or indirectly connected via wired or wireless communication, and this embodiment of the invention does not impose any limitations.
[0037] For example, based on Figure 1 The implementation environment shown in this embodiment of the invention provides an automatic target identification method for sonar images. The following description uses the application of this automatic target identification method for sonar images in server 101 as an example. It can be understood that this automatic target identification method for sonar images can also be applied to terminal 102.
[0038] Reference Figure 2 , Figure 2 This is an optional flowchart of the automatic target identification method for sonar images provided in the embodiments of the present invention. The execution subject of the automatic target identification method for sonar images can be any of the aforementioned computer devices (including servers or terminals). Figure 2 The method may include, but is not limited to, steps S100 to S400.
[0039] Step S100: Acquire sonar monitoring footage of the target area as the raw image; For example, in some specific implementations, the original image can be captured by screen capture: for example, the MMS (Multiple ScreenShot high-performance screen capture) library can be used to efficiently capture the computer screen of the monitoring computer to generate the original BGRA image (BGRA is an image pixel format in which each pixel consists of four channels: blue (B), green (G), red (R) and transparency (A)), and provide it to subsequent algorithms in the form of image frames.
[0040] Step S200: Preprocess the original image to convert it into the target size to obtain the target image; It should be noted that, in some embodiments, preprocessing the original image may include at least one of the following steps: converting the original image into a preset image data format; performing size mapping processing on the original image based on preset size specifications; and performing pixel normalization processing on the original image.
[0041] For example, in some specific embodiments, the detailed steps of preprocessing can be implemented as follows: Step 1: Pixel Processing: Convert the original BGRA frame to a BGR / RGB array: .
[0042] Step 2: Image preprocessing: Use OpenCV to resize the image to 416×416×3, normalize the image, and map the pixel values to the [0, 1] interval.
[0043] The size mapping formula is:
[0044] in These are the original coordinates in the source image. The new coordinates after mapping to the target image, The width and height of the source image. Given the width and height of the target image, this formula is used to map coordinate points in the source image to their corresponding positions in the target image. Essentially, it scales the coordinates proportionally, ensuring that the original coordinates remain in their relative positions after image scaling or resizing.
[0045] The pixel normalization formula is:
[0046] in The original pixel value (range 0-255) is used to convert the image pixel value from an integer range of 0–255 to a floating-point range of 0–1, thus achieving pixel normalization.
[0047] Specifically, the embodiments of the present invention ensure that the input data has a uniform format and consistent scale through standardization steps such as format conversion, size mapping, and pixel normalization, providing a standardized input for subsequent neural network processing, which is conducive to stable training and efficient inference of the model. Specifically, pixel normalization can accelerate model convergence and reduce the adverse effects caused by differences in data dimensions, thereby indirectly improving the performance and reliability of the final recognition model.
[0048] Step S300: Based on the target image, feature extraction is performed through multi-layer convolution and residual structure to obtain a multi-scale feature map; It should be noted that in some embodiments, step S300 may include the following steps: taking the target image as input data; performing convolution processing on the input data through a convolutional layer based on preset weight parameters and bias terms to obtain the convolutional layer output; processing the convolutional layer output sequentially through batch normalization and activation functions to obtain output data; concatenating the input data and output data residuals as new input data, and returning to execute the step of performing convolution processing on the input data through a convolutional layer based on preset weight parameters and bias terms, until the multi-layer convolution and residual structure is processed, and obtaining a multi-scale feature map based on the output data of the last layer of the multi-layer convolution and residual structure.
[0049] For example, in some specific implementations, the Darknet-53 network can be used to extract feature maps. After 53 layers of convolutional and residual structures, each layer employs: Conv (convolution) → BatchNorm (batch normalization) → LeakyReLU (activation function), outputting feature maps F1, F2, and F3 at three scales. .
[0050] The output of the convolutional layer is:
[0051] Residual connections (ResNet-style):
[0052] in This represents the position of the k-th convolutional kernel in the output feature map. The response value, The feature map representing the input. Here, represents the convolution kernel weights, and represents the weight parameters of the k-th convolution kernel at position (m, n). For bias terms, To traverse the spatial range of the convolution kernel, and For the input and output of a layer, This serves as the input for the next layer after the residual connection.
[0053] Specifically, this embodiment of the invention utilizes a feature extraction module composed of convolutional layers, batch normalization, activation functions, and residual connections. The residual structure effectively alleviates the vanishing or exploding gradient problem in deep neural networks, allowing the network to be built deeper and learn more complex feature representations. The batch normalization layer accelerates the training process and improves model stability. This combined design ensures that even with poor sonar image quality, the network can perform efficient and stable deep feature learning, which is a key foundation for achieving high-precision target recognition.
[0054] Step S400: Input the multi-scale feature map into the preset target recognition model, process it to obtain target recognition results at different scales, and then filter to obtain the final recognition result; Among them, the target recognition model is based on the target detection model and is trained on sonar images labeled with target bounding boxes and target categories; It should be noted that in some embodiments, the method may further include the following steps: constructing a dataset based on sonar images labeled with target bounding boxes and target categories; extracting features through multi-layer convolution and residual structures to transform the sonar images in the dataset into multi-scale training feature maps; using the multi-scale training feature maps as model input data, and the target bounding boxes and target categories as label data, training and optimizing the target detection model through a combined loss function to obtain a target recognition model; wherein, the combined loss function includes a coordinate loss function, a confidence loss function, and a classification loss function.
[0055] Specifically, this embodiment of the invention simultaneously considers the location accuracy of the target bounding box (coordinate loss), the confidence level of the target's existence (confidence loss), and the accuracy of the target category judgment (classification loss). This training strategy guides the model to perform multi-task joint learning, enabling the model to simultaneously optimize its localization and classification capabilities. Compared to using only a single loss function, this approach provides more comprehensive supervision of model training, resulting in a target recognition model with superior overall performance and better suitability for complex real-world detection scenarios.
[0056] It should be noted that, in some embodiments, constructing a dataset based on sonar images labeled with target bounding boxes and target categories may include the following steps: extracting a collection of acquired data from a preset dataset; performing image preprocessing on each original sonar image in the acquired data collection to obtain a real acquired data collection; wherein, image preprocessing includes seabed line tracking calibration, projection calibration, and gain correction; responding to the labeling instruction, labeling each real sonar image in the real acquired data collection with target bounding boxes and target category labels using a labeling tool to obtain a dataset; when the data volume of the dataset is less than a preset threshold, performing image enhancement processing on the dataset to increase the data volume of the dataset.
[0057] For example, in some specific implementations, the dataset is created. Detailed steps can be implemented as follows: Step 1: Data Collection: Data is collected in the field and from publicly available online datasets.
[0058] Step 2: Data Processing: The collected data undergoes preprocessing steps such as seabed line tracking calibration, projection calibration, and gain correction to generate realistic collected data. Specifically, seabed line extraction and identification can be performed using a combination of algorithms based on intensity gradient edge detection, window-constrained search, and adaptive filtering. The side-scan sonar echoes are then converted from "slant range images" to "horizontal range images" to eliminate geometric distortions caused by factors such as tow body height and water column, ensuring accurate pixel positions corresponding to the seabed plane. After gain correction using TVG (Time-Varying Gain to compensate for propagation loss), BAC (Beam Angle Correction), and AGC (Automatic Gain Control), the brightness differences between different distances, cruises, and channels of the side-scan sonar are addressed, improving texture consistency and establishing a unified photometric benchmark for mosaic stitching and seabed identification.
[0059] Step 3: Data Labeling: Using a labeling tool, create a dataset with corresponding category labels based on the data type.
[0060] In addition, if the amount of data is small, random scaling, translation, HSV color dithering, and horizontal flipping are used to enhance the image and improve the robustness of the model.
[0061] Specifically, this invention, through professional sonar image preprocessing steps including "seabed line tracking calibration, projection calibration, and gain correction," effectively corrects geometric distortion and radiation distortion in the original data, improving the quality and realism of the training data and making the features learned by the model more closely resemble actual operational environments. Simultaneously, this invention, by introducing "image enhancement processing" to expand the data volume, is an effective technical means to address the scarcity of sonar annotation data, prevent model overfitting, and improve model generalization ability, directly addressing the problems of "limited datasets and poor universality" in the background technology.
[0062] It should be noted that the object detection model includes a feature pyramid network and a prediction layer function. In some embodiments, the object detection model is trained and optimized by combining loss functions to obtain an object recognition model, which may include the following steps: inputting the model input data into the object detection model, and processing it through the feature pyramid network to obtain the prediction output vectors corresponding to the training feature maps at various scales; wherein, the prediction output vector includes a prediction box vector, a prediction confidence vector, and a prediction class vector, the prediction box vector includes a prediction horizontal coordinate vector, a prediction vertical coordinate vector, a prediction width vector, and a prediction height vector, and the prediction class vector includes a class sub-vector for each class; based on the prediction horizontal coordinate vector and the prediction vertical coordinate vector, the prediction layer function uses an activation function to offset and adjust the coordinates of the upper left corner of the grid of the training feature map to obtain the prediction coordinates; based on the prediction width vector and the prediction height vector, the prediction layer function uses an activation function to offset and adjust the coordinates of the upper left corner of the grid of the training feature map to obtain the prediction coordinates. The layer-testing function performs an exponential transformation on the preset anchor box size to obtain the predicted size. Based on the predicted coordinates and predicted size, the predicted bounding box is determined, and the true confidence score is adaptively determined based on whether the target is present in the predicted bounding box. Based on the predicted confidence vector, the prediction layer function uses an activation function to obtain the predicted confidence score. Based on all category sub-vectors in the predicted category vector, the prediction layer function uses a normalized exponential function to obtain the predicted category probability for each category. A coordinate loss function is constructed based on the predicted bounding box and the target bounding box; a confidence loss function is constructed based on the true confidence score and predicted confidence score; and a classification loss function is constructed based on the predicted category probability and the target category. The coordinate loss function, confidence loss function, and classification loss function are weighted and summed to obtain a combined loss function. Based on the combined loss function, the target detection model is updated through backpropagation to obtain the target recognition model.
[0063] For example, in some specific implementations, model training optimization can be achieved as follows: Prediction layer function: Predicts 3 anchors for each grid cell of each feature map. Predicted output vector: The final bounding box position is obtained after passing through the Sigmoid (activation function) and exponential transformation: , , , ,in, The coordinates of the top left corner of the grid. The dimensions of the Anchor Box. It is a sigmoid function. Therefore, the objectness is: The overall category probability is: , It is a normalized exponential function.
[0064] Loss Function Calculation: The total loss function consists of three parts:
[0065] Wherein the coordinate loss function is:
[0066] in, These are the weights (the subscripts correspond to different types of loss functions). and For the first The center coordinates of the true bounding box (relative to the grid cell or image size). and For the first The center coordinates of the predicted bounding box and For the first The width and height of a real bounding box. and For the first The width and height of each predicted bounding box.
[0067] Confidence loss function:
[0068] in, True confidence (1 if the predicted bounding box contains an object, 0 otherwise or IOU (Intersection over Union)). The confidence level of the network prediction. This is an indicator; it is 1 if the predicted bounding box contains an object, and 0 otherwise. This is an indicator; it is 1 if the predicted bounding box contains no objects, and 0 otherwise.
[0069] Classification loss function:
[0070] in As a true category indicator, the first Each prediction box belongs to the category The value is 1 for the time and 0 for the rest. To predict probabilities, the network outputs the first... Each prediction box belongs to the category The probability of C is given by the total number of categories. To predict the target, The value is typically 0.5 to reduce the impact of losses from untargeted cells.
[0071] Backpropagation and parameter update: Training a model typically involves calculating gradients through backpropagation and updating parameters using either SGD (Stochastic Gradient Descent) or Adam (Adaptive Moment Estimation).
[0072] in, Is the model in the first The parameters (weights or biases, etc.) at the next iteration. These are the updated parameters, i.e., the parameters for the next iteration. Here, is the learning rate, and is the batch size (number of training samples) typically used during training, which is 64. The L loss function measures the error between the predicted result and the true value. The gradient of the loss function with respect to the parameters represents the direction in which the loss changes most rapidly at the current parameter position. Existing training results can be used to train the weights. Repeat the above training process until the function converges, completing the training and saving the model.
[0073] Specifically, this embodiment of the invention utilizes a feature pyramid network to process multi-scale features, enhancing the model's ability to detect targets of different sizes. Through specific operations such as activation functions and exponential transformations, the network output is decoded into intuitive prediction box coordinates, size, and confidence scores. This leads to the construction of a weighted combined loss function comprising coordinates, confidence scores, and classification, providing the model with precise gradient feedback. The overall training mechanism of this embodiment ensures that the model can accurately regress target locations, assess presence probabilities, and determine categories from multi-scale features, making it the core of achieving high-precision, real-time multi-target recognition.
[0074] It should be noted that the target recognition model includes a feature pyramid network and a prediction layer function. In some embodiments, step S400 may include the following steps: inputting multi-scale feature maps into the target recognition model, and processing them through the feature pyramid network to obtain target output vectors corresponding to each scale feature map; wherein, the target output vector includes a target bounding box vector, a target confidence vector, and a target category vector, the target bounding box vector includes a target horizontal coordinate vector, a target vertical coordinate vector, a target width vector, and a target height vector, and the target category vector includes a target category sub-vector for each category; based on the target horizontal coordinate vector and the target vertical coordinate vector, the prediction layer function uses an activation function to offset the coordinates of the top left corner of the feature map grid. The process involves: 1) Obtaining the target coordinates; 2) Performing an exponential transformation on the preset anchor frame size using the prediction layer function based on the target width and height vectors to obtain the target size; 3) Determining the target prediction box for each scale based on the target coordinates and size; 4) Obtaining the target confidence score by processing the prediction layer function with an activation function based on the target confidence vector; 5) Obtaining the target class probability for each class by processing the prediction layer function with a normalized exponential function based on all target class sub-vectors in the target class vector; 6) Determining the confidence score for each class corresponding to the target prediction box at all scales based on the product of the target confidence score and the target class probability; 7) Using the target prediction box with the highest confidence score and its corresponding class as the final recognition result.
[0075] For example, in some specific implementations, taking feature maps at three scales as an example, multi-scale object bounding box detection is first performed: based on the feature maps at the three scales, corresponding detections are performed respectively. The output for each scale is: , where 3 represents 3 anchors per point, 4 represents the predicted coordinates (x, y, w, h), and 1 represents the confidence score. C represents the number of categories.
[0076] Next, target bounding box prediction is performed: three anchors are predicted for each grid cell of each feature map. The predicted output vector is: The final bounding box position is obtained after Sigmoid and exponential transformation: , , , ,in, The coordinates of the top left corner of the grid. The dimensions of the Anchor Box. It is a sigmoid function. Therefore, the objectness is: The overall category probability is: Final confidence score:
[0077] Final output: The final output includes three parts of information: (1) the bounding box of each target: (bx, by, bw, bh); (2) the class probability of each target; and (3) the confidence score of each target. The abnormal image is then captured and saved locally.
[0078] Specifically, this embodiment of the invention decodes the abstract vector output by the model into specific prediction boxes, confidence scores, and class probabilities. It then comprehensively evaluates the reliability of each prediction result by calculating a "confidence score" (the product of confidence score and class probability), and finally determines the final recognition result by selecting the highest confidence score. This process enables the automatic selection of the most reliable detection result from multiple scales and candidate boxes, effectively improving the accuracy of recognition results and the reliability of decision-making.
[0079] In some optional implementations, the following post-processing can be performed to continuously optimize the target recognition model: (1) Confidence screening: only retain (i.e., boxes with confidence levels greater than the preset confidence threshold). (2) NMS (Non-maximum suppression): Remove overlap (IoU) predicted boxes: The results are divided into three types: positive samples: the predicted box with the largest IoU with the labeled box; not involved: IoU > 0.5 but not the largest; negative samples: IoU < 0.5.
[0080] To explain in detail the principle of the technical solution of the present invention, the overall process of the present invention will be described below with reference to some specific embodiments. It is easy to understand that the following is an explanation of the technical principle of the present invention and should not be regarded as a limitation of the present invention.
[0081] In view of the shortcomings of existing technologies, the purpose of this invention is to provide an algorithm for real-time capture of desktop information and identification of desktop image content, while utilizing the YOLO detection and recognition algorithm to identify information within the image, achieving universality and real-time detection of multiple target categories. This technology has the following characteristics: the algorithm identifies and captures desktop information, thus possessing general universality and being applicable to various Sonar acquisition software. The algorithm features real-time capture of desktop information, thus possessing real-time detection capabilities, meeting the real-time detection and identification needs during maritime operations; the algorithm's training samples include target objects such as shipwrecks, personnel, and aircraft, thus satisfying diverse identification requirements.
[0082] In some specific application scenarios, such as Figure 3 As shown, the specific operation steps of the present invention can be implemented as follows: Step 1: Dataset Creation. Detailed steps are as follows: Step 1: Data Collection: Data is collected in the field and from publicly available online datasets.
[0083] Step 2: Data Processing: The collected data is preprocessed by steps such as seabed line tracking calibration, projection calibration, and gain correction to generate real collected data.
[0084] Step 3: Data Label Creation: For example Figure 4 The image shown is a schematic diagram illustrating an example of data label creation. In practice, you can use a label creation tool to create a dataset containing corresponding category labels based on the data type.
[0085] Step 2: Model training. For example... Figure 5 As shown, the detailed steps can be implemented as follows: Step 1: Input the training image from Step 1 and load the labels. If the amount of data is small, use random scaling, translation, HSV color jitter, horizontal flipping, etc. to enhance the image and improve the robustness of the model.
[0086] Step 2: Feature Map Extraction: Using the Darknet-53 network, after 53 layers of convolutional and residual structures, each layer employs: Conv (convolution) → BatchNorm (batch normalization) → LeakyReLU (activation function), outputting feature maps at three scales: F1, F2, and F3. .
[0087] Step 3: Feature Fusion and Multi-Scale Detection (Feature Pyramid): Utilizing the concept of FPN (Feature Pyramid Network), high-level features are upsampled and concatenated with low-level features to obtain more detailed information about small targets. Objects are detected at three scales, corresponding to the detection... Each object has 3 anchors.
[0088] Step 4: Prediction Layer Function: Predicts 3 anchors for each grid cell of each feature map. Predicted output vector: The final bounding box position is obtained after passing through the Sigmoid (activation function) and exponential transformation: , , , ,in, The coordinates of the top left corner of the grid. The dimensions of the Anchor Box. It is a sigmoid function. Therefore, the objectness is: The overall category probability is: , It is a normalized exponential function.
[0089] Step 5: Loss Function Calculation: The YOLOv3 total loss function consists of three parts:
[0090] Step 6: Backpropagation and parameter update: The training model is generally trained by calculating the gradient through backpropagation and updating the parameters using SGD (Stochastic Gradient Descent) or Adam (Adaptive Moment Estimation).
[0091] Step 3: Capture screen information in real time and output it as the image to be recognized. For example... Figure 6 and Figure 7 As shown, the detailed steps can be implemented as follows: Step 1: Screen capture: Use the MMS (Multiple ScreenShot high-performance screen capture) library to efficiently capture the computer screen of the monitoring computer, generate raw BGRA images, and provide them to subsequent algorithms in the form of image frames.
[0092] Step 2: Pixel processing: Convert the original BGRA frame to a BGR / RGB array.
[0093] Step 3: Image preprocessing: Use OpenCV to resize the image to 416×416×3, normalize the image, and map the pixel values to the [0, 1] interval.
[0094] Step 4: Output standardization: Input YOLO model or save.
[0095] Step 4: Automatic identification of sonar images. For example... Figure 8 As shown, the detailed steps can be implemented as follows: Step 1: Input the image obtained in Step 3 Common images are [size missing]. .
[0096] Step 2: Extract feature maps: such as Figure 9 As shown, using the Darknet-53 network, after 53 layers of convolution and residual structures, it outputs feature maps F1, F2, and F3 at three scales: .
[0097] Step 3: Multi-scale bounding box detection: Based on the feature maps at the above three scales, detect the corresponding bounding boxes. The output for each scale is: , where 3 represents 3 anchors per point, 4 represents the predicted coordinates (x, y, w, h), and 1 represents the confidence score. C represents the number of categories.
[0098] Step 4: Anchor Box Prediction: Predict 3 anchors for each grid cell of each feature map. The predicted output vector is: The final bounding box position is obtained after Sigmoid and exponential transformation: , , , ,in, The coordinates of the top left corner of the grid. The dimensions of the Anchor Box. It is a sigmoid function. Therefore, the objectness is: The overall category probability is: Final confidence score: .
[0099] Step 5: As Figure 10 As shown, post-processing: (1) Confidence filtering: only retain (2) NMS (Non-maximum suppression): Removes the overlap (IoU) predicted bounding box: .
[0100] The results are divided into three types: positive samples: the predicted box with the largest IoU with the labeled box; not involved: IoU>0.5 but not the largest; negative samples: IoU<0.5.
[0101] Step 6: Final Output: The final output includes three parts of information, (1) the bounding box of each target: (2) The category probability of each target; (3) The confidence score of each target. And the abnormal images are captured and saved locally.
[0102] In summary, this invention efficiently, rapidly, and with low latency captures the computer screen using the MMS library, processes and displays the images using OpenCV, and inputs them into a pre-trained YOLO model for target recognition. Because this method monitors the screen and does not require access to the application's internal structure, it boasts strong compatibility across different systems and is applicable to various domestic and international sonar acquisition software. Specifically, this invention achieves efficient, rapid, and low-latency target recognition by capturing and processing the computer screen, without relying on specific programs or hardware environments, and can be used directly on any computer desktop. It is compatible with different systems and is not limited by resolution, window size, or displayed content. Furthermore, because this invention uses the YOLO model, it can be trained separately according to different needs. Captured relevant image data can be used as training data to improve model accuracy and achieve self-supervised learning. Simultaneously, this algorithm can be trained on multi-beam data and monitor other image data such as multi-beam images.
[0103] Compared with the prior art, the present invention has at least the following beneficial effects: Universality: It does not rely on specific programs or hardware environments and can be used directly on any computer desktop. Because this method monitors the screen and does not require access to the internal structure of applications, it has strong compatibility with different systems and is not limited by resolution, window size, or displayed content.
[0104] Non-invasive: No modification or embedding of the target software is required, and it does not interfere with the original program's operation. The program algorithm does not need to call the target program's interface, so it will not affect the performance of the monitored program and improves operational stability.
[0105] Versatility: The same model and process can be adapted to a variety of application scenarios, and the detection area, frequency and model can be freely adjusted.
[0106] Scalability: Because this algorithm uses the YOLO model, it can be trained separately according to different needs and can be easily integrated with training data, recognition tasks, and multi-model systems. Therefore, it can identify targets not limited to ships, aircraft, and oil drums. Furthermore, the algorithm can be trained on multibeam data and monitor other image data such as multibeam imaging.
[0107] Low cost and high efficiency: The algorithm does not require camera equipment or additional sensors. Running the algorithm can effectively reduce the time spent on manual monitoring and improve efficiency.
[0108] This invention also provides an automatic target identification device for sonar images, which can implement the above-described method. The device may include: The first module is used to acquire sonar surveillance footage of the target area as the raw image; The second module is used to preprocess the original image, converting it into the target size to obtain the target image; The third module is used to extract features from the target image through multi-layer convolution and residual structures to obtain multi-scale feature maps; The fourth module is used to input multi-scale feature maps into a preset target recognition model, process them to obtain target recognition results at different scales, and then filter them to obtain the final recognition result. The target recognition model is based on the target detection model and is trained using sonar images labeled with target bounding boxes and target categories.
[0109] In some embodiments, the apparatus may further include a fifth module for performing the following operations: A dataset was constructed based on sonar imagery with labeled bounding boxes and target categories; Feature extraction is performed using multi-layer convolution and residual structures to transform sonar images in the dataset into multi-scale training feature maps. Multi-scale training feature maps are used as input data for the model, and bounding boxes and target categories are used as label data. The target detection model is trained and optimized by combining loss functions to obtain the target recognition model. The combined loss function includes the coordinate loss function, the confidence loss function, and the classification loss function.
[0110] It is understood that the content of the above method embodiments is applicable to the present device embodiments. The specific functions implemented by the present device embodiments are the same as those of the above method embodiments, and the beneficial effects achieved are also the same as those achieved by the above method embodiments.
[0111] This invention also provides an electronic device, which includes a memory and a processor. The memory stores a computer program, and the processor executes the computer program to implement the method described above. This electronic device can be any smart terminal, including tablet computers, in-vehicle computers, etc.
[0112] It is understood that the content of the above method embodiments is applicable to this device embodiment. The specific functions implemented by this device embodiment are the same as those of the above method embodiments, and the beneficial effects achieved are also the same as those achieved by the above method embodiments.
[0113] This invention also provides a computer-readable storage medium storing a computer program that, when executed by a processor, implements the above-described method.
[0114] It is understood that the content of the above method embodiments is applicable to this storage medium embodiment. The specific functions implemented in this storage medium embodiment are the same as those in the above method embodiments, and the beneficial effects achieved are also the same as those achieved in the above method embodiments.
[0115] This invention also provides a computer program product, including a computer program that, when executed by a processor, implements the above-described method.
[0116] It is understood that the content of the above method embodiments is applicable to the embodiments of this program product. The specific functions implemented by the embodiments of this program product are the same as those of the above method embodiments, and the beneficial effects achieved are also the same as those achieved by the above method embodiments.
[0117] Memory, as a non-transitory computer-readable storage medium, can be used to store non-transitory software programs and non-transitory computer-executable programs. Furthermore, memory may include high-speed random access memory, and may also include non-transitory memory, such as at least one disk storage device, flash memory device, or other non-transitory solid-state storage device. In some embodiments, memory may optionally include memory remotely located relative to the processor, and these remote memories can be connected to the processor via a network. Examples of such networks include, but are not limited to, the Internet, intranets, local area networks, mobile communication networks, and combinations thereof.
[0118] The present invention provides an automatic target recognition method, apparatus, electronic device, storage medium, and program product for sonar images. It acquires sonar monitoring footage of a target area as the original image; preprocesses the original image to convert it into a target image of the target size; based on the target image, it extracts features through multi-layer convolution and residual structures to obtain multi-scale feature maps; inputs the multi-scale feature maps into a preset target recognition model, processes them to obtain target recognition results at different scales, and then filters them to obtain the final recognition result; wherein, the target recognition model is based on a target detection model and is trained on sonar images labeled with target bounding boxes and target categories. The present invention constructs a complete and automated process from sonar image acquisition to final target recognition. First, by introducing "multi-layer convolution and residual structures" for feature extraction, it can effectively mine deep, abstract, and robust feature information in sonar images, overcoming the problems of insufficient detail and noise sensitivity in sonar images by traditional methods or shallow models; further, the extracted "multi-scale feature maps" are input into a preset, specially trained target recognition model for processing, achieving adaptive detection of targets of different sizes. The embodiments of this invention systematically integrate advanced deep learning architecture and sonar image characteristics, which improves the accuracy, robustness and practicality of target recognition algorithms in complex underwater environments, and provides a feasible path to solve the problems of "poor universality and difficulty in real-time application" in existing technologies.
[0119] The embodiments described in this invention are for the purpose of more clearly illustrating the technical solutions of the embodiments of this invention, and do not constitute a limitation on the technical solutions provided by the embodiments of this invention. As those skilled in the art will know, with the evolution of technology and the emergence of new application scenarios, the technical solutions provided by the embodiments of this invention are also applicable to similar technical problems.
[0120] Those skilled in the art will understand that the technical solutions shown in the figures do not constitute a limitation on the embodiments of the present invention, and may include more or fewer steps than shown, or combine certain steps, or different steps.
[0121] The device embodiments described above are merely illustrative. The units described as separate components may or may not be physically separate; that is, they may be located in one place or distributed across multiple network units. Some or all of the modules can be selected to achieve the purpose of this embodiment according to actual needs.
[0122] Those skilled in the art will understand that all or some of the steps in the methods disclosed above, as well as the functional modules / units in the systems and devices, can be implemented as software, firmware, hardware, or suitable combinations thereof.
[0123] The preferred embodiments of the present invention have been described above with reference to the accompanying drawings, but this does not limit the scope of the claims of the present invention. Any modifications, equivalent substitutions, and improvements made by those skilled in the art without departing from the scope and spirit of the present invention should be within the scope of the claims of the present invention.
Claims
1. A method for automatic target identification in sonar images, characterized in that, The method includes the following steps: Acquire sonar surveillance footage of the target area as the raw image; The original image is preprocessed to convert it into the target size to obtain the target image; Based on the target image, feature extraction is performed through multi-layer convolution and residual structures to obtain multi-scale feature maps; The feature maps at multiple scales are input into a preset target recognition model, processed to obtain target recognition results at different scales, and then filtered to obtain the final recognition result. The target recognition model is based on the target detection model and is trained using sonar images labeled with target bounding boxes and target categories.
2. The method according to claim 1, characterized in that, The preprocessing of the original image includes at least one of the following steps: Convert the original image into a preset image data format; The original image is subjected to size mapping processing based on preset size specifications; The original image is then subjected to pixel normalization processing.
3. The method according to claim 1, characterized in that, The step of extracting features from the target image using multi-layer convolution and residual structures to obtain a multi-scale feature map includes the following steps: Use the target image as input data; The input data is processed by a convolutional layer based on preset weight parameters and bias terms to obtain the output of the convolutional layer. The output of the convolutional layer is processed sequentially through batch normalization and activation functions to obtain the output data; The input data and the output data residual are concatenated as new input data. The process of performing convolution processing on the input data through convolutional layers based on preset weight parameters and bias terms is repeated until the multi-layer convolution and residual structure is completed. The multi-scale feature map is obtained based on the output data of the last layer of the multi-layer convolution and residual structure.
4. The method according to claim 1, characterized in that, The method further includes the following steps: A dataset was constructed based on sonar imagery with labeled bounding boxes and target categories; Feature extraction is performed using the multi-layer convolution and residual structure to transform the sonar images in the dataset into multi-scale training feature maps. The multi-scale training feature maps are used as model input data, and the target bounding boxes and target categories are used as label data. The target detection model is trained and optimized by combining loss functions to obtain the target recognition model. The combined loss function includes a coordinate loss function, a confidence loss function, and a classification loss function.
5. The method according to claim 4, characterized in that, The data set constructed based on sonar imagery with labeled bounding boxes and target categories includes the following steps: The collected data set is obtained by extracting data from a preset dataset; Each raw sonar image in the acquired data set is preprocessed to obtain the actual acquired data set; wherein, the image preprocessing includes seabed line tracking calibration, projection calibration, and gain correction; In response to the annotation command, the target bounding box and the target category are labeled in each real sonar image in the real acquisition data set using a labeling tool to obtain the dataset; When the data volume of the dataset is less than a preset threshold, image enhancement processing is performed on the dataset to increase the data volume of the dataset.
6. The method according to claim 4, characterized in that, The target detection model includes a feature pyramid network and a prediction layer function. The step of training and optimizing the target detection model by combining loss functions to obtain the target recognition model includes the following steps: The model input data is input into the target detection model, and the prediction output vectors corresponding to the training feature maps at each scale are obtained through the feature pyramid network. The prediction output vector includes a prediction bounding box vector, a prediction confidence vector, and a prediction category vector. The prediction bounding box vector includes a prediction x-coordinate vector, a prediction y-coordinate vector, a prediction width vector, and a prediction height vector. The prediction category vector includes a category sub-vector for each category. Based on the predicted horizontal coordinate vector and the predicted vertical coordinate vector, the prediction layer function uses an activation function to offset and adjust the coordinates of the upper left corner of the grid of the training feature map to obtain the predicted coordinates; Based on the predicted width vector and the predicted height vector, the preset anchor frame size is exponentially transformed by the prediction layer function to obtain the predicted size; The prediction bounding box is determined based on the predicted coordinates and the predicted size, and the true confidence level is adaptively determined based on whether there is a target in the prediction bounding box. Based on the predicted confidence vector, the predicted confidence is obtained by processing it with the activation function through the prediction layer function; Based on all the category sub-vectors in the predicted category vector, the predicted category probability of each category is obtained by processing with the normalized exponential function through the prediction layer function; A coordinate loss function is constructed based on the predicted bounding box and the target bounding box; a confidence loss function is constructed based on the true confidence score and the predicted confidence score; and a classification loss function is constructed based on the predicted class probability and the target class. The combined loss function is constructed by weighted summing of the coordinate loss function, the confidence loss function, and the classification loss function. Based on the combined loss function, the target detection model is updated by backpropagation to obtain the target recognition model.
7. The method according to any one of claims 1 to 6, characterized in that, The target recognition model includes a feature pyramid network and a prediction layer function. The process of inputting the multi-scale feature maps into the preset target recognition model, processing them to obtain target recognition results at different scales, and then filtering them to obtain the final recognition result includes the following steps: The multi-scale feature maps are input into the target recognition model, and the target output vector corresponding to each scale feature map is obtained through the feature pyramid network. The target output vector includes a target bounding box vector, a target confidence vector, and a target category vector. The target bounding box vector includes a target x-coordinate vector, a target y-coordinate vector, a target width vector, and a target height vector. The target category vector includes a target category sub-vector for each category. Based on the target horizontal coordinate vector and the target vertical coordinate vector, the target coordinates are obtained by offsetting and adjusting the coordinates of the top left corner of the feature map grid using the activation function of the prediction layer function; Based on the target width vector and the target height vector, the target size is obtained by exponentially transforming the preset anchor frame size through the prediction layer function; Determine the target prediction bounding box corresponding to each scale based on the target coordinates and the target size; Based on the target confidence vector, the target confidence is obtained by processing it with the activation function through the prediction layer function; Based on all the target category sub-vectors in the target category vector, the target category probability of each category is obtained by processing with the normalized exponential function through the prediction layer function; Based on the product of the target confidence score and the target class probability, the confidence score of the target prediction box for each class at all scales is determined; The target prediction box with the highest confidence score and its corresponding category are taken as the final recognition result.
8. An automatic target identification device for sonar images, characterized in that, The device includes: The first module is used to acquire sonar surveillance footage of the target area as the raw image; The second module is used to preprocess the original image, converting the original image into the target size to obtain the target image; The third module is used to extract features from the target image through multi-layer convolution and residual structures to obtain a multi-scale feature map. The fourth module is used to input the multi-scale feature maps into a preset target recognition model, process them to obtain target recognition results at different scales, and then filter them to obtain the final recognition result. The target recognition model is based on the target detection model and is trained using sonar images labeled with target bounding boxes and target categories.
9. An electronic device, characterized in that, The electronic device includes a memory and a processor, the memory storing a computer program, and the processor executing the computer program to implement the method according to any one of claims 1 to 7.
10. A computer program product, comprising a computer program, characterized in that, When the computer program is executed by a processor, it implements the method of any one of claims 1 to 7.