Fruit counting method based on guiding perception and sharpening
By using a guided perception and sharpening fruit counting method, and by generating a high-precision density map using a progressive spatial aggregation encoder and an adaptive similarity perception module, the problem of low accuracy in counting small and dense fruits is solved, and high accuracy and robustness in fruit counting are achieved.
Patent Information
- Application Number
- CN202511396247.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-09-28
- Publication Date
- 2025-12-30
- Estimated Expiration
- 2045-09-28
AI Technical Summary
Existing technologies suffer from low counting accuracy and poor robustness in fruit counting, especially in small and densely packed fruit scenes where it is difficult to effectively handle complex background interference and fruit morphological diversity, resulting in large counting errors.
A fruit counting method based on guidance perception and sharpening is adopted. A progressive spatial aggregation encoder is used for multi-level feature extraction. Combined with an adaptive similarity perception module and an interleaved channel reconstruction decoder, a high-precision density map is generated for fruit counting.
It improves the accuracy and robustness of fruit counting, effectively copes with fruit counting in complex natural orchard environments, and enhances the reliability of yield assessment and resource management.
Smart Images

Figure CN121236751A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of image processing technology, and in particular to a fruit counting method based on guidance perception and sharpening. Background Technology
[0002] With the development of agricultural modernization, fruit counting plays an important role in yield assessment, resource management, and precision agriculture. However, traditional methods such as random sampling and manual measurement are not only labor-intensive, inefficient, and inaccurate, but also difficult to adapt to the management needs of large-scale orchards.
[0003] In recent years, computer vision technology has provided new solutions for fruit counting. Object detection methods count fruits by identifying individual fruits and generating bounding boxes, but their ability to handle densely packed fruit scenes is limited, and they are prone to missed detections or duplicate counts due to overlap and occlusion. Density map methods count fruits by generating density maps of fruit distribution, which can alleviate some overlap problems. However, their uniform smoothing strategy is difficult to effectively handle complex background interference, fruit morphological diversity, and fruit adhesion when dealing with small and densely packed fruits (such as cherries), often leading to blurred fruit boundaries, loss of regional information, and local counting bias.
[0004] Furthermore, natural orchard environments present numerous uncertainties, including significant variations in light intensity, dense interlacing of branches and leaves, and differences in proportions due to varying shooting angles. These factors further complicate fruit counting. Therefore, there is an urgent need for a fruit counting method that can improve the accuracy and robustness of counting in complex natural orchard environments, providing reliable support for yield assessment and resource management. Summary of the Invention
[0005] In view of the above-mentioned deficiencies of the prior art, the present invention provides a fruit counting method based on guidance perception and sharpening to solve the technical problem of low counting accuracy for small and dense fruits in the prior art.
[0006] To achieve the above and other related objectives, this invention provides a fruit counting method based on guidance perception and sharpening, comprising: acquiring a first image to be processed, and randomly selecting several fruits in the first image; using a progressive spatial aggregation encoder in a trained fruit guidance perception and sharpening network to perform multi-level feature extraction on the first image to obtain overall features and detail features; extracting features of the selected region from the overall features and performing average processing to obtain example features; using an adaptive similarity perception module in the fruit guidance perception and sharpening network to process the overall features and the example features to obtain a similarity map; multiplying the detail features with the similarity map and inputting the result into an interleaved channel reconstruction decoder in the fruit guidance perception and sharpening network to generate a density map; and obtaining the number of fruits in the first image based on the density map.
[0007] In one embodiment of the present invention, the progressive spatial convergence encoder can be expressed by the following formula: X6=H CSFF (H FAC (Conv(X in ))), F0=Conv 3×3 (X6), F1=Conv 3×3 (X6), In the formula, X in For the first image, Conv is the convolution operation, and H... FAC For foreground-aware convolutional blocks, H CSFF X6 is the output feature of the cross-stage feature fusion unit, and F0 and F1 are the overall feature and the detailed feature, respectively.
[0008] In one embodiment of the present invention, the processing steps of the foreground-aware convolutional block are as follows: performing continuous convolution operations on the input features of the foreground-aware convolutional block to obtain a region-aware offset, so as to capture spatial context information on the feature map; obtaining a vector P based on the average height and average width of the selected region; mapping the vector P to a high-dimensional feature space using a multilayer perceptron, and performing reshaping and tensor copy expansion operations to obtain a size-aware offset; obtaining a dynamic offset based on the region-aware offset and the size-aware offset; calculating the output features of the foreground-aware convolutional block based on the dynamic offset, wherein the feature value y(p) of the output features of the foreground-aware convolutional block at position p is calculated by the following formula: , In the formula, w j Let x(p+j+S) be the weight of the convolution kernel at position j, R be the coverage area of the convolution kernel, and x(p+j+S) be the weight of the convolution kernel at position j. a) represents the value sampled from the input feature map after applying the offset.
[0009] In one embodiment of the present invention, the cross-stage feature fusion unit can be expressed by the following formula: X1=H FAC (PoolConv1Block(X0)), X2 = X1 + H down (X0), X3=H FAC (PoolConv3Block(X2)), X4 = X3 + H down (X2), X5=H FAC (PoolConv3Block(X4)), X6 = X5 + H down (X4), In the formula, X0 represents the input feature of the cross-stage feature fusion unit, PoolConv1Block and PoolConv3Block are the first-order pooling convolutional block and the third-order pooling convolutional block, respectively, and H... down X1~X5 are the intermediate features, which are the downsampling functions.
[0010] In one embodiment of the present invention, the first-order pooling convolutional block is formed by cascading a max pooling layer and a convolutional layer, and the third-order pooling convolutional block is formed by cascading a max pooling layer and three convolutional layers.
[0011] In one embodiment of the present invention, the processing steps of the adaptive similarity perception module are as follows: dividing the overall features and the example features into multiple groups along the channel dimension; performing a convolution operation on each group of overall features to generate shift parameters; performing a convolution operation on each group of overall features and combining it with the Softmax function to generate weight factors; and generating similarity maps for each group using the following formula: , In the formula, Let be the similarity value of position (i,j) in the g-th group. and These are the example features and the overall features of the g-th group, respectively. The weighting factor is... and The displacement parameter is used; the adaptive similarity maps of each group are merged along dimension g to obtain the similarity map.
[0012] In one embodiment of the present invention, the interleaved channel reconstruction decoder includes cascaded components: two 3×3 convolutional layers, three interleaved rearrangement models, one 3×3 convolutional layer, and one ReLU activation function.
[0013] In one embodiment of the present invention, the expression of the staggered rearrangement model is as follows: , , In the formula, The input features of the interleaving rearrangement model are... This refers to the output features of the staggered rearrangement model.
[0014] The beneficial effects of this invention are as follows: This invention proposes a fruit counting method based on guided perception and sharpening. This method uses a progressive spatial aggregation encoder to focus on the fruit region by enhancing spatial perception; the adaptive similarity perception module uses morphologically guided adaptation to perform robust fruit phenotypic recognition; and the interleaved channel reconstruction decoder improves the clarity of fruit distribution through cross-arrangement technology, ultimately achieving high-precision counting. Attached Figure Description
[0015] To more clearly illustrate the technical solutions in the embodiments of the present invention or the prior art, the accompanying drawings used in the description of the embodiments or the prior art will be briefly introduced below. The accompanying drawings are incorporated in and constitute a part of this specification, illustrating embodiments consistent with this application, and are used together with the description to explain the principles of this application. Obviously, the drawings described below are merely some embodiments of the present invention, and those skilled in the art can obtain other drawings based on these drawings without creative effort.
[0016] Figure 1 A flowchart of a fruit counting method provided in an embodiment of the present invention; Figure 2 This is an architecture diagram of a fruit-guided perception and sharpening network provided in an embodiment of the present invention; Figure 3 This is an architectural diagram of a progressive spatial aggregation encoder provided in an embodiment of the present invention; Figure 4 A flowchart illustrating the processing of a foreground-aware convolutional block according to an embodiment of the present invention; Figure 5 This is an architectural diagram of a foreground-aware convolutional block provided in an embodiment of the present invention; Figure 6 This is an architectural diagram of a cross-stage feature fusion unit provided in an embodiment of the present invention; Figure 7 This is an architecture diagram of a first-order pooling convolutional block provided in an embodiment of the present invention; Figure 8 This is an architectural diagram of a third-order pooling convolutional block provided in an embodiment of the present invention; Figure 9 This is a flowchart of the adaptive similarity perception module provided in an embodiment of the present invention; Figure 10 This is an architecture diagram of an adaptive similarity perception module provided in an embodiment of the present invention; Figure 11 This is an architecture diagram of an interleaved channel reconstruction decoder provided in an embodiment of the present invention; Figure 12 This is an architectural diagram of an alternating rearrangement model provided in an embodiment of the present invention. Detailed Implementation
[0017] The following specific embodiments illustrate the implementation of the present invention. Those skilled in the art can easily understand other advantages and effects of the present invention from the content disclosed in this specification. It should be noted that, unless otherwise specified, the following embodiments and features can be combined with each other. In addition to the specific methods, equipment, and materials used in the embodiments, based on the knowledge of the prior art and the description of the present invention by those skilled in the art, any prior art methods, equipment, and materials similar to or equivalent to the methods, equipment, and materials in the embodiments of the present invention can be used to implement the present invention.
[0018] It should be understood that the terminology used in the embodiments of this invention is for describing specific implementations and not for limiting the scope of protection of this invention. Unless otherwise defined, all technical and scientific terms used in this invention have the same meaning as commonly understood by one of ordinary skill in the art.
[0019] In the following description, numerous details are explored to provide a more thorough explanation of embodiments of the invention. However, it will be apparent to those skilled in the art that embodiments of the invention may be practiced without these specific details. In some embodiments, well-known structures and devices are shown in block diagram form rather than in detail to avoid obscuring embodiments of the invention.
[0020] The flowcharts and block diagrams in the accompanying drawings illustrate the architecture, functions, and operations that may be implemented in the methods and computer program products according to various embodiments of the present invention. In this regard, each block in a flowchart or block diagram may represent a module, segment, or portion of code containing one or more executable instructions for implementing the specified logical function. It should also be noted that in some alternative implementations, the functions indicated in the blocks may occur in a different order than those indicated in the drawings. For example, two consecutively indicated blocks may actually be executed substantially in parallel, and they may sometimes be executed in reverse order, depending on the functions involved. It should also be noted that each block in the block diagrams and / or flowcharts, and combinations of blocks in the block diagrams and / or flowcharts, can be implemented using a dedicated hardware-based system that performs the specified function or operation, or using a combination of dedicated hardware and computer instructions.
[0021] Please see Figure 1 , Figure 1 A fruit counting method based on guidance perception and sharpening is provided in one embodiment of the present invention, including steps S101 to S106.
[0022] Step S101: Obtain the first image to be processed, and randomly select several fruits from the first image. The first image is a pre-processed image adapted to the input feature size of the fruit-guided perception and sharpening network. Pre-processing may include, for example, denoising, cropping, and resizing. Unlike other conventional methods, this invention requires manually selecting three fruits randomly from the first image for subsequent processing.
[0023] Step S102: Using the Progressive Spatial Aggregation Encoder (PSAE) in the trained fruit-guided perception and sharpening network, multi-level feature extraction is performed on the first image to obtain overall and detail features. The structure of the fruit-guided perception and sharpening network is as follows: Figure 2 As shown.
[0024] Please see Figure 3 In a specific embodiment of the present invention, the progressive spatial convergence encoder can be expressed by the following formula: X6=H CSFF (H FAC (Conv(X in ))), F0=Conv 3×3 (X6), F1=Conv 3×3 (X6), In the formula, X inFor the first image, Conv represents the convolution operation, and H... FAC For foreground-aware convolutional blocks, H CSFF X6 is the output feature of the cross-stage feature fusion unit, and F0 and F1 are the overall feature and detail feature, respectively. The overall feature F0 is used to highlight the fruit area, thereby effectively suppressing environmental interference caused by changes in branches, leaves and light. The detail feature F1 is used to preserve structural information such as fruit edges and textures, providing fine-grained support for the subsequent generation of high-precision density maps.
[0025] Please see Figure 4 In a specific embodiment of the present invention, the processing steps of the foreground-aware convolutional block include steps S401 to S405, which are described below in conjunction with... Figure 5 These steps will be explained in further detail.
[0026] Step S401: Input features x of the foreground-aware convolutional block n Perform continuous convolution operations (corresponding to) Figure 5 In C), the region-aware offset S is obtained. r This is to capture spatial context information on the feature map, which can be expressed by the formula: S r =Conv 3×3 (ReLU(Conv 3×3 (x n ))), Region-aware offset S r This method captures the spatial variation features of the fruit region by performing continuous convolution operations (including ReLU activation) on the input of the foreground-aware convolutional block.
[0027] Step S402: Based on the average height and average width of the selected area (corresponding to...) Figure 5 We obtain vector P by taking Size h and Sizew from the bounding boxes. For example, if there are three selected regions with heights h1, h2, and h3, the average of these three heights is... Similarly, the average of the three widths w1, w2, and w3 is The final vector P is obtained from and The constructed two-dimensional vector, i.e. .
[0028] Step S403: Utilize a multilayer perceptron (MLP) Figure 5 The vector P (abbreviated as M) is mapped to a high-dimensional feature space, and then reshaped and repeated using tensor copying to obtain the size-aware offset S. s It can be expressed by the formula: , Size-aware offset S s Sample information is extracted using a multilayer perceptron, then reshaped and expanded to match the region-aware offset S. r Same spatial dimension.
[0029] Step S404: Based on the region-aware offset and the size-aware offset, the final dynamic offset is obtained. This process can be expressed by the formula: , In the above formula, Concat represents concatenation. The final dynamic offset is obtained after concatenation. Subsequently, the offset parameter is applied to the sampling position through convolution operation to achieve adaptive adjustment of the receptive field.
[0030] Step S405: Calculate the output features of the foreground-aware convolutional block based on the dynamic offset. The feature value y(p) of the foreground-aware convolutional block at position p is calculated using the following formula: , In the formula, w j Let x(p+j+S) be the weight of the convolution kernel at position j, R be the coverage area of the convolution kernel, and x(p+j+S) be the weight of the convolution kernel at position j. a The value is the sampled value from the input feature map after applying the offset. In this step, the foreground-aware convolutional block can dynamically adjust the receptive field according to the actual size and spatial characteristics of the target region, thereby more accurately aligning fruit regions such as cherries and improving the accuracy and robustness of feature extraction.
[0031] Please see Figure 6 In a specific embodiment of the present invention, the cross-stage feature fusion unit (CSFF) can be expressed by the formula: X1=H FAC (PoolConv1Block(X0)), X2 = X1 + H down (X0), X3=H FAC (PoolConv3Block(X2)), X4 = X3 + H down (X2), X5=H FAC (PoolConv3Block(X4)), X6 = X5 + H down (X4), In the formula, X0 represents the input feature of the cross-stage feature fusion unit, PoolConv1Block and PoolConv3Block are the first-order pooling convolutional block and the third-order pooling convolutional block, respectively, and H... downThe downsampling function is defined by X1 to X5, which are intermediate features. The cross-stage feature fusion unit consists of a foreground-aware convolutional block (FAC), a first-order pooling convolutional block, a third-order pooling convolutional block, and the downsampling function. The structure of the foreground-aware convolutional block is described above. Figure 5 As shown above, this has already been described in detail and will not be repeated here.
[0032] In this embodiment, PoolConv1Block compresses and initially extracts the input feature X0 through a combination of pooling and convolution, while the FAC module further enhances the expression of local structure and detail information. Subsequently, CSFF downsamples the input feature X0, adjusting its resolution to match the feature map of the current stage. Finally, the feature maps of the two stages are fused by element-wise summation to generate a feature representation that integrates shallow details and deep semantics.
[0033] Then, after further joint processing by PoolConv3Block and FAC, a deeper representation is obtained, resulting in feature X3. Based on this, CSFF further merges X2 and X3 to achieve complementarity and information transfer between shallow and deep features, resulting in feature X4.
[0034] Finally, X4 is further extracted using PoolConv3Block and FAC to obtain X5. CSFF then further fuses X5 and X4 to fully integrate multi-level feature information, resulting in the final feature X6. Finally, feature X6 is subjected to convolution operations to obtain the overall feature F0 and detail features F1.
[0035] Please see Figure 7 and Figure 8 In a specific embodiment of the present invention, a first-order pooling convolutional block is formed by cascading a max-pooling layer and a convolutional layer, such as... Figure 7 As shown, a third-order pooling convolutional block consists of a max-pooling layer and three convolutional layers cascaded together, as follows: Figure 8 As shown.
[0036] Step S103: Extract the features of the selected region from the overall features and perform averaging to obtain the example features F. e Understandably, before performing averaging, all cropped selected areas can be adjusted to a uniform size before averaging across channels. The size adjustment operation can be performed, for example, by using an interpolation algorithm (such as bilinear interpolation) to scale (resize) all three feature blocks to the same uniform size.
[0037] Step S104: Using the Adaptive Similarity Perception Module (ASPM) in the Fruit-Guided Perception and Sharpening Network, the overall features and example features are processed to obtain a similarity map.
[0038] Please see Figure 9 In a specific embodiment of the present invention, the processing steps of the adaptive similarity perception module include S901~S905, which are described below in conjunction with... Figure 10 These steps are explained in detail.
[0039] Step S901: Combine the overall feature F0 and the example feature F e Divide into multiple groups along the channel dimension to obtain and The superscript g indicates the number of groups.
[0040] Step S902: For each group of overall features Performing a convolution operation generates shift parameters, which can be expressed by the formula: , , In the formula, ∆x g Let ∆y be the horizontal displacement parameter. g These are vertical displacement parameters used to adjust the sampling position on the input feature map, enabling it to dynamically shift to the region most similar to the sample feature map.
[0041] Step S903: For each group of overall features Perform convolution operations and combine them with the Softmax function to generate weight factors w. g It can be expressed by the formula: .
[0042] Step S904: Generate similarity graphs for each group using the following formula: , In the formula, Let be the similarity value of position (i,j) in the g-th group. and These are the example features and the overall features of the g-th group, respectively. , and The weighting factors w are respectively g Horizontal displacement parameter ∆x g and vertical displacement parameter ∆y g The value at the corresponding position.
[0043] Step S905: Adaptively similarize each group Merging along dimension g yields the similarity graph F. s .
[0044] Step S105: Compare the detail features F1 with the similarity map F s After multiplication, the data is input into the Interleaved Channel Reconstruction Decoder (ICRD) in the Fruit-Guided Perception and Sharpening Network to generate a density map.
[0045] Please see Figure 11 In one specific embodiment of the present invention, the Interleaved Channel Reconstruction Decoder (ICRD) comprises a cascaded array of: two 3×3 convolutional layers, three Crisscross Rearrangement Models (CRMs), one 3×3 convolutional layer, and a ReLU activation function. The ICRD first performs preliminary processing on the input features through two cascaded 3×3 convolutional layers, enhancing the model's ability to capture edges and textures of the input image while maintaining the spatial resolution of the features. Subsequently, the features are sequentially processed by the three Crisscross Rearrangement Models (CRMs). Each CRM segments the input features into four sub-tensors along the channel dimension. This segmentation process uniformly divides the channels of the feature tensor into four subsets according to predefined rules, with each subset retaining complete spatial dimensional information. Then, the CRMs recombine these sub-tensors in an interleaved manner, recombining the spatial and channel information of the sub-tensors through a specific arrangement strategy to generate the rearranged feature representation.
[0046] After three CRM processes, the features are further integrated through an additional 3×3 convolutional layer. This layer refines the rearranged features, optimizing their spatial consistency and density distribution accuracy. Finally, ICRD applies the ReLU activation function to perform a non-linear transformation on the output features, enhancing the model's non-linear expressive power and ensuring that the generated density map has higher robustness and discriminative power.
[0047] Please see Figure 12 In a specific embodiment of the present invention, the expression for the staggered rearrangement model is as follows: , , In the formula, The input features for the staggered rearrangement model are... This represents the output feature of the staggered rearrangement model.
[0048] The first formula above divides the input feature map into four groups evenly along the channel dimension. In the formula, F... n Let H be the input feature map of the nth CRM module, and its shape is (H).n W n C n );c n For the input feature map F n The number of channels; k is the index of the group, k∈{1,2,3,4}; Let H be the k-th subtensor after grouping, and its shape is (H n W n C n / 4), which contains the original feature map F n One-quarter of the channels. The function of the second formula above is to refill the four groups of sub-tensors into a new feature map with double the spatial size in an "interleaved" manner.
[0049] Step S106: Obtain the number of fruits in the first image based on the density map. The density map is a single-channel grayscale image of the same size as the original image. Each pixel value in this image is not a color, but rather the probability density of the presence of a "target" (such as a cherry) at that location. High (bright) pixel values indicate that the area is very likely the central region of a target; low (dark) pixel values indicate that the area is the background or a non-target region; the total number of pixel values in the entire image equals the estimated total number of targets in the image. Figure 2 The right-hand image shows the result of overlaying the density map with the original image, for easier visualization and understanding.
[0050] In a specific embodiment of the present invention, the fruit-guided perception and sharpening network uses the mean squared error loss function (L2 Loss) as the optimization objective during training to measure the difference between the predicted density map and the true density map. Specifically, for any image in the training samples, let the predicted density map be F. out The corresponding true density map is F. gt The loss function is then defined as: , Where N represents the number of samples in the batch. This represents the square norm operation. This loss function guides the model to gradually reduce the overall bias between the predicted and true density maps during backpropagation by summing and averaging the pixel-by-pixel squared differences between the predicted and true density maps. The L2 loss function has a higher penalty for predictions with larger errors, helping to force the model to improve regression accuracy in dense fruit regions during training and reduce local counting bias.
[0051] To evaluate the accuracy of the fruit orientation sensing and sharpening network, mean error (MAE) and root mean square error (RMSE) can be used to assess the network.
[0052] To further verify the effectiveness of the proposed method in the dense small fruit counting task, we conducted a systematic comparative experiment on the cherry dataset with six other density map counting models (FamNet, MCNN, CSTrans-B, BMNet+, PSGCNet, and LOCA). The test results are shown in Table 1.
[0053] Table 1: Comparison of results with other density map models on the cherry dataset
[0054] As can be seen from Table 1, the Fruit Direction Perception and Sharpening Network (FOPSN) in this invention performed best in all experimental results, demonstrating its superiority in the fruit counting task.
[0055] It should be noted that the steps of the various methods described above are only for clarity. In practice, they can be combined into one step or some steps can be split into multiple steps. As long as they contain the same logical relationship, they are all within the scope of protection of this application. Adding insignificant modifications or introducing insignificant designs to the algorithm or process, but without changing the core design of the algorithm and process, are also within the scope of protection of this patent.
[0056] The above embodiments are merely illustrative of the principles and effects of the present invention and are not intended to limit the invention. Any person skilled in the art can modify or alter the above embodiments without departing from the spirit and scope of the present invention. Therefore, all equivalent modifications or alterations made by those skilled in the art without departing from the spirit and technical concept disclosed in the present invention should still be covered by the claims of the present invention.
Claims
1. A method for counting fruits based on guided perception and sharpening, characterized by, The method comprises the following steps: acquiring a first image to be processed, and randomly framing a plurality of fruits in the first image; extracting multi-level features of the first image by using a progressive spatial aggregation encoder in a trained fruit-oriented perception and sharpening network to obtain overall features and detail features; extracting features of the framed region from the overall features and performing average processing to obtain example features; processing the overall features and the example features by using an adaptive similarity perception module in the fruit-oriented perception and sharpening network to obtain a similarity map; multiplying the detail features and the similarity map to input into an interleaved channel reconstruction decoder in the fruit-oriented perception and sharpening network to generate a density map; obtaining the number of fruits in the first image according to the density map.
2. The method for counting fruits based on guided perception and sharpening as claimed in claim 1, wherein, The progressive spatial aggregation encoder can be expressed by a formula as follows: X6= H CSFF (H FAC (Conv(X in ))) F0 = Conv 3×3 (X6), F1 = Conv 3×3 (X6), In the formula, X in is the first image, Conv is a convolution operation, H FAC is a foreground-aware convolution block, H CSFF is a cross-stage feature fusion unit, X6 is an output feature of the cross-stage feature fusion unit, F0 and F1 are the overall feature and the detail feature respectively.
3. The method for fruit counting based on guided perception and sharpening as claimed in claim 2, wherein, The processing steps of the foreground perception convolution block are as follows: performing a continuous convolution operation on the input features of the foreground perception convolution block to obtain a region perception offset to capture spatial context information on the feature map; obtaining a vector P according to the average height and the average width of the framed region; mapping the vector P to a high-dimensional feature space by using a multi-layer perception, and performing reshaping and tensor replication expansion operations to obtain a size perception offset; obtaining a dynamic offset according to the region perception offset and the size perception offset; calculating the output features of the foreground perception convolution block according to the dynamic offset, wherein the feature value y(p) of the output features of the foreground perception convolution block at the position p is calculated by the following formula: , In the formula, w j is the weight of the convolution kernel at j, R is the coverage range of the convolution kernel, x(p+j+S a ) is the value sampled from the input feature map after applying the offset.
4. The guided perception and sharpened fruit counting method according to claim 2, wherein, The cross-stage feature fusion unit can be expressed by a formula as follows: X1=H FAC (PoolConv1Block(X0)), X2 = X1 + H down (X0), X3= H FAC (PoolConv3Block(X2)), X4 = X3 + H down (X2), X5 = H FAC (PoolConv3Block(X4)), X6 = X5 + H down (X4), In the formula, X0 is an input feature of the cross-stage feature fusion unit, PoolConv1Block and PoolConv3Block are a first-order pooling convolution block and a third-order pooling convolution block respectively, H down is a down-sampling function, and X1-X5 are intermediate features.
5. The method for fruit counting based on guided perception and sharpening according to claim 4, characterized in that, The first-order pooling convolution block is formed by cascading a maximum pooling layer and a convolution layer, and the third-order pooling convolution block is formed by cascading a maximum pooling layer and three convolution layers.
6. The guided perception and sharpened fruit counting method according to claim 4, wherein, The processing steps of the adaptive similarity perception module are as follows: dividing the overall features and the example features into a plurality of groups along the channel dimension respectively; performing a convolution operation on each group of the overall features to generate a displacement parameter; performing a convolution operation on each group of the overall features and combining a Softmax function to generate a weight factor; generating a similarity map of each group by the following formula: , wherein is a similarity value for the gth group of positions (i,j), and are the gth group of example features and the overall feature, respectively, is the weight factor, and is the displacement parameter; combining the adaptive similarity maps of each group along the dimension g to obtain the similarity map.
7. The guided perception and sharpened fruit counting method according to claim 1, wherein, The interleaved channel reconstruction decoder comprises cascaded: two 3×3 convolution layers, three interleaved rearrangement models, a 3×3 convolution layer, and a ReLU activation function.
8. The guided perception and sharpened fruit counting method according to claim 7, wherein, The expression of the interleaved rearrangement model is as follows: , , In the formula, is an input feature of the interleaving rearrangement model, is an output feature of the interleaving rearrangement model.
Citation Information
Patent Citations
A method and system for recognizing chart image data based on deep learning
CN118115819A
Optical remote sensing image change detection method and system based on change perception and semantic guidance, storage medium and electronic equipment
CN119494830A
Systems and methods for image labeling utilizing multi-model large language models
US20240331420A1