A method and system for intelligently detecting nutritional components of agricultural products
Through the method of combining neural network with nutritional component trees, the problem of insufficient accuracy and dynamicity of agricultural product nutritional component detection and analysis is solved, and more dynamic and more accurate detection and analysis results are achieved.
Patent Information
- Application Number
- CN202411398676.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-10-09
- Publication Date
- 2025-04-15
- Estimated Expiration
- 2044-10-09
AI Technical Summary
How to achieve more dynamic and accurate detection and analysis of agricultural product nutritional components to solve the problem of insufficient accuracy and dynamicity of detection and analysis in the prior art.
Using a neural network combined with a nutritional component tree, agricultural product images are obtained through electronic devices, and images are analyzed using neural network models to determine the type and quality of agricultural products, and the nutritional component tree is traversed according to the type and quality to determine the proportion of each nutritional component.
It realizes more dynamic and accurate detection and analysis of nutrient components of agricultural products, and can dynamically adjust the detection results according to the type and quality of agricultural products, improving the accuracy and efficiency of the detection.
Smart Images

Figure CN119359659B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of big data technology, and in particular to an intelligent detection method and system for the nutritional components of agricultural products. Background Art
[0002] With the continuous development of artificial intelligence and computer vision technology, intelligent detection and analysis technology of agricultural products has become an important research direction. This technology can take pictures of agricultural products and then use neural networks to analyze the information in the photos to determine key information such as the quality, size, and nutritional content of agricultural products. This article will introduce in detail the working principle, application prospects, and possible challenges of this technology.
[0003] Intelligent detection and analysis technology for agricultural products mainly relies on computer vision and deep learning technology. Its workflow can be roughly divided into the following steps: Image acquisition: Use a high-definition camera to shoot agricultural products and obtain image data of agricultural products. Image preprocessing: De-noise and enhance the collected images to improve the accuracy of subsequent analysis. Feature extraction: Use deep learning models such as convolutional neural networks (CNN) to extract key features from images, such as color, texture, shape, etc. Quality analysis: Based on the extracted features, the quality of agricultural products is evaluated through the trained model. For example, the maturity of agricultural products can be judged by analyzing the color distribution. Nutritional component analysis: Based on the information in the database and combined with the characteristics of agricultural products, predict the nutrients they may contain.
[0004] At present, intelligent detection and analysis technology for agricultural products has broad application prospects. Agricultural production: It can monitor the growth status of agricultural products in real time and improve the yield and quality of agricultural products. Food safety: It can quickly detect harmful substances in agricultural products to ensure food safety. Supply chain management: It can optimize the classification, packaging and transportation process of agricultural products and improve the efficiency of the supply chain. Consumer services: It can provide consumers with detailed information on agricultural products to help them make more informed purchasing decisions.
[0005] However, how to further achieve more dynamic and accurate nutrient component detection and analysis is currently a research issue. Summary of the invention
[0006] The embodiments of the present application provide a method and system for intelligently detecting the nutritional components of agricultural products, which use a neural network combined with a nutritional component tree to achieve more dynamic and accurate nutritional component detection and analysis.
[0007] In order to achieve the above objectives, this application adopts the following technical solutions:
[0008] In a first aspect, a method for intelligently detecting the nutritional components of agricultural products is provided, which is applied to electronic devices, and the method comprises: the electronic device acquires an image of the agricultural product, where the image is an image obtained by photographing the agricultural product; the electronic device analyzes the image through a neural network model to obtain the type of agricultural product output by the neural network model and the quality of the agricultural product; the electronic device traverses the nutritional component tree of the agricultural product according to the type of the agricultural product and the quality of the agricultural product to determine the proportion of each nutritional component of the agricultural product.
[0009] Optionally, the electronic device traverses the nutrient component tree of the agricultural product according to the type and quality of the agricultural product to determine the proportion of each nutrient component of the agricultural product, including: the electronic device determines multiple nutrient component trees of the agricultural product according to the type of the agricultural product; the electronic device determines a target nutrient component tree from the multiple nutrient component trees according to the quality of the agricultural product, the information contained in the root node of the target nutrient component tree is the proportion of the main nutrient components of the agricultural product; the electronic device determines the respective proportions of multiple auxiliary nutrients of the agricultural product in the target nutrient component tree according to the quality of the agricultural product.
[0010] Optionally, multiple nutrient composition trees are divided according to different qualities of agricultural products, and each of the multiple nutrient composition trees corresponds to a quality range of the agricultural products, with a total of multiple different quality ranges; the electronic device determines a target nutrient composition tree from the multiple nutrient composition trees based on the quality of the agricultural products, including: the electronic device determines the target quality range of the quality of the agricultural products from the multiple different quality ranges based on the quality of the agricultural products, the nutrient composition tree corresponding to the target quality range in the multiple nutrient composition trees is the target nutrient composition tree, and the ratios indicated by the root nodes of any two of the multiple nutrient composition trees are different; the electronic device determines the ratio indicated by the root node in the target nutrient composition tree as the proportion of the main nutrients of the agricultural product.
[0011] Optionally, the electronic device determines the respective proportions of multiple auxiliary nutrients of the agricultural products in the target nutrient component tree according to the quality of the agricultural products, including: the electronic device determines the nodes corresponding to each of the multiple auxiliary nutrients under the quality from the target nutrient component tree in turn, and determines a total of multiple nodes, the multiple nodes constitute a branch in the target nutrient component tree, any two adjacent nodes in the multiple nodes are parent-child node relationships, and the ratio indicated by each node in the multiple nodes is the proportion of multiple auxiliary nutrients corresponding to one auxiliary nutrient under the quality.
[0012] Optionally, the multiple auxiliary nutrients are K+1 auxiliary nutrients. For the ith auxiliary nutrient, i is an integer traversing from 1 to K, and the node corresponding to the ith auxiliary nutrient in the target nutrient tree is Ni nodes. The Ni nodes have a common parent node in the target nutrient tree. When i is equal to 1, the parent node of the Ni nodes is the root node. When i is greater than 1, the parent node of the Ni nodes is a node in the target nutrient tree that indicates the proportion of the i-1th auxiliary nutrient; the Ni nodes each correspond to a quality interval, and there are Ni different quality intervals in total, and the proportions indicated by any two of the Ni nodes are different; on this basis, the electronic device determines the nodes corresponding to each of the multiple auxiliary nutrients under quality from the target nutrient tree in turn, including: the electronic device determines the ith quality interval in which the quality of the agricultural product is located from Ni different quality intervals based on the quality of the agricultural product; the electronic device determines the node corresponding to the ith quality interval among the Ni nodes, and the proportion indicated by the node corresponding to the ith quality interval is the proportion of the ith auxiliary nutrient under quality.
[0013] Optionally, the target nutrient tree includes K nodes indicating the proportion of K auxiliary nutrients in terms of mass. According to the traversal relationship from the parent node to the child node in the target nutrient tree, the proportion indicated by any child node among the K nodes is smaller than the proportion indicated by the parent node of the child node.
[0014] Optionally, when i traverses from 1 to K, the electronic device correspondingly determines the proportion of each of the first K kinds of auxiliary nutrients in K+1 kinds of auxiliary nutrients in terms of mass, and the method also includes: the electronic device determines the sum of the proportions of each of the K kinds of auxiliary nutrients in terms of mass; the electronic device subtracts the sum of the proportions of each of the K kinds of auxiliary nutrients in terms of mass from 1 to obtain the proportion of the K+1th auxiliary nutrient in terms of mass among the K+1 kinds of auxiliary nutrients.
[0015] Optionally, the electronic device analyzes the image through a neural network model to obtain the type of agricultural products output by the neural network model and the quality of the agricultural products, including: the electronic device pre-processes the image into grayscale to obtain a grayscale image; the electronic device analyzes the grayscale image through a neural network model to obtain the type of agricultural products output by the neural network model and the quality of the agricultural products.
[0016] Optionally, the neural network model is a convolutional neural network model.
[0017] In a second aspect, an intelligent detection system for the nutritional components of agricultural products is provided, the system includes an electronic device, and the electronic device is configured as follows: the electronic device obtains an image of the agricultural product, where the image is obtained by photographing the agricultural product; the electronic device analyzes the image through a neural network model to obtain the type of agricultural product output by the neural network model and the quality of the agricultural product; the electronic device traverses the nutritional component tree of the agricultural product according to the type of the agricultural product and the quality of the agricultural product to determine the proportion of each nutritional component of the agricultural product.
[0018] Optionally, the electronic device traverses the nutrient component tree of the agricultural product according to the type and quality of the agricultural product to determine the proportion of each nutrient component of the agricultural product, including: the electronic device determines multiple nutrient component trees of the agricultural product according to the type of the agricultural product; the electronic device determines a target nutrient component tree from the multiple nutrient component trees according to the quality of the agricultural product, the information contained in the root node of the target nutrient component tree is the proportion of the main nutrient components of the agricultural product; the electronic device determines the respective proportions of multiple auxiliary nutrients of the agricultural product in the target nutrient component tree according to the quality of the agricultural product.
[0019] Optionally, multiple nutrient composition trees are divided according to different qualities of agricultural products, and each of the multiple nutrient composition trees corresponds to a quality range of the agricultural products, with a total of multiple different quality ranges; the electronic device determines a target nutrient composition tree from the multiple nutrient composition trees based on the quality of the agricultural products, including: the electronic device determines the target quality range of the quality of the agricultural products from the multiple different quality ranges based on the quality of the agricultural products, the nutrient composition tree corresponding to the target quality range in the multiple nutrient composition trees is the target nutrient composition tree, and the ratios indicated by the root nodes of any two of the multiple nutrient composition trees are different; the electronic device determines the ratio indicated by the root node in the target nutrient composition tree as the proportion of the main nutrients of the agricultural product.
[0020] Optionally, the electronic device determines the respective proportions of multiple auxiliary nutrients of the agricultural products in the target nutrient component tree according to the quality of the agricultural products, including: the electronic device determines the nodes corresponding to each of the multiple auxiliary nutrients under the quality from the target nutrient component tree in turn, and determines a total of multiple nodes, the multiple nodes constitute a branch in the target nutrient component tree, any two adjacent nodes in the multiple nodes are parent-child node relationships, and the ratio indicated by each node in the multiple nodes is the proportion of multiple auxiliary nutrients corresponding to one auxiliary nutrient under the quality.
[0021] Optionally, the multiple auxiliary nutrients are K+1 auxiliary nutrients. For the ith auxiliary nutrient, i is an integer traversing from 1 to K, and the node corresponding to the ith auxiliary nutrient in the target nutrient tree is Ni nodes. The Ni nodes have a common parent node in the target nutrient tree. When i is equal to 1, the parent node of the Ni nodes is the root node. When i is greater than 1, the parent node of the Ni nodes is a node in the target nutrient tree that indicates the proportion of the i-1th auxiliary nutrient; the Ni nodes each correspond to a quality interval, and there are Ni different quality intervals in total, and the proportions indicated by any two of the Ni nodes are different; on this basis, the electronic device determines the nodes corresponding to each of the multiple auxiliary nutrients under quality from the target nutrient tree in turn, including: the electronic device determines the ith quality interval in which the quality of the agricultural product is located from Ni different quality intervals based on the quality of the agricultural product; the electronic device determines the node corresponding to the ith quality interval among the Ni nodes, and the proportion indicated by the node corresponding to the ith quality interval is the proportion of the ith auxiliary nutrient under quality.
[0022] Optionally, the target nutrient tree includes K nodes indicating the proportion of K auxiliary nutrients in terms of mass. According to the traversal relationship from the parent node to the child node in the target nutrient tree, the proportion indicated by any child node among the K nodes is smaller than the proportion indicated by the parent node of the child node.
[0023] Optionally, when i traverses from 1 to K, the electronic device correspondingly determines the proportion of each of the first K auxiliary nutrients in K+1 auxiliary nutrients in terms of mass, and the electronic device is configured as: the electronic device determines the sum of the proportions of each of the K auxiliary nutrients in terms of mass; the electronic device subtracts the sum of the proportions of each of the K auxiliary nutrients in terms of mass from 1 to obtain the proportion of the K+1th auxiliary nutrient in terms of mass among the K+1 auxiliary nutrients.
[0024] Optionally, the electronic device analyzes the image through a neural network model to obtain the type of agricultural products output by the neural network model and the quality of the agricultural products, including: the electronic device pre-processes the image into grayscale to obtain a grayscale image; the electronic device analyzes the grayscale image through a neural network model to obtain the type of agricultural products output by the neural network model and the quality of the agricultural products.
[0025] Optionally, the neural network model is a convolutional neural network model.
[0026] In a third aspect, an embodiment of the present invention provides a readable storage medium having a program or instruction stored thereon, wherein the program or instruction implements the steps in the above method when executed by a processor.
[0027] The above method and system have the following technical effects:
[0028] When the electronic device obtains an image of the agricultural product, it can analyze the image through a neural network model to obtain the type of agricultural product and the quality of the agricultural product output by the neural network model. On this basis, the electronic device traverses the nutrient composition tree of the agricultural product according to the type and quality of the agricultural product, and determines the nutrient composition tree suitable for the current quality of the agricultural product under a specific agricultural product type, and determines the proportion of each nutrient component of the agricultural product through the nutrient composition tree, that is, to achieve more dynamic and accurate nutrient composition detection and analysis. BRIEF DESCRIPTION OF THE DRAWINGS
[0029] Figure 1 A schematic diagram of the architecture of an intelligent detection system for nutrient components of agricultural products provided in an embodiment of the present application;
[0030] Figure 2 A schematic diagram of a flow chart of an intelligent method for detecting nutritional components of agricultural products provided in an embodiment of the present application;
[0031] Figure 3 This is a schematic diagram of the nutrient composition tree;
[0032] Figure 4 A schematic diagram of the structure of an electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION
[0033] The technical solution in this application will be described below in conjunction with the accompanying drawings.
[0034] The present application will present various aspects, embodiments or features around a system that may include multiple devices, components, modules, etc. It should be understood and appreciated that each system may include additional devices, components, modules, etc., and / or may not include all of the devices, components, modules, etc. discussed in conjunction with the figures. In addition, combinations of these schemes may also be used.
[0035] In addition, in the embodiments of the present application, words such as "exemplary" and "for example" are used to indicate examples, illustrations or explanations. Any embodiment or design described as "exemplary" in the present application should not be interpreted as being more preferred or more advantageous than other embodiments or designs. Specifically, the use of the word "exemplary" is intended to present concepts in a concrete way.
[0036] In the embodiments of the present application, "information", "signal", "message", "channel" and "signaling" can sometimes be used interchangeably. It should be noted that when the distinction between them is not emphasized, the meanings to be expressed are matched. "of", "corresponding, relevant" and "corresponding" can sometimes be used interchangeably. It should be noted that when the distinction between them is not emphasized, the meanings to be expressed are matched. In addition, the " / " mentioned in the present application can be used to express an "or" relationship.
[0037] The network architecture and business scenarios described in the embodiments of the present application are intended to more clearly illustrate the technical solutions of the embodiments of the present application, and do not constitute a limitation on the technical solutions provided in the embodiments of the present application. A person of ordinary skill in the art can appreciate that with the evolution of the network architecture and the emergence of new business scenarios, the technical solutions provided in the embodiments of the present application are equally applicable to similar technical problems.
[0038] To facilitate understanding of the embodiments of the present application, first Figure 1 The communication system shown in the figure is used as an example to explain in detail the intelligent detection system for nutritional components of agricultural products applicable to the embodiments of the present application.
[0039] Figure 1 This is a schematic diagram of the architecture of an intelligent detection system for agricultural product nutrients applicable to the intelligent detection method for agricultural product nutrients provided in the embodiment of the present application. Figure 1 As shown, the system includes: a shooting device and an electronic device.
[0040] The shooting device can be a camera, a webcam, a camera module set on a device, etc., and there is no specific limitation.
[0041] The electronic device may be a terminal device, and the terminal device may be a terminal device with transceiver functions, or a chip or chip system that can be set in the terminal device. The terminal device may also be called user equipment (UE), access terminal equipment, subscriber unit, user station, mobile station (MS), mobile station, remote station, remote terminal equipment, mobile equipment, user terminal equipment, terminal equipment, wireless communication equipment, user agent or user device. The terminal device in the embodiments of the present application can be a mobile phone, a cellular phone, a smart phone, a tablet computer, a wireless data card, a personal digital assistant (PDA), a wireless modem, a handheld device (handset), a laptop computer, a machine type communication (MTC) terminal device, a computer with wireless transceiver function, a virtual reality (VR) terminal device, an augmented reality (AR) terminal device, a wireless terminal device in industrial control, a wireless terminal device in self driving, a wireless terminal device in remote medical, a wireless terminal device in a smart grid, a wireless terminal device in transportation safety, a wireless terminal device in a smart city, a wireless terminal device in a smart home, a vehicle-mounted terminal device, a road side unit (RSU) with terminal device function, etc. The terminal device of the present application may also be a vehicle-mounted module, a vehicle-mounted module, a vehicle-mounted component, a vehicle-mounted chip or a vehicle-mounted unit built into a vehicle as one or more components or units. Alternatively, the terminal device may also be customer-premises equipment (CPE).
[0042] For ease of understanding, the following will combine Figure 2 The intelligent detection method for the nutritional components of agricultural products provided in the embodiments of the present application is specifically described.
[0043] For example, Figure 2The flowchart of the method for intelligently detecting the nutritional components of agricultural products provided in the embodiment of the present application is shown in FIG.
[0044] like Figure 2 As shown, the process of this method is as follows:
[0045] S201, the electronic device obtains images of agricultural products.
[0046] The agricultural products may be fruits, vegetables, etc. The images may be images obtained by photographing the agricultural products. For example, a photographing device may photograph the agricultural products to obtain images, and then send the images to an electronic device.
[0047] S202, the electronic device analyzes the image through a neural network model to obtain the type of agricultural products and the quality of the agricultural products output by the neural network model.
[0048] The electronic device can pre-process the image into grayscale to obtain a grayscale image. The electronic device analyzes the grayscale image through a neural network model to obtain the type of agricultural products output by the neural network model and the quality of the agricultural products. The neural network model is a convolutional neural network model.
[0049] S203, the electronic device traverses the nutrient component tree of the agricultural product according to the type and quality of the agricultural product, and determines the proportion of each nutrient component of the agricultural product.
[0050] The electronic device can determine multiple nutrient composition trees of agricultural products according to the types of agricultural products. That is, the nutrients contained in different types of agricultural products can be represented by different nutrient composition trees. For the same agricultural product, the proportions of its various nutrients are different under different qualities. Therefore, it is also possible to construct nutrient composition trees of the same agricultural product under different qualities, that is, different nutrient composition trees, with quality as the granularity, to represent the proportions of various nutrients under different qualities.
[0051] The electronic device determines a target nutrient component tree from multiple nutrient component trees based on the quality of the agricultural product, and the information contained in the root node of the target nutrient component tree is the proportion of the main nutrient components of the agricultural product. For example, multiple nutrient component trees are divided according to the different qualities of the agricultural product, and each of the multiple nutrient component trees corresponds to a quality interval of the agricultural product, and there are multiple different quality intervals. For example, quality interval #1 is [x1, x2), quality interval #2 is [x2, x3), and quality interval #3 is [x3, x4]. On this basis, the electronic device can determine the target quality interval of the quality of the agricultural product from multiple different quality intervals based on the quality of the agricultural product. The nutrient component tree corresponding to the target quality interval in the multiple nutrient component trees is the target nutrient component tree, and the ratios indicated by the root nodes of any two of the multiple nutrient component trees are different. The electronic device determines the ratio indicated by the root node in the target nutrient component tree as the proportion of the main nutrient components of the agricultural product. For example, the mass interval #1 is [x1, x2) corresponding to the nutrient tree #1, the mass interval #2 is [x2, x3) corresponding to the nutrient tree #2, and the mass interval #3 is [x3, x4] corresponding to the nutrient tree #3. The root node of the nutrient tree #1 indicates a proportion of 50%, the root node of the nutrient tree #2 indicates a proportion of 53%, and the root node of the nutrient tree #3 indicates a proportion of 55%. These data can be obtained based on actual statistics, such as the range of quality and the approximate proportion of the corresponding main nutrients. At this time, the electronic device can determine the nutrient tree #2 based on the mass y1 of the agricultural product being located at [x2, x3), and determine that the proportion of the main nutrients is 53%. In other words, the sum of the proportions of the main nutrients other than the main nutrients of the agricultural product is 47%.
[0052] The electronic device determines the respective proportions of the various auxiliary nutrients of the agricultural products in the target nutrient component tree according to the quality of the agricultural products. For example, the electronic device determines the nodes corresponding to the various auxiliary nutrients under the quality from the target nutrient component tree in turn, and determines a total of multiple nodes, and the multiple nodes constitute a branch in the target nutrient component tree. Any two adjacent nodes in the multiple nodes are parent-child node relationships, and the ratio indicated by each node in the multiple nodes is the proportion of the multiple auxiliary nutrients corresponding to one auxiliary nutrient under the quality. For ease of understanding, the following is a detailed introduction.
[0053] Specifically, the multiple auxiliary nutrients are K+1 auxiliary nutrients. For the i-th auxiliary nutrient, i is an integer traversing from 1 to K. The node corresponding to the i-th auxiliary nutrient in the target nutrient tree is Ni nodes. The Ni nodes have a common parent node in the target nutrient tree. When i is equal to 1, the parent node of the Ni nodes is the root node. When i is greater than 1, the parent node of the Ni nodes is a node in the target nutrient tree indicating the proportion of the i-1th auxiliary nutrient. Each of the Ni nodes corresponds to a quality interval, with a total of Ni different quality intervals, and the proportions indicated by any two of the Ni nodes are different.
[0054] That is to say, for each auxiliary nutrient, the proportion of each auxiliary nutrient may be different when the quality of the agricultural product is different. These different situations can be represented by different child nodes belonging to the same parent node in the nutrient tree. On this basis, the electronic device can determine the i-th quality interval of the agricultural product's quality from Ni different quality intervals according to the quality of the agricultural product; the electronic device determines the node corresponding to the i-th quality interval among the Ni nodes, and the proportion indicated by the node corresponding to the i-th quality interval is the proportion of the i-th auxiliary nutrient under the quality.
[0055] It can be understood that the target nutrient tree indicates the multiple nodes of K kinds of auxiliary nutrients in terms of mass, that is, K nodes. According to the traversal relationship from parent nodes to child nodes in the target nutrient tree, the proportion indicated by any child node among the K nodes is less than the proportion indicated by the parent node of the child node. In other words, the construction of the target nutrient tree is constructed in the order of the proportion of different types of auxiliary nutrients from large to small, that is, the closer the node is to the end of the branch, the smaller the proportion value it indicates is overall.
[0056] When i traverses from 1 to K, the electronic device correspondingly determines the proportion of each of the first K kinds of auxiliary nutrients in K+1 kinds of auxiliary nutrients in terms of mass. The method also includes: the electronic device determines the sum of the proportions of each of the K kinds of auxiliary nutrients in terms of mass; the electronic device subtracts the sum of the proportions of each of the K kinds of auxiliary nutrients in terms of mass from 1 to obtain the proportion of the K+1th auxiliary nutrient in terms of mass among the K+1 kinds of auxiliary nutrients.
[0057] For ease of understanding, the following is an example. Figure 3 As shown, K=3, the target nutrient tree may include nodes at three levels, and the electronic device can determine the node corresponding to the quality interval of each auxiliary nutrient in the multiple nodes at the corresponding level according to the quality of the agricultural product. For example, the electronic device determines that the sum of the proportions of node 2, node 6, node 11, node 2, node 6, and node 11 is 44%, which means that the proportion of the last auxiliary nutrient is 3%.
[0058] In summary, when the electronic device obtains an image of the agricultural product, the electronic device can analyze the image through the neural network model to obtain the type of agricultural product output by the neural network model and the quality of the agricultural product. On this basis, the electronic device traverses the nutrient component tree of the agricultural product according to the type and quality of the agricultural product, and determines the nutrient component tree suitable for the current quality of the agricultural product under a specific agricultural product type, and determines the proportion of each nutrient component of the agricultural product through the nutrient component tree, that is, to achieve more dynamic and accurate nutrient component detection and analysis.
[0059] Combination of the above Figure 2 The method provided by the embodiment of the present application is described in detail. The following is a detailed description of an intelligent detection system for agricultural product nutrients for executing the intelligent detection method for agricultural product nutrients provided by the embodiment of the present application, the system comprising an electronic device, the electronic device being configured as follows: the electronic device acquires an image of the agricultural product, the image is an image obtained by photographing the agricultural product; the electronic device analyzes the image through a neural network model to obtain the type of agricultural product output by the neural network model and the quality of the agricultural product; the electronic device traverses the nutrient component tree of the agricultural product according to the type of the agricultural product and the quality of the agricultural product, and determines the proportion of each nutrient component of the agricultural product.
[0060] Optionally, the electronic device traverses the nutrient component tree of the agricultural product according to the type and quality of the agricultural product to determine the proportion of each nutrient component of the agricultural product, including: the electronic device determines multiple nutrient component trees of the agricultural product according to the type of the agricultural product; the electronic device determines a target nutrient component tree from the multiple nutrient component trees according to the quality of the agricultural product, the information contained in the root node of the target nutrient component tree is the proportion of the main nutrient components of the agricultural product; the electronic device determines the respective proportions of multiple auxiliary nutrients of the agricultural product in the target nutrient component tree according to the quality of the agricultural product.
[0061] Optionally, multiple nutrient composition trees are divided according to different qualities of agricultural products, and each of the multiple nutrient composition trees corresponds to a quality range of the agricultural products, with a total of multiple different quality ranges; the electronic device determines a target nutrient composition tree from the multiple nutrient composition trees based on the quality of the agricultural products, including: the electronic device determines the target quality range of the quality of the agricultural products from the multiple different quality ranges based on the quality of the agricultural products, the nutrient composition tree corresponding to the target quality range in the multiple nutrient composition trees is the target nutrient composition tree, and the ratios indicated by the root nodes of any two of the multiple nutrient composition trees are different; the electronic device determines the ratio indicated by the root node in the target nutrient composition tree as the proportion of the main nutrients of the agricultural product.
[0062] Optionally, the electronic device determines the respective proportions of multiple auxiliary nutrients of the agricultural products in the target nutrient component tree according to the quality of the agricultural products, including: the electronic device determines the nodes corresponding to each of the multiple auxiliary nutrients under the quality from the target nutrient component tree in turn, and determines a total of multiple nodes, the multiple nodes constitute a branch in the target nutrient component tree, any two adjacent nodes in the multiple nodes are parent-child node relationships, and the ratio indicated by each node in the multiple nodes is the proportion of multiple auxiliary nutrients corresponding to one auxiliary nutrient under the quality.
[0063] Optionally, the multiple auxiliary nutrients are K+1 auxiliary nutrients. For the ith auxiliary nutrient, i is an integer traversing from 1 to K, and the node corresponding to the ith auxiliary nutrient in the target nutrient tree is Ni nodes. The Ni nodes have a common parent node in the target nutrient tree. When i is equal to 1, the parent node of the Ni nodes is the root node. When i is greater than 1, the parent node of the Ni nodes is a node in the target nutrient tree that indicates the proportion of the i-1th auxiliary nutrient; the Ni nodes each correspond to a quality interval, and there are Ni different quality intervals in total, and the proportions indicated by any two of the Ni nodes are different; on this basis, the electronic device determines the nodes corresponding to each of the multiple auxiliary nutrients under quality from the target nutrient tree in turn, including: the electronic device determines the ith quality interval in which the quality of the agricultural product is located from Ni different quality intervals based on the quality of the agricultural product; the electronic device determines the node corresponding to the ith quality interval among the Ni nodes, and the proportion indicated by the node corresponding to the ith quality interval is the proportion of the ith auxiliary nutrient under quality.
[0064] Optionally, the target nutrient tree includes K nodes indicating the proportion of K auxiliary nutrients in terms of mass. According to the traversal relationship from the parent node to the child node in the target nutrient tree, the proportion indicated by any child node among the K nodes is smaller than the proportion indicated by the parent node of the child node.
[0065] Optionally, when i traverses from 1 to K, the electronic device correspondingly determines the proportion of each of the first K auxiliary nutrients in K+1 auxiliary nutrients in terms of mass, and the electronic device is configured as: the electronic device determines the sum of the proportions of each of the K auxiliary nutrients in terms of mass; the electronic device subtracts the sum of the proportions of each of the K auxiliary nutrients in terms of mass from 1 to obtain the proportion of the K+1th auxiliary nutrient in terms of mass among the K+1 auxiliary nutrients.
[0066] Optionally, the electronic device analyzes the image through a neural network model to obtain the type of agricultural products output by the neural network model and the quality of the agricultural products, including: the electronic device pre-processes the image into grayscale to obtain a grayscale image; the electronic device analyzes the grayscale image through a neural network model to obtain the type of agricultural products output by the neural network model and the quality of the agricultural products.
[0067] Optionally, the neural network model is a convolutional neural network model.
[0068] Figure 4 This is a schematic diagram of the structure of an electronic device provided in an embodiment of the present application. For example, the electronic device may be a terminal, or a chip (system) or other components or assemblies that may be provided in a terminal. Figure 4 As shown, the electronic device 400 may include a processor 401. Optionally, the electronic device 400 may further include a memory 402 and / or a transceiver 403. The processor 401 is coupled with the memory 402 and the transceiver 403, such as being connected via a communication bus.
[0069] Combine the following Figure 4 The components of the electronic device 400 are described in detail:
[0070] The processor 401 is the control center of the electronic device 400, and may be a processor or a general term for multiple processing elements. For example, the processor 401 is one or more central processing units (CPUs), or may be application specific integrated circuits (ASICs), or may be configured to implement one or more integrated circuits of the embodiments of the present application, such as one or more microprocessors (digital signal processors, DSPs), or one or more field programmable gate arrays (FPGAs).
[0071] Optionally, the processor 401 can execute various functions of the electronic device 400 by running or executing the software program stored in the memory 402 and calling the data stored in the memory 402, such as executing the above Figure 2 The intelligent detection method of nutritional components of agricultural products is shown.
[0072] In a specific implementation, as an embodiment, the processor 401 may include one or more CPUs, such as Figure 4 CPU0 and CPU1 are shown in FIG.
[0073] In a specific implementation, as an embodiment, the electronic device 400 may also include multiple processors. Each of these processors may be a single-core processor (single-CPU) or a multi-core processor (multi-CPU). The processor here may refer to one or more devices, circuits, and / or processing cores for processing data (e.g., computer program instructions).
[0074] The memory 402 is used to store the software program for executing the solution of the present application, and the execution is controlled by the processor 401. The specific implementation method can refer to the above method embodiment, which will not be repeated here.
[0075] Optionally, the memory 402 may be a read-only memory (ROM) or other types of static storage devices that can store static information and instructions, a random access memory (RAM) or other types of dynamic storage devices that can store information and instructions, or an electrically erasable programmable read-only memory (EEPROM), a compact disc read-only memory (CD-ROM) or other optical disc storage, optical disc storage (including compressed optical disc, laser disc, optical disc, digital versatile disc, Blu-ray disc, etc.), a magnetic disk storage medium or other magnetic storage device, or any other medium that can be used to carry or store the desired program code in the form of instructions or data structures and can be accessed by a computer, but is not limited thereto. The memory 402 may be integrated with the processor 401, or may exist independently and access the computer through the interface circuit ( Figure 4 (not shown) is coupled to the processor 401, which is not specifically limited in the embodiment of the present application.
[0076] The transceiver 403 is used for communication with other electronic devices. For example, if the electronic device 400 is a terminal, the transceiver 403 can be used to communicate with a network device, or with another terminal device. For another example, if the electronic device 400 is a network device, the transceiver 403 can be used to communicate with a terminal, or with another network device.
[0077] Optionally, the transceiver 403 may include a receiver and a transmitter ( Figure 4 The receiver is used to implement a receiving function, and the transmitter is used to implement a sending function.
[0078] Optionally, the transceiver 403 may be integrated with the processor 401, or may exist independently and communicate with the electronic device 400 through an interface circuit ( Figure 4 (not shown) is coupled to the processor 401, which is not specifically limited in the embodiment of the present application.
[0079] Understandably, Figure 4 The structure of the electronic device 400 shown in the figure does not constitute a limitation on the electronic device, and the actual electronic device may include more or fewer components than those shown in the figure, or combine certain components, or arrange the components differently.
[0080] In addition, the technical effects of the electronic device 400 can refer to the technical effects of the methods described in the above method embodiments, which will not be repeated here.
[0081] It should be understood that the processor in the embodiments of the present application may be a central processing unit (CPU), and the processor may also be other general-purpose processors, digital signal processors (DSP), application specific integrated circuits (ASIC), field programmable gate arrays (FPGA) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. A general-purpose processor may be a microprocessor or the processor may also be any conventional processor, etc.
[0082] It should also be understood that the memory in the embodiments of the present application may be a volatile memory or a non-volatile memory, or may include both volatile and non-volatile memories. Among them, the non-volatile memory may be a read-only memory (ROM), a programmable read-only memory (PROM), an erasable programmable read-only memory (EPROM), an electrically erasable programmable read-only memory (EEPROM), or a flash memory. The volatile memory may be a random access memory (RAM), which is used as an external cache. By way of example and not limitation, many forms of random access memory (RAM) are available, such as static RAM (SRAM), dynamic random access memory (DRAM), synchronous DRAM (SDRAM), double data rate synchronous dynamic random access memory (DDR SDRAM), enhanced synchronous dynamic random access memory (ESDRAM), synchronous link DRAM (SLDRAM), and direct rambus RAM (DR RAM).
[0083] The above embodiments can be implemented in whole or in part by software, hardware (such as circuits), firmware or any other combination. When implemented using software, the above embodiments can be implemented in whole or in part in the form of a computer program product. The computer program product includes one or more computer instructions or computer programs. When the computer instructions or computer programs are loaded or executed on a computer, the process or function described in the embodiment of the present application is generated in whole or in part. The computer can be a general-purpose computer, a special-purpose computer, a computer network, or other programmable device. The computer instructions can be stored in a computer-readable storage medium, or transmitted from one computer-readable storage medium to another computer-readable storage medium. For example, the computer instructions can be transmitted from one website site, computer, server or data center to another website site, computer, server or data center by wired (such as infrared, wireless, microwave, etc.). The computer-readable storage medium can be any available medium that a computer can access or a data storage device such as a server or data center that contains one or more available media sets. The available medium can be a magnetic medium (for example, a floppy disk, a hard disk, a tape), an optical medium (for example, a DVD), or a semiconductor medium. The semiconductor medium can be a solid-state hard disk.
[0084] It should be understood that the term "and / or" in this article is only a description of the association relationship of associated objects, indicating that there can be three relationships. For example, A and / or B can represent: A exists alone, A and B exist at the same time, and B exists alone. A and B can be singular or plural. In addition, the character " / " in this article generally indicates that the associated objects before and after are in an "or" relationship, but it may also indicate an "and / or" relationship. Please refer to the context for specific understanding.
[0085] In this application, "at least one" means one or more, and "more" means two or more. "At least one of the following" or similar expressions refers to any combination of these items, including any combination of single or plural items. For example, at least one of a, b, or c can be represented by: a, b, c, ab, ac, bc, or abc, where a, b, c can be single or multiple.
[0086] It should be understood that in the various embodiments of the present application, the size of the serial numbers of the above-mentioned processes does not mean the order of execution. The execution order of each process should be determined by its function and internal logic, and should not constitute any limitation on the implementation process of the embodiments of the present application.
[0087] Those of ordinary skill in the art will appreciate that the units and algorithm steps of each example described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professional and technical personnel can use different methods to implement the described functions for each specific application, but such implementation should not be considered to be beyond the scope of this application.
[0088] Those skilled in the art can clearly understand that, for the convenience and brevity of description, the specific working processes of the systems, devices and units described above can refer to the corresponding processes in the aforementioned method embodiments and will not be repeated here.
[0089] In the several embodiments provided in the present application, it should be understood that the disclosed systems, devices and methods can be implemented in other ways. For example, the device embodiments described above are only schematic. For example, the division of the units is only a logical function division. There may be other division methods in actual implementation, such as multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, indirect coupling or communication connection of devices or units, which can be electrical, mechanical or other forms.
[0090] The units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed on multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.
[0091] In addition, each functional unit in each embodiment of the present application may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit.
[0092] If the functions are implemented in the form of software functional units and sold or used as independent products, they can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present application can be essentially or partly embodied in the form of a software product that contributes to the prior art. The computer software product is stored in a storage medium and includes several instructions for a computer device (which can be a personal computer, a server, or a network device, etc.) to perform all or part of the steps of the methods described in the various embodiments of the present application. The aforementioned storage media include: various media that can store program codes, such as USB flash drives, mobile hard disks, read-only memories (ROM), random access memories (RAM), magnetic disks or optical disks.
[0093] The above is only a specific implementation of the present application, but the protection scope of the present application is not limited thereto. Any person skilled in the art who is familiar with the present technical field can easily think of changes or substitutions within the technical scope disclosed in the present application, which should be included in the protection scope of the present application. Therefore, the protection scope of the present application should be based on the protection scope of the claims.
Claims
1. An intelligent detection method for the nutritional components of agricultural products, characterized in that: Applied to electronic equipment, the method comprises: The electronic device acquires an image of the agricultural product, wherein the image is an image obtained by photographing the agricultural product; The electronic device analyzes the image through a neural network model to obtain the type of the agricultural product and the quality of the agricultural product output by the neural network model; The electronic device traverses the nutrient component tree of the agricultural product according to the type of the agricultural product and the quality of the agricultural product to determine the proportion of each nutrient component of the agricultural product; The electronic device traverses the nutrient component tree of the agricultural product according to the type of the agricultural product and the quality of the agricultural product to determine the proportion of each nutrient component of the agricultural product, including: The electronic device determines a plurality of nutrient component trees of the agricultural product according to the type of the agricultural product; The electronic device determines a target nutrient component tree from the multiple nutrient component trees according to the quality of the agricultural product, wherein the information contained in the root node of the target nutrient component tree is the proportion of the main nutrient components of the agricultural product; The electronic device determines the respective proportions of the plurality of auxiliary nutrients of the agricultural product in the target nutrient component tree according to the quality of the agricultural product.
2. The method according to claim 1, characterized in that The multiple nutrient component trees are divided according to different qualities of the agricultural products, and each of the multiple nutrient component trees corresponds to a quality interval of the agricultural products, and there are a total of multiple different quality intervals; The electronic device determines a target nutrient component tree from the plurality of nutrient component trees according to the quality of the agricultural product, including: The electronic device determines, according to the quality of the agricultural product, a target quality interval in which the quality of the agricultural product is located from the multiple different quality intervals, a nutrient component tree corresponding to the target quality interval in the multiple nutrient component trees is the target nutrient component tree, and the root nodes of any two nutrient component trees in the multiple nutrient component trees indicate different ratios; The electronic device determines the proportion indicated by the root node in the target nutrient component tree as the proportion of the main nutrient components of the agricultural product.
3. The method according to claim 2, characterized in that The electronic device determines the respective proportions of the plurality of auxiliary nutrients of the agricultural product in the target nutrient component tree according to the quality of the agricultural product, including: The electronic device determines in turn from the target nutrient tree the nodes corresponding to each of the multiple auxiliary nutrients under the mass, and determines a total of the multiple nodes, wherein the multiple nodes constitute a branch in the target nutrient tree, any two adjacent nodes among the multiple nodes are in a parent-child node relationship, and the ratio indicated by each of the multiple nodes is the proportion of one auxiliary nutrient corresponding to the multiple auxiliary nutrients under the mass.
4. The method according to claim 3, characterized in that The multiple auxiliary nutrients are K+1 auxiliary nutrients, for the i-th auxiliary nutrient, i is an integer traversing from 1 to K, the nodes corresponding to the i-th auxiliary nutrient in the target nutrient tree are Ni nodes, the Ni nodes have a common parent node in the target nutrient tree, when i is equal to 1, the parent node of the Ni nodes is the root node, when i is greater than 1, the parent node of the Ni nodes is a node indicating the proportion of the i-1th auxiliary nutrient in the target nutrient tree; the Ni nodes each correspond to a mass interval, there are Ni different mass intervals in total, and the proportions indicated by any two of the Ni nodes are different; On this basis, the electronic device sequentially determines the nodes corresponding to each of the plurality of auxiliary nutrients under the mass from the target nutrient component tree, including: The electronic device determines, according to the quality of the agricultural product, the i-th quality interval in which the quality of the agricultural product is located from the Ni different quality intervals; The electronic device determines a node corresponding to the i-th quality interval among the Ni nodes, and the ratio indicated by the node corresponding to the i-th quality interval is the proportion of the i-th auxiliary nutrient under the mass.
5. The method according to claim 4, characterized in that The multiple nodes in the target nutrient component tree indicating the proportions of the K auxiliary nutrients under the mass are K nodes. According to the traversal relationship from the parent node to the child node in the target nutrient component tree, the proportion indicated by any child node among the K nodes is smaller than the proportion indicated by the parent node of the child node.
6. The method according to claim 5, characterized in that When i traverses from 1 to K, the electronic device correspondingly determines the proportion of each of the first K supplementary nutrients in the K+1 supplementary nutrients at the mass, and the method further includes: The electronic device determines the sum of the proportions of the K kinds of supplementary nutrients at the mass; The electronic device subtracts the sum of the proportions of the K supplementary nutrients at the mass from 1 to obtain the proportion of the K+1th supplementary nutrient among the K+1 supplementary nutrients at the mass.
7. The method according to claim 1, characterized in that The electronic device analyzes the image through a neural network model to obtain the type of the agricultural product and the quality of the agricultural product output by the neural network model, including: The electronic device performs grayscale preprocessing on the image to obtain a grayscale image; The electronic device analyzes the grayscale image through the neural network model to obtain the type of the agricultural product and the quality of the agricultural product output by the neural network model.
8. The method according to claim 7, characterized in that The neural network model is a convolutional neural network model.
9. An intelligent detection system for the nutritional components of agricultural products, characterized in that: The system comprises an electronic device configured to: The electronic device acquires an image of the agricultural product, wherein the image is an image obtained by photographing the agricultural product; The electronic device analyzes the image through a neural network model to obtain the type of the agricultural product and the quality of the agricultural product output by the neural network model; The electronic device traverses the nutrient component tree of the agricultural product according to the type of the agricultural product and the quality of the agricultural product to determine the proportion of each nutrient component of the agricultural product; The electronic device traverses the nutrient component tree of the agricultural product according to the type of the agricultural product and the quality of the agricultural product to determine the proportion of each nutrient component of the agricultural product, including: The electronic device determines a plurality of nutrient component trees of the agricultural product according to the type of the agricultural product; The electronic device determines a target nutrient component tree from the multiple nutrient component trees according to the quality of the agricultural product, wherein the information contained in the root node of the target nutrient component tree is the proportion of the main nutrient components of the agricultural product; The electronic device determines the respective proportions of the plurality of auxiliary nutrients of the agricultural product in the target nutrient component tree according to the quality of the agricultural product.
Citation Information
Patent Citations
Food nutritional ingredient processing method and device and storage medium
CN114898842A
Vegetation base material for afforestation, vegetation unit and method for specific space afforestation using the vegetation base material and vegetation unit
JP2002335747A