Sediment pesticide residue image recognition method based on deep learning
By combining multispectral microscopy and deep learning methods with channel registration and feature extraction techniques, the problem of accuracy and efficiency in identifying pesticide residues in sediments under complex environments has been solved, achieving efficient and reliable pesticide residue identification.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-07-24
- Publication Date
- 2026-03-24
AI Technical Summary
Traditional methods for identifying pesticide residues in sediments are susceptible to background noise when the sample texture is complex or the lighting is uneven. Binarization processing leads to the loss of subtle texture information, regional grayscale analysis cannot capture gradient direction and spatial distribution features, and artificial parameters lack a dynamic adjustment mechanism, resulting in insufficient recognition accuracy and low efficiency, making it difficult to apply on a large scale.
Multispectral microscopy combined with cross-correlation algorithm is used for channel registration. By extracting pixel density and gradient direction changes, regional confidence scores are generated. Target regions are selected using fast sorting and Canny algorithm. A ResNet-50 network with channel attention mechanism is introduced to extract deep texture features and generate spatially enhanced feature maps. Finally, a Softmax classifier is used to identify pesticide residue morphology.
It improves the anti-interference ability and feature discrimination of pesticide residue identification under complex lighting and noise environments, enhances identification accuracy and efficiency, solves the stability and reliability problems of traditional methods, and realizes reliable identification and large-scale application of pesticide residues.
Smart Images

Figure CN120894776B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of image analysis technology, and in particular to a method for identifying pesticide residue images in sediments based on deep learning. Background Technology
[0002] Image analysis technology involves using computer vision and image processing techniques to analyze, identify, and classify static or dynamic image information. Its core aspects include image preprocessing, feature extraction, target detection and recognition, and image segmentation and reconstruction. It is widely used in industrial inspection, medical diagnosis, remote sensing analysis, agricultural monitoring, and many other fields. In this field, by extracting and modeling features such as shape, texture, color, and edges of target objects in an image, the discrimination and recognition of specific targets can be achieved. Image analysis methods often rely on high-resolution image data and algorithm training, requiring the establishment of specific feature recognition models tailored to specific application scenarios.
[0003] Traditional methods for identifying pesticide residues in sediments involve acquiring images of sediment samples and determining pesticide residue levels through manual identification or simple threshold segmentation. The key technical challenge is identifying the distribution and presence of pesticide residues in sediment sample images. Traditional methods employ image binarization, color range thresholding, and regional grayscale difference analysis for preliminary identification. They rely on differences in color, brightness, or texture features between suspected pesticide residue areas and background areas for initial identification, and depend on manually set parameters for result interpretation.
[0004] Traditional methods rely on manually setting fixed thresholds and gray-scale difference analysis. When the sample texture is complex or the lighting is uneven, they are easily affected by background noise. Binarization processing leads to the loss of subtle texture information. Regional gray-scale analysis cannot capture gradient direction and spatial distribution features. Manual parameters lack a dynamic adjustment mechanism. When dealing with multiple batches of samples, repeated calibration is required, resulting in low efficiency and poor stability. The recognition accuracy for low-contrast or blurred edge areas is insufficient, which restricts the reliability of detection results and large-scale application. Summary of the Invention
[0005] To address the technical problems of traditional methods that rely on manually set fixed thresholds and gray-level difference analysis, are susceptible to background noise interference when sample textures are complex or lighting is uneven, suffer from loss of subtle texture information during binarization, fail to capture gradient direction and spatial distribution features in regional gray-level analysis, lack dynamic adjustment mechanisms for manual parameters, require repeated calibration for multiple batches of samples, resulting in low efficiency and poor stability, and have insufficient accuracy in recognizing low-contrast or blurred-edge regions, thus limiting the reliability and large-scale application of detection results, this invention provides a deep learning-based image recognition method for pesticide residues in sediments. The technical solution is as follows:
[0006] On the one hand, a deep learning-based image recognition method for pesticide residues in sediments is provided, which includes:
[0007] S1: Obtain visible light red, green and blue channel images and near-infrared high and low band images of sediment samples through multispectral microscopic imaging equipment, perform channel registration operation based on cross-correlation algorithm on the red channel image, and generate a multispectral image set;
[0008] S2: Based on the multispectral image set, extract the proportion of pixels with gray values greater than the gray threshold in the image region block as the pixel density parameter, use the Sobel operator to calculate the degree of change in local gradient direction, analyze the spatial distribution relationship of pixel gray values to calculate the texture contrast parameter, perform normalized weighted fusion, and generate a region credibility score.
[0009] S3: Call the region credibility score, sort it in descending order using the quick sorting algorithm, select the region blocks with the highest scores, detect the edge direction distribution based on the Canny algorithm, filter regions with concentrated main direction angles and edge connectivity that meet the conditions, and generate a set of credible regions.
[0010] S4: Input the set of trusted regions into the ResNet-50 backbone network with channel attention mechanism to extract deep texture features. Calculate the offset between the response value and the average response value in the spatial attention branch. Perform element-wise weighting operation with the deep texture features to generate a spatially enhanced feature map.
[0011] As a further aspect of the present invention, the spatially enhanced feature map is used to fuse spatial response and channel attention information as a high-dimensional feature representation of classification input, thereby enhancing the classifier's ability to perceive differences in pesticide residue morphology.
[0012] The multispectral image set includes a pixel-level registered image set, a visible and near-infrared composite spectral frame, and a channel fusion benchmark template. The regional credibility score includes image region gray-scale density index, local texture direction contrast parameter, and weighted fusion evaluation coefficient. The credibility region set includes a main direction concentrated region, an edge structure continuous region, and a texture feature stable region. The spatial enhancement feature map includes a spatial response offset matrix, a channel enhancement feature map, and a fusion representation feature layer.
[0013] As a further aspect of the present invention, the specific steps of S1 include:
[0014] S101: Acquire raw image data of sediment samples using multispectral microscopic imaging equipment, detect channel image band types, collect pixel matrices of red, green, blue, and near-infrared high-band and low-band images, normalize channel pixel gray values, and generate a set of channel gray-scale matrices.
[0015] S102: Based on the pixel matrices of the red channel and other channels in the channel grayscale matrix set, calculate the two-dimensional cross-correlation matrix between the channels and the red channel, identify the row and column offsets of the correlation coefficient positions, and generate channel registration offset data;
[0016] S103: Call the channel registration offset data to adjust the channel pixel position, reposition the image to a unified coordinate system, and fuse the five-channel images in the same pixel dimension to obtain a multispectral image set with channel pixel coordinates aligned.
[0017] As a further aspect of the present invention, the specific steps of S2 include:
[0018] S201: Based on the multispectral image set, after dividing the image region into blocks, the number of pixels with gray values greater than a set gray threshold in each region is counted sequentially. The ratio of the number of pixels to the total number of pixels in the region is calculated, and the distribution ratio of high gray value points in the image region is summarized to generate a pixel density ratio.
[0019] S202: Call the pixel density ratio, use the Sobel operator to extract the gradient change of the image region, calculate the gradient direction change amplitude of the local position of the pixel, count the change level in the region, and obtain the gradient fluctuation coefficient;
[0020] S203: Based on the gradient fluctuation coefficient and pixel density ratio, the region comprehensive score is calculated by normalization and weighted fusion. The comprehensive score is then linearly mapped to a set benchmark value to generate a region credibility score.
[0021] As a further aspect of the present invention, the grayscale threshold refers to a preset grayscale level value in a grayscale image, which divides the grayscale level of pixels in the image and distinguishes the differential grayscale level distribution within the image region. It is a scalar dynamically set based on the image statistical characteristics.
[0022] The pixel density ratio refers to the ratio between the number of pixels with gray values greater than the gray value threshold in the divided image region block and the total number of pixels in the image region.
[0023] The gradient fluctuation coefficient refers to the coefficient value that represents the gradient change level in the image region after calculating the gray-level gradient direction change amplitude of the local position of the pixel based on the edge detection operator.
[0024] The regional comprehensive score is a numerical index obtained by weighting the pixel density ratio and gradient fluctuation coefficient after normalization. The value reflects the numerical relationship between the differential feature parameters within the image region.
[0025] As a further aspect of the present invention, the specific steps of S3 include:
[0026] S301: Obtain the region confidence score, call each image region block after region division, sort them in descending order using a fast sorting algorithm, extract the region block number with the highest score value, and establish a sequence of region score values with the highest sorting.
[0027] S302: Based on the image data in the sorted top region score value sequence, call the Canny algorithm to extract the gradient direction of edge pixels, calculate the edge direction concentration index, and generate the edge direction concentration sequence.
[0028] S303: Based on the edge direction concentration sequence, combined with the edge image and concentration index, detect the edge connectivity structure, filter out the region blocks that do not meet the concentration and connectivity requirements, and obtain a set of reliable regions.
[0029] As a further aspect of the present invention, the specific steps of S4 include:
[0030] S401: Based on the set of trusted regions, input to the ResNet-50 backbone network with added channel attention mechanism, obtain the response amplitude of the channel feature map, determine the degree of change of response amplitude between channels and set key weights, perform channel-by-channel weighting, and generate channel-weighted feature maps.
[0031] S402: Call the channel weighted feature map, extract the local response intensity of each spatial location, combine it with the overall distribution characteristics of the channel it belongs to, establish a mapping matrix according to the spatial index, record the response fluctuation between local and global, and generate the offset response coefficient distribution map;
[0032] S403: Linearly superimpose the corresponding pixel values of the offset response coefficient distribution map and the channel weighted feature map, and expand the spatial enhanced feature map into a two-dimensional matrix according to the spatial dimension by combining the proportional relationship between the channel response weight and the spatial offset weight.
[0033] As a further embodiment of the present invention, the ResNet-50 backbone network with added channel attention mechanism is based on the original ResNet-50 structure, by introducing channel attention units in the residual connection path to generate channel-dimensional weight information, applying corresponding weighting processing to the channels in the feature map, and performing channel-dimensional feature recalibration.
[0034] The channel attention unit includes a global average pooling structure, a multilayer perceptron structure, and an activation function structure.
[0035] As a further aspect of the present invention, the method includes step S5:
[0036] S5: Input the spatial enhancement feature map into the spectral feature branch, extract the response difference map between the near-infrared high and low bands and the visible light channel respectively, stitch the difference map and the spatial enhancement feature map together in the channel dimension, input the Softmax classifier to output the three types of pesticide residue morphology classification labels: crystal precipitation, adsorption spots and chemical discoloration area.
[0037] The classification labels include labels for crystal precipitation type, adsorption spot type, and chemical discoloration area type.
[0038] As a further aspect of the present invention, the specific steps of S5 include:
[0039] S501: Based on the spatial enhancement feature map, input the high and low band regions of the near-infrared channel, extract the position grayscale response values, construct a difference map according to the pixel correspondence and organize it into a two-dimensional matrix format to generate a near-infrared response deviation matrix.
[0040] S502: Call the near-infrared response deviation matrix, calculate the channel response difference value between it and the visible light channel according to the position, establish the channel mapping format, and then perform channel splicing with the spatial enhancement feature map to generate a multi-channel fusion feature set.
[0041] S503: Based on the multi-channel fused feature set, input the normalized feature vector into the Softmax classifier, filter the category index corresponding to the probability value and assign a label to obtain the pesticide residue form classification label.
[0042] The beneficial effects of the technical solutions provided by the embodiments of the present invention include at least the following:
[0043] Multi-channel precise registration is achieved by combining multispectral microscopy with cross-correlation algorithms, enhancing the spatial consistency of multi-source data. A multi-dimensional quantitative evaluation system is constructed based on pixel density, gradient direction change, and texture contrast. The target area localization is optimized through fast sorting and edge direction filtering mechanisms. A channel attention mechanism is introduced to fuse spatial response offset, strengthening the correlation between deep texture features and local space. This solves the problems of single feature dependence and fixed artificial parameters in traditional methods, and improves the anti-interference ability and feature discrimination of pesticide residue identification under complex lighting and noise environments. Attached Figure Description
[0044] Figure 1 This is a schematic diagram of the workflow of the present invention. Detailed Implementation
[0045] The technical solution of the present invention will now be described with reference to the accompanying drawings.
[0046] In embodiments of the present invention, words such as "exemplarily," "for example," etc., are used to indicate that something is an example, illustration, or description. Any embodiment or design described as "exemplary" in the present invention should not be construed as being more preferred or advantageous than other embodiments or designs. Specifically, the use of the word "exemplary" is intended to present the concept in a concrete manner. Furthermore, in embodiments of the present invention, the meaning expressed by "and / or" can be both, or either one.
[0047] In the embodiments of this invention, the terms "image" and "picture" may sometimes be used interchangeably. It should be noted that, without emphasizing the distinction between them, they convey the same meaning. Similarly, the terms "of," "corresponding (relevant)," and "corresponding" may sometimes be used interchangeably. It should be noted that, without emphasizing the distinction between them, they convey the same meaning.
[0048] In this embodiment of the invention, sometimes a subscript such as W1 may be written in a non-subscript form such as W1. When the difference is not emphasized, the meaning they express is the same.
[0049] To make the technical problems, technical solutions and advantages of the present invention clearer, a detailed description will be given below in conjunction with the accompanying drawings and specific embodiments.
[0050] Please see Figure 1 This invention provides a method for identifying pesticide residue images in sediments based on deep learning. The processing flow of this method may include the following steps:
[0051] S1: Obtain visible light red, green and blue channel images and near-infrared high and low band images of sediment samples through multispectral microscopic imaging equipment, perform channel registration operation based on cross-correlation algorithm on the red channel image, and generate a multispectral image set;
[0052] S2: Based on a multispectral image set, extract the proportion of pixels with gray values greater than the gray threshold in the image region block as the pixel density parameter. Use the Sobel operator to calculate the degree of change in local gradient direction, analyze the spatial distribution relationship of pixel gray values to calculate the texture contrast parameter, perform normalized weighted fusion, and generate a region credibility score.
[0053] S3: Call the region credibility score, sort it in descending order using the quick sorting algorithm, select the region blocks with the highest scores, detect the edge direction distribution based on the Canny algorithm, filter regions with concentrated main direction angles and edge connectivity that meet the conditions, and generate a set of credible regions.
[0054] S4: Input the set of trustworthy regions into the ResNet-50 backbone network with channel attention mechanism to extract deep texture features. Calculate the offset between the response value and the average response value in the spatial attention branch, and perform element-wise weighting with the deep texture features to generate a spatially enhanced feature map.
[0055] S5: Input the spatial enhancement feature map into the spectral feature branch, extract the response difference map between the near-infrared high and low bands and the visible light channel respectively, stitch the difference map and the spatial enhancement feature map along the channel dimension, input the Softmax classifier to output the classification labels of three types of pesticide residue forms: crystal precipitation, adsorption spots and chemical discoloration area.
[0056] The multispectral image set includes a pixel-level registered image set, visible and near-infrared composite spectral frames, and channel fusion benchmark templates. The regional credibility score includes image region gray-scale density index, local texture direction contrast parameter, and weighted fusion evaluation coefficient. The credibility region set includes main direction concentrated region, edge structure continuous region, and texture feature stable region. The spatial enhancement feature map includes spatial response offset matrix, channel enhancement feature map, and fusion representation feature layer. The classification labels include crystal precipitation type label, adsorption spot type label, and chemical discoloration region type label.
[0057] Specifically, the steps in S1 are as follows:
[0058] S101: Acquire raw image data of sediment samples using multispectral microscopic imaging equipment, detect channel image band types, collect pixel matrices of red, green, blue, and near-infrared high-band and low-band images, normalize channel pixel gray values, and generate a set of channel gray-scale matrices.
[0059] Acquiring raw image data of sediment samples using multispectral microscopy involves sequentially completing steps such as parameter initialization before image acquisition, sample preprocessing, spectral channel switching control, image acquisition command transmission, and image reception and buffering. In practice, sediment samples with typical pesticide residue contamination, such as soil sediments collected from agricultural irrigation areas, are first selected. After removing surface impurities, drying, and flattening, the samples are placed under a multispectral imaging platform equipped with a spectral acquisition module supporting visible and near-infrared channels, with five channel band types set. The wavelength range includes visible light (red, 620–750 nm), green, 495–570 nm, and blue (450–495 nm), as well as near-infrared low-band (760–900 nm) and high-band (900–1100 nm). Channel band control uses a stepper motor to rotate the filter, emitting a light source to excite the sample's reflection signal. The acquisition module records the reflection images under multiple bands. After sending the image acquisition command, it waits for a confirmation signal to return after each channel's acquisition is complete before proceeding to the next band. After acquiring each channel's image, it is converted into a two-dimensional grayscale matrix, denoted as... Each element of the matrix corresponds to the grayscale value of a pixel in a given channel. The original grayscale value range is [0, 4095], which is transformed to the [0, 1] interval using linear normalization. The normalization formula is as follows:
[0060] ;
[0061] in and Let these be the minimum and maximum values in the original pixel matrix of a certain channel. For example, if the minimum pixel value in the red channel image is 83 and the maximum value is 3965, then for the (250, 250)th pixel in the red channel with an original value of 2680, the corresponding normalized grayscale value is:
[0062] ;
[0063] By processing the pixel matrix of each channel in this way, a set of five-channel normalized image grayscale matrices is finally obtained. It can be used for subsequent image fusion and recognition.
[0064] To clarify the data structure and acquisition quality, the grayscale values of the central region pixel (pixel position: 250×250) of sample A under five channels are collected as shown in the table below:
[0065] Table 1: Gray values of five channels in the central region of sample A
[0066]
[0067] As shown in Table 1, the normalized values of the five-channel pixels are concentrated between 0.4 and 0.88, indicating that the reflectance characteristics of the samples differ across multiple bands, which can be used to identify pesticide residue characteristics in the future.
[0068] The results show that after channel normalization, the pixel gray values have been mapped to a unified range, providing a standardized data basis for subsequent alignment and fusion of multi-channel images.
[0069] S102: Based on the pixel matrices of the red channel and other channels in the channel grayscale matrix set, calculate the two-dimensional cross-correlation matrix between the channels and the red channel, identify the row and column offsets of the correlation coefficient positions, and generate channel registration offset data.
[0070] Based on the red channel and the pixel matrices of the other channels in the set of channel grayscale matrices, extract the red channel grayscale matrix separately. With any target channel grayscale matrix X corresponds to the G, B, NIRL, and NIRH channels respectively. Each two-dimensional sliding window area (set window size to) (step size is 8 pixels) and Perform two-dimensional cross-correlation operations on corresponding regions of the same size. Set the coordinates of the upper left corner of the window region as (i, j), and denote the window as a submatrix in the red channel and the target channel, respectively. Calculate the cross-correlation coefficient between the two. This coefficient is defined as the standardized form of the sum of the products of the grayscale values of the two submatrices, used to measure the spatial similarity of grayscale patterns. In the specific calculation, the difference operation of corresponding elements in each window, the accumulation of multiplications, the calculation of standard deviation, and the normalization process are performed sequentially. If... and For example, let the average pixel values in the first sub-window be respectively and Then the cross-correlation coefficient is:
[0071] ;
[0072] For the window position in the target channel, calculate the above cross-correlation values with the red channel sequentially, and record the coordinates of the offset window center with the maximum cross-correlation coefficient. Let its coordinates be the center coordinates of the matching window in the red channel. The difference between rows and columns is , This is the registration offset of the target channel relative to the red channel. The above process is repeated to process the green, blue, and near-infrared low and high bands respectively, resulting in four two-dimensional vector-like offset data:
[0073] ;
[0074] To determine whether the offset range is within an acceptable range, an offset threshold range is set as follows: If the offset falls within this range, it is considered a valid registration offset result; otherwise, samples need to be extracted again or the image acquisition order adjusted. For example, in sample A, if the position of maximum cross-correlation in the green channel appears near the red channel reference point (250, 250) at (252, 248), then its offset is... In this way, a set of channel offset data relative to the red channel is obtained, which is used for image unified registration coordinate processing.
[0075] The results show that the spatial offset relationship between channels can be accurately quantified by the sliding window cross-correlation method, and the offset of the maximum cross-correlation point between channels can be directly used for the integration and adjustment of the image coordinate system.
[0076] S103: Call the channel registration offset data to adjust the channel pixel position, reposition the image to a unified coordinate system, and fuse the five-channel images on the same pixel dimension to obtain a multispectral image set with channel pixel coordinates aligned.
[0077] To adjust the channel pixel positions by calling the channel registration offset data, the pixel coordinates of the green, blue, and near-infrared low-band and high-band image matrices need to be shifted up or down, left or right by the corresponding offset amounts to perfectly align with the pixel coordinates of the red channel. In practice, the target channel pixel grayscale matrix is first read. And perform coordinate displacement operation on it, the displacement method is to perform coordinate displacement on each pixel position. Perform the conversion:
[0078] ;
[0079] in This represents the registration offset for that channel. To avoid data loss due to coordinate overflow, the channel is uniformly cropped to the effective image region after registration. For example, if the maximum positive offset is (+4, +3) and the negative offset is (-3, -5), then the central region of the original image is cropped to a size equal to the original image minus 8 pixels in height and 10 pixels in width for fusion. The normalized grayscale values of the corresponding pixel positions of the channel are integrated into a five-dimensional vector to form an image fusion matrix with a unified dimension.
[0080] ;
[0081] The integration process does not introduce additional weighting or interpolation; it directly combines normalized values into pixel feature vectors. In sediment sample images, each pixel is described by five-dimensional channel reflectance features to facilitate subsequent input data for pesticide residue identification based on depth models. To illustrate the data dimensionality after channel fusion, it is assumed that the effective image region size after registration is [missing information]. The dimension of the fused image matrix is That is, each coordinate point corresponds to a 5-dimensional grayscale vector. For example, the fused feature of point (250, 250) is... In this way, the channel images are repositioned to a unified coordinate system and fused.
[0082] The results show that the fused multi-channel image has complete registration and unified expression capabilities, and can be directly used for subsequent image recognition and feature extraction processing.
[0083] Specifically, the steps of S2 are as follows:
[0084] S201: Based on a multispectral image set, after dividing the image region into blocks, the number of pixels with gray values greater than a set gray threshold in each region is counted sequentially. The ratio of this number of pixels to the total number of pixels in the region is calculated, and the distribution ratio of high gray value points in the image region is summarized to generate a pixel density ratio.
[0085] Based on a multispectral image set, the image is first divided into several uniform regions. The criteria for region division are the image pixel size and resolution. For example, an image with a resolution of 1000×1000 pixels can be divided into 100 regions. The process involves dividing a pixel area into blocks. Then, the pixel values within each block are counted sequentially, and the number of pixels exceeding a set grayscale threshold is selected. This threshold is set based on the background noise of the reference image and the typical grayscale value of the target object; for example, a threshold of 200 can be set (assuming a grayscale range of 0-255). Within each block, the number of pixels with a value greater than 200 is counted, and their proportion of the total number of pixels in that block is calculated. For example, if a block contains 700 pixels with a value greater than 200, its pixel density ratio is... This method can summarize the distribution ratio of high grayscale points in multiple regions and generate the corresponding pixel density ratio for subsequent image processing.
[0086] S202: Call the pixel density ratio, use the Sobel operator to extract the gradient change of the image region, calculate the gradient direction change amplitude of the local position of the pixel, count the change level in the region, and obtain the gradient fluctuation coefficient.
[0087] After obtaining the pixel density ratio, the Sobel operator is used to extract the gradient changes in the image region. Specifically, the Sobel operator performs local neighborhood calculations on each pixel, extracting its gradient value by weighting it against its neighboring pixels. For each pixel in each region, the horizontal and vertical gradient values relative to its surrounding neighborhood are calculated, thus determining the magnitude of the gradient direction change at that point. For example, assuming the gradient value of a pixel in a certain region is 3 in the horizontal direction and 4 in the vertical direction, the total gradient at that point is... Next, the gradient values of all pixels within the entire region are statistically analyzed to obtain the gradient fluctuation coefficient of that region, which is the standard deviation of the pixel gradient within that region. If the gradient value of a pixel within a certain region is... The calculation process for its gradient fluctuation coefficient is as follows:
[0088] average gradient value ;
[0089] Gradient Standard Deviation ;
[0090] This result indicates that the gradient in this region fluctuates significantly and exhibits strong variations.
[0091] S203: Based on the gradient fluctuation coefficient and pixel density ratio, the region comprehensive score is calculated by normalization and weighted fusion. The comprehensive score is then linearly mapped to a set benchmark value to generate a region credibility score.
[0092] Based on the gradient fluctuation coefficient and pixel density ratio calculated above, they are normalized and then weighted and fused. The normalization operation first scales the value range of each parameter to the [0, 1] interval. Assuming the maximum pixel density ratio is 0.7 and the minimum is 0.02, and the pixel density ratio of a certain region is 0.07, the normalized result is:
[0093] Normalized pixel density ratio ;
[0094] Similarly, the normalization process for the gradient fluctuation coefficient is performed based on the maximum value of 2.5 and the minimum value of 0.1. If the gradient fluctuation coefficient of a certain region is 2.21, then the normalization result is:
[0095] Normalized gradient fluctuation coefficient ;
[0096] Subsequently, the two normalized parameters are weighted and fused according to the set weights. For example, if the weight of the pixel density ratio is set to 0.6 and the weight of the gradient fluctuation coefficient is set to 0.4, then the comprehensive score of the region is: Finally, the overall score is linearly mapped to a set benchmark value (e.g., 0.5) to obtain the final region credibility score. If the overall score is greater than the benchmark value, the region has high credibility; otherwise, it has low credibility. For example, if the overall score is 0.476, which is lower than the set benchmark value of 0.5, the region has a low credibility score, indicating that the feature distribution of the region is not obvious and contains a lot of noise.
[0097] Table 2 shows the calculation results of pixel density ratio, gradient fluctuation coefficient, and final credibility score for the differentiated regions.
[0098] Table 2: Calculation Results of Regional Credibility Scores
[0099]
[0100] As shown in Table 2, by calculating the pixel density ratio, gradient fluctuation coefficient, and comprehensive score of the differentiated regions, the credibility score of the regions can be obtained, thereby achieving effective screening and analysis of image regions.
[0101] Specifically, the steps of S3 are as follows:
[0102] S301: Obtain the region confidence score, call each image region block after region division, sort them in descending order using a fast sorting algorithm, extract the region block number with the highest score value, and establish a sequence of region score values with the highest sorted score value.
[0103] To obtain the regional confidence score data, first, retrieve the confidence score values corresponding to each image region block: Region 1 is 0.476, Region 2 is 0.634, and Region 3 is 0.593. Then, compare and sort these scores pairwise. Specifically, first, compare Region 1 (score 0.476) with Region 2 (score 0.634). Since Region 2's confidence score of 0.634 is higher than Region 1's 0.476, Region 2 is ranked before Region 1. Next, compare Region 3 (score 0.593) with the already ranked Region 2 (0.634) and Region 1 (0.476). 76) Comparing the results, since the score of region 3 (0.593) is lower than that of region 2 (0.634) but higher than that of region 1 (0.476), the final ranking results are as follows: region 2 (0.634), region 3 (0.593), region 1 (0.476). Then, based on the above descending sorting results, the block numbers of the top-ranked regions are extracted to form a sequence. For example, if the top two region numbers are "region 2" and "region 3", then the region numbers of this sequence are (region 2, region 3), and the corresponding credibility score value sequence is (0.634, 0.593). This is used to establish the ranking sequence of region score values.
[0104] S302: Based on the image data in the ranking of the top region score value sequence, call the Canny algorithm to extract the gradient direction of the edge pixels, calculate the edge direction concentration index, and generate the edge direction concentration sequence.
[0105] Based on the image data of the regions corresponding to the top-ranked region score sequences (such as regions 2 and 3), the Canny algorithm is used to calculate the gradient direction pixel by pixel by calling the image pixel data of each region block, and the gradient direction value is extracted. Taking region 2 as an example, the gradient direction value data of the edge pixels of this region is obtained through image processing, such as 4 pixels with gradient directions of (0.41 rad, 0.39 rad, 0.45 rad, 0.43 rad), and the average value of their gradient directions is calculated. The gradient magnitude data corresponding to each edge pixel is retrieved one by one, for example, (S1=80, S2=75, S3=85, S4=90), and the grayscale data of non-edge pixels in the same area are retrieved one by one, for example, (P1=120, P2=115, P3=123). The edge direction concentration index is calculated using the formula:
[0106] ;
[0107] in, This represents the concentration index along the edge direction of the current region block, in rad. This represents the gradient direction angle of the z-th edge pixel within the current region block, in rad. The average gradient direction angle of the edge pixels within the current region is represented in rad. This represents the gradient magnitude of the z-th edge pixel within the current region block. This represents the total number of edge pixels within the current region block. This represents the grayscale value of the k-th non-edge pixel within the current region block. This represents the average grayscale value of non-edge pixels within the current region block. This represents the total number of non-edge pixels within the current region block.
[0108] The average grayscale value is calculated as follows:
[0109] ;
[0110] Then, calculate the sum of the products of the absolute value of the difference between the gradient direction and the average gradient direction of each edge pixel and the gradient magnitude:
[0111] ;
[0112] Next, calculate the square root of the sum of squares of the gradient magnitudes of the edge pixels:
[0113] ;
[0114] Then calculate the sum of the absolute values of the differences between the grayscale values of each non-edge pixel and its average value:
[0115] ;
[0116] Finally, substitute the above calculation results into the formula for the concentration index in the edge direction:
[0117] ;
[0118] The result shows that the edge direction concentration is 0.0373 rad, indicating that the edge direction difference in this region is small and the concentration value falls within the set range (0.03~0.06 rad), which is within the effective range.
[0119] S303: Based on the edge direction concentration sequence, combined with the edge image and concentration index, detect the edge connectivity structure, filter out the region blocks that do not meet the concentration and connectivity requirements, and obtain a set of reliable regions;
[0120] Based on the aforementioned edge direction concentration index sequence (e.g., region 2: 0.0373 rad, region 3: 0.0451 rad), the edge image data generated for each corresponding region block is combined one by one. The pixel coordinate information of the region is called to check the connection between edge pixels one by one. Through a specific pixel-by-pixel connectivity scan, the connection between pixels in the 8-neighborhood space (top, bottom, left, right, and diagonal) is determined. Taking region 2 as an example, the pixel coordinates within the region (e.g., coordinates A(10, 20), B(11, 20), C(11, 21)) are checked one by one. When the gradient magnitude of adjacent coordinate pixels simultaneously meets the condition of being greater than a preset threshold (set threshold)... If the value is 50 (e.g., 0.0373 rad) and the edge direction concentration is lower than the upper limit of the set concentration index (e.g., 0.06 rad), then the pixel is determined to be a valid connected structure. If the edge pixels of a certain region block fail to connect into a continuous pixel chain within the 8-neighborhood or the concentration index exceeds the threshold range (e.g., the concentration index of region 1 is 0.07 rad, which is higher than the 0.06 rad threshold), then this region is determined to be an invalid region. Finally, the regions are screened, and regions that do not meet the concentration and connectivity requirements (e.g., region 1 with an excessive concentration index) are deleted, thereby obtaining the final set of reliable regions as region 2 and region 3.
[0121] Table 3: Edge Direction Concentration Index and Threshold Setting Table
[0122]
[0123] As shown in Table 3, by setting reasonable concentration index thresholds (0.03~0.06 rad) and gradient magnitude thresholds (e.g., 50), and combining the actual calculated edge direction concentration values, the edge connectivity structure is finely detected, effectively filtering out region 2 and region 3, and obtaining the final set of reliable regions.
[0124] Specifically, the steps of S4 are as follows:
[0125] S401: Based on a set of trustworthy regions, input is fed into the ResNet-50 backbone network with added channel attention mechanism to obtain the response amplitude of the channel feature map, determine the degree of change in response amplitude between channels and set key weights, perform channel-wise weighting, and generate channel-weighted feature maps.
[0126] The set of trustworthy regions includes several pre-labeled regions of interest (ROIs). Five ROIs are selected as input data in the actual scene. The size of the ROI images is uniformly set to 224 pixels, and they are input into the ResNet-50 backbone network, which incorporates a channel attention mechanism, in RGB three-channel format. Each channel corresponds to a color channel (R, G, B). Based on the input feature map, the network calculates the average value of the feature values at spatial locations within each channel through a global average pooling (GAP) operation. For example, the average value of 224×224 pixels in the red channel of the first ROI image is 132.5, the average value in the green channel is 121.3, and the average value in the blue channel is 110.7, thus obtaining the channel global response amplitude. Subsequently, the global response amplitude values corresponding to each channel are compared between channels, and the absolute value of the difference between any two channels is calculated. For example, the absolute value of the difference between the red channel (132.5) and the blue channel (110.7) is 21.8, and the absolute value of the difference between the red and green channels is 11.2, and this is used to determine... The degree of difference in response amplitude between channels is analyzed. Further, based on the difference in response amplitude, the absolute values of the channel differences are divided into three levels: "low," "medium," and "high," according to three intervals: 0-10, 10-20, and above 20. The red-green channel difference (11.2) is classified as "medium," and the red-blue channel difference (21.8) is classified as "high." Then, based on the differences in channel difference classification, a key weight coefficient is assigned to each channel. The weight coefficients are set as follows: 0.8 for "low," 1.0 for "medium," and 1 for "high." 2; In the above example, the weight of the red and green channels is set to 1.0, and the weight of the red and blue channels is set to 1.2. Then, the original channel response amplitude is multiplied and weighted according to the set weight coefficients. For example, the original response amplitude of the red channel (132.5) is multiplied by the weight coefficient 1.2 to obtain a weighted channel response value of 159.0. The response amplitude of the blue channel (110.7) is multiplied by the weight 1.2 to obtain 132.84. The amplitude of the green channel remains unchanged (the weight coefficient is 1.0, and the result is 121.3). This generates the final channel weighted feature map.
[0127] Table 4: Correspondence between Channel Response Amplitude and Weighting Coefficient
[0128]
[0129] As shown in Table 4, the differential response difference range corresponds to the differential weight coefficient. This table allows for the rapid determination of channel weight settings during actual calculations, facilitating the execution of actual weighted calculations.
[0130] S402: Call the channel weighted feature map, extract the local response intensity of each spatial location, combine it with the overall distribution characteristics of the channel it belongs to, establish a mapping matrix according to the spatial index, record the response fluctuation between local and global, and generate the offset response coefficient distribution map;
[0131] The channel-weighted feature map is invoked, and the feature values corresponding to each spatial location (pixel) are extracted one by one. For example, at the spatial location index (100, 100), the weighted feature response values of the red, green, and blue channels are extracted as 152.4, 120.9, and 131.2, respectively. Then, taking the local response intensity of 152.4 in the red channel at the spatial location index (100, 100) as an example, it is compared with the global response mean of 159.0 for the corresponding channel. The difference (local 152.4 - global 159.0 = -6.6) is calculated and recorded as a negative fluctuation, and the absolute value of 6.6 is defined as the response offset value. This process is repeated at other locations and channels. The process involves calculating the response offset value point-by-point and channel-by-channel. The offset values are then divided into three intervals: 0-5, 5-15, and above 15, categorized into "low," "medium," and "high" response fluctuation intensity levels. The corresponding offset response coefficients are determined based on the position and channel fluctuation intensity levels, set as follows: "low" coefficient 0.9, "medium" coefficient 1.0, and "high" coefficient 1.1. For example, the response offset value at index (100, 100) is 6.6, falling within the "medium" level, with an offset response coefficient of 1.0. The offset response coefficients obtained from the position are used to form a spatial index mapping matrix, corresponding to the fluctuation intensity of the pixel position relative to the global feature distribution, ultimately yielding an offset response coefficient distribution map.
[0132] S403: Linearly superimpose the corresponding pixel values of the offset response coefficient distribution map and the channel weighted feature map, and expand it into a two-dimensional matrix according to the spatial dimension by combining the proportional relationship between the channel response weight and the spatial offset weight to generate a spatially enhanced feature map.
[0133] The obtained offset response coefficient distribution map and channel weighted feature map are linearly superimposed pixel-by-pixel and channel-by-channel at corresponding positions, that is, a corresponding pixel-level multiplication operation is performed at each spatial location index; for example, at spatial location index (100, 100), the channel weighted feature value of the red channel is 152.4, and the offset response coefficient is 1.0, and the linear superposition calculation is as follows:
[0134] ;
[0135] The green channel has a channel weighted eigenvalue of 120.9 and an offset coefficient of 1.1, so the superimposed result is...
[0136] ;
[0137] The blue channel has a channel weighting value of 131.2 and an offset coefficient of 0.9, so the result after stacking is...
[0138] ;
[0139] Subsequently, the linear superposition of the three channels at spatial location index (100, 100) and the resulting feature values (152.4, 133.0, 118.08) are flattened into a two-dimensional matrix according to the spatial dimension. The feature point data is then rearranged in the order of rows representing spatial location and columns representing channel dimension. That is, the row data corresponding to spatial location index (100, 100) is (152.4, 133.0, 118.08), and the adjacent positions (100, 101) are similarly arranged to form a complete two-dimensional matrix data, which ultimately generates a spatially enhanced feature map.
[0140] Specifically, the steps of S5 are as follows:
[0141] S501: Based on the spatial enhancement feature map, input the high and low band regions of the near-infrared channel, extract the position grayscale response values, construct a difference map according to the pixel correspondence and organize it into a two-dimensional matrix format to generate the near-infrared response deviation matrix.
[0142] Based on the input spatial enhancement feature map and high and low band region data of the near-infrared channel, grayscale response values are extracted pixel by pixel. Assuming that the band response value range of a certain region in the near-infrared image is 300 to 350 nm, the response value of each pixel is extracted first. For example, at a certain position (100, 100), the near-infrared channel response value is 315, while the corresponding response value in the spatial enhancement feature map is 152.4. Then, the near-infrared response value of each position is compared with the values of adjacent pixels to calculate the response difference and generate a difference map. In the difference map, assuming that the difference between the positions (100, 100) and (100, 101) is 315-310=5, the pixel difference value is then mapped to a two-dimensional matrix format according to the position. For example, the value corresponding to this position in the two-dimensional matrix is 5. The difference values of other regions are processed in the same way to generate a complete near-infrared response deviation matrix. The matrix format facilitates the subsequent analysis and mapping of position response deviations. The output of this matrix provides accurate difference data for further calculation and processing.
[0143] Table 5: Example of Near-Infrared Response Deviation Matrix
[0144]
[0145] Table 5 shows some data from the calculation process of the near-infrared response deviation matrix and the difference in visible light response values.
[0146] S502: Call the near-infrared response deviation matrix, calculate the channel response difference value between it and the visible light channel according to the position, establish the channel mapping format, and then perform channel stitching with the spatial enhancement feature map to generate a multi-channel fusion feature set.
[0147] When calling the near-infrared response deviation matrix, the response value of each position in the matrix (e.g., position (100, 100)) is first extracted. In practical applications, the response value of a certain position (e.g., 315) is compared with that of the visible light channel (e.g., the response value of the red channel is 120.5). The response difference is calculated using the following formula:
[0148] ;
[0149] in, Representing the Line number The channel response difference value at the column pixel position. Representing the Line number The visible light channel response value at the column pixel position. This represents the average value of the visible light channel response V in a pixel. Representing the Line number The local weighting factor of the spatial enhancement feature map at the column pixel location is a dimensionless parameter. Representing the Line number Near-infrared response deviation matrix values at column pixel positions, The average value of the near-infrared response deviation matrix N in the pixel represents the average value of the pixel. The standard deviation of the visible light channel response value V in a pixel. The standard deviation of the near-infrared response deviation matrix value N in the pixel. A very small positive constant set to avoid the denominator being zero.
[0150] in, , where is the response value of the visible light red channel at the position (100, 100). , which is the average value of the visible light channel response (obtained from multiple training samples). , which is the local weighting factor of the spatially enhanced feature map. , is the value of the near-infrared response deviation matrix. , which is the average value of the near-infrared response bias matrix (also obtained from the training set). , where is the standard deviation of the visible light response value. , where is the standard deviation of the near-infrared response bias matrix values. This is a minimum value set to avoid a denominator of zero. The value is then substituted into the formula to calculate the response difference. For example, the calculation process at the position (100, 100) is as follows:
[0151] ;
[0152] Through the above calculations, response difference values are obtained. The entire matrix is then processed, and the response difference value at each position is calculated and formed into a channel mapping format. This format summarizes the channel response differences, preparing for the generation of multi-channel fusion feature sets in the next step. The calculated difference values directly affect the channel stitching and fusion process. Multi-channel fusion feature sets are generated by stitching pixel-by-pixel and channel-by-channel, so that the fused features can reflect the channel differences and feature responses.
[0153] S503: Based on the multi-channel fused feature set, input the normalized feature vector into the Softmax classifier, filter the category index corresponding to the probability value and assign a label to obtain the pesticide residue form classification label;
[0154] Based on the generated multi-channel fused feature set, it is input into the Softmax classifier for normalization. First, the feature value of each channel is standardized so that it falls within the (0, 1) interval. After the Softmax normalization operation, the probability value of each class is obtained. Then, the class with the highest probability value is selected. For example, suppose that after normalization, the probability values of the three classes are as follows:
[0155] ;
[0156] The maximum probability is 0.70, indicating that the sample belongs to the second category. Therefore, the index of this category (category 2 in this case) is used as the classification label, assigning a label to the sample. This label indicates that the sample belongs to a specific form of pesticide residue. Through the output of the Softmax classifier and normalization operations, a pesticide residue morphology classification label can be accurately assigned to each input image, further providing a basis for pesticide residue detection in practical applications.
[0157] The above description is merely a specific embodiment of the present invention, but the scope of protection of the present invention is not limited thereto. Any variations or substitutions that can be easily conceived by those skilled in the art within the technical scope disclosed in the present invention should be included within the scope of protection of the present invention. Therefore, the scope of protection of the present invention should be determined by the scope of the claims.
Claims
1. A deep learning-based image recognition method for pesticide residues in sediments, characterized in that, Includes the following steps: S1: Obtain visible light red, green and blue channel images and near-infrared high and low band images of sediment samples through multispectral microscopic imaging equipment, perform channel registration operation based on cross-correlation algorithm on the red channel image, and generate a multispectral image set; S2: Based on the multispectral image set, extract the proportion of pixels with gray values greater than the gray threshold in the image region block as the pixel density parameter, use the Sobel operator to calculate the degree of change in local gradient direction, analyze the spatial distribution relationship of pixel gray values to calculate the texture contrast parameter, perform normalized weighted fusion, and generate a region credibility score. S3: Call the region credibility score, sort it in descending order using the quick sorting algorithm, select the region blocks with the highest scores, detect the edge direction distribution based on the Canny algorithm, filter regions with concentrated main direction angles and edge connectivity that meet the conditions, and generate a set of credible regions. S4: Input the set of trusted regions into the ResNet-50 backbone network with added channel attention mechanism to extract deep texture features, calculate the offset between the response value and the average response value in the spatial attention branch, and perform element-wise weighting operation with the deep texture features to generate a spatially enhanced feature map. S5: Input the spatial enhancement feature map into the spectral feature branch, extract the response difference map between the near-infrared high and low bands and the visible light channel respectively, stitch the difference map and the spatial enhancement feature map together in the channel dimension, input the Softmax classifier to output the three types of pesticide residue morphology classification labels: crystal precipitation, adsorption spots and chemical discoloration area. The classification labels include labels for crystal precipitation type, adsorption spot type, and chemical discoloration area type; The specific steps of S5 include: S501: Based on the spatial enhancement feature map, input the high and low band regions of the near-infrared channel, extract the position grayscale response values, construct a difference map according to the pixel correspondence and organize it into a two-dimensional matrix format to generate a near-infrared response deviation matrix. S502: Call the near-infrared response deviation matrix and calculate the channel response difference value between it and the response value of the visible light channel according to the position, using the formula: ; in, Representing the Line 1 The channel response difference value at the column pixel position. Representing the Line 1 The visible light channel response value at the column pixel position. This represents the average value of the visible light channel response V in a pixel. Representing the Line 1 The local weighting factor of the spatial enhancement feature map at the column pixel location is a dimensionless parameter. Representing the Line 1 Near-infrared response deviation matrix values at column pixel positions, The average value of the near-infrared response deviation matrix N in the pixel represents the average value of the pixel. The standard deviation of the visible light channel response value V in a pixel. The standard deviation of the near-infrared response deviation matrix value N in the pixel. To avoid the extremely small positive constant set by the denominator being zero, after establishing the channel mapping format, it is concatenated with the spatial enhancement feature map to generate a multi-channel fused feature set. S503: Based on the multi-channel fused feature set, input the normalized feature vector into the Softmax classifier, filter the category index corresponding to the probability value and assign a label to obtain the pesticide residue form classification label.
2. The method for recognizing pesticide residues in sediments based on deep learning according to claim 1, characterized in that, The multispectral image set includes a pixel-level registered image set, a visible and near-infrared composite spectral frame, and a channel fusion benchmark template. The regional credibility score includes image region gray-scale density index, local texture direction contrast parameter, and weighted fusion evaluation coefficient. The credibility region set includes a main direction concentrated region, an edge structure continuous region, and a texture feature stable region. The spatial enhancement feature map includes a spatial response offset matrix, a channel enhancement feature map, and a fusion representation feature layer.
3. The method for recognizing pesticide residues in sediments based on deep learning according to claim 1, characterized in that, The specific steps of S1 include: S101: Acquire raw image data of sediment samples using multispectral microscopic imaging equipment, detect channel image band types, collect pixel matrices of red, green, blue, and near-infrared high-band and low-band images, normalize channel pixel gray values, and generate a set of channel gray-scale matrices. S102: Based on the pixel matrices of the red channel and other channels in the grayscale matrix set, calculate the two-dimensional cross-correlation matrix between the channels and the red channel, identify the row and column offsets of the correlation coefficient positions, and generate channel registration offset data; S103: Call the channel registration offset data to adjust the channel pixel position, reposition the image to a unified coordinate system, and fuse the five-channel images in the same pixel dimension to obtain a multispectral image set with channel pixel coordinates aligned.
4. The method for recognizing pesticide residues in sediments based on deep learning according to claim 3, characterized in that, The specific steps of S2 include: S201: Based on the multispectral image set, after dividing the image region into blocks, the number of pixels with gray values greater than a set gray threshold in each region is counted sequentially. The number of pixels is then calculated as a ratio to the total number of pixels in the region. The distribution ratio of high gray value points in the image region is summarized to generate a pixel density ratio. S202: Call the pixel density ratio, use the Sobel operator to extract the gradient change of the image region, calculate the gradient direction change amplitude of the local position of the pixel, count the change level in the region, and obtain the gradient fluctuation coefficient; S203: Based on the gradient fluctuation coefficient and pixel density ratio, the region comprehensive score is calculated by normalization and weighted fusion. The comprehensive score is then linearly mapped to a set benchmark value to generate a region credibility score.
5. The method for recognizing pesticide residues in sediments based on deep learning according to claim 4, characterized in that, The grayscale threshold refers to a preset grayscale level value in a grayscale image, which divides the grayscale level of pixels in the image and distinguishes the differential grayscale level distribution within the image region. It is a scalar that is dynamically set based on the statistical characteristics of the image. The pixel density ratio refers to the ratio between the number of pixels with gray values greater than the gray value threshold in the divided image region block and the total number of pixels in the image region. The gradient fluctuation coefficient refers to the coefficient value that represents the gradient change level in the image region after calculating the gray-level gradient direction change amplitude of the local position of the pixel based on the edge detection operator. The regional comprehensive score is a numerical index obtained by weighting the pixel density ratio and gradient fluctuation coefficient after normalization. The value reflects the numerical relationship between the differential feature parameters within the image region.
6. The method for recognizing pesticide residues in sediments based on deep learning according to claim 4, characterized in that, The specific steps of S3 include: S301: Obtain the region confidence score, call each image region block after region division, sort them in descending order using a fast sorting algorithm, extract the region block number with the highest score value, and establish a sequence of region score values with the highest sorting value. S302: Based on the image data in the sorted top region score value sequence, call the Canny algorithm to extract the gradient direction of edge pixels, calculate the edge direction concentration index, and generate the edge direction concentration sequence. S303: Based on the edge direction concentration sequence, combined with the edge image and concentration index, detect the edge connectivity structure, filter out region blocks that do not meet the concentration and connectivity requirements, and obtain a set of reliable regions.
7. The method for recognizing pesticide residues in sediments based on deep learning according to claim 5, characterized in that, The specific steps of S4 include: S401: Based on the set of trusted regions, input to the ResNet-50 backbone network with added channel attention mechanism, obtain the response amplitude of the channel feature map, determine the degree of change of response amplitude between channels and set key weights, perform channel-by-channel weighting, and generate channel-weighted feature maps. S402: Call the channel weighted feature map, extract the local response intensity of each spatial location, combine it with the overall distribution characteristics of the channel it belongs to, establish a mapping matrix according to the spatial index, record the response fluctuation between local and global, and generate the offset response coefficient distribution map; S403: Linearly superimpose the corresponding pixel values of the offset response coefficient distribution map and the channel weighted feature map, and expand the spatial enhanced feature map into a two-dimensional matrix according to the spatial dimension by combining the proportional relationship between the channel response weight and the spatial offset weight.
8. The method for recognizing pesticide residues in sediments based on deep learning according to claim 7, characterized in that, The ResNet-50 backbone network with added channel attention mechanism is based on the original ResNet-50 structure. Channel attention units are introduced into the residual connection path to generate channel-dimensional weight information, apply corresponding weighting processing to the channels in the feature map, and perform channel-dimensional feature recalibration. The channel attention unit includes a global average pooling structure, a multilayer perceptron structure, and an activation function structure.
Citation Information
Patent Citations
Traditional Chinese medicine pesticide residue detection method and system based on artificial intelligence and medium
CN120182729A