Image recognition method and device for eggplant picking machine
By introducing interactive scaling, feature importance assessment, and adaptive fusion mechanisms into an eggplant harvester, combined with conditional gating and bidirectional information flow, eggplant image recognition was optimized, solving the recognition error problem in complex environments and achieving high-precision maturity judgment and location positioning.
Patent Information
- Application Number
- CN202511523275.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-10-23
- Publication Date
- 2025-12-26
AI Technical Summary
The existing image recognition system of eggplant harvesting machines has recognition errors in complex natural environments, which leads to a decrease in recognition accuracy and affects harvesting efficiency and success rate. It also lacks a systematic feature enhancement and multi-task collaboration mechanism.
An interactive scaling factor based on eggplant feature perception is adopted to improve the scaling strategy of fixed factors. Combined with feature importance evaluation and adaptive fusion mechanism, the recognition of color features and location information is optimized through conditional gating and bidirectional information flow mechanism.
It improves the robustness and adaptability of eggplant image recognition, enhances the accuracy of maturity judgment and positioning, and ensures accurate identification by the harvester in different environments.
Smart Images

Figure CN121214072A_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the technical field of machine vision, and in particular to an image recognition method and device for an eggplant picking machine. BACKGROUND
[0002] In the agricultural automatic picking device of eggplants, the image recognition system often faces various disturbances in complex natural environments, which can cause large feature deviations and recognition errors in the recognition process. Feature deviations in image recognition not only cause a decrease in recognition accuracy, affecting the work efficiency of the picking machine, but also lead to mispicking or missed picking, reducing the success rate of picking and thus affecting the overall work performance. Therefore, to improve the image recognition accuracy of the eggplant picking machine, higher robustness requirements should be proposed for the recognition method, and the robustness target should be refined to each module of the image processing. At present, there is a lack of a systematic feature enhancement and multi-task coordination mechanism for eggplant image recognition in agricultural environments, which can adaptively optimize feature expression according to the morphological and color characteristics of eggplants and verify its effectiveness through actual image data. SUMMARY
[0003] The purpose of the present application is to at least solve one of the deficiencies of the prior art, and to provide an image recognition method and device for an eggplant picking machine.
[0004] To achieve the above-mentioned purpose, the present application adopts the following technical solutions: Specifically, an image recognition method for an eggplant picking machine is proposed, which includes the following: Obtaining an eggplant image collected by an eggplant picking machine; Performing feature extraction on the eggplant image based on an interactive scale transformation factor improved fixed factor scale strategy of eggplant feature perception to obtain a feature set; Performing feature fusion on the feature set based on feature importance evaluation and an adaptive feature fusion mechanism to obtain fused features; Optimizing the eggplant color features in the fused features to obtain final color features and updating the fused features; Performing recognition on the updated fused features based on a conditional gating and bidirectional information flow mechanism to obtain maturity and position information of the eggplants.
[0005] Further, specifically, performing feature extraction on the eggplant image based on an interactive scale transformation factor improved fixed factor scale strategy of eggplant feature perception to obtain a feature set includes, The input image I is:
[0006] The target input size is ; The interactive scaling process is defined as:
[0007] where τ is a scale transform function, , is a dynamic scaling factor, whose formula is as follows:
[0008]
[0009] where is the image horizontal gradient, which is more capable of representing the main edge of eggplant due to the elongated shape feature of eggplant; is the stem area energy obtained by threshold segmentation of the HSV green channel; is the balance weight between shape feature and key part protection;
[0010] The above formula means that when the horizontal gradient energy of eggplant reaches the trigger threshold 25, the width direction scaling ratio is automatically increased , and the limit scaling ratio is 1.2; and the image protection is performed on the root stem in order to obtain accurate picking point position information, and the stem area mask is generated by color thresholding,
[0011] S is the input saturation value, take 10, which represents the green color tone tolerance, which represents a function of excluding highlight reflection; The scaled feature size is calculated by the interactive scale transform factor, and then different scale features are extracted by convolution, and finally the feature set F={ , … }, l is the lth feature.
[0012] Further, specifically, the feature set is fused to obtain fused features based on feature importance evaluation and adaptive feature fusion mechanism, including, Assume:
[0013] Introduce the channel importance weight:
[0014] where GAP is the global average pooling, is the dimension reduction matrix, ReLU activation function, dimension lifting matrix, Sigmoid function, Introducing spatial importance weights:
[0015] where max-pooling and average-pooling along the channel dimension, respectively, [;] is channel concatenation, 3x3 convolution; Introducing eggplant prior knowledge:
[0016] Final importance weights:
[0017] Initial settings = 0.8 = 0.2; Adaptive feature fusion is as follows: First, the resolution is unified, and the formula is
[0018] where element-wise multiplication to upsample all feature maps to the maximum resolution ; Introducing a gating fusion mechanism:
[0019]
[0020] gate weight matrix, 1x1 convolution, used to learn cross-level information interaction; Final eggplant shape adaptation enhancement:
[0021] 1x3 horizontal convolution kernel, used to enhance eggplant long stem ratio features, used to control the enhancement strength of horizontal features.
[0022] Further, specifically, the eggplant color feature in the fused feature is optimized to obtain the final color feature, and the fused feature is updated, including, Adaptive hue enhancement is performed by the following formula:
[0023] where H is the input color gamut value, For the target purple color tone center value, is the hue enhancement bandwidth, is the enhancement intensity coefficient; The saturation adaptive adjustment formula is:
[0024] where S is the input saturation value, is the image average saturation, is the saturation enhancement coefficient; The color attention mechanism formula is:
[0025] where is a 3x3 learnable convolution, the purpose is to highlight the main region of the eggplant: Purple probability mask generation:
[0026] S is the input saturation value, V is the input brightness value, is the maximum saturation normalization factor, taking 1, is the maximum brightness normalization factor, taking 255, Stem green feature extraction:
[0027] S is the input saturation value, Take 10, indicating the green color tone tolerance, indicating the function of excluding highlight reflection.
[0028] Reflection area detection:
[0029] indicating the function of excluding low brightness, indicating the function of excluding high saturation, the whole can indicate the detection of the area in the image due to strong light reflection, Color feature extraction:
[0030] where k=1, 2, 4, 8, is the multi-scale pooling size;
[0031] respectively, the image mean and standard deviation, is a learnable enhancement coefficient; The color statistical feature formula is:
[0032] where , is the mean and standard deviation, , are the third and fourth order statistical matrices, respectively, which are used to describe the color distribution; The final color feature expression formula is: .
[0033] Further, specifically, based on the conditional gating and bidirectional information flow mechanism, the updated fusion features are recognized to obtain the maturity and position information of eggplants, including, use a shared backbone encoder to extract general features of the image:
[0034] X is the input image, is the extracted basic shared feature map; Then the classification task and the regression task each have a lightweight task-specific encoder to extract highly specialized features from ;
[0035]
[0036] where are the task-specific encoders for classification and regression tasks, respectively, is the classification task-specific feature, which focuses on maturity-related details, is the regression task-specific feature, which focuses on position and boundary details; A position-aware gate is constructed to use the position information of the regression task to guide the region that the classification task should focus on,
[0037]
[0038] represents the pooling operation on the basic features inside the boundary box predicted by the regression head, obtaining fixed-size region features, which encodes the position information into features, represents the concatenation operation, , are the weights and biases of the position-aware gate network, is the Sigmoid activation function, is the generated spatial gating map, and the larger the value represents the more important the position feature is to classification, is an element-wise multiplication method, is the classification feature enhanced by position information; The semantic perception gate is constructed, and the semantic information of the classification task, i.e., mature confidence, is used to adjust the attention of the regression task;
[0039]
[0040] wherein is the maturity probability of the preliminary prediction of the classification head, and 1 is the mature confidence of the classification head; is a tensor with the same spatial size and element 1, represents that the one-dimensional semantic confidence information is copied to the entire spatial dimension to form a semantic confidence map, represents a generated channel gating map, is the regression feature adjusted by the semantic information, , are weights and biases of the semantic perception gating network; The final task prediction is based on the enhanced feature, Classification head:
[0041]
[0042] Regression head:
[0043]
[0044] , is the final classification and regression head, is the real classification label, is the real bounding box coordinate; The total loss function is introduced, and the total loss is composed of the main task loss and the auxiliary loss of the two gating modules, the auxiliary loss ensures the effectiveness of the preliminary prediction and , so as to ensure that the information flowing into the gating module is of high quality;
[0045] is a parameter for balancing the auxiliary loss and the main loss, respectively, the classification head main task loss and the regression head main task loss.
[0046] The application also provides an image recognition device for an eggplant picking machine, characterized by comprising the following: An image acquisition module is configured to acquire eggplant images collected by an eggplant picking machine; An interactivity module is configured to perform feature extraction on the eggplant images based on an interactivity scale transformation factor of eggplant feature perception to improve a fixed factor scale strategy to obtain a feature set; A feature fusion module is configured to perform feature fusion on the feature set based on feature importance evaluation and an adaptive feature fusion mechanism to obtain fused features; A color feature enhancement module is configured to optimize eggplant color features in the fused features to obtain final color features and update the fused features; An eggplant image recognition module is configured to recognize the updated fused features based on a conditional gating and bidirectional information flow mechanism to obtain maturity and position information of the eggplants.
[0047] The present application has the following advantages: The present application provides an image recognition method and device for an eggplant picking machine, which aims to enhance the expression ability of eggplant color and morphological features by constructing a multi-scale interactivity module and introducing feature importance evaluation and an adaptive fusion mechanism; based on a conditional gating and bidirectional information flow mechanism, dynamic information complementarity between classification and regression tasks is realized to improve maturity judgment and positioning accuracy; finally, a robust and adaptable eggplant image recognition model is constructed to accurately recognize the maturity and position information of eggplants in different environments, providing reliable technical support for automated picking, and the specific advantages are as follows: 1. By using an interactivity scale transformation method based on eggplant image feature perception, dynamic scaling factors and structure protection mechanisms are introduced to adaptively scale the image for the elongated shape of the eggplant and the key structure of the stem, avoiding deformation and preserving key identification information; 2. By introducing feature importance evaluation and an adaptive fusion mechanism, multi-scale features are weighted and fused by combining channel, spatial and eggplant prior weights, and cross-level information complementarity is realized by using a gating mechanism to improve feature expression ability; 3. By using adaptive hue enhancement, saturation adjustment and color attention mechanisms, the expression of eggplant color features in different environments is optimized, and the robustness and discriminability of color features are improved by combining multi-scale pooling and statistical features; 4. By constructing an identification module based on a conditional gating and bidirectional information flow mechanism, semantic and position information interaction between classification and regression tasks is realized to enhance task-specific features, and auxiliary loss is used to ensure preliminary prediction quality to improve maturity judgment and positioning accuracy. BRIEF DESCRIPTION OF DRAWINGS
[0048] The above and other features of the present disclosure will become more apparent by describing in detail the embodiments thereof with reference to the attached drawings, in which like reference numerals refer to like elements or features and wherein: Figure 1 Fig. 1 shows a flow chart of an image recognition method for an eggplant picking machine according to an embodiment of the present disclosure; Figure 2 Fig. 2 shows a flow chart of a scale transformation according to an embodiment of the present disclosure; Figure 3 Fig. 3 shows a flow chart of feature fusion according to an embodiment of the present disclosure; Figure 4 Fig. 4 shows a flow chart of color feature optimization according to an embodiment of the present disclosure; Figure 5 Fig. 5 shows a flow chart of recognition of updated fusion features based on conditional gating and bidirectional information flow mechanism according to an embodiment of the present disclosure. DETAILED DESCRIPTION
[0049] The concept, specific structure and generated technical effects of the present disclosure will be described clearly and completely below in combination with embodiments and drawings, so as to fully understand the purpose, scheme and effects of the present disclosure. It should be noted that the embodiments in the present disclosure and the features in the embodiments can be combined with each other without conflict. The same reference numerals in the drawings indicate the same or similar parts.
[0050] Embodiment 1, refer to Figure 1 The present disclosure provides an image recognition method for an eggplant picking machine, comprising the following steps: obtaining an eggplant image collected by an eggplant picking machine; performing feature extraction on the eggplant image based on an interactive scale transformation factor improved fixed factor scale strategy of an eggplant feature perception to obtain a feature set; performing feature fusion on the feature set based on a feature importance evaluation and an adaptive feature fusion mechanism to obtain fusion features; optimizing an eggplant color feature in the fusion features to obtain a final color feature and update the fusion features; recognizing the updated fusion features based on a conditional gating and bidirectional information flow mechanism to obtain maturity and position information of the eggplant.
[0051] In this embodiment 1, by constructing a multi-scale interaction module, introducing feature importance evaluation and adaptive fusion mechanism, the expression ability of eggplant color and morphological characteristics is enhanced; based on the conditional gate and bidirectional information flow mechanism, the dynamic information complement between classification and regression tasks is realized, and the positioning accuracy of maturity is improved; finally, a robust and adaptive eggplant image recognition model is constructed to accurately identify the maturity and location information of eggplants in different environments, and provide reliable technical support for automatic picking.
[0052] In addition, considering the problem of model training, when training the eggplant image recognition model, images under different conditions can be collected, such as backlight, backlight, sunny day, cloudy day environment, mature eggplant, immature eggplant with different maturity, and eggplant images with different shielding such as being shielded by leaves and overlapping fruits to form a training set for training in the above steps, and the obtained eggplant image recognition model can basically cover eggplant images under various conditions.
[0053] Reference Figure 2 As a preferred embodiment of the present application, specifically, the interactive scale transformation factor based on the feature perception of eggplant improves the scale strategy of the fixed factor to extract features from the eggplant image to obtain a feature set, including, The input image I is:
[0054] The target input size is ; The interactive scaling process is defined as:
[0055] Where τ is the scale transformation function, , The formula of the dynamic scaling factor is as follows:
[0056]
[0057] Where is the image horizontal gradient, which responds to the elongated shape feature of eggplant, and the horizontal gradient can better represent the edge of the main body of eggplant; is the stem area energy obtained by threshold segmentation through the HSV green channel, and the stem of eggplant is a key recognition part, which needs to be specially protected for its structural integrity; is the balance weight of shape feature and key part protection; Compared with the traditional fixed scaling, the width direction scaling ratio can be automatically increased when the eggplant horizontal gradient energy is large, which can avoid the over-compression of elongated objects,
[0058] The method can be used when the horizontal gradient energy of eggplant is large, i.e. When the comparison is large and reaches the trigger threshold 25, the width direction scaling ratio is automatically increased The limit is that the scaling ratio can reach 1.2, and compared with the traditional fixed scaling, the increase of the horizontal direction scaling ratio can avoid the over-compression of the slender eggplant.
[0059] And the image protection is performed on the rhizome to obtain accurate picking point position information, and a stem region mask is generated by color thresholding,
[0060] S is an input saturation value, 10 represents a green color tone tolerance, and the function represents the exclusion of highlight reflection; The scaled feature size is calculated through the interactive scale transformation factor, and then different scale features are extracted through convolution, and finally the feature set F={ , … } is obtained, and l is the lth feature.
[0061] Referring to Figure 3 As a preferred embodiment of the present application, specifically, the feature set is fused to obtain fused features based on feature importance evaluation and an adaptive feature fusion mechanism, including, Suppose:
[0062] The channel importance weight is introduced:
[0063] Where GAP is a global average pooling, is a dimension reduction matrix, is a ReLU activation function, is a dimension increasing matrix, is a Sigmoid function, The spatial importance weight is introduced:
[0064] Where are the maximum pooling and average pooling along the channel dimension, respectively, [;] is channel splicing, is a 3x3 convolution; Prior knowledge of eggplant is introduced:
[0065] The final importance weight is:
[0066] Initial setting =0.8 =0.2; Adaptive feature fusion is performed as follows: First, the resolution is unified, and the formula is
[0067] Wherein is an element-wise multiplication to upsample all feature maps to the maximum resolution ; Introduce a gating fusion mechanism:
[0068]
[0069] The gating weight matrix is is a 1x1 convolution used to learn cross-level information interaction; Finally, the eggplant shape adaptation degree is enhanced:
[0070] is a 1x3 horizontal convolution kernel used to enhance the eggplant stem ratio feature, is used to control the horizontal feature enhancement strength.
[0071] Referring to Figure 4 , as a preferred embodiment of the present application, specifically, the eggplant color feature in the fused feature is optimized to obtain the final color feature, and the fused feature is updated, including, Adaptive hue enhancement is performed by the following formula:
[0072] Wherein H is the input color gamut value, is the target purple hue center value, is the hue enhancement bandwidth, is the enhancement intensity coefficient; as preferred, is the target purple hue center value, is the hue enhancement bandwidth, .
[0073] Saturation adaptive adjustment is performed, and the formula is:
[0074] Wherein S is the input saturation value, is the average saturation of the image, is the saturation enhancement coefficient, preferably 0.3; The color attention mechanism formula is introduced as:
[0075] wherein is a 3x3 learnable convolution, aiming to highlight the main body region of eggplant: Purple probability mask generation:
[0076] S is the input saturation value, V is the input lightness value, is the maximum saturation normalization factor, taking 1, is the maximum lightness normalization factor, taking 255, Stem green feature extraction:
[0077] S is the input saturation value, taking 10, indicating the green hue tolerance, indicating a function of excluding high light reflection.
[0078] Reflection region detection:
[0079] indicating a function of excluding low lightness, indicating a function of excluding high saturation, the whole can represent the region of the image due to strong light reflection, Color feature extraction:
[0080] wherein k=1, 2, 4, 8, is the multi-scale pooling size;
[0081] are the image mean and standard deviation, respectively, is a learnable enhancement coefficient; The color statistical feature formula is:
[0082] wherein , are the mean and standard deviation, , are the third and fourth order statistical matrices, respectively, used to describe the color distribution; because for the H channel, and are effective and robust features, high-order statistical matrices are not suitable, and the provided information is not stable and has little value; for the S channel and The change of color purity has been described, and The key information has been captured, and it is meaningless to do high-order matrix; for the V channel, the high peak degree distribution is relatively concentrated in the graph, so it is meaningful to do high-order statistical matrix, so only the V in HSV needs to be processed by high-order matrix.
[0083] The final color feature expression formula is: .
[0084] As a preferred embodiment of the present application, specifically, based on the condition gating and bidirectional information flow mechanism, the updated fusion features are identified to obtain the maturity and position information of eggplants, including, using a shared backbone encoder extracting general features of the image:
[0085] X is an input image, is the extracted basic shared feature map; Then the classification task and the regression task each have a lightweight task-specific encoder, which extracts highly specialized features from .
[0086]
[0087] wherein are the task-specific encoders of the classification and regression tasks, is the classification task-specific feature, which focuses on maturity-related details, is the regression task-specific feature, which focuses on position and boundary details; a position-aware gate is constructed to use the position information of the regression task to guide the region that the classification task should focus on,
[0088]
[0089] represents the pooling operation of the basic feature inside the boundary box predicted by the regression head to obtain a fixed-size region feature, which encodes the position information into features, and represents the splicing operation, , are the weights and biases of the position-aware gate network, is a Sigmoid activation function, is the spatial gating map, the larger the value is, the more important the position feature is to the classification, is the element-wise multiplication, is the classification feature enhanced by the position information; The semantic-aware gating is constructed to adjust the focus of the regression task by the semantic information of the classification task, i.e., the mature confidence;
[0090]
[0091] wherein is the maturity probability of the preliminary prediction of the classification head, 1 is the is a tensor with the same spatial size as and the elements are 1, represents copying the one-dimensional semantic confidence information to the entire spatial dimension to form a semantic confidence map, represents the generated channel gating map, is the regression feature adjusted by the semantic information, , are the weights and biases of the semantic-aware gating network; The final task prediction is based on the enhanced feature, Classification head:
[0092]
[0093] Regression head:
[0094]
[0095] , is the final classification and regression head, is the true classification label, is the true bounding box coordinates; The total loss function is introduced, and the total loss is composed of the main task loss and the auxiliary loss of the two gating modules. The auxiliary loss ensures the effectiveness of the and , thereby ensuring that the information flowing into the gating module is of high quality;
[0096] is a parameter for balancing the auxiliary loss and the main loss, are the classification head main task loss and the regression head main task loss, respectively.
[0097] Compared with the traditional method of separating the classification task and the regression task, the method provided in the embodiment can dynamically and selectively share information between the tasks, complement each other through a gating mechanism, be more flexible, and make the two tasks, i.e., the classification task (judging whether the eggplant is mature) and the regression task (delineating the bounding box), more accurate and efficient.
[0098] In the embodiment 2, the application further provides an image recognition device for an eggplant picking machine, which comprises the following: An image acquisition module, configured to acquire an eggplant image collected by the eggplant picking machine; An interactive module, configured to perform feature extraction on the eggplant image based on an interactive scale transformation factor of eggplant feature perception to improve a fixed factor scale strategy, to obtain a feature set; A feature fusion module, configured to perform feature fusion on the feature set based on feature importance evaluation and an adaptive feature fusion mechanism, to obtain fused features; A color feature enhancement module, configured to optimize eggplant color features in the fused features to obtain final color features, and update the fused features; An eggplant image recognition module, configured to recognize the updated fused features based on a conditional gating and bidirectional information flow mechanism, to obtain maturity and position information of the eggplant.
[0099] In addition, each functional module in each embodiment of the application can be integrated in one processing module, or each module can exist physically independently, or two or more modules can be integrated in one module. The integrated module can be realized in the form of hardware or in the form of a software functional module.
[0100] When the integrated module is realized in the form of a software functional module and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, all or part of the processes in the above-mentioned embodiment methods can also be completed by a computer program instructing related hardware, and the computer program can be stored in a computer-readable storage medium. When the processor executes the computer program, the steps of each method embodiment described above can be implemented. The computer program includes computer program code, which can be in the form of source code, object code, executable files or some intermediate forms, etc. The computer-readable medium can include any entity or system, recording medium, U disk, mobile hard disk, magnetic disk, optical disk, computer memory, read-only memory (ROM), random access memory (RAM), electrical carrier signal, telecommunication signal and software distribution medium, etc. that can carry the computer program code.
[0101] Although the description of the application has been quite detailed and particularly with respect to several described embodiments, it is not intended to limit the application to any of these details or embodiments or any particular embodiment, but rather it is intended to cover the intended scope of the application as provided by the appended claims, which should be interpreted as broadly as the prior art will permit, effectively encompassing the intended range of the application. Furthermore, the above description of the application is made by way of example with the embodiments that the inventors can foresee, and the purpose is to provide a useful description, and those non-essential changes to the application that have not yet been foreseen can still represent equivalent changes to the application.
[0102] The above description is only the preferred embodiments of the present application, and the present application is not limited to the above-described embodiments, but any technical solutions and / or embodiments within the protection scope of the present application, as long as they achieve the same technical effects by the same means, should belong to the protection scope of the present application.
Claims
1. An image recognition method for an eggplant harvester, characterized in that, Including the following: Acquire images of eggplants captured by an eggplant harvester; Based on eggplant feature perception, an interactive scale transformation factor improves the scale scaling strategy of the fixed factor to extract features from the eggplant image to obtain a feature set; The feature set is fused based on feature importance assessment and an adaptive feature fusion mechanism to obtain fused features; The eggplant color feature in the fused features is optimized to obtain the final color feature, and the fused features are then updated. Based on conditional gating and bidirectional information flow mechanisms, the updated fusion features are identified to obtain the maturity and location information of eggplants.
2. The image recognition method for an eggplant harvester according to claim 1, characterized in that, Specifically, a feature set is obtained by improving the scale scaling strategy of the fixed factor based on the interactive scale transformation factor of eggplant feature perception to extract features from the eggplant image, including: The input image I is: The target input size is ; The interactive scaling process is defined as follows: Where τ is the scaling function. , The dynamic scaling factor is calculated using the following formula: in The horizontal gradient of the image, responding to the slender shape of the eggplant, better represents the edge of the eggplant body; The energy in the stem region is obtained by threshold segmentation using the HSV green channel. To balance the protection weight of shape features and critical parts; The above formula represents the energy gradient at the eggplant level. When the trigger threshold of 25 is reached, the scaling ratio in the width direction will be automatically increased. The maximum scaling ratio is 1.2; In addition, image protection is performed on the rhizomes to obtain accurate harvesting point location information, and stem area masking codes are used. Generated by color thresholding S is the input saturation value. A value of 10 indicates a tolerance level for green hues. This function represents the function that excludes highlights and reflections. The scaled feature size is calculated using an interactive scaling factor, and then features at different scales are extracted through convolution, ultimately yielding the feature set F={ , ... }, where l is the l-th feature.
3. The image recognition method for an eggplant harvester according to claim 2, characterized in that, Specifically, based on feature importance assessment and an adaptive feature fusion mechanism, the feature set is fused to obtain fused features, including: Assumption: Introducing channel importance weights: GAP stands for Global Average Pooling. For a dimension reduction matrix, It is the ReLU activation function. For an upgraded matrix, For the Sigmoid function, Introduce spatial importance weights: in These represent max pooling and average pooling along the channel dimension, respectively, and [;] represents channel concatenation. It is a 3×3 convolution; Introducing prior knowledge about eggplant: Final importance weights: Initial settings =0.8 =0.2; Adaptive feature fusion is performed as follows: First, unify the resolution using the following formula: in To upsample all feature maps to the maximum resolution for element-wise multiplication ; Introducing a gating fusion mechanism: For the gated weight matrix, It is a 1×1 convolution, used to learn cross-level information interaction; The final eggplant shape adaptation is improved: A 1×3 horizontal convolution kernel was used to enhance the eggplant stem-to-length ratio feature. Used to control the intensity of horizontal feature enhancement.
4. The image recognition method for an eggplant harvester according to claim 3, characterized in that, Specifically, the eggplant color feature in the fused features is optimized to obtain the final color feature, and the fused features are updated, including... Adaptive tone enhancement is achieved using the following formula: Where H is the input color gamut value. The target purple hue center value, It is a hue enhancement bandwidth, It is the strength enhancement coefficient; The formula for adaptive saturation adjustment is as follows: Where S is the input saturation value. It is the average saturation of the image. This is the saturation enhancement coefficient; The formula for introducing the color attention mechanism is: in The purpose of using a 3×3 learnable convolution is to highlight the main region of the eggplant image. Purple probability mask generation: S represents the input saturation value, and V represents the input brightness value. As a preset constant, This is the maximum saturation normalization factor, with a value of 1. The maximum brightness normalization factor is set to 255. Green feature extraction from stems: S is the input saturation value. A value of 10 indicates a tolerance level for green hues. This function represents the function that excludes highlights and reflections. Reflective area detection: This indicates a function to exclude low brightness levels. This function excludes highly saturated areas; overall, it represents the regions in the detected image that are reflected due to strong light. Color feature extraction: Where k = 1, 2, 4, 8, is the multi-scale pooling size; These are the image mean and standard deviation, respectively. For learnable enhancement coefficients; The formula for color statistical characteristics is: in , For the mean and standard deviation, , These are third-order and fourth-order statistical matrices, used to describe the color distribution; The final color feature expression formula is: 。 5. The image recognition method for an eggplant harvester according to claim 4, characterized in that, Specifically, based on conditional gating and a two-way information flow mechanism, the updated fusion features are identified to obtain the maturity and location information of the eggplant, including... Use a shared trunk encoder Extract common features from images: X is the input image. The extracted basic shared feature map; Then, the classification and regression tasks each have a lightweight task-specific encoder, from... Highly specialized features are extracted from it; in Task-specific encoders for classification and regression tasks, respectively. To classify task-specific features, focus on maturity-related details. To regress task-specific features, focus on location and boundary details; Construct a location-aware gating system to use location information from the regression task to guide the areas that the classification task should focus on. This indicates the initial bounding box predicted by the regression head. Internal basic characteristics Pooling is performed to obtain features of a fixed-size region. This operation encodes location information as features. [,] represents a concatenation operation. , For the weights and biases of the position-aware gating network, It is the Sigmoid activation function. This generates a spatial gating map; a larger value indicates that the feature at that location is more important for classification. It is the element-wise multiplication method. These are classification features enhanced with location information; Construct a semantic-aware gating system and use the semantic information of the classification task, i.e., mature confidence, to adjust the focus of the regression task. in The initial maturity probability predicted by the classification head, where 1 represents the probability of maturity relative to the classification head. Tensors with the same spatial dimensions and all elements being 1 This means copying the one-dimensional semantic confidence information to the entire spatial dimension to form a semantic confidence graph. This represents the generated channel gating diagram. These are regression features adjusted for semantic information. , The weights and biases of the semantically aware gating network; The final task prediction is based on the enhanced features. Category Header: Return to the head: , For the final classification and regression probe, For real category labels, These are the actual bounding box coordinates; A total loss function is introduced, consisting of the main task loss and the auxiliary losses from the two gating modules. The auxiliary losses ensure the accuracy of the initial predictions. and The effectiveness of this ensures that the information from the entry control module is of high quality; These are parameters used to balance the auxiliary loss and the main loss. These are the classification head primary task loss and the regression head primary task loss, respectively.
6. An image recognition device for an eggplant harvester, characterized in that, Including the following: The image acquisition module is used to acquire images of eggplants collected by the eggplant harvester; An interactive module is used to extract features from the eggplant image to obtain a feature set by improving the scale scaling strategy of the fixed factor based on the interactive scale transformation factor of eggplant feature perception. The feature fusion module is used to perform feature fusion on the feature set based on feature importance evaluation and an adaptive feature fusion mechanism to obtain fused features; The color feature enhancement module is used to optimize the eggplant color features in the fused features to obtain the final color features and update the fused features; The eggplant image recognition module is used to identify updated fused features based on conditional gating and bidirectional information flow mechanisms to obtain the maturity and location information of eggplants.
