An image recognition method for multi-class underwater targets
By combining TSVM and multi-SVM in a two-layer classification system, the problem of decreased accuracy in the identification of multiple underwater targets is solved, achieving efficient and economical technology application.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- 750 TEST SITE OF CHINA SHIPBUILDING IND CORP
- Filing Date
- 2022-11-21
- Publication Date
- 2026-05-12
AI Technical Summary
In the identification of multiple underwater targets, the accuracy of multi-SVM classification decreases as the number of target types increases, making it difficult to maintain a high recognition rate, and the annotation cost is high.
A preliminary classifier is constructed using TSVM to classify the target based on its geometric properties and determine the sample subset. Then, a multi-SVM classifier is used to confirm the specific category based on texture features, thus constructing a two-layer classification system.
In situations with a wide variety of targets, this method improves the accuracy of underwater image target recognition, reduces the number of multi-SVM classifiers, and lowers annotation costs.
Smart Images

Figure CN115861783B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of underwater image recognition technology, and in particular to an image recognition method for multiple types of underwater targets. Background Technology
[0002] Underwater image target recognition is increasingly widely used in practical production and scientific research. Multi-SVM is commonly used for underwater image target recognition, achieving good target recognition results by learning from a limited number of image samples. However, the classification accuracy of multi-SVM decreases with the increase in target types, making it difficult to achieve a good recognition rate when there are many target types, thus reducing the recognition effect. TSVM is a typical transductive semi-supervised learning method that only requires labeling a small number of samples in the training set to train the desired classifier and classify unlabeled samples. To overcome the difficulty of decreased accuracy due to a large number of target types in image target recognition without increasing costs excessively and meeting practical application needs, a new underwater image target recognition method combining TSVM and multi-SVM could guarantee a high recognition rate even with a large number of target types, better meeting practical requirements. Summary of the Invention
[0003] To address the aforementioned problems, this invention provides an image recognition method for multiple types of underwater targets. To handle a large variety of targets, a classifier constructed using TSVM is first used to perform preliminary classification based on the target's geometric properties, determining the set to which the target belongs (this set is a subset of the sample set, composed of multiple classes of samples with similar geometric properties). Then, the corresponding multi-SVM classifier is used to classify the target based on its texture features, confirming the specific category of the target and achieving target recognition. Specifically, the objective of this invention is achieved as follows:
[0004] An image recognition method for multiple types of underwater targets includes the following steps:
[0005] S1, Preprocessing: Normalize the obtained images to unify the visual effects; then remove salt and pepper noise from the images; finally, enhance the contrast and sharpness of the images.
[0006] S2, extract texture feature vector; based on the image processed by S1, extract HOG features using sliding boxes and unit blocks as texture feature vectors;
[0007] S3, edge detection; finds the overall outline of the target on the image after S1 preprocessing;
[0008] S4, Extract geometric feature vectors; extract using simple shape descriptors, based on edge detection results, calculate five simple shape descriptors and put them into a... In the vector, it serves as the geometric feature vector;
[0009] S5, construct the first-layer classifier; add labels to several classes of samples with typical geometric features in the sample set, combine with the geometric feature vectors obtained in S4, and use TSVM for learning, training and classification to obtain a sample subset composed of multi-class samples with similar geometric properties;
[0010] S6, construct the second-layer classifier; build a multi-SVM classifier model based on the sample subset obtained in S5, and train your own multi-classifier by combining the texture feature vector obtained in S2.
[0011] S7, Image Recognition: Substitute the geometric feature vector into the first-layer classifier constructed in S5 to classify the target, and then substitute the texture feature vector into the second-layer classifier constructed in S6 to complete the recognition.
[0012] Furthermore, in step S1, the preprocessing first converts the image into a grayscale image, then uses gamma transformation to normalize the image and unify its visual effect; then, median filtering is used to eliminate isolated noise points in the image and reduce salt-and-pepper noise; finally, histogram equalization is used to enhance the image, improving its contrast and clarity.
[0013] Furthermore, step S2 utilizes a sliding frame and cell blocks to extract HOG features, where a cell block consists of... The slider is composed of 4 units, consisting of 4 pixels. The slider step size is 1. Set the square gradient histogram to have 9 directions, use a sliding box to traverse the entire image, calculate the HOG within each sliding box, and then concatenate them to obtain a... The dimensional feature vector is used as the texture feature vector.
[0014] Furthermore, the specific method for edge detection in step S3 is as follows: First, Gaussian filtering is used to denoise the image, smoothing the image while increasing the width of the edges. Then, the gradient value of each pixel is calculated. and gradient direction Based on the gradient magnitude, points with significant grayscale changes are selected as the set of possible edges. Then, the pixels with the largest gradient value in the gradient direction are selected and retained, transforming multi-pixel-wide edges into single-pixel-wide edges. Finally, two thresholds are set. and , where greater than All of them were detected as edges, while those smaller than 1 were detected as edges. All pixels in the middle section are detected as non-edge pixels; pixels in the middle section that are adjacent to pixels identified as edges are considered edges, otherwise they are non-edge pixels.
[0015] Further, the simple shape descriptor in step S4 includes:
[0016] Concavity / convexity: Assuming the perimeter of the contour is... and the convex hull of the contour, wherein the convex hull is the covering contour of all convexities, with a perimeter of Concavity and convexity are ;
[0017] The ratio between principal axes: that is, the ratio of the orthogonal axes passing through the centroid of the figure enclosed by the contour, which is calculated through the covariance matrix of the contour;
[0018] Compactness: The ratio of the circumference of a circle of equal area in the contour region to the perimeter of the contour.
[0019] Differences: Assumptions It is a circle used to fit the shape of a contour, with its center being the centroid of the contour, and the difference being the contour edge and... The proportional mean square error;
[0020] Elliptic Dissimilarity: Assumption It is an ellipse used to fit the shape of a contour, with the center of the ellipse being the centroid of the contour. The ellipse's difference is the difference between the contour edges and... The proportional mean square error.
[0021] Furthermore, in step S5, a macroscopic understanding is first obtained by observing the geometric shapes of various samples, assuming that the samples can be roughly divided into... There are several geometric shapes, and then a typical representative sample is selected from each geometric shape and labeled to distinguish the geometric shapes.
[0022] To build a multi-class classifier for TSVM using a "one-to-one" structure, first establish... A basic SVM model is used, employing a Gaussian kernel function and a hinge loss function. First, [the model is then...] The class learns from already labeled samples to obtain a multi-classifier, and assigns a pseudo-label to the remaining unlabeled samples; it is stipulated that the first... In class samples The samples were classified into For a given geometric shape, we determine the first one using the following formula. Pseudo-labels for class samples:
[0023] (1)
[0024] in , , , To classify this type of sample The quantity of a geometric shape, let
[0025] (2)
[0026] Then the first Class sample belongs to the first Class geometry, where each sample is labeled as the first Geometric shapes;
[0027] Once all samples have been geometrically labeled, add slack variables and corresponding coefficients for the pseudo-labeled samples to the optimization objective equation:
[0028] (3)
[0029] in , This corresponds to manually labeled samples. , The corresponding sample is the pseudo-labeled sample. This is a pseudo-marker, used during initial setup. Much larger TSVM will use local search to iteratively seek the optimal solution in equation (3). First, it needs to find the classes that may be mislabeled. Based on equation (2), equation (4) is given as follows:
[0030] (4)
[0031] when and The difference is less than a smaller integer:
[0032] (5)
[0033] At this point, it is considered that this type of sample may be mislabeled, so the geometry of this type of sample is labeled as follows: Then, substitute the result back into equation (3) to find the optimal solution, and repeat this iterative process to train the TSVM, gradually increasing the value during the iteration. ,until Stop iterating; the first-layer classifier is constructed.
[0034] Further, in step S6, a multi-SVM classifier model is first established using a "one-to-one" structure; then, the support vector machine models for all subsets employ a Gaussian kernel function and a hinge loss function, with their parameters being... and penalty coefficient Given the same initial values, the HOG features of the samples in each subset are used to train the multi-SVM classifier corresponding to that subset. The k-fold cross-folding method is used during training to optimize the parameters of the support vector machine so that each classifier achieves optimal performance; the second-layer classifier is then constructed.
[0035] The working principle of this invention is as follows:
[0036] First, underwater images are preprocessed by normalizing them to unify visual effects, reduce noise, and enhance details. Second, Canny edge detection is used to find the overall outline of the target, and geometric features are calculated based on this outline. Then, the Histogram of Oriented Gradients (HOG) features are extracted. Finally, a two-layer target recognition system is built using TSVM and multi-SVM, such as... Figure 4 As shown. In the first layer: firstly, geometric type labels are added to several classes of samples with typical geometric features. Then, TSVM is used to learn the geometric features of all samples, dividing all samples into several sample subsets based on their geometric properties. In the second layer, multi-SVM is used to learn the image texture features, building a multi-class classifier for each sample subset obtained in the first layer.
[0037] Because color features reduce processing speed and increase computational load, the image preprocessing part of this method first converts all images directly to grayscale. Since varying lighting conditions result in different images having different color temperatures and exposures, this may cause errors in feature extraction for the same type of samples, affecting the training of subsequent machine learning algorithms. Therefore, gamma transformation is used for normalization preprocessing. Underwater images contain significant salt-and-pepper noise; median filtering, which is most effective at handling salt-and-pepper noise, is used to eliminate this noise. Finally, histogram equalization is used to enhance the images.
[0038] The Canny algorithm is one of the classic and advanced image edge detection algorithms, widely used in various fields. We use Canny to find the outermost contour of the target in an image, and then derive simple shape descriptors of the target based on the obtained contour: concavity / convexity, the ratio between principal axes, compactness, dissimilarity, and elliptic dissimilarity. These factors are then combined to form the target's shape. 3D geometric eigenvectors.
[0039] Histogram of Oriented Gradients (HOG) and SVM have achieved excellent results in practical applications. Therefore, we chose HOG as the texture feature for underwater image target recognition, ultimately obtaining a... 3D eigenvectors The number of features.
[0040] TSVM is a very typical transductive semi-supervised learning method, such as Figure 3 As shown, only a small number of samples in the training set need to be labeled to train TSVM and obtain the desired classifier, and to classify unlabeled samples. Since TSVM, like ordinary SVM, is a binary classification method, we also use a "one-to-one" multi-classification approach to construct a TSVM-based multi-classifier. This method requires labeling several classes of samples with typical geometric features in the sample set, and then using TSVM for learning and classification to obtain a subset of samples composed of multi-class samples with similar geometric properties. By using the first-layer TSVM classifier, the target range is narrowed down to a specific sample subset, avoiding the need to directly train a multi-SVM classifier on the entire sample set, thus reducing the number of classification types in the multi-SVM.
[0041] Finally, a multi-SVM classifier model is built using a "one-to-one" multi-classification structure. Then, each multi-classifier is trained using the sample subset obtained in the previous step. By using the second-layer multi-SVM classifier, the target is classified to determine its specific category, thus completing the recognition process.
[0042] The beneficial effects of this invention are as follows:
[0043] Compared with existing technologies, this invention utilizes a two-layer classification structure, which can effectively handle situations with a large number of target types to be identified, ensuring the recognition rate of multi-class underwater image target identification using SVM. It reduces the number of binary support vector machines in multi-SVM, largely overcoming the difficulty that the higher the number of target types, the lower the classification accuracy of multi-SVM; therefore, it has greater practical significance and value. Furthermore, the use of TSVM in this method also reduces the time and effort required for manual sample annotation to a certain extent, saving costs. Attached Figure Description
[0044] Figure 1 This is a flowchart illustrating the training process of the recognition method described in an embodiment of the present invention.
[0045] Figure 2 This is a flowchart of the identification method described in an embodiment of the present invention;
[0046] Figure 3 This is a conceptual diagram of TSVM learning as described in an embodiment of the present invention;
[0047] Figure 4 This is a structural diagram of the dual-layer target recognition system according to an embodiment of the present invention. Detailed Implementation
[0048] To make the technical means, creative features, and objectives of this invention easier to understand, the technical solution of this invention will be further explained below with reference to one embodiment and specific implementation of an image recognition method for multiple types of underwater targets provided by this invention.
[0049] like Figure 1-4 As shown, the main steps of this method include: underwater target image preprocessing, Histogram of Oriented Gradients (HOG) feature extraction, Canny edge detection, simple shape descriptor extraction, training of a first-layer classifier based on TSVM, training of a second-layer classifier based on multi-SVM, and target detection using the resulting two-layer classification system. The specific implementation plan is as follows:
[0050] Image preprocessing: First, underwater target images are acquired using specialized equipment. To normalize the images and unify their visual appearance, they are first converted to grayscale. Then, gamma transformation is applied to unify the visual effect and mitigate the adverse effects of insufficient or excessive lighting on image detection. Next, median filtering is used to eliminate isolated noise points in the images, significantly reducing salt-and-pepper noise in underwater images and improving image quality. Finally, histogram equalization is used to enhance the images, improving contrast and sharpness.
[0051] Extracting texture feature vectors; we do not need to use the sliding window in traditional Histogram of Oriented Gradients (HOG) feature extraction, but only use a sliding box and cell blocks to extract HOG features. A cell block consists of... The slider is composed of 4 units, consisting of 4 pixels. The slider step size is 1. Set the square gradient histogram to have 9 directions, use a sliding box to traverse the entire image, calculate the HOG within each sliding box, and then concatenate them to obtain a... The dimensional feature vector is used as the texture feature vector.
[0052] Edge detection; the specific method of Canny edge detection is to first use Gaussian filtering to denoise the image, making the image smooth and increasing the width of the edges, and then calculate the gradient value of each pixel. and gradient direction Based on the gradient magnitude, points with significant grayscale changes are selected as the set of potential edges. Then, pixels with the largest gradient value along the gradient direction are retained, transforming multi-pixel-wide edges into single-pixel-wide edges. Finally, two thresholds are set. and , where greater than All of them were detected as edges, while those below... All pixels are detected as non-edge pixels. For a middle pixel, if it is adjacent to a pixel that is determined to be an edge, it is determined to be an edge; otherwise, it is a non-edge pixel.
[0053] Extract geometric feature vectors; the simple shape descriptor of the target includes:
[0054] (1) Concavity / convexity: Assuming the perimeter of the contour is The perimeter of the convex hull (the covering contour of all convex parts is called the convex hull) is... Concavity and convexity are ;
[0055] (2) Proportion between principal axes: that is, the proportion of orthogonal axes passing through the centroid of the graphic enclosed by the contour, which is calculated by the covariance matrix of the contour;
[0056] (3) Compactness: The ratio of the circumference of the circle of equal area in the contour region to the circumference of the contour.
[0057] (4) Differences: Assumptions It is a circle used to fit the shape of a contour, with its center being the centroid of the contour, and the difference being the contour edge and... The proportional mean square error;
[0058] (5) Ellipticity: Assumption It is an ellipse used to fit the shape of a contour, with the center of the ellipse being the centroid of the contour. The ellipse's difference is the difference between the contour edges and... The proportional mean square error.
[0059] Based on the definition of a simple shape descriptor, using the target contour obtained in the previous step, calculate five simple shape descriptors and place them into a... In the vector, it serves as the geometric feature vector.
[0060] Based on such Figure 3 The diagram illustrates the TSVM learning concept, illustrating the construction of the first-layer classifier. We gain a macroscopic understanding by observing the geometric shapes of various sample types, assuming that the samples can be roughly categorized into... There are several geometric shapes, and then a typical representative sample is selected from each geometric shape and labeled to distinguish the geometric shapes.
[0061] Since this is not a simple binary classification problem, a multi-class classifier must be built on top of the traditional TSVM, but because The size won't be too large, so we'll use a "one-to-one" structure to build a multi-class classifier for TSVM. First, we'll build... A basic SVM model is used, employing a Gaussian kernel function and a hinge loss function. First, [the model is then...] After learning from the already labeled samples to obtain a multi-classifier, a pseudo-label is assigned to the remaining unlabeled samples. Since samples of a class should have uniform geometric properties, it is stipulated that the first... In class samples The samples were classified into For a given geometric shape, we determine the first one using the following formula. Pseudo-labels for class samples:
[0062] (1)
[0063] in , , , To classify this type of sample The quantity of a geometric shape, let
[0064] (2)
[0065] Then the first Class sample belongs to the first Class geometry, where each sample is labeled as the first Geometric shape.
[0066] Once all samples have been geometrically labeled, add slack variables and corresponding coefficients for the pseudo-labeled samples to the optimization objective equation:
[0067] (3)
[0068] in , This corresponds to manually labeled samples. , The corresponding sample is the pseudo-labeled sample. This is a pseudo-marker, used during initial setup. Much larger TSVM will use local search to iteratively seek the optimal solution in equation (3). First, it needs to find the classes that may be mislabeled. Based on equation (2), equation (4) is given as follows:
[0069] (4)
[0070] when and The difference is less than a smaller integer:
[0071] (5)
[0072] At this point, it is considered that this type of sample may be mislabeled, so the geometry of this type of sample is labeled as follows: Then, substitute the result back into equation (3) to find the optimal solution, and repeat this iterative process to train the TSVM, gradually increasing the value during the iteration. ,until Stop the iteration. This step yields the first-layer classifier.
[0073] Construct the second-layer classifier; from the previous step... After considering each subset of samples, this method uses multi-SVM to build a one-to-one multi-class classifier for each subset. First, an initial model is built. We use a "one-to-one" structure to build the multi-SVM classifier. All subset support vector machine models initially employ a Gaussian kernel function and a hinge loss function, with parameters denoted as . and penalty coefficient Assigning the same initial values, we then sequentially train the multi-SVM classifier corresponding to each subset using the HOG features of the samples contained in that subset. During training, we use a k-fold cross-folding method to optimize the support vector machine parameters, ensuring that each classifier achieves optimal performance. This step yields the second-layer classifier, as follows: Figure 4 As shown.
[0074] Image recognition: The geometric feature vector and texture feature vector are substituted into the first-layer classifier and the second-layer classifier, respectively, to identify the target.
[0075] It should be understood that the specific embodiments described above are merely illustrative or explanatory of the principles of the invention and do not constitute a limitation thereof. Therefore, any modifications or equivalent substitutions made without departing from the spirit and scope of the invention should be included within the protection scope of the invention. Furthermore, the appended claims are intended to cover all variations and modifications falling within the scope and boundaries of the appended claims, or equivalent forms of such scope and boundaries.
Claims
1. An image recognition method for multiple types of underwater targets, characterized in that, Includes the following steps: S1, Preprocessing: Normalize the obtained images to unify the visual effects; then remove salt and pepper noise from the images; finally, enhance the contrast and sharpness of the images. S2, extract texture feature vector; based on the image processed by S1, extract HOG features using sliding boxes and unit blocks as texture feature vectors; S3, edge detection; finds the overall outline of the target on the image after S1 preprocessing; S4, extract geometric feature vectors; Five simple shape descriptors are calculated based on the edge detection results and extracted using simple shape descriptors, and then placed into a... In the vector, it serves as the geometric feature vector; S5, Construct the first-layer classifier; Labels are added to samples of several classes with typical geometric features in the sample set. Combined with the geometric feature vectors obtained in S4, TSVM is used for learning, training and classification to obtain a sample subset composed of multi-class samples with similar geometric properties. S6, construct the second-layer classifier; build a multi-SVM classifier model based on the sample subset obtained in S5, and train your own multi-classifier by combining the texture feature vector obtained in S2. S7, Image Recognition; Substitute the geometric feature vector into the first-layer classifier constructed in S5 to classify the target, and then substitute the texture feature vector into the second-layer classifier constructed in S6 to complete the recognition. In step S5, a macroscopic understanding is first obtained by observing the geometric shapes of various samples, assuming that the samples are divided into... There are several geometric shapes, and then a typical representative sample is selected from each geometric shape and labeled to distinguish the geometric shapes. To build a multi-class classifier for TSVM using a "one-to-one" structure, first establish... A basic SVM model is used, employing a Gaussian kernel function and a hinge loss function. First, [the model is then...] The class learns from already labeled samples to obtain a multi-classifier, and assigns a pseudo-label to the remaining unlabeled samples; it is stipulated that the first... In class samples The samples were classified into For a given geometric shape, we determine the first one using the following formula. Pseudo-labels for class samples: (1) in , , , To classify this type of sample The quantity of a geometric shape, let (2) Then the first Class sample belongs to the first Class geometry, where each sample is labeled as the first Geometric shapes; Once all samples have been geometrically labeled, add slack variables and corresponding coefficients for the pseudo-labeled samples to the optimization objective equation: (3) in , This corresponds to manually labeled samples. , The corresponding sample is the pseudo-labeled sample. This is a pseudo-marker, used during initial setup. Much larger TSVM will use local search to iteratively seek the optimal solution in equation (3). First, it needs to find the classes that may be mislabeled. Based on equation (2), equation (4) is given as follows: (4) when and The difference is less than a smaller integer: (5) At this point, it is considered that this type of sample may be mislabeled, so the geometry of this type of sample is labeled as follows: Then, substitute the result back into equation (3) to find the optimal solution, and repeat this iterative process to train the TSVM, gradually increasing the value during the iteration. ,until Stop iterating; the first-layer classifier is constructed.
2. The image recognition method for multiple types of underwater targets as described in claim 1, characterized in that: The preprocessing step S1 first converts the image to grayscale, then uses gamma transformation to normalize and unify the visual effect of the image; then, median filtering is used to eliminate isolated noise points in the image and reduce salt-and-pepper noise; finally, histogram equalization is used to enhance the image, improving its contrast and clarity.
3. The image recognition method for multiple types of underwater targets as described in claim 1, characterized in that: Step S2 extracts HOG features using a sliding frame and cell blocks. A cell block consists of... The slider is composed of 4 units, consisting of 4 pixels. The slider step size is 1. Set the square gradient histogram to have 9 directions, use a sliding box to traverse the entire image, calculate the HOG within each sliding box, and then concatenate them to obtain a... The dimensional feature vector is used as the texture feature vector.
4. The image recognition method for multiple types of underwater targets as described in claim 1, characterized in that: The specific method for edge detection in step S3 is as follows: First, Gaussian filtering is used to reduce image noise, smoothing the image while increasing the width of the edges. Then, the gradient value of each pixel is calculated. and gradient direction Based on the gradient magnitude, points with significant grayscale changes are selected as the set of possible edges. Then, the pixels with the largest gradient value in the gradient direction are selected and retained, transforming multi-pixel-wide edges into single-pixel-wide edges. Finally, two thresholds are set. and , where greater than All of them were detected as edges, while those smaller than 1 were detected as edges. All pixels in the middle section are detected as non-edge pixels; pixels in the middle section that are adjacent to pixels identified as edges are considered edges, otherwise they are non-edge pixels.
5. The image recognition method for multiple types of underwater targets as described in claim 1, characterized in that: The simple shape descriptor in step S4 includes: Concavity / convexity: Assuming the perimeter of the contour is... and the convex hull of the contour, wherein the convex hull is the covering contour of all convexities, with a perimeter of Concavity and convexity are ; The ratio between principal axes: that is, the ratio of the orthogonal axes passing through the centroid of the figure enclosed by the contour, which is calculated through the covariance matrix of the contour; Compactness: The ratio of the circumference of a circle of equal area in the contour region to the perimeter of the contour. Differences: Assumptions It is a circle used to fit the shape of a contour, with its center being the centroid of the contour, and the difference being the contour edge and... The proportional mean square error; Elliptic Dissimilarity: Assumption It is an ellipse used to fit the shape of a contour, with the center of the ellipse being the centroid of the contour. The ellipse's difference is the difference between the contour edges and... The proportional mean square error.
6. The image recognition method for multiple types of underwater targets as described in claim 1, characterized in that: Step S6 first establishes a multi-SVM classifier model using a "one-to-one" structure; then, all subset support vector machine models employ a Gaussian kernel function and a hinge loss function, with parameters... and penalty coefficient Given the same initial values, the HOG features of the samples in each subset are used to train the multi-SVM classifier corresponding to that subset. The k-fold cross-folding method is used during training to optimize the parameters of the support vector machine so that each classifier achieves optimal performance; the second-layer classifier is then constructed.