A dictionary learning SAR ship target detection method based on self-attention mechanism
By adopting a dictionary learning method with self-attention mechanism in SAR object detection, the difference between sub-dictionaries is enhanced, and the problem of weak object detection in complex contexts is solved, the detection accuracy and model robustness are improved, and false alarms are reduced.
Patent Information
- Application Number
- CN202311622861.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-11-30
- Publication Date
- 2024-11-22
- Estimated Expiration
- 2043-11-30
AI Technical Summary
The existing SAR object detection methods are difficult to detect weak targets in complex contexts, and deep learning methods require a large amount of labeled data and have poor interpretability. Dictionary learning methods have shortcomings in terms of robustness and noise sensitivity.
Using a dictionary learning method based on self-attention mechanism, the objective function that increases the difference between sub-dictionaries is designed, and the dictionary is updated and the encoding coefficient is calculated using self-attention mechanism, which improves the expression ability of the dictionary, and enhances the robustness and identification of the model. ability.
Weak object detection with fewer image samples is achieved, which improves detection accuracy, reduces false alarms, and enhances the interpretability and robustness of the model.
Smart Images

Figure CN117788968B_ABST
Abstract
Description
Technical Field
[0001] The invention belongs to the field of radar image processing and target detection, and in particular relates to a dictionary learning SAR ship target detection method based on a self-attention mechanism. Background Art
[0002] Synthetic Aperture Radar (SAR) has the advantage of being able to work around the clock and in all weather conditions, so it is widely used in both civil and military applications. SAR ship detection can effectively detect ship targets in the ocean, so SAR-based ship detection systems have been widely used in maritime surveillance activities and are playing an increasingly important role.
[0003] SAR images have great potential in target detection and recognition tasks. SAR images contain rich information, such as the amplitude and phase of the echo signal, which can provide richer and more accurate target features, and can be used to construct SAR target detection datasets, which helps to improve the ability of target detection. Traditional SAR target detection methods usually detect targets by comparing radar echo signals or target templates, and have some shortcomings when dealing with complex scenes. With the rise of deep learning, SAR target detection methods based on deep learning have made some significant progress. However, deep learning methods also face some challenges, such as the need for a large amount of labeled data for training and easy overfitting in some complex scenes. In addition, the "black box" nature of deep learning methods makes it difficult to explain model decisions, which is a problem that cannot be ignored in some application scenarios. In order to overcome the limitations of traditional methods and deep learning methods, a SAR target detection method based on dictionary learning is adopted. Dictionary learning can automatically learn the optimal representation from the data, avoiding the reliance on manually designed features, and compared with deep learning methods, dictionary learning usually requires less labeled data. In addition, dictionary learning methods are easier to explain, which helps to improve the interpretability of the model. Therefore, the SAR target detection method based on dictionary learning has better performance and broader application prospects when processing complex SAR images.
[0004] Dictionary learning is a method for learning a set of "dictionaries" or "sparse bases" from high-dimensional data to represent the structure and features of the original data. In dictionary learning, the original data is represented as a linear combination of dictionaries, where each element corresponds to a basis vector or atom. Through dictionary learning, tasks such as data dimensionality reduction, feature extraction, signal decomposition and reconstruction can be achieved. Traditional dictionary learning methods are mostly used for classification and recognition, such as sparse representation based classification (SRC) method, D-KSVD algorithm and Fisher criterion-based discriminant dictionary learning (FDDL). Dictionary learning has been successfully applied in SAR target detection. By representing SAR images as linear combinations of atoms in the dictionary, dictionary learning can better capture the features of targets in SAR images and improve the accuracy of target detection. However, most of the existing SAR target detection algorithms based on dictionary learning do not consider the detection of weak targets in complex backgrounds. The robustness and sensitivity to noise of the model are also aspects that need to be further improved to adapt to the complex and changeable SAR scenes in the real world.
[0005] The present invention proposes dictionary learning based on self-attention mechanism to perform SAR ship target detection, and realizes weak target detection of small samples. The dictionary learning (SADL) method based on self-attention mechanism proposed in the present invention designs an objective function that increases the difference between sub-dictionaries, updates the dictionary and calculates the coding coefficient by self-attention mechanism, and more accurately captures the local features of the target, which helps to improve the expression ability of the dictionary. Dictionary learning based on self-attention mechanism has brought significant improvements to SAR target detection, enabling it to use fewer image samples, more effectively cope with weak target detection tasks, improve model robustness, reduce false alarms of target detection, and improve detection accuracy. Summary of the invention
[0006] Purpose of the invention: The present invention provides a dictionary learning SAR ship target detection method based on self-attention mechanism, which can improve detection accuracy and reduce false alarms of target detection.
[0007] Technical solution: The dictionary learning SAR ship target detection method based on self-attention mechanism described in the present invention comprises the following steps:
[0008] (1) Preprocess the pre-acquired SAR image, extract feature vectors pixel by pixel, and form a feature matrix;
[0009] (2) Construct a dictionary learning model based on the self-attention mechanism and design an objective function to increase the differences between sub-dictionaries;
[0010] (3) Use the self-attention mechanism to update the dictionary and calculate the encoding coefficients to construct a target and background sub-dictionary with discriminative capabilities;
[0011] (4) Using the feature matrix obtained in step (1) as the input of the dictionary learning model based on the self-attention mechanism proposed in step (2) to perform threshold detection and obtain preliminary detection results;
[0012] (5) The detection result of the target is obtained by calculating the connected area size, aspect ratio and complexity of the detection result.
[0013] Furthermore, the implementation process of step (1) is as follows:
[0014] The input image is I, and the input sample x is extracted ij When selecting features, select the pixel set in the 3×3 neighborhood window of the pixel:
[0015]
[0016] Considering the gradient information and intensity information of the neighborhood window, the input sample feature vector is extracted; the intensity information is the pixel information of the SAR image, which reflects the echo intensity of different objects to the SAR signal; the gradient amplitude information is calculated as follows:
[0017]
[0018]
[0019]
[0020] Among them, G X (i, j) and G Y (i, j) are the gradients of the image in the x-direction and y-direction respectively, i is the horizontal coordinate of the pixel coordinate position, and j is the vertical coordinate of the pixel coordinate position; for each pixel, a multidimensional feature vector is defined:
[0021] x=[grad(:),x ij (:)] T
[0022] Considering the different effects of target distance, radar gain and target scattering strength on the target and background echo strength, the eigenvector is not normalized; the obtained eigenvector X = [x1, x2, x3…, x N ], N is the number of samples.
[0023] Furthermore, the objective function for increasing the difference of the sub-dictionaries in step (2) is:
[0024]
[0025] Where X = [X1, X2] is the input background sample and target sample, D = [D1, D2] is the dictionary to be trained, D1 and D2 are the background sub-dictionary and target sub-dictionary respectively, Z = [Z1, Z2] is the encoding coefficient of the background sample and the target sample under the dictionary D, and Z i =[Z 1i ; Z 2i ] represents the coding coefficient of the sample in the background sub-dictionary and the target sub-dictionary, λ1, λ2 and λ3 are balance parameters; the first term f1(X, D, Z) is the reconstruction error term; the second term f2(X, D, Z) is the class reconstruction error term; the third term f3(D, Z) is the different class reconstruction error term; the fourth term f4(D) is the dictionary mutual difference term;
[0026] The reconstruction error term is:
[0027]
[0028] Among them, λ is the sparsity parameter; the reconstruction error term is the reconstruction error of the entire dictionary and the sparsity of the coding coefficient, which realizes the dictionary's better representation of the target sample and the sparsity of the coding coefficient;
[0029] The class reconstruction error term is:
[0030]
[0031] The class reconstruction error term is the reconstruction error of the class sub-dictionary, which ensures that the reconstruction error of the class sub-dictionary for the class sample is small, and achieves a better representation of the class sample by the class sub-dictionary;
[0032] The different types of reconstruction errors are:
[0033]
[0034] The reconstruction error of different classes is the reconstruction of other classes by the class sub-dictionary, which ensures that the class sub-dictionary has poor reconstruction ability for other classes, realizes that the class sub-dictionary has weak representation ability for other class samples, and improves the difference between class sub-dictionaries;
[0035] The dictionary mutual dissimilarity terms are:
[0036]
[0037] The dictionary mutual dissimilarity term is the mutual dissimilarity of the dictionary, which reduces the correlation between atoms, enhances the mutual dissimilarity of the dictionary, and ensures that each basis vector can capture different features and structures in the data without overlapping.
[0038] Furthermore, the implementation process of step (3) is as follows:
[0039] In the self-attention mechanism, the correlation between each element in the sequence and all other elements is calculated; for each element in the input sequence, a query vector Q, a key vector K, and a value vector V are calculated:
[0040] Q=W q X
[0041] K=W k X
[0042] V=W v X
[0043] Next, the obtained Q and K are used to calculate the correlation between each two input vectors; the dot product of the Q and K matrices is divided by The similarity calculation is performed to prevent the calculated value from being too large, and then normalized by the softmax function, and finally the final data is obtained by the weighted summation method:
[0044]
[0045] Where Q, K, and V are matrices obtained by linearly mapping the input matrix; D k is a matrix for stabilizing training gradients; softmax() is an activation function with normalization function;
[0046] When updating the dictionary using the self-attention mechanism, the encoding coefficient Z is fixed, the dictionary D is used as the input X of the self-attention mechanism, and the weight matrix W is randomly initialized. q , W v , W k , the weight matrix is updated by the self-attention mechanism, thereby updating the dictionary D, and the gradient is calculated according to the objective function to perform gradient descent:
[0047]
[0048] Similarly, when using the self-attention mechanism to calculate the encoding coefficient, the dictionary D is fixed, the encoding coefficient Z is used as the input X of the self-attention mechanism, and the weight matrix W is randomly initialized. q , W v , W k , the weight matrix is updated by the self-attention mechanism to calculate the encoding coefficient Z, and the gradient is calculated according to the objective function to perform gradient descent:
[0049]
[0050] Furthermore, the implementation process of step (4) is as follows:
[0051] The feature matrix is used as the input of the proposed dictionary learning model based on the self-attention mechanism for training. The feature vector y of the SAR image to be detected is input, and the sparse representation a=[a1; a2] is obtained using the trained dictionary, where a1 and a2 are the sparse representations of the feature vector y on the sub-dictionaries D1 and D2 respectively; the metric value e is calculated based on the obtained results:
[0052]
[0053] Set the threshold T. If e>T, it is a target, otherwise it is clutter. Get the preliminary detection result.
[0054] Furthermore, the implementation process of step (5) is as follows:
[0055] By setting a threshold, connected areas that are too small or too large are screened out; connected areas smaller than the threshold are considered noise or false detections and are excluded; connected areas larger than the threshold may represent uninteresting or abnormal targets and are discarded;
[0056] Preset the aspect ratio range to filter the connected areas with reasonable target shapes; exclude targets that do not meet the range:
[0057]
[0058] Among them, A is the aspect ratio, width x 、width y are the lengths in different dimensional directions respectively;
[0059] The complexity or contour shape information of the target is used to further optimize the detection results, remove excessive details or noise, and obtain a smoother contour:
[0060]
[0061] Among them, P is the contour complexity, C and S are the perimeter and area of the connected region respectively.
[0062] Beneficial effects: Compared with the prior art, the beneficial effects of the present invention are as follows: 1. The intensity and gradient information of the SAR image are used as the feature matrix to obtain more information of the SAR image, and more SAR image feature information is provided for subsequent dictionary learning and target detection; 2. The present invention proposes a dictionary learning objective function model to train a target sub-dictionary and a background sub-dictionary with large differences, thereby improving the discrimination between the target sub-dictionary and the background sub-dictionary; 3. The present invention adopts a self-attention mechanism to update the dictionary and calculate the coding coefficient, thereby enhancing the correlation within the class sub-dictionary and the difference between the class sub-dictionaries, thereby enhancing the model's ability to distinguish between the target and the background; 4. A post-processing part is added to improve the target detection accuracy and reduce false alarms and missed detections. BRIEF DESCRIPTION OF THE DRAWINGS
[0063] Figure 1 Schematic diagram of the dictionary learning model based on the self-attention mechanism proposed in the present invention;
[0064] Figure 2 Schematic diagram of the basic structure of the self-attention mechanism used in the present invention;
[0065] Figure 3 This is a flowchart of the dictionary update based on the self-attention mechanism proposed in the present invention;
[0066] Figure 4 A flowchart of the coding coefficient calculation based on the self-attention mechanism used in the present invention;
[0067] Figure 5 It is a comparison diagram of ROC curves of SAR ship images in dictionary learning based on Fisher criterion and detection results based on the present invention;
[0068] Figure 6 The figure is a detection result diagram of target detection using the present invention for SAR ship images, wherein (a) is a test image, (b) is a label of the test image, and (c) is a detection result. DETAILED DESCRIPTION
[0069] The present invention will be further described below in conjunction with the accompanying drawings.
[0070] The present invention proposes a dictionary learning SAR ship target detection method based on self-attention mechanism, and the specific implementation steps are as follows:
[0071] Step S1: SAR image feature extraction: Based on the SAR ship amplitude image, the feature vector of the input sample is extracted as the feature vector of the sample to form the input sample feature matrix for dictionary learning.
[0072] Assuming the input image is I, considering the influence of the pixels around the pixel on the pixel detection result, extract the input sample x ij The feature is the set of pixels in the 3×3 neighborhood window of the selected pixel:
[0073]
[0074] Considering the gradient information and intensity information of the neighborhood window, the input sample feature vector is extracted. The intensity information is the pixel information of the SAR image, which reflects the echo intensity of different objects to the SAR signal. Under normal circumstances, the SAR ship target intensity information is larger, the target reflection ability is stronger, the reflected signal is stronger, and the objects in the corresponding area usually appear bright colors; while the background part has smaller intensity information, relatively weaker reflection ability, and weaker reflected signal, and the corresponding area usually appears dim. The gradient information is the gradient amplitude information of the SAR image, which reflects the magnitude of the pixel intensity change in the SAR image. Ship targets usually have obvious geometric shapes and edge features, showing higher reflection intensity in SAR images, and the surface gradient size is generally larger; the background usually appears as background noise in SAR images, with lower reflection intensity and smaller surface gradient size. The following formula is the calculation method of gradient amplitude information:
[0075]
[0076]
[0077]
[0078] Among them, G X (i, j) and G Y (i, j) are the gradients of the image in the x and y directions respectively, i is the horizontal coordinate of the pixel coordinate position, and j is the vertical coordinate of the pixel coordinate position; for each pixel, an 18-dimensional feature vector is defined:
[0079] x=[grad(:),x ij (:)] T
[0080] Considering the different effects of target distance, radar gain, and target scattering strength on the target and background echo strength, the feature vector is not normalized. The obtained feature vector X = [x1, x2, x3…, x N ], N is the number of samples, which is the input sample for subsequent dictionary learning.
[0081] Step S2: Figure 1 As shown in the figure, a dictionary learning model based on the self-attention mechanism is constructed, and an objective function is designed to increase the differences between sub-dictionaries.
[0082] The input training samples obtained from step S1 are subjected to feature learning using dictionary learning based on the self-attention mechanism to obtain target sub-dictionary and background sub-dictionary. In order to enhance the correlation within the sub-dictionary and the difference between the sub-dictionaries, thereby enhancing the model's ability to distinguish between the target and the background and improving the target detection accuracy, the proposed dictionary learning objective function is:
[0083]
[0084] Where X = [X1, X2] is the input background sample and target sample, D = [D1, D2] is the dictionary to be trained, D1 and D2 are the background sub-dictionary and target sub-dictionary respectively, Z = [Z1, Z2] is the encoding coefficient of the background sample and the target sample under the dictionary D, and Z i =[Z 1i ; Z 2i ] represents the coding coefficient of the sample in the background sub-dictionary and the target sub-dictionary, and λ1, λ2 and λ3 are balance parameters. In addition, the first term f1(X, D, Z) in the objective function is the reconstruction error term; the second term f2(X, D, Z) is the class reconstruction error term; the third term f3(D, Z) is the different class reconstruction error term; and the fourth term f4(D) is the dictionary mutual difference term.
[0085] The reconstruction error term is the reconstruction error of the entire dictionary and the sparsity of the coding coefficients, which realizes the dictionary's better representation of the target sample and the sparsity of the coding coefficients. λ is the sparsity parameter, and its expression is:
[0086]
[0087] The class reconstruction error term is the reconstruction error of the class sub-dictionary, which ensures that the reconstruction error of the class sub-dictionary for the class sample is small, and achieves a good representation of the class sub-dictionary for the class sample. Its expression is:
[0088]
[0089] The reconstruction error of different classes is the reconstruction of other classes by the class sub-dictionary, which ensures that the class sub-dictionary has poor reconstruction ability for other classes, realizes that the class sub-dictionary has weak representation ability for other class samples, and improves the difference between class sub-dictionaries. Its expression is:
[0090]
[0091] The dictionary mutual dissimilarity term is the mutual dissimilarity of the dictionary, which reduces the correlation between atoms, enhances the mutual dissimilarity of the dictionary, and ensures that each basis vector can capture different features and structures in the data without overlapping. Its expression is:
[0092]
[0093] Step S3: Figure 3 , Figure 4 As shown in the figure, the self-attention mechanism is used to update the dictionary and calculate the encoding coefficients, filter out important information, discard interference information, and build a more discriminative dictionary.
[0094] like Figure 2As shown in the figure, the self-attention mechanism is a variant of the attention mechanism, which can capture the interaction of information at two different positions in the same input, pay more attention to the characteristics of the data itself and the internal interaction between the data, assign weights to the state information of the superior output, filter out important information, discard interference information, and improve the utilization of information.
[0095] In the self-attention mechanism, the model calculates the association (or weight) of each element in the sequence with all other elements. For each element in the input sequence, a query vector Q, a key vector K, and a value vector V are calculated:
[0096] Q=W q X
[0097] K=W k X
[0098] V=W v X
[0099] Next, the correlation between each two input vectors is calculated using the obtained Q and K. The dot product of the Q and K matrices is divided by The similarity calculation is performed to prevent the calculated value from being too large, and then normalized by the softmax function, and finally the final data is obtained by the weighted summation method:
[0100]
[0101] Where Q, K, and V are matrices obtained by linearly mapping the input matrix; D k is a matrix for stabilizing training gradients; softmax() is an activation function with normalization function.
[0102] When updating the dictionary using the self-attention mechanism, the encoding coefficient Z is fixed, the dictionary D is used as the input X of the self-attention mechanism, and the weight matrix W is randomly initialized. q , W v , W k , the weight matrix is updated by the self-attention mechanism, thereby updating the dictionary D, and the gradient is calculated according to the objective function to perform gradient descent.
[0103]
[0104] Similarly, when using the self-attention mechanism to calculate the encoding coefficient, the dictionary D is fixed, the encoding coefficient Z is used as the input X of the self-attention mechanism, and the weight matrix W is randomly initialized. q , W v , W k , the weight matrix is updated by the self-attention mechanism to calculate the encoding coefficient Z, and the gradient is calculated according to the objective function to perform gradient descent.
[0105]
[0106] In order to reduce false alarms and missed detections in target detection and improve the difference between the target sub-dictionary and the background sub-dictionary, this study adopts the self-attention mechanism to update the dictionary, uses the inherent information within the features to interact with attention, reduces dependence on external information, and models the relationship by associating features at different positions between sequences.
[0107] Step S4: Use the feature matrix obtained in step S1 as the input of the dictionary learning model based on the self-attention mechanism proposed in step S2 to perform threshold detection.
[0108] The feature matrix obtained in step S1 is used as the input of the proposed dictionary learning model based on the self-attention mechanism for training. The feature vector y of the SAR image to be detected is input, and the sparse representation a=[a1; a2] is obtained using the trained dictionary, where a1 and a2 are the sparse representations of the feature vector y on the sub-dictionaries D1 and D2, respectively. The metric value e is calculated based on the obtained results, as shown in the following formula:
[0109]
[0110] Set the threshold T, if e>T, it is a target, otherwise it is clutter. Get the preliminary detection result.
[0111] Step S5: Use the preliminary detection results obtained in step S4 to perform post-target detection processing to improve the quality and reliability of the detection results. By calculating the connected area size, aspect ratio and complexity of the detection results, false alarms can be reduced and the accuracy of target detection can be improved.
[0112] By setting a threshold, we can filter out connected areas that are too small or too large. Connected areas that are smaller than the threshold can be considered as noise or false positives and can be excluded. Connected areas that are larger than the threshold may represent uninteresting or abnormal targets and can also be discarded.
[0113] By setting a suitable aspect ratio range, connected areas with reasonable target shapes can be screened. For target morphological features known in a specific application scenario, a reasonable aspect ratio range can be defined based on prior knowledge to exclude targets that do not meet the range.
[0114]
[0115] Among them, A is the aspect ratio, width x 、width y are the lengths in different dimensional directions respectively.
[0116] The complexity or contour shape information of the target is used to further optimize the detection results, remove excessive details or noise, and obtain a smoother contour.
[0117]
[0118] Among them, P is the contour complexity, C and S are the perimeter and area of the connected region respectively.
[0119] The present invention is verified by taking the ship images of the actual data LS-SSDD-v1.0 dataset as an example.
[0120] like Figure 5 As shown in the figure, the ROC curve comparison of the target detection experimental results of SAR ship images in the traditional dictionary learning based on Fisher criterion and the dictionary learning based on self-attention mechanism proposed in the present invention is shown. Compared with the traditional dictionary learning based on Fisher criterion, the target detection method proposed in the present invention has better algorithm performance, improved detection accuracy, and reduced false alarm rate of SAR ship target detection.
[0121] like Figure 6 As shown in the figure, the target detection experimental results of the SAR ship image using the target detection algorithm proposed in the present invention, wherein (a) is the test image, (b) is the label of the test image (Ground Truth, abbreviated as GT), and (c) is the detection result. It can be seen that the target detection network proposed in the present invention successfully detects weak and small ship targets under complex backgrounds, achieving a higher accuracy rate and a lower false alarm rate for target detection.
Claims
1. A dictionary learning SAR ship target detection method based on self-attention mechanism, It is characterized in that The following steps are involved: (1) Preprocess the pre-acquired SAR image, extract feature vectors pixel by pixel, and form a feature matrix; (2) Construct a dictionary learning model based on the self-attention mechanism and design an objective function to increase the differences between sub-dictionaries; (3) Use the self-attention mechanism to update the dictionary and calculate the encoding coefficients to construct a target and background sub-dictionary with discriminative capabilities; (4) Using the feature matrix obtained in step (1) as the input of the dictionary learning model based on the self-attention mechanism proposed in step (2) to perform threshold detection and obtain preliminary detection results; (5) Obtain the detection result of the target by calculating the connected area size, aspect ratio and complexity of the detection result; The objective function for increasing the difference of sub-dictionaries in step (2) is: Where X = [X 1 , X 2 ] is the input background sample and target sample, D=[D 1 , D 2 ] is the dictionary to be trained, D 1 and D 2 are background sub-dictionary and target sub-dictionary respectively, Z=[Z 1 , Z 2 ] is the coding coefficient of the background sample and the target sample under the dictionary D, and Z i =[Z 1i ; Z 2i ] represents the encoding coefficient of the sample in the background sub-dictionary and the target sub-dictionary, λ 1 , 2 and λ 3 is the equilibrium parameter; the first term f 1 (X, D, Z) is the reconstruction error term; the second term f 2 (X, D, Z) is the class reconstruction error term; the third term f 3 (D, Z) are reconstruction errors of different types; the fourth term f 4 (D) is the dictionary mutual dissimilarity item; The implementation process of step (3) is as follows: In the self-attention mechanism, the correlation between each element in the sequence and all other elements is calculated; for each element in the input sequence, a query vector Q, a key vector K, and a value vector V are calculated: Q=W q X K=W k X V=W v X Next, the obtained Q and K are used to calculate the correlation between each two input vectors; the dot product of the Q and K matrices is divided by The similarity calculation is performed to prevent the calculated value from being too large, and then normalized by the softmax function, and finally the final data is obtained by the weighted summation method: Where Q, K, V are matrices obtained by linear mapping the input matrix; D k is a matrix for stabilizing training gradients; softmax() is an activation function with normalization function; When updating the dictionary using the self-attention mechanism, the encoding coefficient Z is fixed, the dictionary D is used as the input X of the self-attention mechanism, and the weight matrix W is randomly initialized. q , W v , W k , the weight matrix is updated by the self-attention mechanism, thereby updating the dictionary D, and the gradient is calculated according to the objective function to perform gradient descent: Similarly, when using the self-attention mechanism to calculate the encoding coefficient, the dictionary D is fixed, the encoding coefficient Z is used as the input X of the self-attention mechanism, and the weight matrix W is randomly initialized. q , W v , W k , the weight matrix is updated by the self-attention mechanism to calculate the encoding coefficient Z, and the gradient is calculated according to the objective function to perform gradient descent: The reconstruction error term is: Among them, λ is the sparsity parameter; the reconstruction error term is the reconstruction error of the entire dictionary and the sparsity of the coding coefficient, which realizes the dictionary's better representation of the target sample and the sparsity of the coding coefficient; The class reconstruction error term is: The class reconstruction error term is the reconstruction error of the class sub-dictionary, which ensures that the reconstruction error of the class sub-dictionary for the class sample is small, and achieves a good representation of the class sample by the class sub-dictionary; The different types of reconstruction errors are: The reconstruction error of different classes is the reconstruction of other classes by the class sub-dictionary, which ensures that the class sub-dictionary has poor reconstruction ability for other classes, realizes that the class sub-dictionary has weak representation ability for other class samples, and improves the difference between class sub-dictionaries; The dictionary mutual dissimilarity terms are: The dictionary mutual dissimilarity term is the mutual dissimilarity of the dictionary, which reduces the correlation between atoms, enhances the mutual dissimilarity of the dictionary, and ensures that each basis vector can capture different features and structures in the data without overlapping.
2. According to the dictionary learning SAR ship target detection method based on self-attention mechanism according to claim 1, It is characterized in that The implementation process of step (1) is as follows: The input image is I, and the input sample x is extracted ij When selecting features, select the pixel set in the 3×3 neighborhood window of the pixel: Considering the gradient information and intensity information of the neighborhood window, the input sample feature vector is extracted; the intensity information is the pixel information of the SAR image, which reflects the echo intensity of different objects to the SAR signal; the gradient amplitude information is calculated as follows: Among them, G X (i, j) and G Y (i, j) are the gradients of the image in the x-direction and y-direction respectively, i is the horizontal coordinate of the pixel coordinate position, and j is the vertical coordinate of the pixel coordinate position; for each pixel, a multidimensional feature vector is defined: x=[grad(:),x ij (:)] T Considering the different effects of target distance, radar gain and target scattering strength on the target and background echo strength, the eigenvector is not normalized; the obtained eigenvector X = [x 1 , x 2 , x 3 …, x N ], N is the number of samples.
3. According to the dictionary learning SAR ship target detection method based on self-attention mechanism according to claim 1, It is characterized in that The implementation process of step (4) is as follows: The feature matrix is used as the input of the proposed dictionary learning model based on the self-attention mechanism for training. The feature vector y of the SAR image to be detected is input, and the sparse representation a=[a 1 ; a 2 ], where a 1 and a 2 are the feature vector y in the sub-dictionary D 1 and D 2 ; the metric e is calculated based on the result: Set the threshold T. If e>T, it is a target, otherwise it is clutter. Get the preliminary detection result.
4. The dictionary learning SAR ship target detection method based on self-attention mechanism according to claim 1, It is characterized in that The implementation process of step (5) is as follows: By setting a threshold, connected areas that are too small or too large are screened out; connected areas smaller than the threshold are considered noise or false detections and are excluded; connected areas larger than the threshold may represent uninteresting or abnormal targets and are discarded; Preset the aspect ratio range to filter the connected areas with reasonable target shapes; exclude targets that do not meet the range: Among them, A is the aspect ratio, width x 、width y are the lengths in different dimensional directions respectively; The complexity or contour shape information of the target is used to further optimize the detection results, remove excessive details or noise, and obtain a smoother contour: Among them, P is the contour complexity, C and S are the perimeter and area of the connected region respectively.
Citation Information
Patent Citations
Polarization SAR image ship target detection method
CN104091335A
SAR target identification method based on scattering center feature extraction
CN116778349A
Hyperspectral image anomaly detection method based on feature learning and collaborative representation network
CN116797901A
Image filtering by sparse reconstruction on affinity net
JP2013130573A
