Agent-based agricultural product detection model construction method, electronic device, and medium
Patent Information
- Application Number
- CN202610805668.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2026-06-05
- Publication Date
- 2026-10-16
- Estimated Expiration
- 2046-06-05
AI Technical Summary
[0003]但是农业作业现场环境复杂多变,采摘目标常呈现小目标或远距离分布状态,且伴随叶片与枝条的遮挡、果串密集重叠等现象
[0017]The method, electronic device, and medium for constructing an agricultural product detection model based on an intelligent agent disclosed in this application can provide targeted evaluation criteria for the model by constructing bucketed datasets tailored to specific harvesting scene characteristics, such as data subsets containing specific features like occlusion, density, and light and shadow changes. Then, the model-building intelligent agent automatically trains and validates multiple candidate model architectures quickly, avoiding blind manual selection. It also combines a pre-trained visual language model to perform in-depth analysis of the work scenario and automatically maps and generates training configuration parameters. The model-building intelligent agent then performs segmented adjustment training on the target model architecture using the bucketed datasets, automatically adapting to complex agricultural scenarios for training and adjustment. Finally, edge deployment optimization ensures successful deployment of the target trained model, resulting in the target deployed model. This achieves automatic construction of agricultural product detection models based on the characteristics of agricultural scenarios through a model-building intelligent agent, reducing manual debugging costs.
Smart Images

Figure CN122336335B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of machine learning technology, and in particular to a method for constructing an agent-based agricultural product detection model, an electronic device, and a medium. Background Technology
[0002] With the development of agricultural automation, agricultural harvesting robots have become an important tool for improving production efficiency and reducing labor costs. In the operation process of harvesting robots, the accurate identification and positioning of fruits, crops and their ripeness by the target detection model is a key prerequisite for achieving automated grasping.
[0003] However, agricultural work environments are complex and variable. Harvesting targets are often small or distributed over long distances, and are often obscured by leaves and branches, with densely overlapping fruit clusters. Furthermore, environmental lighting conditions are unstable, with alternating strong glare and shadows, rain, fog, dust pollution, and motion blur caused by robotic arms. Moreover, the appearance of the same crop varies significantly under different light intensities, maturity levels, varieties, and cultivation methods.
[0004] Therefore, how to develop a method for constructing an agricultural product detection model that can automatically adapt to complex agricultural scenarios and reduce the cost of manual adjustment has become an urgent technical problem to be solved. Summary of the Invention
[0005] The main objective of this application is to propose a method, electronic device, and medium for constructing an agricultural product detection model based on an intelligent agent, aiming to enable the automatic construction of an agricultural product detection model that can adapt to complex agricultural scenarios.
[0006] To achieve the above objectives, a first aspect of this application proposes a method for constructing an agricultural product detection model based on an intelligent agent. The method is applied to an intelligent agent for model construction and includes: Acquire product images of the target agricultural product and construct a bucketed dataset based on the product images of the target agricultural product; wherein the bucketed dataset contains multiple data subsets, each of which corresponds to specific features in the scenario of harvesting the target agricultural product; Multiple candidate model architectures for agricultural product testing tasks are obtained, and each candidate model architecture is quickly trained and validated in a preset number of rounds using the bucketed dataset. The target model architecture is then determined from the multiple candidate model architectures. Acquire sampled images of the scene to be worked on, and input the sampled images into a pre-trained visual language model for scene feature analysis to obtain the corresponding scene feature information; Based on the scene feature information, corresponding training configuration parameters are generated, and the training configuration parameters are applied to the target model architecture. For the target model architecture using the training configuration parameters, the target training model is obtained by segmented adjustment training using the model-built agent and the bucketed dataset. Based on the benchmark test information from the deployment end, the target training model is optimized for deployment on the edge to obtain the target deployment model.
[0007] In some embodiments, the step of performing segmented tuning training on the target model architecture using the training configuration parameters and the bucketed dataset to obtain the target training model includes: The target model architecture, which applies the training configuration parameters, is subjected to segmented adjustment training to determine multiple training stages; At the end of each training phase, phase training indicators are obtained; The stage training metrics are input into the model building agent to perform model quality analysis and obtain model training control instructions or model architecture adjustment information. In response to obtaining the model architecture adjustment information, the target model architecture is adjusted based on the model architecture adjustment information, and the segmented adjustment training is performed based on the adjusted target model architecture to obtain the target training model; In response to receiving the model training control command, the segmented adjustment training is adjusted based on the model training control command to obtain the target training model.
[0008] In some embodiments, optimizing the target trained model based on benchmark information from the deployment end to obtain the target deployment model includes: Convert the target training model into a preset format model; The single-frame latency, throughput, and resource consumption information of the preset format model on the deployment end are obtained as the benchmark test information; Based on the benchmark test information, the target training model is quantized or pruned to obtain the target deployment model adapted to the deployment end.
[0009] In some embodiments, after optimizing the target training model based on the benchmark information from the deployment end to obtain the target deployment model, the method further includes: The target deployment model is post-optimized based on a preset post-optimization strategy to obtain the model to be evaluated. The bucketed dataset is used to optimize the model to be evaluated, and optimization index data is obtained. If the optimization metric data indicates that the performance of the model to be evaluated has declined relative to the target deployment model, then an automatic rollback instruction is executed to restore it to the target deployment model.
[0010] In some embodiments, obtaining multiple candidate model architectures for agricultural product testing tasks, and performing rapid training and validation on each candidate model architecture through the bucketed dataset for a preset number of rounds, and determining the target model architecture from the multiple candidate model architectures, includes: Based on the bucketed dataset, each candidate model architecture is rapidly trained and validated in a preset number of rounds to obtain short training performance data corresponding to each candidate model architecture. Based on the short training performance data, the candidate model architecture with the best performance is selected from all the candidate model architectures and determined as the target model architecture.
[0011] In some embodiments, generating corresponding training configuration parameters based on the scene feature information includes: The visual language model is used to identify the fruit size ratio, occlusion degree, density, light intensity, and background interference in the sampled image to obtain the scene feature information; Based on the scene feature information, the corresponding input resolution, data augmentation strategy, and configuration suggestions for the detection head feature layer are automatically mapped and used as the training configuration parameters.
[0012] In some embodiments, after optimizing the target training model based on the benchmark information from the deployment end to obtain the target deployment model, the method further includes: Obtain the deployment model performance metrics of the target deployment model; The scene feature information, the training configuration parameters, the target deployment model, and the corresponding performance indicators of the deployment model are used to generate a target model version, which is then stored in a preset version experience library.
[0013] In some embodiments, the method further includes: After acquiring a sampled image of the scene to be worked on and inputting the sampled image into a pre-trained visual language model for scene feature analysis to obtain the corresponding scene feature information, the method further includes: Based on the scene feature information, a matching target model version is retrieved from the version experience base; Reusable reference experience information is extracted from the target model version, and the corresponding target deployment model is used as a comparison deployment model; The target deployment model is generated based on the aforementioned reference experience information; After optimizing the target training model based on the benchmark information from the deployment end to obtain the target deployment model, the process further includes: Based on the performance comparison between the target deployment model and the comparison deployment model, the final target deployment model is determined.
[0014] To achieve the above objectives, a second aspect of this application proposes an agent-based agricultural product detection model construction system, the system comprising: A dataset construction model is used to acquire product images of target agricultural products and construct bucketed datasets based on the product images of the target agricultural products; wherein, the bucketed datasets contain multiple data subsets, each of which corresponds to specific features in the scenario of harvesting the target agricultural products; The architecture verification module is used to obtain multiple candidate model architectures for agricultural product testing tasks, and to perform a preset number of rounds of rapid training and verification on each candidate model architecture using the bucketed dataset, and to determine the target model architecture from the multiple candidate model architectures. The visual analysis module is used to acquire sampled images of the scene to be worked on, and input the sampled images into a pre-trained visual language model for scene feature analysis to obtain the corresponding scene feature information; The training parameter configuration module is used to generate corresponding training configuration parameters based on the scene feature information and apply the training configuration parameters to the target model architecture. The segmented training module is used to perform segmented adjustment training on the target model architecture using the model-built agent and the bucketed dataset, based on the training configuration parameters, to obtain the target training model. The edge optimization module is used to optimize the target training model on the edge based on the benchmark test information of the deployment end, so as to obtain the target deployment model.
[0015] To achieve the above objectives, a third aspect of this application provides an electronic device, which includes a memory and a processor. The memory stores a computer program, and the processor executes the computer program to implement the agent-based agricultural product detection model construction method described in the first aspect.
[0016] To achieve the above objectives, a fourth aspect of the present application provides a computer-readable storage medium storing a computer program that, when executed by a processor, implements the agent-based agricultural product detection model construction method described in the first aspect.
[0017] The method, electronic device, and medium for constructing an agricultural product detection model based on an intelligent agent disclosed in this application can provide targeted evaluation criteria for the model by constructing bucketed datasets tailored to specific harvesting scene characteristics, such as data subsets containing specific features like occlusion, density, and light and shadow changes. Then, the model-building intelligent agent automatically trains and validates multiple candidate model architectures quickly, avoiding blind manual selection. It also combines a pre-trained visual language model to perform in-depth analysis of the work scenario and automatically maps and generates training configuration parameters. The model-building intelligent agent then performs segmented adjustment training on the target model architecture using the bucketed datasets, automatically adapting to complex agricultural scenarios for training and adjustment. Finally, edge deployment optimization ensures successful deployment of the target trained model, resulting in the target deployed model. This achieves automatic construction of agricultural product detection models based on the characteristics of agricultural scenarios through a model-building intelligent agent, reducing manual debugging costs.
[0018] Additional aspects and advantages of this application will be set forth in part in the description which follows, and in part will be obvious from the description, or may be learned by practice of this application. Attached Figure Description
[0019] The above and / or additional aspects and advantages of this application will become apparent and readily understood from the description of the embodiments taken in conjunction with the following drawings, in which: Figure 1 This is a flowchart illustrating a method for constructing an agricultural product detection model based on an intelligent agent, according to an embodiment of this application. Figure 2 This is another flowchart illustrating the method for constructing an agricultural product detection model based on an intelligent agent, as described in this application. Figure 3 This is another flowchart illustrating the method for constructing an agricultural product detection model based on an intelligent agent, as described in this application. Figure 4 This is another flowchart illustrating the method for constructing an agricultural product detection model based on an intelligent agent, as described in this application. Figure 5 This is another flowchart illustrating the method for constructing an agricultural product detection model based on an intelligent agent, as described in this application. Figure 6 This is another flowchart illustrating the method for constructing an agricultural product detection model based on an intelligent agent, as described in this application. Figure 7 This is another flowchart illustrating the method for constructing an agricultural product detection model based on an intelligent agent, as described in this application. Figure 8 This is another flowchart illustrating the method for constructing an agricultural product detection model based on an intelligent agent, as described in this application. Figure 9This is a schematic diagram of the hardware structure of the electronic device provided in the embodiments of this application. Detailed Implementation
[0020] The embodiments of this application are described in detail below. Examples of the embodiments are shown in the accompanying drawings, wherein the same or similar reference numerals denote the same or similar elements or elements having the same or similar functions throughout. The embodiments described below with reference to the accompanying drawings are exemplary and are only used to explain this application, and should not be construed as limiting this application.
[0021] In the description of this application, "several" means one or more, "more than" means two or more, "greater than," "less than," and "exceeding" are understood to exclude the stated number, while "above," "below," and "within" are understood to include the stated number. The use of "first" and "second" in the description is merely for distinguishing technical features and should not be construed as indicating or implying relative importance, or implicitly indicating the number of indicated technical features, or implicitly indicating the order of the indicated technical features.
[0022] In the description of this application, it should be understood that the orientation descriptions, such as up, down, left, right, front, and back, are based on the orientation or positional relationship shown in the accompanying drawings. They are only for the convenience of describing this application and simplifying the description, and do not indicate or imply that the device or element referred to must have a specific orientation, or be constructed and operated in a specific orientation. Therefore, they should not be construed as limitations on this application.
[0023] In the description of this specification, the references to terms such as "one embodiment," "some embodiments," "illustrative embodiment," "example," "specific example," or "some examples," etc., indicate that a specific feature, structure, material, or characteristic described in connection with that embodiment or example is included in at least one embodiment or example of this application. In this specification, the illustrative expressions of the above terms do not necessarily refer to the same embodiment or example. Furthermore, the specific features, structures, materials, or characteristics described may be combined in any suitable manner in one or more embodiments or examples.
[0024] In the description of this application, it should be noted that, unless otherwise explicitly defined, terms such as "setting," "installation," and "connection" should be interpreted broadly. Those skilled in the art can reasonably determine the specific meaning of the above terms in this application based on the specific content of the technical solution. Furthermore, the identification of specific steps in the following text does not imply a limitation on the order of steps or execution logic. The execution order and logic between each step should be understood and inferred from the content described in the embodiments.
[0025] With the development of agricultural automation, agricultural harvesting robots have become an important tool for improving production efficiency and reducing labor costs. In the operation process of harvesting robots, the accurate identification and positioning of fruits, crops and their ripeness by the target detection model is a key prerequisite for achieving automated grasping.
[0026] However, agricultural work environments are complex and variable. Harvesting targets are often small or distributed over long distances, and are often obscured by leaves and branches, with densely overlapping fruit clusters. Furthermore, environmental lighting conditions are unstable, with alternating strong glare and shadows, rain, fog, dust pollution, and motion blur caused by robotic arms. Moreover, the appearance of the same crop varies significantly under different light intensities, maturity levels, varieties, and cultivation methods.
[0027] Therefore, how to develop a method for constructing an agricultural product detection model that can automatically adapt to complex agricultural scenarios and reduce the cost of manual adjustment has become an urgent technical problem to be solved.
[0028] Based on this, embodiments of this application provide a method, electronic device, and medium for constructing an agricultural product detection model based on an intelligent agent, aiming to enable the automatic construction of an agricultural product detection model that can adapt to complex agricultural scenarios.
[0029] The method, electronic device and medium for constructing an agricultural product detection model based on intelligent agents provided in this application are specifically described through the following embodiments. First, the method for constructing an agricultural product detection model based on intelligent agents in this application is described.
[0030] The embodiments of this application can acquire and process relevant data based on artificial intelligence technology. Artificial intelligence (AI) refers to the theories, methods, technologies, and application systems that use digital computers or machines controlled by digital computers to simulate, extend, and expand human intelligence, perceive the environment, acquire knowledge, and use that knowledge to obtain optimal results.
[0031] Foundational technologies for artificial intelligence generally include sensors, dedicated AI chips, cloud computing, distributed storage, big data processing, operating / interactive systems, and mechatronics. AI software technologies mainly encompass computer vision, robotics, biometrics, speech processing, natural language processing, and machine learning / deep learning.
[0032] The method for constructing an agent-based agricultural product detection model provided in this application relates to the field of machine learning technology. This method can be applied to a terminal, a server, or software running on either a terminal or a server. In some embodiments, the terminal can be a smartphone, tablet, laptop, desktop computer, etc.; the server can be configured as an independent physical server, a server cluster or distributed system composed of multiple physical servers, or a cloud server providing basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communication, middleware services, domain name services, security services, CDN, and big data and artificial intelligence platforms; the software can be an application implementing the agent-based agricultural product detection model construction method, but is not limited to the above forms.
[0033] Reference Figure 1 , Figure 1 This is an optional flowchart illustrating the method for constructing an agricultural product detection model based on intelligent agents provided in this application embodiment. Figure 1 The method described above is applied to model building agents and may include, but is not limited to, steps S101 to S106.
[0034] Step S101: Obtain product images of the target agricultural products and construct a bucketed dataset based on the product images of the target agricultural products; wherein, the bucketed dataset contains multiple data subsets, and each data subset corresponds to specific features in the scene of picking the target agricultural products; Step S102: Obtain multiple candidate model architectures for agricultural product testing tasks, and quickly train and verify each candidate model architecture in a preset number of rounds using a bucketed dataset to determine the target model architecture from the multiple candidate model architectures. Step S103: Obtain a sampled image of the scene to be worked on, and input the sampled image into a pre-trained visual language model for scene feature analysis to obtain the corresponding scene feature information; Step S104: Generate corresponding training configuration parameters based on scene feature information, and apply the training configuration parameters to the target model architecture; Step S105: For the target model architecture with application training configuration parameters, segmented adjustment training is performed using the model building agent and bucketed dataset to obtain the target training model. Step S106: Based on the benchmark test information of the deployment end, perform edge deployment optimization on the target training model to obtain the target deployment model.
[0035] In step S101 of some embodiments, image data of the target agricultural product is first acquired, and a bucketed dataset is constructed based on these images. The design of the bucketed dataset aims to deconstruct the complex environmental factors in the agricultural harvesting scenario, thereby forming multiple independent data subsets. Each data subset corresponds to specific features in the process of harvesting the target agricultural product, such as small target distribution, leaf and branch occlusion, dense overlapping of fruit bunches, similar background colors, strong light and shadow interference, and motion blur. Through this subdivided bucketed dataset, a subsequent neural network model can be constructed for the application scenario of the target agricultural product, ensuring that the constructed neural network model can cope with various extreme working conditions.
[0036] In step S102 of some embodiments, multiple candidate model architectures pre-configured for the agricultural product detection task are retrieved. These candidate model architectures are some detection model architectures commonly used in agricultural product harvesting tasks. To efficiently evaluate the potential of each architecture, these candidate model architectures can be rapidly trained and validated using the aforementioned bucketed dataset for a preset number of rounds, such as performing fixed short-cycle training operations. By analyzing the performance of different candidate model architectures on the bucketed dataset, the most robust target model architecture can be automatically selected and determined from multiple candidate model architectures, thereby avoiding the one-sidedness of human experience-driven selection and realizing the objectivity and automation of model architecture selection.
[0037] Please see Figure 2 In some embodiments, step S102 may include, but is not limited to, steps S201 to S202: Step S201: Based on the bucketed dataset, perform a preset number of rounds of rapid training and verification on each candidate model architecture to obtain short training performance data corresponding to each candidate model architecture. Step S202: Based on the short training performance data, select the candidate model architecture with the best performance from each candidate model architecture and determine it as the target model architecture.
[0038] In step S201 of some embodiments, a fixed number of fast training and validation cycles are performed on each candidate model architecture using a pre-built bucketed dataset. For example, short-term training of 10 training cycles is performed on 4 to 7 pre-selected candidate architectures respectively. After the short-term training process, the performance of each candidate architecture on each subset of the bucketed dataset is obtained, thus obtaining short-training performance data. The short-training performance data includes the performance data of each candidate model architecture when facing the task of harvesting agricultural products, such as key quantitative indicators such as mean precision and recall for small object detection, dense occlusion, and conventional recognition tasks.
[0039] In step S202 of some embodiments, the architecture verification module compares the short training performance data of each candidate model architecture, comparing scores across multiple dimensions such as small target buckets, occlusion buckets, and dense cluster buckets, and can comprehensively rank the candidate model architectures according to a preset weight allocation. It should be noted that the dimensions here correspond to the various subsets of data in the bucketed dataset.
[0040] Based on the ranking results, the system automatically selects the candidate model architecture with the highest robustness in the agricultural harvesting environment from the candidate set and identifies it as the target model architecture. This achieves automated selection in the architecture selection stage and effectively avoids the bias that may be caused by human subjective judgment.
[0041] It should be noted that the process described above—using bucketed datasets to rapidly train and validate each candidate model architecture through a predetermined number of rounds, and selecting the best-performing candidate model architecture from among them based on short-training performance data—can be performed by the model-building agent. Especially after obtaining the short-training performance data for each candidate model architecture, since this data contains scores across multiple dimensions, determining how to assign different weights to the scores to comprehensively rank the candidate model architectures can also be accomplished by the model-building agent.
[0042] Steps S201 to S202 reduce the computational and time costs associated with model architecture selection, avoiding the uncertainties inherent in traditional models that rely on human experience. By finely ranking specific harvesting conditions, this approach ensures that the selected target architecture possesses stronger anti-occlusion capabilities and higher accuracy in small target recognition during subsequent model training, thus laying a solid foundation for building a high-quality agricultural product detection model.
[0043] In step S103 of some embodiments, sampled images of the actual work scenario are acquired, and these sampled images are input into a pre-trained visual language model for scene feature analysis. The visual language model can understand the complexity of the agricultural product environment from a semantic level, diagnosing physical characteristics such as the size ratio of fruit distribution, degree of occlusion, density, and lighting or background interference. Through scene feature analysis, scene feature information highly related to the current work environment can be obtained, providing a decision basis for subsequent model training.
[0044] It should be noted that the visual language model can meticulously depict the size ratio of the fruit in the image, the degree of occlusion by leaves or branches, the dense distribution of fruit clusters, as well as the intensity of strong reflections and shadow alternations in the environment, the degree of background interference, and the degree of motion blur caused by the movement of the robotic arm. Through the comprehensive analysis of these multi-dimensional visual information, it can be transformed into scene feature information that can characterize the characteristics of the current working environment.
[0045] In step S104 of some embodiments, based on the acquired scene feature information, corresponding training configuration parameters are automatically generated through a configuration mapping mechanism. These training configuration parameters involve specific aspects such as input image resolution adjustment, selection of data augmentation strategies, and preference settings for detection head weights. Subsequently, these specific training configuration parameters are applied to the target model architecture, thereby achieving an automated closed loop from environment perception to training strategy, ensuring that the neural network model can start learning in an optimal initial state, thereby improving the model's training convergence speed and detection performance.
[0046] It should be noted that this step can also be completed by the model building agent. The model building agent can schedule the required functional modules to complete this step, or schedule the corresponding neural network model to complete this step.
[0047] Please see Figure 3 In some embodiments, step S104 may include, but is not limited to, steps S301 to S302: Step S301: The visual language model is used to identify the fruit size ratio, occlusion degree, density, light intensity and background interference in the sampled image to obtain scene feature information; Step S302: Based on scene feature information, automatically map the corresponding input resolution, data augmentation strategy, and configuration suggestions for the detection head feature layer preference, which are used as training configuration parameters.
[0048] In step S301 of some embodiments, a pre-trained visual language model is used to perform deep recognition analysis on the sampled images. This visual language model has the ability to understand the semantics of the agricultural product harvesting environment and can perform quantitative diagnosis on multiple dimensions such as the size ratio of fruits, the severity of occlusion by leaves or branches, the distribution density of fruits, the light intensity at the site, and the degree of background interference in the sampled images. Through this diagnostic process, the perceived visual information is transformed into scene feature information that can describe the challenges of the current working scene, which is usually manifested as feature descriptions reflecting the proportion of small objects, the level of occlusion, and the intensity of light and shadow. This diagnostic method based on a large model ensures the comprehensiveness and accuracy of feature extraction for complex agricultural environments, providing an objective basis for subsequent strategy generation.
[0049] In step S302 of some embodiments, an automatic mapping mechanism from environmental diagnostic results to training strategies is established, namely a configuration mapping mechanism. Based on the acquired scene feature information, the most suitable training configuration parameters for the current specific environment can be automatically matched and mapped. These training configuration parameters specifically include, but are not limited to, suggestions for adjusting the input resolution, data augmentation strategies for specific lighting or occlusion conditions, and suggestions for setting preferences for detection heads or feature layer extraction. For example, when the diagnostic results show a high proportion of small targets or the presence of motion blur, the mapping mechanism will automatically generate a training configuration that increases the resolution or applies specific augmentation operators. This mapping process enables the neural network model to adaptively determine the training starting point in a data-driven manner, thereby significantly improving the targeting of subsequent training processes and the model convergence efficiency.
[0050] Through steps S301 to S302, by extracting the physical features of the agricultural product environment and converting them into specific training configuration parameters, the model's initial perception ability of small targets and highly occluded targets is improved. While ensuring detection accuracy, the training efficiency and environmental adaptability of the model are greatly optimized, and the technical pain point of blindly setting parameters by relying too much on human experience in traditional model training is effectively solved.
[0051] In step S105 of some embodiments, for a target model architecture that has been applied with specific training configuration parameters, the model building agent performs segmented adjustment training on the target model architecture using a bucketed dataset.
[0052] At the end of each training cycle, the model building intelligence analyzes the current training metrics trends and error patterns, automatically issuing commands to continue training, adjust parameters, or stop training. This dynamic intervention and adjustment mechanism guides the model to achieve a balance across multiple performance dimensions, ultimately yielding a target training model that meets application requirements.
[0053] Please see Figure 4 In some embodiments, step S105 may include, but is not limited to, steps S401 to S405: Step S401: Perform segmented adjustment training on the target model architecture using the applied training configuration parameters to determine multiple training stages; Step S402: At the end of each training phase, obtain the phase training index. Step S403: Input the stage training indicators into the model building agent to perform model quality analysis and obtain model training control instructions or model architecture adjustment information. Step S404: In response to obtaining model architecture adjustment information, adjust the target model architecture based on the model architecture adjustment information, and perform segmented adjustment training based on the adjusted target model architecture to obtain the target training model. Step S405: In response to receiving the model training control command, adjust the segmented training based on the model training control command to obtain the target training model.
[0054] In step S401 of some embodiments, segmented tuning training is performed on the target model architecture with the training configuration parameters applied, thereby determining multiple interconnected training phases. Specifically, the phase division method involves setting the overall training process into several phase rounds, for example, dividing every 50 iterations into an independent training phase.
[0055] In step S402 of some embodiments, at the key node at the end of each training phase, training metric data for that training phase can be extracted. These phase training metrics not only include the convergence values of the conventional loss function, but also focus on quantitative evaluation results such as recall, precision, and mean precision for small targets, occluded targets, and dense cluster subsets in the bucketed dataset. By obtaining these multi-dimensional phase feedbacks, the learning status and performance bottlenecks of the model in the current specific agricultural product harvesting scenario can be grasped in real time.
[0056] In step S403 of some embodiments, the acquired stage training metrics are input to the model building agent. This agent utilizes the decision analysis capabilities of a large model to perform in-depth analysis of model quality, thereby generating model training control instructions or model architecture adjustment information. The agent can logically judge the evolution trend of the stage training metrics and analyze whether the current model exhibits performance stagnation or specific error patterns. The model training control instructions typically involve operational suggestions such as continuing training, stopping training, or adjusting hyperparameters, while the model architecture adjustment information involves fine-tuning suggestions for network structure layers, feature layer fusion methods, or detector head configurations.
[0057] In step S404 of some embodiments, after responding to and receiving model architecture adjustment information, the current target model architecture can be structurally adjusted based on the model architecture adjustment information. The adjusted target model architecture is then used to re-enter the segmented adjustment training process, ultimately training the target training model. Dynamic adjustments at the architecture level can promptly correct the limitations exhibited by the target model architecture in actual training, enabling the target model architecture to achieve a higher degree of adaptation to the complex characteristics of agricultural product environments during the learning process.
[0058] In step S405 of some embodiments, after responding to and receiving a model training control command, the segmented adjustment training process can be intervened and adjusted based on the specific content of the model training control command, ultimately producing the target training model. If the model training control command requires parameter adjustment, specific actions such as optimizing the learning rate, changing the data augmentation intensity, or adjusting the loss weights that prioritize target recall are executed. Through closed-loop automatic adjustment logic, it is ensured that the model always runs on the optimal training path until the stopping condition is met and a high-quality target training model is output.
[0059] Steps S401 to S405 effectively address the technical problem of high manual tuning costs caused by parameter coupling in agricultural target detection model training, and avoid technical pain points such as wasted training rounds and slow iteration speed. By enabling the model-building agent to interpret and provide feedback on stage training metrics in real time, the model architecture and training strategy can be optimized, significantly improving the recall rate of the target training model when dealing with small and highly occluded targets, ensuring that the target training model has high adaptability to agricultural product harvesting scenarios.
[0060] In step S106 of some embodiments, benchmark test information of the target training model on the deployment hardware is obtained, including real-time performance indicators such as inference latency, throughput, and memory usage. Based on these hardware-level constraint feedbacks, edge deployment optimization operations are performed on the target training model, such as model conversion, quantization, pruning, or specific model optimization. The optimized target deployment model can maintain high detection accuracy and response speed in agricultural product harvesting operations on deployment terminals such as agricultural robots, even with limited computing power.
[0061] Please see Figure 5 In some embodiments, step S106 may include, but is not limited to, steps S501 to S503: Step S501: Convert the target training model into a preset format model; Step S502: Obtain the single-frame latency, throughput, and resource consumption information of the preset format model on the deployment end as benchmark test information; Step S503: Based on the benchmark test information, the target training model is quantized or pruned to obtain the target deployment model adapted to the deployment end.
[0062] In step S501 of some embodiments, the trained target model is exported and converted into a preset format model suitable for running on edge hardware. The target training model can be converted into a format supported by high-performance inference frameworks such as ONNX or TensorRT to fully utilize the computing power of specific hardware such as embedded GPUs or industrial control computers on the harvesting robot deployment end.
[0063] In step S502 of some embodiments, the performance of the preset format model is evaluated in the deployment hardware environment to obtain accurate benchmark information. The benchmark information covers key indicators of agricultural product harvesting operations, specifically including the single-frame latency of the model processing images, the throughput per unit time, and the resource consumption such as video memory or RAM generated during operation.
[0064] In step S503 of some embodiments, the obtained benchmark information is used as a reference, and the target training model is lightweighted using techniques such as quantization or pruning to finally obtain a target deployment model adapted to the deployment end. Depending on the limited computing power of the deployment end, redundant computational overhead can be reduced through pruning, or storage, memory, and power consumption requirements can be reduced through quantization, ensuring that the final target training model can run stably and efficiently on the agricultural product harvesting robot.
[0065] Steps S501 to S503 ensure that the harvesting robot can still achieve stable and efficient target detection even with limited hardware such as embedded GPUs or industrial control computers.
[0066] Steps S101 to S106 as illustrated in this embodiment involve: acquiring product images of the target agricultural product and constructing a bucketed dataset based on these images; wherein the bucketed dataset contains multiple data subsets, each corresponding to specific features in the scene of harvesting the target agricultural product; acquiring multiple candidate model architectures for the agricultural product detection task and performing rapid training and verification on each candidate model architecture for a preset number of rounds using the bucketed dataset to determine the target model architecture from the multiple candidate model architectures; acquiring sampled images of the scene to be processed and inputting these images into a pre-trained visual language model for scene feature analysis to obtain corresponding scene feature information; generating corresponding training configuration parameters based on the scene feature information and applying these training configuration parameters to the target model architecture; performing segmented adjustment training on the target model architecture using the applied training configuration parameters and the bucketed dataset to obtain the target training model; and optimizing the target training model for deployment based on benchmark information from the deployment end to obtain the target deployment model. Therefore, this application constructs bucketed datasets tailored to specific harvesting scene characteristics, such as subsets containing specific features like occlusion, density, and light and shadow variations, providing targeted evaluation criteria for the model. Then, a model-building agent is used to automatically and rapidly train and validate multiple candidate model architectures, avoiding blind manual selection. Furthermore, a pre-trained visual language model is combined to perform in-depth analysis of the work scenario, automatically mapping and generating training configuration parameters. The model-building agent then uses the bucketed datasets to perform segmented adjustment training on the target model architecture, automatically adapting to complex agricultural scenarios for training and adjustment. Finally, edge deployment optimization ensures successful deployment of the target trained model, resulting in the target deployed model. This achieves the automatic construction of agricultural product detection models based on the characteristics of agricultural scenarios through a model-building agent, reducing manual debugging costs.
[0067] Please see Figure 6 In some embodiments, step S106 may be followed by steps S601 to S603, including but not limited to: Step S601: Perform post-optimization processing on the target deployment model based on the preset post-optimization strategy to obtain the model to be evaluated; Step S602: Use the bucketed dataset to evaluate the model to be evaluated and obtain the optimization index data; Step S603: If the optimization index data indicates that the performance of the model to be evaluated has declined relative to the target deployment model, then execute the automatic rollback instruction to restore to the target deployment model.
[0068] In step S601 of some embodiments, a pre-defined post-optimization strategy is used to perform detailed performance enhancement processing on the target deployment model. The implementation of these post-optimization strategies is optional and can be decided by the model-building agent. Specific post-optimization strategies involve hard example mining, pseudo-label generation, fine-tuning of non-maximum suppression (NMS) or threshold parameters, confidence calibration, and detector head fine-tuning. By applying these optimization algorithms to the target deployment model, the performance potential of the target deployment model under specific harvesting conditions can be further improved, thereby obtaining the model to be evaluated.
[0069] In step S602 of some embodiments, a standardized evaluation is performed on the generated model to be evaluated using a bucketed dataset containing various specific features to obtain optimization index data. The performance of the model to be evaluated after post-optimization is then evaluated again using the bucketed dataset to measure the real-world effectiveness of the post-optimization strategy in complex environments.
[0070] In step S603 of some embodiments, the optimization index data can be analyzed and judged. If the optimization index data indicates that the model to be evaluated has experienced performance degradation or accuracy decline in key harvesting indicators compared to the original target deployment model, an automatic rollback command can be executed. Through this mechanism, invalid optimization operations can be undone and the model can be quickly restored to the previously verified target deployment model, thereby ensuring the continuity of the harvesting robot's operation process and the reliability of the model output.
[0071] Steps S601 to S603 effectively address the risk of accuracy loss that may accompany the improvement of model inference speed. By evaluating the performance of the bucketed dataset, it is determined whether the performance of the model to be evaluated has improved or decreased. Through automatic rollback instructions, this embodiment of the application can ensure the bottom line of operational quality while pursuing higher operating performance. This enables the target deployment model to have traceable and continuously optimized engineering capabilities, thereby providing technical support for the long-term stable operation of agricultural product harvesting robots in complex environments.
[0072] Please see Figure 7 In some embodiments, step S106 may be followed by steps S701 to S702, including but not limited to: Step S701: Obtain the deployment model performance metrics of the target deployment model; Step S702: Generate a target model version from scene feature information, training configuration parameters, target deployment model and corresponding deployment model performance indicators, and store it in a preset version experience library.
[0073] In step S701 of some embodiments, after the target deployment model completes edge-side optimization and post-processing evaluation, the performance metrics of the target deployment model are comprehensively acquired to obtain the deployment model performance metrics. The deployment model performance metrics include detection accuracy data, such as the average precision and recall on the bucketed dataset, and also include the target deployment model's performance in a real-world environment, including single-frame inference latency, data throughput, and GPU or memory resource usage. By acquiring these quantified deployment model performance metrics, the actual operational capability of the model in a specific agricultural product harvesting task can be accurately evaluated.
[0074] In step S702 of some embodiments, the acquired scene feature information, training configuration parameters used during training, optimized target deployment model ontology, and corresponding deployment model performance indicators are associated, and then encapsulated to generate a standardized target model version. This target model version is then stored in a preset version experience library. This allows for the storage of different versions of target deployment models and their associated data. For example, target deployment models for the same agricultural product under different lighting conditions can be stored, or target deployment models for different categories but the same type of agricultural product, such as cherries of category A and cherries of category B, can have different versions of target deployment models. In this way, multiple different target deployment models for agricultural product harvesting scenarios can be stored, realizing the storage of harvesting scenario training experience.
[0075] Please see Figure 8 In some embodiments, the embodiments of this application may also include, but are not limited to, steps S801 to S803: Step S801: Based on the scene feature information, retrieve the matching target model version from the version experience database; Step S802: Extract reusable reference experience information from the target model version and use it as a comparison deployment model with the corresponding target deployment model; Step S803: Generate a target deployment model based on reference experience information; Step S106 may include, but is not limited to, step S804, which involves comparing the performance of the target deployment model and the comparison deployment model to determine the final target deployment model.
[0076] In step S801 of some embodiments, the acquired scene feature information is used to perform a similarity search in a preset version experience base, thereby matching the target model version that is closest to the current working environment. The version experience base stores historical scene feature information, training configuration parameters, target deployment models, and deployment model performance indicators. By calculating the similarity score between the current scene features and historical data in the version experience base, a target model version that performs well under similar lighting, crop type, maturity, or occlusion levels can be identified.
[0077] In step S802 of some embodiments, highly reusable reference experience information is extracted from the matched target model version, and the historical target deployment model corresponding to that target model version is determined as the comparison deployment model. The reference experience information includes past model architecture choices, hyperparameter configurations for specific harvesting scenarios, post-processing optimization paths, and benchmark test results for the deployment hardware. Using historically successful deployment models as comparison objects to obtain the comparison deployment model provides a clear performance reference and competitive benchmark for the currently being built model. It should be noted that there can be multiple extracted reference experience information and comparison deployment models.
[0078] In step S803 of some embodiments, the target deployment model for the current task is generated based on the extracted reference experience information. This reference experience information provides crucial historical prior knowledge for generating training configuration parameters and implementing segmented training decision-making logic. This allows the model-building agent to skip unnecessary parameter trial-and-error processes and prioritize the application of enhancement strategies or weight parameter preferences that have been validated in similar scenarios. This historical experience-based auxiliary generation mechanism significantly accelerates the model building process and greatly improves the determinism and efficiency of model construction in complex agricultural scenarios.
[0079] In step S804 of some embodiments, after the current target deployment model is constructed, it is compared with several comparative deployment models for performance analysis, and the final target deployment model is determined accordingly.
[0080] Performance comparison analysis can be performed using precision tests and recall statistics on bucketed datasets, as well as real-time benchmark tests on edge hardware. By comparing the core metrics of the old and new models side-by-side, it can be verified whether the current training and optimization have achieved a substantial performance leap. If the optimization metrics of the new target deployment model decline, an automatic rollback command can be executed to determine the deployment model with better performance metrics as the final target deployment model.
[0081] In some embodiments, if the working environment of the agricultural product harvesting robot changes but there is not enough time to build a new target deployment model, sampled images of the scene to be operated can be collected to obtain the corresponding scene feature information. Then, the most similar target model version can be matched from the version experience library, and the historical target deployment model can be extracted for use.
[0082] It should be noted that in some embodiments, the model building agent may choose not to extract reference experience information from the version experience base; that is, whether or not reference experience information is used is optional. Allowing the model building agent to autonomously construct the target training model avoids the final generated target training model having exactly the same performance as the historical deployment models in the version experience base, and also avoids the final generated target training model making the same mistakes as in the past.
[0083] Through steps S801 to S804, the establishment of the version experience base enables the rapid reuse of historically successful strategies through similarity retrieval when facing new model training tasks. This achieves rapid iteration and efficient migration of tasks across plots, seasons, and categories, thereby reducing the development and trial-and-error costs in subsequent new scenarios. Furthermore, the experience accumulated in building models in the past provides reference information for the optimization of new models.
[0084] This application also provides a system for constructing an agricultural product detection model based on an intelligent agent, which can implement the above-mentioned method for constructing an agricultural product detection model based on an intelligent agent. The system includes: A dataset construction model is used to acquire product images of target agricultural products and construct bucketed datasets based on these images. Each bucketed dataset contains multiple data subsets, and each subset corresponds to specific features in the scenario of harvesting the target agricultural products. The architecture verification module is used to obtain multiple candidate model architectures for agricultural product testing tasks, and to quickly train and verify each candidate model architecture in a preset number of rounds using a bucketed dataset, thereby determining the target model architecture from multiple candidate model architectures. The visual analysis module is used to acquire sampled images of the scene to be worked on, and input the sampled images into a pre-trained visual language model for scene feature analysis to obtain the corresponding scene feature information; The training parameter configuration module is used to generate corresponding training configuration parameters based on scene feature information and apply the training configuration parameters to the target model architecture. The segmented training module is used to perform segmented adjustment training on the target model architecture with application training configuration parameters through model building agent and bucketed dataset to obtain the target training model. The edge optimization module is used to optimize the target training model on the edge based on the benchmark test information of the deployment end, so as to obtain the target deployment model.
[0085] The specific implementation of the agent-based agricultural product detection model construction device is basically the same as the specific implementation of the agent-based agricultural product detection model construction method described above, and will not be repeated here.
[0086] This application also provides an electronic device, which includes a memory and a processor. The memory stores a computer program, and the processor executes the computer program to implement the above-described method for constructing an agent-based agricultural product detection model. This electronic device can be any smart terminal, including tablet computers, in-vehicle computers, etc.
[0087] Please see Figure 9 , Figure 9 The hardware structure of an electronic device according to another embodiment is illustrated. The electronic device includes: The processor 901 can be implemented using a general-purpose CPU (Central Processing Unit), microprocessor, application-specific integrated circuit (ASIC), or one or more integrated circuits, and is used to execute relevant programs to implement the technical solutions provided in the embodiments of this application. The memory 902 can be implemented as a read-only memory (ROM), static storage device, dynamic storage device, or random access memory (RAM). The memory 902 can store the operating system and other applications. When the technical solutions provided in the embodiments of this specification are implemented through software or firmware, the relevant program code is stored in the memory 902 and called and executed by the processor 901 using the agent-based agricultural product detection model construction method of the embodiments of this application. The input / output interface 903 is used to implement information input and output; The communication interface 904 is used to enable communication and interaction between this device and other devices. Communication can be achieved through wired means (such as USB, Ethernet cable, etc.) or wireless means (such as mobile network, WIFI, Bluetooth, etc.). Bus 905 transmits information between various components of the device (e.g., processor 901, memory 902, input / output interface 903, and communication interface 904); The processor 901, memory 902, input / output interface 903, and communication interface 904 are connected to each other within the device via bus 905.
[0088] This application also provides a computer-readable storage medium storing a computer program that, when executed by a processor, implements the above-described method for constructing an agent-based agricultural product detection model.
[0089] Memory, as a non-transitory computer-readable storage medium, can be used to store non-transitory software programs and non-transitory computer-executable programs. Furthermore, memory may include high-speed random access memory, and may also include non-transitory memory, such as at least one disk storage device, flash memory device, or other non-transitory solid-state storage device. In some embodiments, memory may optionally include memory remotely located relative to the processor, and these remote memories can be connected to the processor via a network. Examples of such networks include, but are not limited to, the Internet, intranets, local area networks, mobile communication networks, and combinations thereof.
[0090] The method, electronic device, and medium for constructing an agricultural product detection model based on an intelligent agent provided in this application embodiment acquire product images of the target agricultural product and construct a bucketed dataset based on the product images. The bucketed dataset contains multiple data subsets, each corresponding to specific features in the scene of harvesting the target agricultural product. Multiple candidate model architectures for the agricultural product detection task are acquired, and each candidate model architecture is rapidly trained and validated through a preset number of rounds using the bucketed dataset to determine the target model architecture. Sampled images of the scene to be processed are acquired and input into a pre-trained visual language model for scene feature analysis to obtain corresponding scene feature information. Based on the scene feature information, corresponding training configuration parameters are generated and applied to the target model architecture. For the target model architecture applying the training configuration parameters, segmented adjustment training is performed using a model-constructing intelligent agent and the bucketed dataset to obtain the target training model. Based on benchmark test information from the deployment end, the target training model is optimized for edge deployment to obtain the target deployment model. Therefore, this application constructs bucketed datasets tailored to specific harvesting scene characteristics, such as subsets containing specific features like occlusion, density, and light and shadow variations, providing targeted evaluation criteria for the model. Then, a model-building agent is used to automatically and rapidly train and validate multiple candidate model architectures, avoiding blind manual selection. Furthermore, a pre-trained visual language model is combined to perform in-depth analysis of the work scenario, automatically mapping and generating training configuration parameters. The model-building agent then uses the bucketed datasets to perform segmented adjustment training on the target model architecture, automatically adapting to complex agricultural scenarios for training and adjustment. Finally, edge deployment optimization ensures successful deployment of the target trained model, resulting in the target deployed model. This achieves the automatic construction of agricultural product detection models based on the characteristics of agricultural scenarios through a model-building agent, reducing manual debugging costs.
[0091] The embodiments described in this application are for the purpose of more clearly illustrating the technical solutions of the embodiments of this application, and do not constitute a limitation on the technical solutions provided by the embodiments of this application. As those skilled in the art will know, with the evolution of technology and the emergence of new application scenarios, the technical solutions provided by the embodiments of this application are also applicable to similar technical problems.
[0092] Those skilled in the art will understand that the technical solutions shown in the figures do not constitute a limitation on the embodiments of this application, and may include more or fewer steps than shown, or combine certain steps, or different steps.
[0093] The device embodiments described above are merely illustrative. The units described as separate components may or may not be physically separate; that is, they may be located in one place or distributed across multiple network units. Some or all of the modules can be selected to achieve the purpose of this embodiment according to actual needs.
[0094] Those skilled in the art will understand that all or some of the steps in the methods disclosed above, as well as the functional modules / units in the systems and devices, can be implemented as software, firmware, hardware, or suitable combinations thereof.
[0095] The terms “first,” “second,” “third,” “fourth,” etc. (if present) in the specification and accompanying drawings of this application are used to distinguish similar objects and are not necessarily used to describe a specific order or sequence. It should be understood that such data can be interchanged where appropriate so that the embodiments of this application described herein can be implemented in orders other than those illustrated or described herein. Furthermore, the terms “comprising” and “having,” and any variations thereof, are intended to cover non-exclusive inclusion; for example, a process, method, system, product, or apparatus that comprises a series of steps or units is not necessarily limited to those steps or units explicitly listed, but may include other steps or units not explicitly listed or inherent to such processes, methods, products, or apparatus.
[0096] It should be understood that in this application, "at least one (item)" means one or more, and "more than" means two or more. "And / or" is used to describe the relationship between related objects, indicating that three relationships can exist. For example, "A and / or B" can represent three cases: only A exists, only B exists, and both A and B exist simultaneously, where A and B can be singular or plural. The character " / " generally indicates that the preceding and following related objects are in an "or" relationship. "At least one (item) of the following" or similar expressions refer to any combination of these items, including any combination of single or plural items. For example, at least one (item) of a, b, or c can represent: a, b, c, "a and b", "a and c", "b and c", or "a and b and c", where a, b, and c can be single or multiple.
[0097] In the several embodiments provided in this application, it should be understood that the disclosed apparatus and methods can be implemented in other ways. For example, the apparatus embodiments described above are merely illustrative; for instance, the division of the units described above is only a logical functional division, and in actual implementation, there may be other division methods. For example, multiple units or components may be combined or integrated into another system, or some features may be ignored or not executed. The coupling or direct coupling or communication connection between the shown or discussed units may be through some interfaces, or indirect coupling or communication connection between the apparatus or units, and may be electrical, mechanical, or other forms.
[0098] The units described above as separate components may or may not be physically separate. The components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple network units. Some or all of the units can be selected to achieve the purpose of this embodiment according to actual needs.
[0099] Furthermore, the functional units in the various embodiments of this application can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit. The integrated unit can be implemented in hardware or as a software functional unit.
[0100] If the integrated unit is implemented as a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of this application, in essence, or the part that contributes to the prior art, or all or part of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes multiple instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods of the various embodiments of this application. The aforementioned storage medium includes various media capable of storing programs, such as USB flash drives, portable hard drives, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks.
[0101] The preferred embodiments of the present application have been described above with reference to the accompanying drawings, but this does not limit the scope of the claims of the present application. Any modifications, equivalent substitutions, and improvements made by those skilled in the art without departing from the scope and substance of the embodiments of the present application shall be within the scope of the claims of the present application.
Claims
1. A method for constructing an agricultural product detection model based on intelligent agents, characterized in that, The method, applied to model building agents, includes: Acquire product images of the target agricultural product and construct a bucketed dataset based on the product images of the target agricultural product; wherein the bucketed dataset contains multiple data subsets, each data subset corresponds to specific features in the scene of picking the target agricultural product, the specific features include small target distribution, leaf and branch occlusion, dense overlapping of fruit bunches, similar background colors, strong light and shadow interference, and motion blur; Multiple candidate model architectures for agricultural product testing tasks are obtained, and each candidate model architecture is quickly trained and validated in a preset number of rounds using the bucketed dataset. The target model architecture is then determined from the multiple candidate model architectures. Acquire sampled images of the scene to be worked on, and input the sampled images into a pre-trained visual language model for scene feature analysis to obtain the corresponding scene feature information; Based on the scene feature information, corresponding training configuration parameters are generated, and the training configuration parameters are applied to the target model architecture. For the target model architecture using the training configuration parameters, the target training model is obtained by segmented adjustment training using the model-built agent and the bucketed dataset. Based on the benchmark test information from the deployment end, the target training model is optimized for deployment on the edge to obtain the target deployment model.
2. The method according to claim 1, characterized in that, The target model architecture, which applies the training configuration parameters, is trained in stages using the model-constructing agent and the bucketed dataset to obtain the target training model, including: The target model architecture, which applies the training configuration parameters, is subjected to segmented adjustment training to determine multiple training stages; At the end of each training phase, phase training indicators are obtained; The stage training metrics are input into the model building agent to perform model quality analysis and obtain model training control instructions or model architecture adjustment information. In response to obtaining the model architecture adjustment information, the target model architecture is adjusted based on the model architecture adjustment information, and the segmented adjustment training is performed based on the adjusted target model architecture to obtain the target training model; In response to receiving the model training control command, the segmented adjustment training is adjusted based on the model training control command to obtain the target training model.
3. The method according to claim 1, characterized in that, The target training model is optimized for on-device deployment based on the benchmark test information from the deployment end to obtain the target deployment model, including: Convert the target training model into a preset format model; The single-frame latency, throughput, and resource consumption information of the preset format model on the deployment end are obtained as the benchmark test information; Based on the benchmark test information, the target training model is quantized or pruned to obtain the target deployment model adapted to the deployment end.
4. The method according to claim 1, characterized in that, After optimizing the target trained model based on the benchmark test information from the deployment end to obtain the target deployment model, the process further includes: The target deployment model is post-optimized based on a preset post-optimization strategy to obtain the model to be evaluated. The bucketed dataset is used to optimize the model to be evaluated, and optimization index data is obtained. If the optimization metric data indicates that the performance of the model to be evaluated has declined relative to the target deployment model, then an automatic rollback instruction is executed to restore it to the target deployment model.
5. The method according to claim 1, characterized in that, The process of acquiring multiple candidate model architectures for agricultural product testing tasks, and performing rapid training and validation on each candidate model architecture through the bucketed dataset for a preset number of rounds, and determining the target model architecture from the multiple candidate model architectures, includes: Based on the bucketed dataset, each candidate model architecture is rapidly trained and validated in a preset number of rounds to obtain short training performance data corresponding to each candidate model architecture. Based on the short training performance data, the candidate model architecture with the best performance is selected from all the candidate model architectures and determined as the target model architecture.
6. The method according to claim 1, characterized in that, The generation of corresponding training configuration parameters based on the scene feature information includes: The visual language model is used to identify the fruit size ratio, occlusion degree, density, light intensity, and background interference in the sampled image to obtain the scene feature information; Based on the scene feature information, the corresponding input resolution, data augmentation strategy, and configuration suggestions for the detection head feature layer are automatically mapped and used as the training configuration parameters.
7. The method according to claim 1, characterized in that, After optimizing the target trained model based on the benchmark test information from the deployment end to obtain the target deployment model, the process further includes: Obtain the deployment model performance metrics of the target deployment model; The scene feature information, the training configuration parameters, the target deployment model, and the corresponding performance indicators of the deployment model are used to generate a target model version, which is then stored in a preset version experience library.
8. The method according to claim 7, characterized in that, The method further includes: After acquiring a sampled image of the scene to be worked on and inputting the sampled image into a pre-trained visual language model for scene feature analysis to obtain the corresponding scene feature information, the method further includes: Based on the scene feature information, the matching target model version is retrieved from the version experience base; Reusable reference experience information is extracted from the target model version, and the corresponding target deployment model is used as a comparison deployment model; The target deployment model is generated based on the aforementioned reference experience information; After optimizing the target trained model based on the benchmark test information from the deployment end to obtain the target deployment model, the process further includes: Based on the performance comparison between the target deployment model and the comparison deployment model, the final target deployment model is determined.
9. An electronic device, characterized in that, The electronic device includes a memory and a processor. The memory stores a computer program, and when the processor executes the computer program, it implements the agent-based agricultural product detection model construction method according to any one of claims 1 to 8.
10. A computer-readable storage medium storing a computer program, characterized in that, When the computer program is executed by the processor, it implements the method for constructing an agent-based agricultural product detection model as described in any one of claims 1 to 8.
Citation Information
Patent Citations
Speech recognition method and system
CN117456987A
Robust and fast model fitting by adaptive sampling
US8756175B1