A Method and System for Optimizing Spectrogram Based on Adaptive Threshold Sparse Gradient
Through the spectrum line graph optimization method of adaptive threshold sparse gradient, the problem of gradient information noise interference in sonar signal processing is solved, the sparseness and interpretability are improved, and the calculation complexity and redundant data processing are reduced.
Patent Information
- Application Number
- CN202510688794.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-05-27
- Publication Date
- 2025-07-22
- Estimated Expiration
- 2045-05-27
AI Technical Summary
In sonar signal processing, the gradient information often contains noise, which leads to insufficient sparsity of Doppler shift spectrum line graphs and sticky artifacts.
The spectrum line graph optimization method of adaptive threshold sparse gradient is used to generate a dynamic threshold matrix by combining local mean and standard deviation with adaptive coefficients, and perform maximum value suppression and gradient direction quantization, and non-maximum suppression screen key gradient points to generate a sparse spectrum gradient map.
Effectively suppress glitch noise and random interference, improve the sparsity and interpretability of Doppler frequency shift spectrum line graphs, reduce calculation complexity, reduce redundant data processing, and improve algorithm operation efficiency.
Smart Images

Figure CN120195668B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of sonar array signal processing, and particularly relates to a method and system for optimizing a spectrogram with an adaptive threshold sparse gradient. Background Art
[0002] With the rapid development of marine resource exploration and underwater monitoring technologies, the importance of sonar signal processing and analysis in fields such as marine environment perception and target detection has become increasingly prominent. The complexity of the marine environment, such as turbulent diffusion, strong noise, high reverberation, and water absorption effects, significantly interferes with the quality of sonar signals, making it a huge challenge to extract target features from echo signals.
[0003] Traditional sonar signal processing methods mainly rely on time-frequency analysis techniques to represent the echo structure by decomposing the time-frequency domain features of signals. However, after propagation in a long-distance marine channel, the fine features of sonar signals are easily masked by noise, resulting in a significant decrease in the separability of the features extracted by time-frequency analysis and making it difficult to meet the actual application requirements. As an important carrier for representing the motion characteristics of targets, the gradient information in the full-angle Doppler frequency shift spectrogram of sonar signals often contains noise, leading to the problem of adhesion artifacts and insufficient sparsity of the Doppler frequency shift spectrogram. Summary of the Invention
[0004] The main objective of the present invention is to provide a method and system for optimizing a spectrogram with an adaptive threshold sparse gradient, aiming to solve the problem that the gradient information in sonar signals often contains noise, resulting in the problem of adhesion artifacts and insufficient sparsity of the Doppler frequency shift spectrogram.
[0005] The technical solution proposed by the present invention is as follows:
[0006] A method for optimizing a spectrogram with an adaptive threshold sparse gradient, which is applied to a system for optimizing a spectrogram with an adaptive threshold sparse gradient; the system includes a calculation module and a display module; the method includes:
[0007] The calculation module imports a two-dimensional matrix of the full-angle Doppler frequency shift spectrogram, where the size of the two-dimensional matrix is M×N, M is the size of the two-dimensional matrix in the angle dimension, N is the size of the two-dimensional matrix in the frequency dimension, and the matrix element value of the two-dimensional matrix represents the spectrogram intensity value at the corresponding angle and frequency coordinates;
[0008] The calculation module performs boundary filling on the input two-dimensional matrix of the full-angle Doppler frequency shift spectrogram, calculates the horizontal gradient Gx and the vertical gradient Gy through convolution operations, and calculates the gradient amplitude matrix G_mag and the gradient direction matrix G_dir using Gx and Gy;
[0009] The calculation module quantizes the gradient direction matrix G_dir into four main directions, and performs non-maximum suppression on each data point (i, j) in G_mag to obtain the non-maximum suppression gradient matrix G_nms;
[0010] The calculation module calculates the local mean matrix Local_mean and the local standard deviation matrix Local_std using G_nms, calculates the dynamic threshold matrix Threshold_map using Local_mean and Local_std, performs thresholding on the dynamic threshold matrix Threshold_map to obtain the sparse spectral gradient map G_sparse, and displays the sparse spectral gradient map G_sparse through the display module.
[0011] Preferably, the calculation module performs boundary padding on the input two-dimensional matrix of full-angle Doppler frequency shift spectral lines, calculates the horizontal gradient Gx and the vertical gradient Gy through convolution operations, and calculates the gradient magnitude matrix G_mag and the gradient direction matrix G_dir using Gx and Gy, including:
[0012] The calculation module defines the Sobel operator. Among them, the Sobel operator is used to calculate the discrete gradient approximation values of the two-dimensional matrix of full-angle Doppler frequency shift spectral lines in the angle and frequency directions to represent the spectral intensity change rate. The Sobel operator includes the horizontal Sobel operator Sobel_x and the vertical Sobel operator Sobel_y, and the expressions are respectively:
[0013] ,
[0014] ,
[0015] The calculation module performs boundary padding on the input two-dimensional matrix of full-angle Doppler frequency shift spectral lines to ensure the effectiveness of neighborhood operations for data points at the spectral map edges, thereby obtaining the two-dimensional matrix Matrix_padded of full-angle Doppler frequency shift spectral lines after boundary padding. The calculation formula is:
[0016] ,
[0017] In the formula, the matrix size of the two-dimensional matrix of full-angle Doppler frequency shift spectral lines after boundary padding is (M + 2) × (N + 2) to ensure that the operation of the Sobel operator at the edge data points will not exceed the boundary; Matrix(i, j) represents the spectral line intensity value of the two-dimensional matrix Matrix of full-angle Doppler frequency shift spectral lines at the angle coordinate i and the frequency coordinate j; Matrix_padded(i, j) represents the spectral line intensity value of the two-dimensional matrix Matrix_padded of full-angle Doppler frequency shift spectral lines after boundary padding at the angle coordinate i and the frequency coordinate j.
[0018] Preferably, the calculation module performs boundary padding on the input two-dimensional matrix of full-angle Doppler frequency shift spectral lines to ensure the effectiveness of neighborhood operations on data points at the spectral graph edge, thereby obtaining Matrix_padded. Subsequently, it further includes:
[0019] The calculation module initializes a horizontal gradient matrix Gx and a vertical gradient matrix Gy. Among them, the sizes of the horizontal gradient matrix Gx and the vertical gradient matrix Gy are the same as those of the input two-dimensional matrix of full-angle Doppler frequency shift spectral lines, and the elements of the horizontal gradient matrix Gx and the vertical gradient matrix Gy are initialized to zero;
[0020] The calculation module calculates Gx and Gy through convolution operations, extracts the 3×3 neighborhood window of each data point (i,j) of Matrix_padded, and performs convolution calculations with Sobel_x and Sobel_y respectively. The calculation formula is:
[0021] ,
[0022] In the formula, Sobel_x(m,n) represents the coefficient value of the horizontal Sobel operator Sobel_x at the coordinate (m,n), and the summation operation is performed for m and n in the range of 1-3; the horizontal gradient matrix Gx represents the change rate of the spectral line intensity in the angular dimension; Gx(i,j) represents the value of the horizontal gradient Gx matrix at the angular coordinate i and the frequency coordinate j , that is, at the angular coordinate i and the frequency coordinate j , the horizontal gradient value obtained by performing convolution calculation on the boundary-padded two-dimensional matrix Matrix_padded of full-angle Doppler frequency shift spectral lines through the horizontal Sobel operator Sobel_x;
[0023] ,
[0024] In the formula, Sobel_y(m,n) represents the coefficient value of the vertical Sobel operator Sobel_y at the coordinate (m,n), and the summation operation is performed for m and n in the range of 1-3; the vertical gradient Gy represents the change rate of the spectral line intensity in the frequency dimension; Gy(i,j) represents the value of the vertical gradient Gy matrix at the angular coordinate i and the frequency coordinate j , that is, at the angular coordinate i and the frequency coordinate j , the vertical gradient value obtained by performing convolution calculation on the boundary-padded two-dimensional matrix Matrix_padded of full-angle Doppler frequency shift spectral lines through the vertical Sobel operator Sobel_y.
[0025] Preferably, the calculation module calculates Gx and Gy through convolution operations, extracts the 3×3 neighborhood window of each data point (i, j) in Matrix_padded, and performs convolution calculations with Sobel_x and Sobel_y respectively. After that, it further includes:
[0026] The calculation module calculates the gradient magnitude matrix G_mag and the gradient direction matrix G_dir using Gx and Gy. The calculation formulas are:
[0027] ,
[0028] ,
[0029] In the formula, the gradient magnitude matrix G_mag represents the severity of the spectral line intensity change; the gradient direction matrix G_dir is in radians, and its value range is [-π, π], representing the direction of the spectral line intensity change; G_mag(i, j) represents the value of the gradient magnitude matrix G_mag at the angular coordinate i and the frequency coordinate j i.e., the gradient magnitude calculated by performing the square root operation on the sum of the squares of the horizontal gradient value Gx(i, j) and the vertical gradient value Gy(i, j); G_dir(i, j) represents the value of the gradient direction matrix G_dir at the angular coordinate i and the frequency coordinate j i.e., the gradient direction radian value calculated by performing the arctangent operation on the horizontal gradient value Gx(i, j) and the vertical gradient value Gy(i, j).
[0030] Preferably, the calculation module quantizes the gradient direction matrix G_dir into four main directions and performs non-maximum suppression on each data point (i, j) in G_mag to obtain the non-maximum suppression gradient matrix G_nms, including:
[0031] The calculation module initializes the non-maximum suppression gradient matrix G_nms. Among them, the size of the non-maximum suppression gradient matrix G_nms is the same as that of the gradient magnitude matrix G_mag, and the elements of the non-maximum suppression gradient matrix G_nms are initialized to zero;
[0032] The calculation module quantizes the gradient direction matrix G_dir into four main directions. Among them, the four main directions of the gradient direction matrix G_dir are 0°, 45°, 90°, and 135° respectively. The calculation formula for the quantized gradient direction Angle_deg(i, j) of each data point (i, j) in G_dir is:
[0033] ,
[0034] Wherein, the angular range of the quantized gradient direction Angle_deg(i,j) is [0°, 180°).
[0035] Preferably, the calculation module quantizes the gradient direction matrix G_dir into four main directions, and then further includes:
[0036] The calculation module performs non-maximum suppression on each data point (i,j) in G_mag, where the ranges of i and j in the data point (i,j) need to exclude the boundaries of the data matrix to avoid out-of-bounds neighborhood access;
[0037] The calculation module selects two neighboring data points in the gradient direction for gradient magnitude comparison according to the quantized gradient direction Angle_deg(i,j) of each data point (i,j) in G_mag, and obtains the non-maximum suppression gradient matrix G_nms according to the comparison result. The calculation formula is as follows:
[0038] ,
[0039] ,
[0040] Wherein, max(Nei(i,j)) represents at the angular coordinate i and the frequency coordinate j the maximum value of the gradient magnitudes of the two neighboring data points selected according to the quantized gradient direction Angle_deg(i,j).
[0041] Preferably, the calculation module calculates the local mean matrix Local_mean and the local standard deviation matrix Local_std using G_nms, calculates the dynamic threshold matrix Threshold_map using Local_mean and Local_std, performs thresholding on the dynamic threshold matrix Threshold_map to obtain the sparse spectral gradient map G_sparse, and displays the sparse spectral gradient map G_sparse through the display module, including:
[0042] The calculation module calculates the local mean matrix Local_mean using G_nms, filters the non-maximum suppression gradient matrix G_nms using a 3×3 mean filter to obtain the average gradient magnitude of the 3×3 neighborhood of each data point. Wherein, the calculation formula of Local_mean(i,j) is;
[0043] ,
[0044] Wherein, Local_mean(i,j) represents the local mean matrix Local_mean at the angular coordinate i and the frequency coordinatej The value at, i.e., the local average gradient magnitude obtained by performing neighborhood averaging on the gradient matrix G_nms after non-maximum suppression using a 3×3 mean filter; u represents the offset in the angular coordinate; v represents the offset in the frequency coordinate; K_mean represents the mean filter kernel, and the expression of K_mean is:
[0045] .
[0046] Preferably, the calculation module calculates the local mean matrix Local_mean using G_nms, filters the non-maximum suppression gradient matrix G_nms using a 3×3 mean filter to obtain the average gradient magnitude of the 3×3 neighborhood of each data point, and then further includes:
[0047] The calculation module calculates the local standard deviation matrix Local_std, filters the non-maximum suppression gradient matrix G_nms using a standard deviation filter to obtain the standard deviation of the gradient magnitude of the 3×3 neighborhood of each data point. Among them, the window size of the standard deviation filter is 3×3, and the calculation formula of Local_std(i,j) is:
[0048] ,
[0049] In the formula, Local_std(i,j) represents the value of the local standard deviation matrix Local_std at the angular coordinate i and the frequency coordinate j ;
[0050] The calculation module calculates the dynamic threshold matrix Threshold_map. Among them, the calculation formula of the dynamic threshold Threshold_map(i,j) of each data point (i,j) in Threshold_map is:
[0051] ,
[0052] In the formula, Local_mean(i,j) is the value of the data point (i,j) in the local mean matrix Local_mean, Local_std(i,j) is the value of the data point (i,j) in the local standard deviation matrix Local_std, k is the adaptive threshold coefficient, which is an adjustable parameter, k The value range of is 0.5 - 2, which is used to control the threshold sensitivity and the sparsity of the spectrogram.
[0053] Preferably, after the calculation module calculates the dynamic threshold matrix Threshold_map, it further includes:
[0054] The computing module performs thresholding to generate a sparse spectral gradient map G_sparse. Among them, for the data point (i, j), if the value of the non-maximum suppression gradient matrix G_nms(i, j) is greater than the dynamic threshold threshold_map(i, j), the gradient value is retained in the sparse spectral gradient map G_sparse. If the value of the non-maximum suppression gradient matrix G_nms(i, j) is less than or equal to the dynamic threshold threshold_map(i, j), the gradient value is set to zero in the sparse spectral gradient map G_sparse. The calculation formula is as follows:
[0055] ,
[0056] In the formula, G_sparse(i, j) is the data point (i, j) in the sparse spectral gradient map;
[0057] The computing module outputs the sparse spectral gradient map G_sparse to the display module, and the display module displays the sparse spectral gradient map G_sparse.
[0058] The present invention also proposes a spectral line graph optimization system for adaptive threshold sparse gradients, which applies the spectral line graph optimization method for adaptive threshold sparse gradients. The system includes a computing module and a display module.
[0059] Through the above technical solutions, the following beneficial effects can be achieved:
[0060] Compared with the prior art, the spectral line graph optimization method for adaptive threshold sparse gradients proposed by the present invention has the following beneficial effects: a dynamic threshold matrix Threshold_map is generated by combining the local mean and standard deviation with an adaptive coefficient, replacing the traditional fixed threshold or manually preset threshold. It can adjust the threshold in real time according to the local noise level, effectively suppressing spike noise and random interference, especially performing excellently in a low signal-to-noise ratio environment and without manual intervention or data training, and is suitable for the actual scenario where marine sonar data is scarce; by performing maximum suppression combined with gradient direction quantization, the gradient direction is quantized into four main directions, greatly reducing the computational complexity. At the same time, key gradient points are screened through non-maximum suppression, and only the significant gradient features in the main direction are retained, thus avoiding the problem of gradient adhesion artifacts caused by noise, improving the sparsity and interpretability of the full-angle Doppler frequency shift spectral line graph, and also being able to reduce redundant data processing and improve the operation efficiency of the optimization algorithm. BRIEF DESCRIPTION OF THE DRAWINGS
[0061] To more clearly illustrate the technical solutions in the embodiments of the present invention or the prior art, the following will briefly introduce the drawings required for the description of the embodiments or the prior art. Obviously, the drawings in the following description are only some embodiments of the present invention. For those of ordinary skill in the art, without creative efforts, other drawings can be obtained based on the structures shown in these drawings.
[0062] Figure 1 It is a flowchart of the steps of the first embodiment of a method for optimizing a spectrogram with an adaptive threshold sparse gradient proposed by the present invention;
[0063] Figure 2 It is a schematic diagram of the input data of the Doppler frequency shift spectrogram matrix of the ninth embodiment of a method for optimizing a spectrogram with an adaptive threshold sparse gradient proposed by the present invention;
[0064] Figure 3 It is a schematic diagram of the optimized result of the spectrogram of the ninth embodiment of a method for optimizing a spectrogram with an adaptive threshold sparse gradient proposed by the present invention. Detailed implementation manners
[0065] It should be understood that the specific embodiments described herein are only used to explain the present invention and are not used to limit the present invention.
[0066] The present invention proposes a method and system for optimizing a spectrogram with an adaptive threshold sparse gradient.
[0067] As shown in the Figure 1 accompanying drawings, in the first embodiment of a method for optimizing a spectrogram with an adaptive threshold sparse gradient proposed by the present invention, this method is applied to a spectrogram optimization system with an adaptive threshold sparse gradient; the system includes a calculation module and a display module; this embodiment includes the following steps:
[0068] Step S110: The calculation module imports a two-dimensional matrix of full-angle Doppler frequency shift spectrograms (i.e., Matrix), where the size of the two-dimensional matrix is M×N, M is the size of the two-dimensional matrix in the angle dimension, N is the size of the two-dimensional matrix in the frequency dimension, and the matrix element value of the two-dimensional matrix represents the spectrogram intensity value at the corresponding angle and frequency coordinates.
[0069] Step S120: The calculation module performs boundary filling on the imported two-dimensional matrix of full-angle Doppler frequency shift spectrograms, calculates the horizontal gradient Gx and the vertical gradient Gy through convolution operations, and calculates the gradient magnitude matrix G_mag and the gradient direction matrix G_dir using Gx and Gy.
[0070] Step S130: The calculation module quantizes the gradient direction matrix G_dir into four main directions, and performs non-maximum suppression on each data point (i, j) in G_mag to obtain the non-maximum suppression gradient matrix G_nms.
[0071] Step S140: The calculation module calculates the local mean matrix Local_mean and the local standard deviation matrix Local_std using G_nms, calculates the dynamic threshold matrix Threshold_map using Local_mean and Local_std, performs thresholding on the dynamic threshold matrix Threshold_map to obtain the sparse spectral gradient map G_sparse, and displays the sparse spectral gradient map G_sparse through the display module.
[0072] Compared with the prior art, the beneficial effects of an optimized method for spectral line diagrams of adaptive threshold sparse gradients proposed by the present invention are as follows: by combining the local mean and standard deviation with an adaptive coefficient to generate the dynamic threshold matrix Threshold_map, replacing the traditional fixed threshold or manually preset threshold, it can adjust the threshold in real time according to the local noise level, effectively suppressing spurious noise and random interference, especially performing excellently in a low signal-to-noise ratio environment and without manual intervention or data training, being applicable to the actual scenario where marine sonar data is scarce; by performing maximum suppression combined with gradient direction quantization, quantizing the gradient direction into four main directions, it greatly reduces the computational complexity. At the same time, by screening key gradient points through non-maximum suppression and only retaining the significant gradient features in the main directions, it can avoid the problem of gradient adhesion artifacts caused by the inclusion of noise, improve the sparsity and interpretability of the full-angle Doppler frequency shift spectral line diagram, and can also reduce redundant data processing and improve the operating efficiency of the optimization algorithm.
[0073] In the second embodiment of an optimized method for spectral line diagrams of adaptive threshold sparse gradients proposed by the present invention, based on the first embodiment, step S120 includes the following steps:
[0074] Step S210: The calculation module defines the Sobel operator, where the Sobel operator is used to calculate the discrete gradient approximation values of the two-dimensional matrix of the full-angle Doppler frequency shift spectral line in the angle and frequency directions to represent the spectral intensity change rate. The Sobel operator includes the horizontal Sobel operator Sobel_x and the vertical Sobel operator Sobel_y, and the expressions are respectively:
[0075] ,
[0076] .
[0077] Step S220: The calculation module performs boundary padding on the input two-dimensional matrix of full-angle Doppler frequency shift spectral lines to ensure the effectiveness of neighborhood operations on data points at the spectral graph edge, thereby obtaining the two-dimensional matrix Matrix_padded of full-angle Doppler frequency shift spectral lines after boundary padding. The calculation formula is as follows:
[0078] ,
[0079] In the formula, the matrix size of the two-dimensional matrix of full-angle Doppler frequency shift spectral lines after boundary padding is (M + 2) × (N + 2) to ensure that the operation of the Sobel operator at the edge data points will not exceed the boundary; Matrix(i, j) represents the spectral line intensity value of the two-dimensional matrix Matrix of full-angle Doppler frequency shift spectral lines at the angle coordinate i and the frequency coordinate j ; Matrix_padded(i, j) represents the spectral line intensity value of the two-dimensional matrix Matrix_padded of full-angle Doppler frequency shift spectral lines after boundary padding at the angle coordinate i and the frequency coordinate j .
[0080] In the third embodiment of an optimized method for spectral line graphs with an adaptive threshold sparse gradient proposed by the present invention, based on the second embodiment, after step S220, the following steps are further included:
[0081] Step S310: The calculation module initializes the horizontal gradient matrix Gx and the vertical gradient matrix Gy. Among them, the sizes of the horizontal gradient matrix Gx and the vertical gradient matrix Gy are the same as those of the input two-dimensional matrix of full-angle Doppler frequency shift spectral lines, and the elements of the horizontal gradient matrix Gx and the vertical gradient matrix Gy are initialized to zero.
[0082] Step S320: The calculation module calculates Gx and Gy through convolution operations, extracts the 3×3 neighborhood window of each data point (i, j) of Matrix_padded, and performs convolution calculations with Sobel_x and Sobel_y respectively. The calculation formula is as follows:
[0083] ,
[0084] In the formula, Sobel_x(m, n) represents the coefficient value of the horizontal Sobel operator Sobel_x at the coordinate (m, n), and the summation operation is performed for m and n in the range of 1 - 3; the horizontal gradient matrix Gx represents the change rate of spectral line intensity in the angle dimension; Gx(i, j) represents the value of the horizontal gradient Gx matrix at the angle coordinate i and the frequency coordinate j , that is, at the angle coordinate i and the frequency coordinate jThe horizontal gradient value obtained by convolving the two-dimensional matrix Matrix_padded of the full-angle Doppler frequency shift spectrum line after boundary padding with the horizontal Sobel operator Sobel_x in the horizontal direction.
[0085] 。
[0086] In the formula, Sobel_y(m,n) represents the coefficient value of the vertical Sobel operator Sobel_y at the coordinate (m,n), and the summation operation is performed for m and n in the range of 1-3; the vertical gradient Gy represents the change rate of the spectral line intensity in the frequency dimension; Gy(i,j) represents the vertical gradient Gy matrix at the angular coordinate i and the frequency coordinate j The value at, that is, the vertical gradient value obtained by convolving the two-dimensional matrix Matrix_padded of the full-angle Doppler frequency shift spectrum line after boundary padding with the vertical Sobel operator Sobel_y at the angular coordinate i and the frequency coordinate j 。
[0087] In the fourth embodiment of an optimized method for a spectral line graph with an adaptive threshold sparse gradient proposed in the present invention, based on the third embodiment, step S320, the following steps are further included:
[0088] Step S410: The calculation module calculates the gradient magnitude matrix G_mag and the gradient direction matrix G_dir using Gx and Gy, and the calculation formula is:
[0089] ,
[0090] ,
[0091] In the formula, the gradient magnitude matrix G_mag represents the severity of the spectral line intensity change; the gradient direction matrix G_dir is in radians, and the value range is [-π,π], representing the direction of the spectral line intensity change; G_mag(i,j) represents the value of the gradient magnitude matrix G_mag at the angular coordinate i and the frequency coordinate j The value at, that is, the gradient magnitude calculated by performing a square sum and square root operation on the values of the horizontal gradient value Gx(i,j) and the vertical gradient value Gy(i,j); G_dir(i,j) represents the value of the gradient direction matrix G_dir at the angular coordinate i and the frequency coordinate j The value at, that is, the gradient direction radian value calculated by performing an arctangent operation on the horizontal gradient value Gx(i,j) and the vertical gradient value Gy(i,j).
[0092] In the fifth embodiment of an optimized method for spectrogram using adaptive threshold sparse gradient proposed by the present invention, based on the fourth embodiment, step S130 includes the following steps:
[0093] Step S510: The computing module initializes the non-maximum suppression gradient matrix G_nms. Here, the size of the non-maximum suppression gradient matrix G_nms is the same as that of the gradient magnitude matrix G_mag, and the elements of the non-maximum suppression gradient matrix G_nms are initialized to zero.
[0094] Step S520: The computing module quantizes the gradient direction matrix G_dir into four main directions. Here, the four main directions of the gradient direction matrix G_dir are 0°, 45°, 90°, and 135° respectively. The calculation formula for the quantized gradient direction Angle_deg(i,j) of each data point (i,j) in G_dir is:
[0095] ,
[0096] In the formula, the angle range of the quantized gradient direction Angle_deg(i,j) is [0°, 180°).
[0097] In the sixth embodiment of an optimized method for spectrogram using adaptive threshold sparse gradient proposed by the present invention, based on the fifth embodiment, after step S520, the following steps are further included:
[0098] Step S610: The computing module performs non-maximum suppression on each data point (i,j) in G_mag. Here, the value ranges of i and j in the data point (i,j) need to exclude the data matrix boundary to avoid out-of-bounds neighborhood access.
[0099] Step S620: The computing module selects two neighboring data points in the gradient direction for gradient magnitude comparison according to the quantized gradient direction Angle_deg(i,j) of each data point (i,j) in G_mag, and obtains the non-maximum suppression gradient matrix G_nms according to the comparison result. The calculation formula is as follows:
[0100] ,
[0101] ,
[0102] In the formula, max(Nei(i,j)) represents at the angular coordinate i and the frequency coordinate j the maximum value of the gradient magnitudes of the two neighboring data points selected according to the quantized gradient direction Angle_deg(i,j).
[0103] In the seventh embodiment of an optimized method for spectrogram based on adaptive threshold sparse gradient proposed by the present invention, based on the sixth embodiment, step S140 includes the following steps:
[0104] Step S710: The calculation module uses G_nms to calculate the local mean matrix Local_mean, and filters the non-maximum suppression gradient matrix G_nms using a 3×3 mean filter to obtain the average gradient amplitude of the 3×3 neighborhood of each data point. The calculation formula of Local_mean(i,j) is;
[0105] ,
[0106] In the formula, Local_mean(i,j) represents the value of the local mean matrix Local_mean at the angular coordinate i and the frequency coordinate j , that is, the local average gradient amplitude obtained by performing neighborhood averaging on the gradient matrix G_nms after non-maximum suppression using a 3×3 mean filter; u represents the offset at the angular coordinate; v represents the offset at the frequency coordinate; K_mean represents the mean filter kernel, and the expression of K_mean is:
[0107] .
[0108] In the eighth embodiment of an optimized method for spectrogram based on adaptive threshold sparse gradient proposed by the present invention, based on the seventh embodiment, after step S710, the following steps are further included:
[0109] Step S810: The calculation module calculates the local standard deviation matrix Local_std, and filters the non-maximum suppression gradient matrix G_nms using a standard deviation filter to obtain the standard deviation of the gradient amplitude of the 3×3 neighborhood of each data point. The window size of the standard deviation filter is 3×3, and the calculation formula of Local_std(i,j) is:
[0110] ,
[0111] In the formula, Local_std(i,j) represents the value of the local standard deviation matrix Local_std at the angular coordinate i and the frequency coordinate j .
[0112] Step S820: The calculation module calculates the dynamic threshold matrix Threshold_map. The calculation formula of the dynamic threshold Threshold_map(i,j) for each data point (i,j) in Threshold_map is:
[0113] ,
[0114] Wherein, Local_mean(i,j) is the value of the data point (i,j) in the local mean matrix Local_mean, and Local_std(i,j) is the value of the data point (i,j) in the local standard deviation matrix Local_std. k is the adaptive threshold coefficient, which is an adjustable parameter. k The value range of is 0.5 - 2, which is used to control the threshold sensitivity and the sparsity of the spectrogram.
[0115] In the ninth embodiment of an adaptive threshold sparse gradient spectrogram optimization method proposed by the present invention, based on the eighth embodiment, after step S820, the following steps are further included:
[0116] Step S910: The calculation module performs thresholding to generate a sparse spectral gradient map G_sparse. Among them, for the data point (i,j), if the value of the non-maximum suppression gradient matrix G_nms(i,j) is greater than the dynamic threshold threshold_map(i,j), then the gradient value is retained in the sparse spectral gradient map G_sparse. If the value of the non-maximum suppression gradient matrix G_nms(i,j) is less than or equal to the dynamic threshold threshold_map(i,j), then the gradient value is set to zero in the sparse spectral gradient map G_sparse. The calculation formula is:
[0117] ,
[0118] Wherein, G_sparse(i,j) is the data point (i,j) in the sparse spectral gradient map.
[0119] Step S920: The calculation module outputs the sparse spectral gradient map G_sparse to the display module, and the display module displays the sparse spectral gradient map G_sparse.
[0120] As shown in and attached Figure 2 and attached Figure 3 shown, attached Figure 3 is a schematic diagram of the optimization result of the spectrogram of the adaptive threshold sparse gradient in the embodiment of the present invention, that is, the output result diagram. In the case of complex background noise, strong offshore reverberation, and strong terrain reverberation, the solution of the present application has the following advantages:
[0121] 1. The anti-noise interference ability is significantly improved, and it can adjust the threshold in real time according to the local noise level, effectively suppressing spike noise and random interference.
[0122] 2. Gradient sparsification enhancement, non-maximum suppression combined with gradient direction quantization, only retaining significant gradient features in the main direction, avoiding gradient adhesion problems caused by noise, and improving the sparsity and interpretability of the spectrogram.
[0123] 3. Adaptive gradient optimization, calculating dynamic thresholds through local statistical characteristics, taking into account local context information, avoiding over-segmentation or under-segmentation problems caused by global thresholds, and ensuring the complete retention of the edges of Doppler shift spectrograms.
[0124] 4. Direction quantization simplifies calculations, quantizing gradient directions into four main directions, greatly reducing computational complexity. At the same time, key gradient points are screened through non-maximum suppression, reducing redundant data processing and improving the running efficiency of the algorithm.
[0125] 5. Strong robustness, the adaptive coefficient dynamically adjusts the threshold sensitivity according to specific requirements, enhancing the generality and scenario adaptability of the method. It shows good stability and applicability in different sea areas, different target shapes, different reverberation intensities, and background noise conditions.
[0126] The present invention also proposes a spectrogram optimization system with adaptive threshold sparse gradients, applying the spectrogram optimization method with adaptive threshold sparse gradients; the system includes a calculation module and a display module.
[0127] The serial numbers of the above embodiments of the present invention are only for description and do not represent the advantages or disadvantages of the embodiments.
[0128] The embodiments of the present invention have been described above in conjunction with the accompanying drawings. However, the present invention is not limited to the above specific embodiments. The above specific embodiments are merely illustrative and not restrictive. Under the inspiration of the present invention, those of ordinary skill in the art can also make many forms without departing from the purpose of the present invention and the scope protected by the claims. These all fall within the protection scope of the present invention.
Claims
1. An optimized method for spectral line graphs with adaptive threshold sparse gradients, characterized in that, Spectral Line Graph Optimization System Applied to Adaptive Threshold Sparse Gradient The system includes a calculation module and a display module; The method includes: The calculation module imports a two-dimensional matrix of full-angle Doppler frequency shift spectral lines. Among them, the size of the two-dimensional matrix is M×N, M is the size of the two-dimensional matrix in the angle dimension, N is the size of the two-dimensional matrix in the frequency dimension, and the matrix element value of the two-dimensional matrix represents the spectral line intensity value at the corresponding angle and frequency coordinates; The calculation module performs boundary padding on the input two-dimensional matrix of full-angle Doppler frequency shift spectral lines, calculates the horizontal gradient Gx and the vertical gradient Gy through convolution operations, and calculates the gradient magnitude matrix G_mag and the gradient direction matrix G_dir using Gx and Gy; The calculation module quantizes the gradient direction matrix G_dir into four main directions, and performs non-maximum suppression on each data point (i,j) in G_mag to obtain the non-maximum suppression gradient matrix G_nms; The calculation module calculates the local mean matrix Local_mean and the local standard deviation matrix Local_std using G_nms, calculates the dynamic threshold matrix Threshold_map using Local_mean and Local_std, performs thresholding on the dynamic threshold matrix Threshold_map to obtain the sparse spectral gradient map G_sparse, and displays the sparse spectral gradient map G_sparse through the display module.
2. The optimized method for spectral line graph of adaptive threshold sparse gradient according to claim 1, wherein The calculation module performs boundary padding on the input two-dimensional matrix of full-angle Doppler frequency shift spectral lines, calculates the horizontal gradient Gx and the vertical gradient Gy through convolution operations, and calculates the gradient magnitude matrix G_mag and the gradient direction matrix G_dir, including: The calculation module defines the Sobel operator. Among them, the Sobel operator is used to calculate the discrete gradient approximation values of the two-dimensional matrix of full-angle Doppler frequency shift spectral lines in the angle and frequency directions to represent the spectral intensity change rate. The Sobel operator includes the horizontal direction Sobel operator Sobel_x and the vertical direction Sobel operator Sobel_y, and the expressions are respectively: , , The calculation module performs boundary padding on the input two-dimensional matrix of full-angle Doppler frequency shift spectral lines to ensure the effectiveness of neighborhood operations on data points at the edge of the spectral graph, thereby obtaining the boundary-padded two-dimensional matrix of full-angle Doppler frequency shift spectral lines Matrix_padded. The calculation formula is: , In the formula, the matrix size of the boundary-padded two-dimensional matrix of full-angle Doppler frequency shift spectral lines is (M + 2)×(N + 2) to ensure that the operation of the Sobel operator at the edge data points will not exceed the boundary; Matrix(i,j) represents the spectral line intensity value of the two-dimensional matrix Matrix of full-angle Doppler frequency shift spectral lines at the angle coordinate i and the frequency coordinate j; Matrix_padded(i,j) represents the spectral line intensity value of the boundary-padded two-dimensional matrix Matrix_padded of full-angle Doppler frequency shift spectral lines at the angle coordinate i and the frequency coordinate j.
3. An optimized method for spectral line graph of adaptive threshold sparse gradient according to claim 2, characterized in that, The computing module performs boundary padding on the input two-dimensional matrix of full-angle Doppler frequency shift spectral lines to ensure the effectiveness of neighborhood operations on data points at the spectral map edges, thereby obtaining Matrix_padded. Subsequently, it also includes: The computing module initializes the horizontal gradient matrix Gx and the vertical gradient matrix Gy. Here, the sizes of the horizontal gradient matrix Gx and the vertical gradient matrix Gy are the same as those of the input two-dimensional matrix of full-angle Doppler frequency shift spectral lines, and the elements of the horizontal gradient matrix Gx and the vertical gradient matrix Gy are initialized to zero; The computing module calculates Gx and Gy through convolution operations, extracts the 3×3 neighborhood window of each data point (i,j) in Matrix_padded, and performs convolution calculations with Sobel_x and Sobel_y respectively. The calculation formula is: , Wherein, Sobel_x(m,n) represents the coefficient value of the Sobel_x operator in the horizontal direction at the coordinate (m,n), and the summation operation is performed for m and n within the range of 1-3; the horizontal gradient matrix Gx represents the change rate of the spectral line intensity in the angular dimension; Gx(i,j) represents the value of the horizontal gradient Gx matrix at the angular coordinate i and the frequency coordinate j at, that is, at the angular coordinate i and the frequency coordinate j the horizontal gradient value obtained by convolving the two-dimensional matrix Matrix_padded of the full-angle Doppler frequency shift spectral line after boundary filling with the Sobel_x operator in the horizontal direction; , Wherein, Sobel_y(m,n) represents the coefficient value of the Sobel_y operator in the vertical direction at the coordinate (m,n), and the summation operation is performed for m and n within the range of 1-3; the vertical gradient Gy represents the change rate of the spectral line intensity in the frequency dimension; Gy(i,j) represents the value of the vertical gradient Gy matrix at the angular coordinate i and the frequency coordinate j i.e., the vertical gradient value obtained by convolving the two-dimensional matrix Matrix_padded of the full-angle Doppler shift spectral line after boundary filling with the Sobel_y operator in the vertical direction at the angular coordinate i and the frequency coordinate j .
4. An optimized method for spectrogram of adaptive threshold sparse gradient according to claim 3, characterized in that The computing module calculates Gx and Gy through convolution operations, extracts the 3×3 neighborhood window of each data point (i,j) in Matrix_padded, and performs convolution calculations with Sobel_x and Sobel_y respectively. Subsequently, it also includes: The computing module calculates the gradient magnitude matrix G_mag and the gradient direction matrix G_dir using Gx and Gy. The calculation formula is: , , In the formula, the gradient magnitude matrix G_mag represents the severity of the spectral line intensity change; the gradient direction matrix G_dir is in radian value, and its value range is [-π, π], representing the direction of the spectral line intensity change; G_mag(i,j) represents the value of the gradient magnitude matrix G_mag at the angular coordinate i and the frequency coordinate j , that is, the gradient magnitude calculated by taking the square root of the sum of the squares of the horizontal gradient value Gx(i,j) and the vertical gradient value Gy(i,j); G_dir(i,j) represents the value of the gradient direction matrix G_dir at the angular coordinate i and the frequency coordinate j , that is, the gradient direction radian value calculated by the arctangent operation of the horizontal gradient value Gx(i,j) and the vertical gradient value Gy(i,j).
5. An optimized method for spectral line graph of adaptive threshold sparse gradient according to claim 4, characterized in that The computing module quantizes the gradient direction matrix G_dir into four main directions, and performs non-maximum suppression on each data point (i,j) in G_mag to obtain the non-maximum suppression gradient matrix G_nms, including: The computing module initializes the non-maximum suppression gradient matrix G_nms. Here, the size of the non-maximum suppression gradient matrix G_nms is the same as that of the gradient magnitude matrix G_mag, and the elements of the non-maximum suppression gradient matrix G_nms are initialized to zero; The computing module quantizes the gradient direction matrix G_dir into four main directions. Here, the four main directions of the gradient direction matrix G_dir are 0°, 45°, 90°, and 135° respectively. The calculation formula for the quantized gradient direction Angle_deg(i,j) of each data point (i,j) in G_dir is: , In the formula, the angular range of the quantized gradient direction Angle_deg(i,j) is [0°, 180°).
6. An optimized method for spectral line graph of adaptive threshold sparse gradient according to claim 5, characterized in that The computing module quantizes the gradient direction matrix G_dir into four main directions. Subsequently, it also includes: The computing module performs non-maximum suppression on each data point (i,j) in G_mag. Here, the value ranges of i and j in the data point (i,j) need to exclude the data matrix boundary to avoid out-of-bounds neighborhood access; The computing module selects two neighborhood data points in the gradient direction for gradient magnitude comparison according to the quantized gradient direction Angle_deg(i,j) of each data point (i,j) in G_mag, and obtains the non-maximum suppression gradient matrix G_nms according to the comparison result. The calculation formula is as follows: , , where max(Nei(i,j)) represents the maximum value of the gradient magnitudes of two neighboring data points selected according to the quantization gradient direction Angle_deg(i,j) at the angular coordinate i and the frequency coordinate j .
7. An optimized method for spectral line graph of adaptive threshold sparse gradient according to claim 6, characterized in that The calculation module uses G_nms to calculate the local mean matrix Local_mean and the local standard deviation matrix Local_std, uses Local_mean and Local_std to calculate the dynamic threshold matrix Threshold_map, performs thresholding on the dynamic threshold matrix Threshold_map to obtain the sparse spectral gradient map G_sparse, and displays the sparse spectral gradient map G_sparse through the display module, including: The calculation module uses G_nms to calculate the local mean matrix Local_mean, filters the non-maximum suppression gradient matrix G_nms using a 3×3 mean filter to obtain the average gradient magnitude of the 3×3 neighborhood of each data point. Among them, the calculation formula of Local_mean(i,j) is; , Wherein, Local_mean(i,j) represents the value of the local mean matrix Local_mean at the angular coordinate i and the frequency coordinate j , that is, the local average gradient amplitude obtained by performing neighborhood averaging on the gradient matrix G_nms after non-maximum suppression through a 3×3 mean filter; u represents the offset at the angular coordinate; v represents the offset at the frequency coordinate; K_mean represents the mean filter kernel, and the expression of K_mean is: 。 8. An optimized method for spectral line graph of adaptive threshold sparse gradient according to claim 7, characterized in that The calculation module uses G_nms to calculate the local mean matrix Local_mean, filters the non-maximum suppression gradient matrix G_nms using a 3×3 mean filter to obtain the average gradient magnitude of the 3×3 neighborhood of each data point. After that, it further includes: The calculation module calculates the local standard deviation matrix Local_std, filters the non-maximum suppression gradient matrix G_nms using a standard deviation filter to obtain the standard deviation of the gradient magnitude of the 3×3 neighborhood of each data point. Among them, the window size of the standard deviation filter is 3×3, and the calculation formula of Local_std(i,j) is: , where Local_std(i,j) represents the value of the local standard deviation matrix Local_std at the angular coordinate i and the frequency coordinate j ; The calculation module calculates the dynamic threshold matrix Threshold_map. Among them, the calculation formula of the dynamic threshold Threshold_map(i,j) of each data point (i,j) in Threshold_map is: , Where, Local_mean(i,j) is the value of the data point (i,j) in the local mean matrix Local_mean, and Local_std(i,j) is the value of the data point (i,j) in the local standard deviation matrix Local_std. k is the adaptive threshold coefficient and is an adjustable parameter. k The value range of is 0.5 - 2, which is used to control the threshold sensitivity and the sparsity of the spectrogram.
9. An optimized method for spectral line graph of adaptive threshold sparse gradient according to claim 8, characterized in that The calculation module calculates the dynamic threshold matrix Threshold_map. After that, it further includes: The calculation module performs thresholding to generate the sparse spectral gradient map G_sparse. Among them, for the data point (i,j), if the value of the non-maximum suppression gradient matrix G_nms(i,j) is greater than the dynamic threshold threshold_map(i,j), then retain this gradient value in the sparse spectral gradient map G_sparse. If the value of the non-maximum suppression gradient matrix G_nms(i,j) is less than or equal to the dynamic threshold threshold_map(i,j), then set this gradient value to zero in the sparse spectral gradient map G_sparse. The calculation formula is: , In the formula, G_sparse(i,j) is the data point (i,j) in the sparse spectral gradient map; The calculation module outputs the sparse spectral gradient map G_sparse to the display module, and displays the sparse spectral gradient map G_sparse through the display module.
10. An optimized system for spectral line graphs with an adaptive threshold sparse gradient, characterized in that, Apply the spectral line graph optimization method of adaptive threshold sparse gradient as described in any one of claims 1-9; the system includes a calculation module and a display module.
Citation Information
Patent Citations
Marine phytoplankton image edge detection method based on non-local mean denoising mode
CN119722720A
Method and apparatus for automatic control of spectral doppler imaging
US20030158484A1