Method and electronic device for determining health score of plant
The plant health scoring model trained through triplet contrast learning solves the problem of difficulty in automatically evaluating plant health status in existing technologies, realizes accurate assessment of plant health status and generation of maintenance plans, and improves maintenance efficiency.
Patent Information
- Application Number
- CN202510969192.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-07-14
- Publication Date
- 2025-10-10
- Estimated Expiration
- 2045-07-14
AI Technical Summary
Existing technologies cannot effectively and automatically evaluate and provide feedback on the health status of plants, making it difficult for users to perform maintenance in a timely and accurate manner.
The plant health scoring model trained using the triplet contrastive learning method obtains plant images, determines their health scores, and combines the user interface to present the scores and generate maintenance plans. The model is trained using triplet data to distinguish different health states.
It realizes the automated assessment and accurate feedback of plant health status, helps users to better carry out maintenance, and improves maintenance efficiency and effectiveness.
Smart Images

Figure CN120766066A_ABST
Abstract
Description
Technical Field
[0001] The present disclosure relates to the field of information processing technology, and more particularly, to a method for determining a plant health score, an electronic device, a computer-readable storage medium, and a computer program product, and also to a maintenance system. Background Art
[0002] With the improvement of living standards, more and more users are starting to take care of plants. Since plants may experience various growth events during their growth process, it is necessary to always pay attention to the health status of plants in order to better care for them. Summary of the Invention
[0003] A brief overview of the present disclosure is provided below to provide a basic understanding of some aspects of the present disclosure. However, it should be understood that this overview is not an exhaustive overview of the present disclosure. It is not intended to identify key or important parts of the present disclosure, nor is it intended to limit the scope of the present disclosure. Its purpose is simply to present certain concepts of the present disclosure in a simplified form as a prelude to the more detailed description that will be given later.
[0004] According to a first aspect of the present disclosure, a method for determining a health score of a plant is provided, comprising: acquiring a plant image; determining, by a plant health score model, the health score of the plant based on the acquired plant image, wherein the plant health score model is trained according to triplet data using a triplet contrastive learning method, the triplet data including a first plant image with a label of a first health score as an anchor sample, a second plant image with a label of a second health score as a positive sample, and a third plant image with a label of a third health score as a negative sample, the difference between the second health score and the first health score being less than the difference between the third health score and the first health score; and presenting the determined health score of the plant on a user interface.
[0005] In some embodiments, the method further includes determining, by a plant health scoring model, the species of the plant based on the acquired plant image before determining the plant health score based on the plant image, wherein the plant health scoring model is trained based on labeled plant species data.
[0006] In some embodiments, the triplet data includes multiple sets of triplet data of plants of different species, and the anchor samples, positive samples, and negative samples in the same triplet data are plant images of the same species.
[0007] In some embodiments, determining the health score of a plant based on an acquired plant image by a plant health score model includes: selecting a plant image labeled with a first specified health score from a database as a first reference image based on the species of the plant, the plant in the first reference image and the plant being of the same species; determining the similarity between the plant image and the first reference image; and determining that the health score of the plant is the first specified health score in response to determining that the similarity is greater than a preset similarity threshold.
[0008] In some embodiments, determining the health score of the plant based on the acquired plant image by the plant health score model also includes: in response to determining that the similarity is not greater than a preset threshold, selecting other plant images labeled with a second specified health score from the database as a second reference image, wherein the plant in the second reference image is the same species as the plant, and the second specified health score is different from the first specified health score; determining the similarity between the plant image and the second reference image; and in response to determining that the similarity is greater than the preset similarity threshold, determining that the health score of the plant is the second specified health score.
[0009] In some embodiments, the plant health scoring model includes multiple classification heads, different classification heads correspond to different health scores, and the plant health scoring model determines the health score of the plant based on the acquired plant image, including: extracting the embedding vector of the acquired plant image by the plant health scoring model; each of the multiple classification heads: determining the probability that the health score of the plant exceeds the health score corresponding to the classification head based on the embedding vector, comparing the determined probability with a preset probability threshold, and outputting a first value in response to the determined probability being not less than the preset probability threshold, or outputting a second value different from the first value in response to the determined probability being less than the preset probability threshold; and determining the health score of the plant based on the outputs of the multiple classification heads.
[0010] In some embodiments, the plant image includes multiple plant images of the same plant at multiple growth stages.
[0011] In some embodiments, a plant health scoring model is trained based on triplet data using a triplet contrastive learning method, including: calculating the first embedding vector of the anchor sample, the second embedding vector of the positive sample, and the third embedding vector of the negative sample respectively; calculating the distance between the first embedding vector and the second embedding vector, and the distance between the first embedding vector and the third embedding vector respectively; updating the parameters in the plant health scoring model according to the loss function until the distance between the first embedding vector and the second embedding vector obtained by the updated plant health scoring model is less than the distance between the first embedding vector and the third embedding vector and maintains a preset interval.
[0012] In some embodiments, the method includes: generating a maintenance plan based on the determined health score of the plant, the maintenance plan including maintenance tasks and identification of maintenance devices for performing the maintenance tasks; and outputting the maintenance plan.
[0013] In some embodiments, the method includes: controlling the corresponding maintenance device according to the identification of the maintenance device in the maintenance plan to complete the maintenance task.
[0014] According to a second aspect of the present disclosure, an electronic device is provided, comprising: a processor; and a memory storing computer-executable instructions, which, when executed by the processor, causes the processor to perform the method for determining a plant health score according to any embodiment of the first aspect of the present disclosure.
[0015] According to a third aspect of the present disclosure, there is provided a computer-readable storage medium having computer-executable instructions stored thereon. When the computer-executable instructions are executed by a computer, the computer is caused to perform the method for determining a plant health score according to any embodiment of the first aspect of the present disclosure.
[0016] According to a fourth aspect of the present disclosure, a computer program product is provided. The computer program product comprises instructions, which, when executed by a processor, implement the method for determining a plant health score according to any embodiment of the first aspect of the present disclosure.
[0017] According to a fifth aspect of the present disclosure, a maintenance system is provided, comprising: an acquisition module configured to acquire a plant image; and a scoring module configured to determine a plant health score based on the acquired plant image by a plant health scoring model, wherein the plant health scoring model is trained according to triplet data using a triplet contrast learning method, the triplet data comprising a first plant image with a label of a first health score as an anchor sample, a second plant image with a label of a second health score as a positive sample, and a third plant image with a label of a third health score as a negative sample, the difference between the second health score and the first health score being the difference between the first and second health scores. The difference is less than the difference between the third health score and the first health score; a presentation module is configured to present the determined health score of the plant on a user interface; a maintenance plan generation module is configured to generate a maintenance plan based on the determined health score of the plant, the maintenance plan including a maintenance task and an identification of a maintenance device for performing the maintenance task; a control module is configured to control the corresponding maintenance device according to the identification of the maintenance device in the maintenance plan to complete the maintenance task; and an execution module, the execution module includes a maintenance device communicatively coupled to the control module, the maintenance device being configured to perform the maintenance task in response to receiving a command from the control module. BRIEF DESCRIPTION OF THE DRAWINGS
[0018] The foregoing and other features and advantages of the present disclosure will become apparent from the following description of the embodiments of the present disclosure taken in conjunction with the accompanying drawings, which are incorporated herein and form a part of the specification and serve to further explain the principles of the present disclosure and enable those skilled in the art to make and use the present disclosure.
[0019] Figure 1 A flow chart illustrating a method for determining a health score of a plant according to some embodiments of the present disclosure is shown;
[0020] Figure 2 A schematic diagram illustrating an exemplary user interface for a method for determining a health score of a plant according to some embodiments of the present disclosure;
[0021] Figure 3 A schematic diagram illustrating an exemplary user interface for a method for determining a health score of a plant according to some embodiments of the present disclosure;
[0022] Figure 4 A schematic diagram illustrating an exemplary user interface for a method for determining a health score of a plant according to some embodiments of the present disclosure;
[0023] Figure 5 A schematic block diagram of an electronic device according to some embodiments of the present disclosure is shown;
[0024] Figure 6 A schematic block diagram of a computer system on which embodiments of the present disclosure may be implemented is shown;
[0025] Figure 7 A schematic block diagram of a maintenance system according to some embodiments of the present disclosure is shown.
[0026] Note that in the embodiments described below, the same reference numerals are sometimes used in common across different drawings to denote the same parts or parts having the same functions, and their repeated descriptions are omitted. In some cases, similar reference numerals and letters are used to denote similar items, so once an item is defined in one drawing, it need not be further discussed in subsequent drawings.
[0027] For ease of understanding, the positions, sizes, and ranges of various structures shown in the drawings and the like may not represent actual positions, sizes, and ranges, etc. Therefore, the present disclosure is not limited to the positions, sizes, and ranges disclosed in the drawings and the like. DETAILED DESCRIPTION
[0028] Various exemplary embodiments of the present disclosure will be described in detail below with reference to the accompanying drawings. It should be noted that unless otherwise specifically stated, the relative arrangements of components and steps, numerical expressions and numerical values set forth in these embodiments do not limit the scope of the present disclosure.
[0029] The following description of at least one exemplary embodiment is merely illustrative and is not intended to limit the present disclosure, its application, or use. In other words, the structures and methods herein are presented in an exemplary manner to illustrate various embodiments of the structures and methods of the present disclosure. However, those skilled in the art will appreciate that these are merely exemplary of the disclosure that may be implemented, and are not exhaustive. Furthermore, the drawings are not necessarily drawn to scale, and some features may be exaggerated to illustrate details of specific components.
[0030] In addition, technologies, methods, and equipment known to ordinary technicians in the relevant art may not be discussed in detail, but where appropriate, the technologies, methods, and equipment should be considered part of the specification.
[0031] In all examples shown and discussed herein, any specific values should be interpreted as merely exemplary and not limiting. Therefore, other examples of the exemplary embodiments may have different values.
[0032] The present disclosure provides, on one hand, a method for determining a plant health score, which automatically processes plant images to determine the plant health score by using a plant health score model trained based on triplet data using a triplet contrastive learning method, thereby providing the determined plant health score to a user, so that the user can clearly understand the health status of the plants they are caring for, thereby facilitating the user to better care for the plants.
[0033] The following describes in detail the method for determining a plant health score according to the present disclosure, with reference to the accompanying drawings. It should be understood that the actual method for determining a plant health score may include other additional steps, but to avoid obscuring the key points of the present disclosure, these additional steps are not discussed herein and are not shown in the accompanying drawings.
[0034] Figure 1 A flow chart of a method for determining a plant's health score (hereinafter referred to as "method 100") according to some embodiments of the present disclosure is shown. Method 100 can be executed by an application program (APP) installed on an electronic device such as a computer or a mobile phone to provide a user with a function for determining a plant's health score. Figure 1 As shown, the method 100 includes steps S102 to S106.
[0035] In step S102 , a plant image is acquired.
[0036] At step S104, a plant health score is determined by a plant health score model based on the acquired plant image, wherein the plant health score model is trained according to triplet data using a triplet contrastive learning method, the triplet data including a first plant image with a label of a first health score as an anchor sample (Anchor), a second plant image with a label of a second health score as a positive sample (Positive), and a third plant image with a label of a third health score as a negative sample (Negative), and a difference between the second health score and the first health score is less than a difference between the third health score and the first health score.
[0037] At step S106 , the determined health score of the plant is presented on a user interface.
[0038] In some embodiments, the plant image may be input by a user. In other embodiments, the plant image may be automatically captured and input by a visual monitoring device (eg, a camera).
[0039] In some embodiments, the plant images may include one or more images of the same plant. In some examples, the plant images include at least one of the following: an image that depicts the overall appearance of the plant, an image that depicts the appearance of a growing part of the plant, or an image that depicts the appearance of a diseased part of the plant. In other words, the plant images can provide the plant health scoring model with sufficient information to determine the plant's health score.
[0040] In some embodiments, the plant image may also include multiple plant images of the same plant at multiple growth stages, thereby allowing the changes in the health status of the plant at these multiple growth stages to be observed, thereby enabling the dynamic growth of the plant to be grasped and the plant to be better maintained.
[0041] In some embodiments, the plant health score may include multiple health scores for indicating different health states of the plant. Health score indicators may include, for example, leaf color, such as healthy leaves are typically bright green, while yellow, brown, or black may indicate leaf health issues; growth status, such as whether growth is vigorous and whether there are new shoots, flowers, or fruits; signs of pests and diseases, such as whether there are lesions, insect holes, or other signs of disease; structural integrity, such as whether branches and leaves are full and lush, and whether there are signs of wilting or falling off; and environmental stress, such as observing for signs of sunburn, frostbite, or other signs of environmental stress.
[0042] In some examples, a health score 10 (e.g., can be represented by “very healthy”) can be used to indicate that the plant is in an optimal health condition, leaves are bright green, growing vigorously, structurally intact, no signs of pests and diseases, no environmental stress; a health score 9 (e.g., can be represented by “healthy”) can be used to indicate that the plant is in a healthy condition, most leaves are bright green, growing vigorously, structurally intact, no signs of pests and diseases, no environmental stress; a health score 8 (e.g., can be represented by “fine”) can be used to indicate that the plant is generally healthy, but some leaves are turning yellow from green, growing vigorously, structurally intact, no signs of pests and diseases, no environmental stress, etc., which can be recovered by simple measures; a health score 7 (e.g., can be represented by “okay”) can be used to indicate that the plant has mild health problems, some leaves are turning yellow from green and are slightly sunburned, but the plant is growing vigorously, structurally intact, no signs of pests and diseases, etc., which can be recovered by simple measures; a health score 6 (e.g., can be represented by “attention”) can be used to indicate that the plant has obvious health problems, leaves are yellow and have disease spots and the root system is moldy, but the structure of the plant is relatively complete, the growth is relatively strong, and new leaves can grow normally, which can be recovered by certain measures; a health score 5 (e.g., can be represented by “more attention”) can be used to indicate that the plant has relatively serious health problems, leaves are yellow, growth is weak, have disease spots and the root system is moldy, but the structure of the plant is relatively complete, which can be recovered by certain measures; a health score 4 (e.g., can be represented by “sick”) can be used to indicate that the plant has serious health problems, leaves are wilting, growth is weak, insect bites are serious, the root system is moldy, and the structure of the plant is not complete, which needs to be recovered by complex and precise measures; a health score 3 (e.g., can be represented by “significantly sick”) can be used to indicate that the plant has very serious health problems, leaves have all fallen off, growth is weak, insect bites are serious, the structure of the plant is not complete, and the root system is seriously moldy, which needs to be recovered by complex and precise measures; a health score 2 (e.g., can be represented by “barely survive”) can be used to indicate that the plant is generally wilted, but a small amount of green leaves can be seen; a health score 1 (e.g., can be represented by “about to death”) can be used to indicate that the plant is generally dead; a health score 0 (e.g., can be represented by “death”) can be used to indicate that the plant is completely dead and no evidence can be found to prove that the plant is alive.
[0043] In some embodiments, method 100 may further include: before determining the health score of the plant based on the plant image, determining the species of the plant based on the acquired plant image by a plant health scoring model, wherein the plant health scoring model may be trained based on labeled plant species data, so that the trained plant health scoring model can determine the species of the plant therein based on the plant image.
[0044] In some embodiments, the triple data may include multiple sets of triple data in units of species. That is, the triple data may include multiple sets of triple data of plants of different species, and the anchor samples, positive samples, and negative samples in the same triple data correspond to plant images of the same species. Thus, the plant health score can be trained through triple comparative learning on a species basis.
[0045] In some embodiments, determining a plant health score based on a captured plant image by a plant health scoring model may include: selecting a plant image labeled with a first designated health score from a database as a first reference image based on the plant species, wherein the plant in the first reference image is of the same species as the plant for which the health score is to be determined, also referred to as the "target plant" in this disclosure; determining a similarity between the plant image and the first reference image; and determining that the similarity is greater than a preset similarity threshold, determining the plant health score to be the first designated health score. In some embodiments, the first designated health score may be any one of a plurality of defined health scores.
[0046] In some examples, the database may store one or more plant images of each plant in different health states among a plurality of plants, and each plant image has a labeled label, wherein the label of each plant image indicates a health score of the plant in the plant image.
[0047] Since there may be differences in the health status of plants of different species, the species of the target plant can be determined first, and then plant images of the same species as the target plant can be retrieved and selected from the database as reference images, thereby improving the reference value of the reference image and further improving the accuracy of the health score of the target plant determined subsequently based on the reference image.
[0048] Of course, it is understandable that, considering that even plants of different species may have similar performances when facing the same growth events (e.g., yellowing leaves, lesions, sunburn, etc.), in other embodiments, plant images with health score labels in the database may be directly selected as reference images, which can save the step of determining the species of the target plant and save computing resources.
[0049] In further embodiments, determining the health score of the plant based on the acquired plant image by the plant health score model can further include: in response to determining that the similarity is not greater than the preset threshold, selecting, from the database, other plant images with labels of a second specified health score as second reference images, wherein the plants in the second reference images are of the same species as the plant and the second specified health score is different from the first specified health score; determining the similarity between the plant image and the second reference images; and in response to determining that the similarity is greater than the preset similarity threshold, determining that the health score of the plant is the second specified health score.
[0050] As a non-limiting illustrative example, when it is determined that the plant image is not similar to the first reference image, it can be considered that the health score of the target plant is not the health score of the plant in the first reference image (e.g., the first specified health score), and therefore, plant images with labels of other health scores (e.g., the second specified health score) under the same species can be selected from the database as second reference images, and the similarity between the plant image and the second reference images is calculated again. This cycle continues until a reference image that meets the similarity requirement with the plant image is found, thereby determining the health score of the target plant.
[0051] As a non-limiting illustrative example, determining the similarity between the plant image and the reference image (e.g., the first reference image and the second reference image) can be achieved by calculating the cosine similarity between the embedding vector representing the image features of the plant image and the embedding vector representing the image features of the reference image.
[0052] The foregoing embodiments can determine the health score of the plant in the plant image by determining the similarity between the plant image and the reference image. In other embodiments, the health score of the plant in the plant image can also be determined by predicting the probability that the embedding vector of the plant image exceeds a certain health score through a classification head.
[0053] In some embodiments, a plant health scoring model may include multiple classification heads, with different classification heads corresponding to different health scores. Determining a plant health score based on a captured plant image by the plant health scoring model includes: extracting an embedding vector for the captured plant image by the plant health scoring model; each of the multiple classification heads determining, based on the embedding vector, a probability that the plant health score exceeds the health score corresponding to the classification head; comparing the determined probability with a preset probability threshold; and outputting a first value in response to the determined probability being no less than the preset probability threshold, or outputting a second value different from the first value in response to the determined probability being less than the preset probability threshold; and determining the plant health score based on the outputs of the multiple classification heads. The preset probability threshold is used to represent the confidence level of the model and can be appropriately set based on actual needs. In some embodiments, the classification heads may be binary classification heads.
[0054] As a non-limiting example, a plant health score model may include 10 classification heads, each corresponding to a health score of 0 to 9. Each head is responsible for handling a binary classification task. For example, the first classification head may ask, "Is the health score of the target plant greater than 0?"; the second classification head may ask, "Is the health score of the target plant greater than 1?"; and the ninth classification head may ask, "Is the health score of the target plant greater than 9?" Taking the first classification head as an example, if the probability that the plant's health score calculated by the first classification head based on the embedded vector extracted from the plant image exceeds the health score of the first classification head (i.e., 0) is 0.9, and the preset probability threshold is 0.5, the first classification head may output a 1. Alternatively, if the probability that the plant's health score calculated by the first classification head based on the extracted embedded vector exceeds a health score of 0 is 0.4, and the preset probability threshold is 0.5, the first classification head may output a 0. The implementation of other classification heads can refer to the implementation of the first classification head.
[0055] Based on the outputs of these classification heads, a result vector consisting of first and second values is generated. This result vector has 1 row and the number of columns equal to the number of classification heads. The plant's health score can then be determined based on the distribution of the first and second values in this result vector. For example, assuming the result vector is [1, 1, 1, 0, 0, 0, 0, 0, 0, 0], it can be seen that the plant's health score exceeds 0, 1, and 2, but does not exceed 3. Therefore, the plant's health score can be determined to be 3. Specifically, the plant's health score can be determined to be the lowest health score, corresponding to the highest health score corresponding to element 1 and / or the lowest health score corresponding to element 0 in the result vector. If the result vector does not include element 0 (i.e., the plant's health score exceeds 9), the plant's health score can be determined to be 10. If the result vector does not include element 1 (i.e., the plant's health score does not exceed 0), the plant's health score can be determined to be 0.
[0056] In some examples, the multiple classification heads can be arranged in a cascaded (series) manner after the feature extraction network in the plant health score model. In this way, when the previous classification head outputs a first value (e.g., outputs 1), the next classification head continues to make a judgment; when the previous classification head outputs a second value (e.g., outputs 0), the judgment of the subsequent classification head is not performed, and the subsequent classification head all outputs the second value by default, which can save computing resources and improve operation speed.
[0057] In other examples, the multiple classification heads can be arranged in a parallel manner after the feature extraction network in the plant health score model. In this way, the multiple classification heads can output multiple values based on the extracted embedding vectors simultaneously, thereby improving the computing efficiency.
[0058] Before using the plant health score model for inference, the plant health score model needs to be trained. In some embodiments, the plant health score model can be trained according to triple data using a triple contrast learning method.
[0059] In some embodiments, the training process can include: calculating a first embedding vector of an anchor sample, a second embedding vector of a positive sample, and a third embedding vector of a negative sample, respectively; calculating a distance between the first embedding vector and the second embedding vector, and a distance between the first embedding vector and the third embedding vector, respectively; updating parameters in the plant health score model according to a loss function until the distance between the first embedding vector and the second embedding vector obtained via the updated plant health score model is less than the distance between the first embedding vector and the third embedding vector and a preset margin is maintained. Here, the margin is used to represent the relative distance between the anchor sample and the positive sample and the anchor sample and the negative sample, for distinguishing samples of different categories.
[0060] The anchor sample can be a first plant image with a label of a first health score, the positive sample can be a second plant image with a label of a second health score, and the negative sample can be a third plant image with a label of a third health score. Here, the anchor sample, the positive sample, and the negative sample can satisfy that the difference between the second health score and the first health score is less than the difference between the third health score and the first health score. Here, the "difference" refers to the absolute value of the difference between the second health score or the third health score and the first health score.
[0061] For example, in some examples, the first health score can be 7 points, the second health score can be 7 points (i.e., the difference between the second health score and the first health score is 0) or 8 points or 6 points (i.e., the difference between the second health score and the first health score is 1), and the third health score can be 9 points or 5 points (i.e., the difference between the third health score and the first health score is 2).
[0062] In some examples, anchor samples and positive samples with labels having similar health scores (for example, the anchor sample has a label indicating a health score of 7, and the positive sample has a label indicating a health score of 6 or 8) can be considered as samples of the same category, while anchor samples and negative samples with labels having health scores that are significantly different can be considered as samples of different categories (for example, the anchor sample has a label indicating a health score of 7, and the negative sample has a label indicating a health score of 4 or 10).
[0063] In other examples, anchor samples and positive samples labeled with the same health score can be considered as samples of the same category, while anchor samples and negative samples labeled with different health scores can be considered as samples of different categories.
[0064] It is understood that the health score difference threshold can be set according to actual needs to classify samples. For example, in some examples, anchor samples and positive samples whose health scores indicated by their labels differ by no more than 2 can be considered as samples of the same category, while anchor samples and negative samples whose health scores indicated by their labels differ by more than 3 can be considered as samples of different categories.
[0065] As a non-limiting example, triple contrastive learning is a special metric learning method whose training goal is to make the distance between the anchor sample and the positive sample smaller than the distance between the anchor sample and the negative sample, while maintaining a certain interval. That is, the training goal can be formally expressed as d(anchor, positive) + margin <d(anchor,negative),其中,其中d(a, b)表示a与b之间的距离度量函数。三元组对比学习方法通过学习样本之间的相对距离关系来优化嵌入空间(Embedding Space),使得在该嵌入空间中类别相同的样本之间的距离足够近,而类别不同的样本之间的距离足够远。
[0066] Therefore, through training, the trained plant health scoring model can bring plant images belonging to the same category closer in the learned embedding space, and push plant images belonging to different categories further away.
[0067] In addition, compared with the binary contrastive learning method, the triple contrastive learning method introduces richer relative constraint relationships. Therefore, the plant health scoring model trained using the triple contrastive learning method combined with triple data has better feature extraction capabilities and more accurate judgment of the distance between the plant image and the reference image. Therefore, the trained plant health scoring model disclosed in the present invention has better plant health score judgment capabilities.
[0068] In contrast, related art often employs a binary classification approach to determine plant health. Specifically, this approach assigns a 0 / 1 label to plant images in a training dataset based on their health status (for example, "0" indicates diseased plants, and "1" indicates healthy plants). This training dataset is then combined with a binary classification loss function (BCEWithLogitsLoss) (a loss function for binary classification problems that combines a Sigmoid function with binary cross-entropy loss) to train a plant health scoring model. This allows the plant health scoring model to determine plant health based on plant images and output whether the plant is healthy or diseased. In contrast, the trained plant scoring model of the present disclosure can output not only more detailed plant health status information but also more accurate judgment results.
[0069] refer to Figure 2 , which shows a schematic diagram of an exemplary user interface 200A for a method for determining a plant's health score according to some embodiments of the present disclosure. Figure 2 As shown, the user interface 200A may include an input button 202 for inputting plant images and an image display area 204 for displaying plant images. The user may input one or more plant images stored in the user device or directly captured plant images through the input button 202.
[0070] In some embodiments, if a plant health score cannot be determined based on the currently acquired plant image, an interactive question may be presented to the user, and a response to the interactive question may be obtained from the user. The response is then input into a plant health score model to further determine the plant health score based on the response. In some examples, the interactive question may include a request for one or more close-up images of the plant or an image of the entire plant.
[0071] The user interface 200A may further include a species information display area 206 for presenting species information of the plants in the plant image.
[0072] The user interface 200A may also include a health score display area 208 to present the health score of the plant determined by the plant health score model. Figure 2As shown, the health score of a frangipani plant determined based on a user-uploaded plant image is healthy (i.e., the plant health score of the frangipani plant is 0). By converting the numeric health score to text and presenting the plant health score in text form on the user interface, users can more directly access plant health information. Alternatively, the plant health score can be presented in numeric form on the user interface.
[0073] Therefore, the user can learn the health score / health status of the plant by inputting the plant image, thereby providing more reference for the user to maintain the plant in the future.
[0074] refer to Figure 3 , which shows a schematic diagram of an exemplary user interface 200B for a method for determining a plant's health score according to some embodiments of the present disclosure. Figure 3 As shown, the user interface 200B can also display other health scores of the plant: as shown in the health score display area 208A, the health score of the frangipani is sick; as shown in the health score display area 208B, the health score of the frangipani is attention; as shown in the health score display area 208C, the health score of the frangipani is okay.
[0075] Continue to refer Figure 3 For example, when the health score of the frangipani is sick, the user can also click on the user interface element 210 to obtain relevant solutions. In some embodiments, the database can store the species name of the plant, the maintenance information of the plant, the disease of the plant, the cause of the disease, and the corresponding treatment and prevention methods. This information about the plant can be stored in the database in association with the plant image and the label of the plant image. In some embodiments, the associated maintenance task can be generated and displayed to the user based on the content in the obtained solution. When a device capable of performing maintenance tasks is connected, the corresponding device can also be automatically controlled to perform the maintenance task to achieve automated maintenance of the plant.
[0076] Specifically, in some embodiments, method 100 may further include: generating a maintenance plan based on the determined plant health score, the maintenance plan including a maintenance task and an identifier of a maintenance device for performing the maintenance task; and outputting the maintenance plan.
[0077] Maintenance plans can include daily maintenance plans, therapeutic maintenance plans, preventive maintenance plans, and the like, or a combination thereof. For example, when the determined plant health score is between 10 and 9, the daily maintenance plan and / or preventive maintenance plan for the plant can be output; when the determined plant health score is between 8 and 3, the therapeutic maintenance plan for the plant can be output, and optionally, a combined daily maintenance plan and preventive maintenance plan can also be output.
[0078] For illustrative purposes, a non-limiting example application of method 100 may include determining the health score of a frangipani plant being cared for by a user. In this example, the leaves of the frangipani plant in the plant image input by the user display piles of orange-yellow to brown powdery spores, and corresponding locations on the leaf surface have chlorotic yellow spots. To further assist the user in caring for the frangipani plant, a maintenance task may be generated based on the species information "frangipani" presented in the user interface, the health score "sick," and the solution "Disease: Rust; Cause: Excessive humidity, high temperature, spore spread; Treatment measures: Cut off diseased leaves, improve ventilation, and spray pesticides." The task may be to "cut off diseased leaves for the frangipani plant, move the frangipani plant to a more ventilated and light-permeable location, and spray the frangipani plant with pesticides."
[0079] After generating a maintenance task, since the database also stores identifiers of maintenance devices communicatively coupled to the user terminal, the identifiers of the maintenance devices associated with the maintenance task can be determined from the database based on the maintenance task, thereby generating a maintenance plan. After obtaining the maintenance plan, it can be displayed on the user interface. This allows the user to determine which maintenance devices (e.g., irrigation devices, fertilizing devices, moving devices, pruning devices, drug delivery devices, lighting control devices, temperature control devices, humidity control devices, etc., or combinations thereof) should be utilized and which maintenance tasks should be performed to maintain the frangipani flowers. Maintenance tasks may include, for example, watering, spraying, fertilizing, pruning, weeding, rotating pots, moving, sun exposure, shading, adjusting temperature and humidity, applying pesticides, and applying fungicides. Specifically, a maintenance task may also include various task parameters, such as the time, interval, and amount of watering; the dosage, time, and interval of fertilization; the location of pruning; the dosage and location of pesticide spraying; and the target location of movement.
[0080] In some embodiments, the method 100 may include: controlling a corresponding maintenance device according to an identification of the maintenance device in the maintenance plan to complete the maintenance task.
[0081] Since maintenance devices typically have communication capabilities, commands can be transmitted to them (e.g., via Bluetooth or Zigbee protocols). For example, in the aforementioned example, the maintenance plan may include three maintenance tasks: a "leaf pruning task, pruning device identification," a "plant movement task, mobile device identification," and a "pesticide spraying task, drug delivery device identification." Based on the identification, commands instructing the pruning, movement, and drug delivery devices to execute the pruning, movement, and drug delivery tasks are sent to the corresponding pruning, movement, and drug delivery devices, respectively. This controls the pruning, movement, and drug delivery devices to automatically complete the pruning, movement, and drug delivery tasks, thereby reducing the user's maintenance burden and improving maintenance efficiency.
[0082] In addition to automatically executing the maintenance plan, in some embodiments, after displaying the maintenance plan, the user may be further asked whether to confirm the execution of the maintenance plan. After the user confirms the execution of the maintenance plan, the corresponding maintenance device is controlled according to the maintenance plan to complete the corresponding maintenance task.
[0083] In some embodiments, method 100 may include: inputting an image of a plant in a first growth stage and an image of a plant in a second growth stage; determining, using a plant health scoring model, a plant health score for the first growth stage and a plant health score for the second growth stage, and determining a conclusion based on the plant health score and the plant image in the first growth stage and the plant health score and the plant image in the second growth stage, the conclusion comprising a change in the plant's health status from the first growth stage to the second growth stage; and presenting the determined conclusion on a user interface. It will be appreciated that, herein, different growth stages may be distinguished based on different growth states of the plant or different time points. For example, if a plant's flower buds are small and insect bites are present, the plant may be considered to be in the first growth stage; if the flower buds are larger than in the first growth stage and the insect bites have disappeared, the plant may be considered to be in the second growth stage. For another example, a plant photographed in September 2024 may be considered to be in the first growth stage, while a plant photographed in October 2024 may be considered to be in the second growth stage.
[0084] refer to Figure 4 , which shows a schematic diagram of an exemplary user interface 400 for a method for determining a plant's health score according to some embodiments of the present disclosure. Figure 4As shown, after a user inputs a first plant image of a plant taken on September 20, 2024 (the first growth stage) and a second plant image of the plant taken on October 5, 2024 (the second growth stage), the first plant image may be displayed in first display area 402, and the second plant image may be displayed in second display area 404. Furthermore, words such as "Sep 20, 2024," "Before," and "Oct 5, 2024," and "After" may also be displayed in first display area 402 and second display area 404, respectively, to further identify the relationship between the first and second plant images and the specific time of capture. Furthermore, first display area 402 may also display a plant health score of "5.0" for the first growth stage, and second display area 404 may also display a plant health score of "9.0" for the second growth stage.
[0085] Continue to refer Figure 4 The user interface 400 may further include a third display area 406 for presenting a conclusion based on the plant health score model to illustrate the change in the health status of the plant. Figure 4 As shown, the third display area 406 can present the conclusion of the health change of the plant from the first growth stage to the second growth stage: "Good News. The plant shows clear improvement, with vibrant, plump upper leaves and new growth indicating an active growth phase. The lower leaves are stillslightly dull but better than two weeks ago."
[0086] Therefore, by reading the user interface 400, the user can not only understand the health score of the plant at the corresponding growth stage, but also understand the changes in the health status of the plant between these growth stages, thereby helping the user understand the dynamic growth process of the plant and better maintain the plant.
[0087] The present disclosure also provides an electronic device in another aspect. Figure 5 , which shows a schematic block diagram of an electronic device 500 according to some embodiments of the present disclosure. Figure 5As shown, the electronic device 500 includes a processor 502 and a memory 504 storing computer-executable instructions that, when executed by the processor 502, cause the processor 502 to perform the method for determining a health score of a plant according to any of the preceding embodiments of the present disclosure. The processor 502 may, for example, be a central processing unit (CPU) of the electronic device 500. The processor 502 can be any type of general purpose processor, or can be a processor specifically designed for determining a health score of a plant, such as an application-specific integrated circuit (“ASIC”). The memory 504 can be coupled to the processor 502 and can include various computer-readable media which are accessible by the processor 502. In various embodiments, the memory 504 described herein can include volatile and non-volatile media, removable and non-removable media. By way of example, the memory 504 can include any combination of the following: random access memory (“RAM”), dynamic RAM (“DRAM”), static RAM (“SRAM”), read only memory (“ROM”), flash memory, cache memory, and / or any other type of non-transitory computer readable media. The memory 504 can store instructions that, when executed by the processor 502, cause the processor 502 to perform the method for determining a health score of a plant according to any of the preceding embodiments of the present disclosure.
[0088] In some embodiments, the electronic device 500 can be implemented as a smartphone, a smart camera, a computer, etc.
[0089] The electronic device 500 is configured to perform the method 100 according to any of the preceding embodiments, and thus reference is made to the previous description regarding various embodiments of the method 100, which will not be repeated here.
[0090] The present disclosure also provides a computer-readable storage medium having stored thereon computer-executable instructions that, when executed by a computer, cause the computer to perform the method for determining a health score of a plant according to any of the preceding embodiments.
[0091] The present disclosure also provides a computer program product comprising instructions which, when executed by a processor, implement the method for determining a health score of a plant according to any of the preceding embodiments. The instructions can be any set of instructions which are directly executable by one or more processors, such as machine code, or indirectly executable, such as scripts. The instructions can be stored in object code format for direct processing by one or more processors, or in any other computer languages, including scripts or collections of independent source code modules that are interpreted or compiled on demand.
[0092] Figure 6A schematic block diagram of a computer system 600 on which embodiments of the present disclosure may be implemented is shown. Computer system 600 includes a bus 602 or other communication mechanism for communicating information, and a processing device 604 coupled to bus 602 for processing information. Computer system 600 also includes a memory 606 coupled to bus 602 for storing instructions to be executed by processing device 604. Memory 606 may be a random access memory (RAM) or other dynamic storage device. Memory 606 may also be used to store temporary variables or other intermediate information during the execution of instructions to be executed by processing device 604. Computer system 600 also includes a read-only memory (ROM) 608 or other static storage device coupled to bus 602 for storing static information and instructions for processing device 604. A storage device 610, such as a magnetic disk or optical disk, is provided and coupled to bus 602 for storing information and instructions. Computer system 600 may be coupled via bus 602 to output devices 612 for providing output to a user, such as, but not limited to, a display (such as a cathode ray tube (CRT) or liquid crystal display (LCD)), speakers, and the like. Input devices 614, such as a keyboard, mouse, microphone, and the like, are coupled to bus 602 for communicating information and command selections to processing device 604. Computer system 600 may perform embodiments of the present disclosure. Consistent with certain implementations of the present disclosure, results are provided by computer system 600 in response to processing device 604 executing one or more sequences of one or more instructions contained in memory 606. Such instructions may be read into memory 606 from another computer-readable medium, such as storage device 610. Execution of the sequences of instructions contained in memory 606 causes processing device 604 to perform the methods described herein. Alternatively, hardwired circuitry may be used in place of or in combination with software instructions to implement the present teachings. Therefore, implementations of the present disclosure are not limited to any specific combination of hardware circuitry and software. In various embodiments, computer system 600 can be connected to one or more other computer systems like computer system 600 across a network via network interface 616 to form a networked system. The network can include a private network or a public network such as the Internet. In a networked system, one or more computer systems can store data and supply data to other computer systems. As used herein, the term "computer-readable medium" refers to any medium that participates in providing instructions to processing device 604 for execution. Such media can take many forms, including but not limited to non-volatile media, volatile media, and transmission media. Non-volatile media include, for example, optical or magnetic disks such as storage device 610. Volatile media include dynamic memory such as memory 606. Transmission media include coaxial cables, copper wire, and optical fibers, including the wiring comprising bus 602.Common forms of computer-readable media or computer program products include, for example, floppy disks, flexible disks, hard disks, magnetic tape, or any other magnetic medium, CD-ROMs, digital video disks (DVDs), Blu-ray discs, any other optical medium, thumb drives, memory cards, RAM, PROMs and EPROMs, flash EPROMs, any other memory chips or cartridges, or any other tangible medium from which a computer can read. Various forms of computer-readable media may be involved in carrying one or more sequences of one or more instructions to processing device 604 for execution. For example, the instructions may initially be carried on a diskette of a remote computer. The remote computer may load the instructions into its dynamic memory and send the instructions over a telephone line using a modem. A modem local to computer system 600 may receive the data over the telephone line and convert the data into an infrared signal using an infrared transmitter. An infrared detector coupled to bus 602 may receive the data carried in the infrared signal and place the data on bus 602. Bus 602 carries the data to memory 606, from which processing device 604 retrieves the instructions and executes them. For example, instructions received by memory 606 may be stored on storage device 610 either before or after execution by processing device 604 .
[0093] Figure 7 A schematic block diagram of a maintenance system 700 according to some embodiments of the present disclosure is shown. Maintenance system 700 includes an acquisition module 702, a scoring module 704, a presentation module 706, a maintenance plan generation module 708, and a control module 710. Acquisition module 702 is configured to acquire plant images. Scoring module 704 is configured to determine a plant health score based on the acquired plant images using a plant health scoring model. The plant health scoring model is trained using a triplet contrastive learning method based on triplet data. The triplet data includes a first plant image labeled with a first health score as an anchor sample, a second plant image labeled with a second health score as a positive sample, and a third plant image labeled with a third health score as a negative sample, wherein the difference between the second health score and the first health score is less than the difference between the third health score and the first health score. Presentation module 706 is configured to present the determined plant health score on a user interface. Maintenance plan generation module 708 is configured to generate a maintenance plan based on the determined plant health score. The maintenance plan includes a maintenance task and an identifier of a maintenance device for performing the maintenance task. Control module 710 is configured to control the corresponding maintenance device based on the identifier of the maintenance device in the maintenance plan to complete the maintenance task.
[0094] The acquisition module 702, the scoring module 704, the presentation module 706, the maintenance plan generation module 708 and the control module 710 can be implemented together in the form of the aforementioned electronic device 500 or computer system 600, etc., and can be implemented as, for example but not limited to, a smart phone, a smart camera, a computer, etc.
[0095] The maintenance system 700 further includes an execution module 720, which may include one or more maintenance devices (eg, 7201, 7202, ..., 720) communicatively coupled to the control module 710. n ), which is configured to perform maintenance tasks in response to receiving commands from the control module 710.
[0096] In some embodiments, the maintenance device (e.g., 7201, 7202, ..., 720 n ) is configured to transmit execution data to the control module 710 in response to the execution of a maintenance task. Thus, the maintenance system 700 can also be configured to update the plant's maintenance information based on the execution data received from the maintenance device. This way, when the user's plant image is acquired again, the updated plant maintenance information can be combined to provide the user with more personalized information and update the corresponding maintenance plan.
[0097] In some embodiments, the maintenance system 700 may further include a user interface (not shown). For example, a result page including the determined plant health score may be displayed on the user interface, and / or a maintenance plan may be displayed on the user interface.
[0098] In some embodiments, acquisition module 702 can be implemented as a camera that is communicatively coupled to scoring module 704. The camera can be configured to capture plant images and transmit the captured plant images to scoring module 704. The camera can be any suitable imaging device for monitoring plants.
[0099] For example, scoring module 704 can be configured so that the plant health scoring module determines a plant health score based on plant images received from the camera. For example, a plant image or video of a plant that requires user care, which may be partial or overall, can be automatically captured by the camera without the user having to input these plant images or videos. Alternatively, if the user's plant image cannot be recognized due to various reasons, such as lack of clarity, the camera can automatically capture the plant image without the user having to re-enter it. In other words, plant images captured by the camera can be used to assist in determining the plant's health score.
[0100] Various embodiments of the maintenance system 700 can be similarly referred to any embodiment of any of the aforementioned aspects of the present disclosure, and will not be described in detail here.
[0101] The foregoing description describes one or more exemplary embodiments of the present disclosure. Other embodiments are within the scope of the appended claims. In some cases, the actions or steps recited in the claims may be performed in an order different from that described in the exemplary embodiments and still achieve the desired results. Furthermore, the processes depicted in the accompanying drawings do not necessarily require the specific order or sequential order shown to achieve the desired results. In certain embodiments, multitasking and parallel processing are also possible or may be advantageous.
[0102] The systems, devices, modules, or units described in the above embodiments may be implemented by computer chips or entities, or by products having certain functions. A typical implementation device is a server system. Of course, this disclosure does not exclude that with the future development of computer technology, the computer that implements the functions of the above embodiments may be, for example, a personal computer, a laptop computer, an in-vehicle human-computer interaction device, a cellular phone, a camera phone, a smartphone, a personal digital assistant, a media player, a game console, a tablet computer, a wearable device, or any combination thereof.
[0103] The terms "comprises," "includes," or any other variations thereof are intended to encompass non-exclusive inclusion, such that a process, method, product, or apparatus that includes a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such process, method, product, or apparatus. Without further limitation, the presence of additional identical or equivalent elements in a process, method, product, or apparatus that includes the elements is not precluded. For example, if words such as "first," "second," etc. are used to indicate names, they do not imply any particular order.
[0104] For the convenience of description, the above devices are described in terms of functions divided into various modules. Of course, when implementing one or more embodiments of the present disclosure, the functions of each module can be implemented in the same or multiple software and / or hardware, or the module that implements the same function can be implemented by a combination of multiple sub-modules or sub-units, etc. The device embodiments described above are merely 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.
[0105] The present disclosure is described with reference to the flowcharts and / or block diagrams of the methods, devices (systems), and computer program products according to the embodiments of the present disclosure. It should be understood that each process and / or block in the flowchart and / or block diagram, as well as the combination of processes and / or blocks in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing device to produce a machine, so that the instructions executed by the processor of the computer or other programmable data processing device produce a device for implementing the functions specified in one or more processes in the flowchart and / or one or more blocks in the block diagram.
[0106] These computer program instructions may also be stored in a computer-readable memory capable of directing a computer or other programmable data processing device to operate in a specific manner, such that the instructions stored in the computer-readable memory produce an article of manufacture comprising instruction means that implement the functions specified in one or more flows of the flowchart and / or one or more blocks of the block diagram. These computer program instructions may also be loaded onto a computer or other programmable data processing device, such that a series of operating steps are executed on the computer or other programmable device to produce a computer-implemented process, whereby the instructions executed on the computer or other programmable device provide steps for implementing the functions specified in one or more flows of the flowchart and / or one or more blocks of the block diagram.
[0107] Those skilled in the art will appreciate that one or more embodiments of the present disclosure may take the form of an entirely hardware embodiment, an entirely software embodiment, or an embodiment combining software and hardware. Furthermore, one or more embodiments of the present disclosure may take the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to magnetic disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.
[0108] One or more embodiments of the present disclosure may be described in the general context of computer-executable instructions executed by a computer, such as program modules. Generally, program modules include routines, programs, objects, components, data structures, and the like that perform specific tasks or implement specific abstract data types. One or more embodiments of the present disclosure may also be practiced in distributed computing environments where tasks are performed by remote processing devices connected via a communications network. In a distributed computing environment, program modules may be located in local and remote computer storage media, including storage devices.
[0109] The same or similar parts between the various embodiments of the present disclosure can be referred to each other, and each embodiment focuses on the differences from other embodiments. In particular, for the device embodiment, since it is basically similar to the method embodiment, the description is relatively simple, and the relevant parts can be referred to the partial description of the method embodiment. In the description of the present disclosure, the reference terms "one embodiment", "some embodiments", "example", "specific example", or "some examples", "exemplary", etc. mean that the specific features, structures, materials or characteristics described in conjunction with the embodiment or example are included in at least one embodiment or example of the present disclosure. In the present disclosure, the schematic representation of the above terms does not necessarily refer to the same embodiment or example. Moreover, the specific features, structures, materials or characteristics described can be combined in any one or more embodiments or examples in an appropriate manner. In addition, those skilled in the art can combine and combine the different embodiments or examples described in the present disclosure and the features of different embodiments or examples without contradiction.
[0110] In addition, when used in this disclosure, the words "herein," "above," "below," "hereunder," "supra," and words of similar meaning shall refer to the disclosure as a whole and not to any particular portions of the disclosure. Furthermore, unless expressly stated otherwise or otherwise understood in the context of use, conditional language used herein, such as "may," "might," "for example," "such as," and the like, is generally intended to convey that certain embodiments include, while other embodiments do not include, certain features, elements, and / or states. Thus, such conditional language is generally not intended to imply that one or more embodiments in any way require features, elements, and / or states, or whether such features, elements, and / or states are included or performed in any particular embodiment.
[0111] In addition, embodiments of the present disclosure may also include the following examples:
[0112] Example 1. A method for determining a health score of a plant, comprising:
[0113] Acquire plant images;
[0114] determining, by a plant health scoring model, a plant health score based on the acquired plant image, wherein the plant health scoring model is trained using a triplet contrastive learning method based on triplet data, the triplet data including a first plant image labeled with a first health score as an anchor sample, a second plant image labeled with a second health score as a positive sample, and a third plant image labeled with a third health score as a negative sample, wherein a difference between the second health score and the first health score is less than a difference between the third health score and the first health score;
[0115] presenting the determined health score of the plant on a user interface.
[0116] Example 2. The method of example 1, further comprising:
[0117] determining, by the plant health score model, a species of the plant based on the obtained plant image before determining the health score of the plant based on the plant image, wherein the plant health score model is trained according to annotated plant species data.
[0118] Example 3. The method of example 2, wherein the triple data comprises multiple sets of triple data of plants of different species, and the anchor sample, the positive sample and the negative sample in a same set of triple data are plant images of a same species.
[0119] Example 4. The method of example 2, wherein determining, by the plant health score model, the health score of the plant based on the obtained plant image comprises:
[0120] selecting, from a database, a plant image with a label of a first specified health score as a first reference image according to the species of the plant, the plant in the first reference image being of a same species as the plant;
[0121] determining a similarity between the plant image and the first reference image;
[0122] in response to determining that the similarity is greater than a preset similarity threshold, determining the health score of the plant as the first specified health score.
[0123] Example 5. The method of example 4, wherein determining, by the plant health score model, the health score of the plant based on the obtained plant image further comprises:
[0124] in response to determining that the similarity is not greater than the preset threshold, selecting, from the database, another plant image with a label of a second specified health score as a second reference image, wherein the plant in the second reference image is of a same species as the plant, and the second specified health score is different from the first specified health score;
[0125] determining a similarity between the plant image and the second reference image; and
[0126] in response to determining that the similarity is greater than the preset similarity threshold, determining the health score of the plant as the second specified health score.
[0127] Example 6. The method of Example 1, wherein the plant health scoring model includes multiple classification heads, different classification heads correspond to different health scores, and determining, by the plant health scoring model, the plant health score based on the acquired plant image includes:
[0128] extracting an embedding vector of the acquired plant image by the plant health scoring model;
[0129] Each of the plurality of classification headers:
[0130] Determine the probability that the health score of the plant exceeds the health score corresponding to the classification head based on the embedding vector,
[0131] Comparing the determined probability with a preset probability threshold,
[0132] In response to the determined probability being not less than the preset probability threshold, outputting a first value, or in response to the determined probability being less than the preset probability threshold, outputting a second value different from the first value;
[0133] A health score of the plant is determined based on the outputs of the plurality of classification heads.
[0134] Example 7. The method according to Example 1, wherein the plant image comprises multiple plant images of the same plant at multiple growth stages.
[0135] Example 8. The method of Example 1, wherein the plant health scoring model is trained based on triplet data using a triplet contrastive learning method, comprising:
[0136] Calculating a first embedding vector of the anchor sample, a second embedding vector of the positive sample, and a third embedding vector of the negative sample respectively;
[0137] Calculating the distance between the first embedding vector and the second embedding vector, and the distance between the first embedding vector and the third embedding vector respectively;
[0138] Parameters in the plant health scoring model are updated according to the loss function until a distance between the first embedding vector and the second embedding vector obtained by the updated plant health scoring model is less than a distance between the first embedding vector and the third embedding vector and maintains a preset interval.
[0139] Example 9. The method of Example 1, further comprising:
[0140] generating a maintenance plan based on the determined health score of the plant, the maintenance plan including maintenance tasks and identification of maintenance devices for performing the maintenance tasks;
[0141] The maintenance plan is output.
[0142] Example 10. The method of Example 9, comprising:
[0143] According to the identification of the maintenance device in the maintenance plan, the corresponding maintenance device is controlled to complete the maintenance task.
[0144] Example 11. An electronic device comprising:
[0145] processor; and
[0146] A memory storing computer executable instructions that, when executed by the processor, cause the processor to perform the method for determining a health score of a plant according to any one of Examples 1 to 10.
[0147] Example 12. A computer-readable storage medium having computer-executable instructions stored thereon, the computer-executable instructions, when executed by a computer, causing the computer to perform the method for determining a health score of a plant according to any one of Examples 1 to 10.
[0148] Example 13. A computer program product comprising instructions that, when executed by a processor, implement the method for determining a health score of a plant according to any one of Examples 1 to 10.
[0149] Example 14. A maintenance system comprising:
[0150] an acquisition module configured to acquire plant images;
[0151] a scoring module configured to determine, by a plant health scoring model, a plant health score based on the acquired plant image, wherein the plant health scoring model is trained using a triplet contrastive learning method based on triplet data, the triplet data including a first plant image labeled with a first health score as an anchor sample, a second plant image labeled with a second health score as a positive sample, and a third plant image labeled with a third health score as a negative sample, wherein a difference between the second health score and the first health score is less than a difference between the third health score and the first health score;
[0152] a presentation module configured to present the determined plant health score on a user interface;
[0153] a maintenance plan generating module configured to generate a maintenance plan based on the determined health score of the plant, the maintenance plan including a maintenance task and an identification of a maintenance device for performing the maintenance task;
[0154] a control module configured to control a corresponding maintenance device according to an identification of the maintenance device in the maintenance plan to complete the maintenance task; and
[0155] An execution module includes a maintenance device communicatively coupled to the control module, wherein the maintenance device is configured to execute a maintenance task in response to receiving a command from the control module.
[0156] The foregoing is merely an example of one or more embodiments of the present disclosure and is not intended to limit the one or more embodiments of the present disclosure. It will be apparent to those skilled in the art that various modifications and variations may be made to one or more embodiments of the present disclosure. Any modifications, equivalent substitutions, improvements, etc. made within the spirit and principles of the present disclosure are intended to be included within the scope of the claims.
Claims
1. A method for determining a plant health score, comprising: Acquire plant images; determining, by a plant health scoring model, a plant health score based on the acquired plant image, wherein the plant health scoring model is trained using a triplet contrastive learning method based on triplet data, the triplet data including a first plant image labeled with a first health score as an anchor sample, a second plant image labeled with a second health score as a positive sample, and a third plant image labeled with a third health score as a negative sample, wherein a difference between the second health score and the first health score is less than a difference between the third health score and the first health score; The determined health score of the plant is presented on a user interface.
2. The method according to claim 1, Optionally, the method further includes: Before determining the health score of the plant based on the plant image, determining the species of the plant based on the acquired plant image by a plant health scoring model, wherein the plant health scoring model is trained based on labeled plant species data; Optionally, the triplet data includes a plurality of sets of triplet data of plants of different species, and the anchor samples, positive samples and negative samples in the same triplet data are plant images of the same species; Optionally, determining the plant health score based on the acquired plant image by the plant health score model includes: selecting a plant image labeled with a first specified health score from a database according to the species of the plant as a first reference image, wherein the plant in the first reference image is of the same species as the plant; determining a similarity between the plant image and the first reference image, In response to determining that the similarity is greater than a preset similarity threshold, determining the health score of the plant to be the first designated health score; Optionally, determining the plant health score based on the acquired plant image by the plant health score model further includes: In response to determining that the similarity is not greater than the preset threshold, selecting another plant image labeled with a second specified health score from the database as a second reference image, wherein the plant in the second reference image is the same species as the plant, and the second specified health score is different from the first specified health score; determining a similarity between the plant image and the second reference image, and In response to determining that the similarity is greater than the preset similarity threshold, the health score of the plant is determined to be the second designated health score.
3. The method according to claim 1, in, The plant health scoring model includes multiple classification heads, where different classification heads correspond to different health scores. The plant health scoring model determines the plant health score based on the acquired plant image, including: extracting an embedding vector of the acquired plant image by the plant health scoring model; Each of the plurality of classification headers: Determine the probability that the health score of the plant exceeds the health score corresponding to the classification head based on the embedding vector, Comparing the determined probability with a preset probability threshold, In response to the determined probability being not less than the preset probability threshold, outputting a first value, or in response to the determined probability being less than the preset probability threshold, outputting a second value different from the first value; A health score of the plant is determined based on the outputs of the plurality of classification heads.
4. The method according to claim 1, wherein The plant images include multiple plant images of the same plant at multiple growth stages.
5. The method according to claim 1, wherein The plant health scoring model is trained based on triplet data using a triplet contrastive learning method, including: Calculating a first embedding vector of the anchor sample, a second embedding vector of the positive sample, and a third embedding vector of the negative sample respectively; Calculating the distance between the first embedding vector and the second embedding vector, and the distance between the first embedding vector and the third embedding vector respectively; Parameters in the plant health scoring model are updated according to the loss function until a distance between the first embedding vector and the second embedding vector obtained by the updated plant health scoring model is less than a distance between the first embedding vector and the third embedding vector and maintains a preset interval.
6. The method according to claim 1, Optionally, the method further includes: generating a maintenance plan based on the determined health score of the plant, the maintenance plan including a maintenance task and an identifier of a maintenance device for performing the maintenance task, and outputting the maintenance plan; Optionally, the method further includes: controlling a corresponding maintenance device according to an identifier of the maintenance device in the maintenance plan to complete the maintenance task.
7. An electronic device comprising: processor; as well as A memory storing computer executable instructions which, when executed by the processor, cause the processor to perform the method for determining a health score of a plant according to any one of claims 1 to 6.
8. A computer-readable storage medium having computer-executable instructions stored thereon, which, when executed by a computer, cause the computer to perform the method for determining a health score of a plant according to any one of claims 1 to 6.
9. A computer program product comprising instructions which, when executed by a processor, implement the method for determining a health score of a plant according to any one of claims 1 to 6.
10. A maintenance system comprising: an acquisition module configured to acquire plant images; a scoring module configured to determine, by a plant health scoring model, a plant health score based on the acquired plant image, wherein the plant health scoring model is trained using a triplet contrastive learning method based on triplet data, the triplet data including a first plant image labeled with a first health score as an anchor sample, a second plant image labeled with a second health score as a positive sample, and a third plant image labeled with a third health score as a negative sample, wherein a difference between the second health score and the first health score is less than a difference between the third health score and the first health score; a presentation module configured to present the determined plant health score on a user interface; a maintenance plan generating module configured to generate a maintenance plan based on the determined health score of the plant, the maintenance plan including a maintenance task and an identification of a maintenance device for performing the maintenance task; a control module configured to control a corresponding maintenance device according to an identification of the maintenance device in the maintenance plan to complete the maintenance task; and An execution module includes a maintenance device communicatively coupled to the control module, wherein the maintenance device is configured to execute a maintenance task in response to receiving a command from the control module.
Citation Information
Patent Citations
Image retrieval method, image retrieval device and image retrieval system
CN111581421A
Method and system for detecting plant diseases and insect pests
CN119206504A
Plant identification method and related device
CN120124746A
System and method for enhancing a plant image database for improved damage identification on plants
WO2022049190A1