Plant identification method and related device
By combining the plant recognition technology of the visual model and the multi-modal large language model, the problem of low plant recognition accuracy and efficiency in the existing technology is solved, the effective association of plant images and text is achieved, and the recognition accuracy and efficiency are improved. , and provide detailed identification results.
Patent Information
- Application Number
- CN202410702506.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-05-31
- Publication Date
- 2024-09-06
AI Technical Summary
Existing plant recognition technology is difficult to effectively process multi-modal data, especially in understanding the correlation between plant images and text, resulting in low recognition accuracy and efficiency.
Using a plant recognition model that combines a visual model and a multi-modal large language model, the convolutional neural network transformer model and the multi-modal large language model are trained through comparative learning, and multi-modal data are used for joint training to extract image and text features. Generate recognition answer text, and interact with interactive questions and external knowledge bases when recognition is not possible.
It improves the accuracy and efficiency of plant identification, enhances the model's cross-modal information expression and reasoning capabilities, can more accurately identify plant species and diseases, and provides detailed answers, including disease causes and maintenance recommendations.
Smart Images

Figure CN118608957A
Abstract
Description
Technical Field
[0001] The present disclosure relates to the field of information processing technology, and more particularly, to a plant identification method, an electronic device, a non-transitory storage medium, and a computer program product. Background Art
[0002] A multimodal large language model is a large neural network model that combines multiple modal data such as text and images. This model can not only process text information, but also other types of data such as images, audio, etc. By learning the correlation between multiple modal data at the same time, the multimodal large language model can understand and express information more comprehensively. Multimodal large language models are widely used in various fields, such as natural language processing, computer vision, speech recognition, etc. Summary of the invention
[0003] A brief overview of the disclosure is given below in order to provide a basic understanding of some aspects of the disclosure. However, it should be understood that this overview is not an exhaustive overview of the disclosure. It is not intended to identify the key or important parts of the disclosure, nor is it intended to limit the scope of the disclosure. Its purpose is simply to give some concepts of the disclosure in a simplified form as a prelude to a more detailed description given later.
[0004] According to one aspect of the present disclosure, a plant identification method is provided, comprising: acquiring a plant image and a question text about identifying the plant in the plant image; inputting the plant image and the question text into a plant identification model, the plant identification model comprising a first visual model and a multimodal large language model, the first visual model being configured to receive the plant image to extract a first image feature of the plant image, the multimodal large language model being configured to receive the first image feature and the question text to identify the plant in the plant image, the plant identification model being trained with multimodal data, the multimodal data comprising a plant image, a question about identifying the plant in the plant image, and an answer to the question; and outputting an answer text about identifying the plant in the plant image provided by the plant identification model.
[0005] In some embodiments, the plant recognition model also includes a second visual model different from the first visual model, the second visual model is configured to receive the plant image to extract second image features of the plant image, and the multimodal large language model is configured to receive the first image features, the second image features and the question text to identify the plant in the plant image.
[0006] In some embodiments, the first visual model is a convolutional neural network transformer model, which is trained by contrastive learning using plant image-text pairs.
[0007] In some embodiments, the convolutional neural network transformer model is first pre-trained using plant image-text pairs alone through contrastive learning, and then jointly trained with the multimodal large language model using the multimodal data.
[0008] In some embodiments, the training set of the convolutional neural network transformer model includes plant images having one or more resolutions and label text having one or more granularities.
[0009] In some embodiments, during the training process of the convolutional neural network transformer model, one or more labels in a label text comprising multiple labels are randomly selected to extract text features of the label text.
[0010] In some embodiments, the acquired question text includes question text about identifying the type of plant in the plant image, the multimodal data includes a plant image, a question asking about the type of plant in the plant image, and an answer indicating the type of plant in the plant image, and the plant image-text pair includes at least one of a pair of a plant image and a plant Latin name, and a pair of a plant image and a set of plant feature labels.
[0011] In some embodiments, the acquired question text includes question text about identifying the disease of the plant in the plant image, the multimodal data includes a plant image, a question asking about the disease of the plant in the plant image, and an answer indicating the disease of the plant in the plant image, and the plant image-text pair includes at least one of a pair of a plant image and a plant disease name, and a pair of a plant image and a set of disease feature labels.
[0012] In some embodiments, the plant identification method also includes: in response to the plant identification model being unable to provide answer text regarding the identification of the plant in the plant image, outputting an interactive question regarding the identification of the plant in the plant image; obtaining a reply to the interactive question, and: in response to the reply including a reply image, providing image features extracted from the reply image using the first visual model to the multimodal large language model, and / or in response to the reply including a reply text, providing the reply text to the multimodal large language model; and outputting an answer text regarding the identification of the plant in the plant image newly provided by the plant identification model.
[0013] In some embodiments, the plant identification method also includes: in response to the plant identification model being unable to provide answer text regarding the identification of the plant in the plant image, outputting an interactive question regarding the identification of the plant in the plant image; obtaining a reply to the interactive question, and: in response to the reply including a reply image, providing image features extracted from the reply image using the first visual model and the second visual model respectively to the multimodal large language model, and / or in response to the reply including a reply text, providing the reply text to the multimodal large language model; and outputting an answer text regarding the identification of the plant in the plant image newly provided by the plant identification model.
[0014] In some embodiments, the obtained question text includes question text about identifying the type of plant in the plant image, and the interactive question includes requesting one or more of a close-up image of one or more characteristic parts of the plant, the shooting time of the plant image, and the shooting location of the plant image.
[0015] In some embodiments, the obtained question text includes question text about identifying the disease of the plant in the plant image, and the interactive question includes requesting one or more of a close-up image of one or more diseased parts of the plant, the shooting time of the plant image, the shooting location of the plant image, and the maintenance details of the plant.
[0016] In some embodiments, the answer text includes a symptom of the plant, and the answer text further includes one or more of a cause of the symptom, a treatment method for the symptom, and maintenance suggestions for the plant.
[0017] In some embodiments, the plant recognition model is also trained with second multimodal data comprising images, questions asking about the location of objects in the images, and answers to the questions.
[0018] In some embodiments, after the plant image and the question text are input into the plant recognition model, the plant recognition model is further configured to: generate a question asking about the location of an object in the plant image based on the plant image and the question text by the multimodal large language model, and generate an answer to the location of the object in the plant image based on the plant image and the generated question; crop a local image of the area where the object is located from the plant image according to the location of the object in the plant image; receive the local image by the first visual model to extract a third image feature; and receive the first image feature, the third image feature and the question text by the multimodal large language model to identify the plant in the plant image.
[0019] In some embodiments, the plant recognition model is also trained with second multimodal data, the second multimodal data including an image, a question asking about the location of an object in the image, and an answer to the question, and wherein, after the plant image and the question text are input into the plant recognition model, the plant recognition model is configured to: generate a question asking about the location of an object in the plant image based on the plant image and the question text by the multimodal large language model, and generate an answer to the location of the object in the plant image based on the plant image and the generated question; crop a local image of the area where the object is located from the plant image according to the location of the object in the plant image; receive the local image by the first visual model to extract a third image feature; receive the local image by the second visual model to extract a fourth image feature; receive the first image feature, the second image feature, the third image feature, the fourth image feature, and the question text by the multimodal large language model to identify the plant in the plant image.
[0020] In some embodiments, the partial image is magnified before being received by the vision model.
[0021] In some embodiments, the object comprises a plant, or one or more characteristic parts of a plant, or one or more diseased parts of a plant.
[0022] In some embodiments, the second visual model is a multimodal contrastive learning pre-training (CLIP) model.
[0023] In some embodiments, the plant identification method also includes: in response to the plant identification model being unable to provide answer text regarding identification of the plant in the plant image, accessing an external plant knowledge base to obtain additional information regarding the plant image and the question text, and: in response to the additional information including an additional image, providing image features extracted from the additional image using the first visual model to the multimodal large language model, and / or in response to the additional information including additional text, providing the additional text to the multimodal large language model; and outputting the answer text regarding identification of the plant in the plant image newly provided by the plant identification model.
[0024] In some embodiments, the plant identification method also includes: in response to the plant identification model being unable to provide answer text regarding identification of the plant in the plant image, accessing an external plant knowledge base to obtain additional information regarding the plant image and the question text, and: in response to the additional information including an additional image, providing image features extracted from the additional image using the first visual model and the second visual model, respectively, to the multimodal large language model, and / or in response to the additional information including additional text, providing the additional text to the multimodal large language model; and outputting the answer text regarding identification of the plant in the plant image newly provided by the plant identification model.
[0025] According to another aspect of the present disclosure, an electronic device is provided, comprising: one or more processors; and a memory storing computer executable instructions, wherein when the computer executable instructions are executed by the one or more processors, the one or more processors execute the plant identification method described in any embodiment of the aforementioned aspects of the present disclosure.
[0026] According to another aspect of the present disclosure, a non-transitory storage medium having computer executable instructions stored thereon is provided. When the computer executable instructions are executed by a computer, the computer executes the plant identification method according to any embodiment of the aforementioned aspects of the present disclosure.
[0027] According to another aspect of the present disclosure, a computer program product is provided. The computer program product includes instructions. When the instructions are executed by a processor, the plant identification method according to any embodiment of the foregoing aspect of the present disclosure is implemented. BRIEF DESCRIPTION OF THE DRAWINGS
[0028] 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 in conjunction with the accompanying drawings. The accompanying drawings are incorporated herein and form a part of the specification, and are further used to explain the principles of the present disclosure and enable those skilled in the art to make and use the present disclosure. Among them:
[0029] Figure 1 is a flow chart of a plant identification method according to some embodiments of the present disclosure;
[0030] Figure 2A and Figure 2B is a schematic block diagram of a plant identification model according to some embodiments of the present disclosure;
[0031] Figure 3A and Figure 3B shows example training data for a first visual model used to train a plant recognition model according to some embodiments of the present disclosure;
[0032] Figure 4 and Figure 5 is a schematic diagram of an example user interface in which a plant identification method according to some embodiments of the present disclosure is applied;
[0033] Figure 6 is a schematic block diagram of an electronic device according to some embodiments of the present disclosure;
[0034] Figure 7 is a schematic block diagram of a computer system on which embodiments of the present disclosure may be implemented.
[0035] Note that in the embodiments described below, sometimes the same reference numerals are used in common between different drawings to represent the same parts or parts with the same functions, and their repeated descriptions are omitted. In some cases, similar numbers and letters are used to represent similar items, so once an item is defined in one drawing, it does not need to be further discussed in subsequent drawings.
[0036] For ease of understanding, the position, size, range, etc. of each structure shown in the drawings and the like may not represent the actual position, size, range, etc. Therefore, the present disclosure is not limited to the position, size, range, etc. disclosed in the drawings and the like. DETAILED DESCRIPTION
[0037] 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 arrangement of components and steps, numerical expressions and numerical values set forth in these embodiments do not limit the scope of the present disclosure.
[0038] The following description of at least one exemplary embodiment is in fact merely illustrative and is in no way intended to limit the present disclosure and its application or use. That is, the structures and methods herein are shown in an exemplary manner to illustrate different embodiments of the structures and methods in the present disclosure. However, those skilled in the art will appreciate that they merely illustrate exemplary ways of the present disclosure that can be implemented, rather than exhaustive ways. In addition, the drawings need not be drawn to scale, and some features may be enlarged to illustrate the details of specific components.
[0039] 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 as part of the specification.
[0040] In all examples shown and discussed herein, any specific values should be interpreted as merely exemplary and not as limiting. Therefore, other examples of the exemplary embodiments may have different values.
[0041] The present disclosure provides a plant identification method on one hand, which uses a plant identification model combined with a visual model and a multimodal large language model to automatically process plant images and related questions for answering. The plant identification method according to the present disclosure will be described in detail below in conjunction with the accompanying drawings. It should be understood that the actual method may also include other additional steps, but in order to avoid obscuring the main points of the present disclosure, these other additional steps are not discussed herein and are not shown in the accompanying drawings.
[0042] Figure 1 A plant identification method 100 (hereinafter referred to as method 100) according to some embodiments of the present disclosure is shown. Figure 1 As shown, the method 100 includes:
[0043] In step S102, a plant image and a question text about identifying plants in the plant image are obtained;
[0044] In step S104, the plant image and the question text are input into a plant recognition model, where the plant recognition model is trained with multimodal data, where the multimodal data includes the plant image, the question about identifying the plant in the plant image, and the answer to the question;
[0045] In step S106, an answer text regarding the identification of the plant in the plant image provided by the plant identification model is output.
[0046] Specifically, identifying the plant in the plant image may include, for example, identifying the type and / or disease of the plant in the plant image. Accordingly, the acquired question text may include question text about identifying the type and / or disease of the plant in the plant image. As a non-limiting example, the following may be provided: Figure 4 and Figure 5 The user interface 300 shown includes a dialog box 310, a text input box 320 and an image adding button 330. The image adding button 330 is used to receive a plant image and the text input box 320 is used to receive a question text.
[0047] In order to identify the species of plants in plant images, the multimodal data used to train the plant recognition model may include plant images, questions asking about the species of plants in the plant images, and answers indicating the species of plants in the plant images, such as {<plant image.jpg>, "What is this plant?", "This plant is a fig tree."}. In order to identify the disease of plants in plant images, the multimodal data used to train the plant recognition model may include plant images, questions asking about the disease of plants in plant images, and answers indicating the disease of plants in plant images, such as {<plant image.jpg>, "What's wrong with this plant?", "This plant has leaf mold."}.
[0048] In the multimodal data used to train the plant recognition model, plant images and questions can be used as training samples, and the answers to the questions can be used as annotations for the samples. During the training process, the plant recognition model will learn how to understand the relationship between images and texts, and how to generate answers related to them. By jointly training on different modal data such as images and texts, the plant recognition model can learn the correspondence between different modalities, thereby achieving cross-modal information expression and reasoning capabilities. Through training data specific to the field of plant recognition, the model is infused with plant recognition capabilities.
[0049] Figure 2A FIG. 2 shows a plant identification model 200 according to some embodiments of the present disclosure. Figure 2A As shown, the plant recognition model 200 includes a first visual model 210 and a multimodal large language model 230. The first visual model 210 is configured to receive a plant image to extract a first image feature of the plant image. The multimodal large language model 230 is configured to receive the first image feature and a question text to identify the plant in the plant image, thereby outputting an answer text about identifying the plant in the plant image.
[0050] The visual ability of the multimodal large language model 230 may mainly depend on the first visual model 210, especially the image features extracted by the first visual model 210. Therefore, the expression ability of the image features of the first visual model 210 will directly affect the performance of the multimodal large language model in the plant recognition visual task.
[0051] The first visual model 210 can be based on various suitable neural network architectures, such as ResNet, DenseNet, etc. In some embodiments, the first visual model 210 can be a convolutional neural network (CNN) transformer model, such as but not limited to a ConvNext model. In order to improve the expressiveness of such visual models in the field of plant identification, plant image text pairs can be used to train them through contrastive learning. For example, the convolutional neural network transformer model can be pre-trained by contrastive learning with plant image text pairs alone, and then jointly trained with multimodal large language model 230 using multimodal data. In this way, it is conducive to improving the overall performance of the model. Of course, the convolutional neural network transformer model can also be pre-trained alone first, and then the parameters of the convolutional neural network transformer model are fixed when the plant identification model is trained with multimodal data, and only the parameters of the multimodal large language model are updated, which can speed up the training speed and reduce the computing and storage resources consumed by the training.
[0052] Exemplarily, the training set of the convolutional neural network transformer model may include plant images with one or more resolutions and label text with one or more granularities. For non-limiting illustrative purposes, Figure 3A and Figure 3B Example training data for training a convolutional neural network transformer model is shown. Figure 3A As shown in FIG. 1 , in order to identify the species of plants in plant images, two plant images with different resolutions and two label texts with different granularities are provided. The coarse-grained label text is the species of the plant (for example, indicated by the Latin name of the plant), and the fine-grained label text is the plant feature label (for example, the morphology (for example, shape, size, color, texture, position, etc.) of the plant's characteristic parts such as leaves, stems, flowers, and fruits). As shown in FIG. Figure 3B As shown, in order to identify plant diseases in plant images, two plant images with different resolutions and two label texts with different granularities are provided. The coarse-grained label text is the name of the plant disease, and the fine-grained label text is the disease feature label (for example, various specific manifestations of the disease, etc.). By including label texts of different granularities in the training set, the model can learn more levels of semantic information. The finer the granularity, the more likely it is to obtain stronger visual feature expression capabilities. By including plant images of different resolutions in the training set, the robustness of the model can be enhanced. In addition, before plant images of different resolutions are input into the model, they can be interpolated to convert them to a uniform resolution for the model to process. Although Figure 3A and Figure 3B Only two plant images with different resolutions and two label texts with different granularities are shown as examples, but this is not restrictive, and plant images with any resolutions and label texts with any granularities can be provided, for example, plant images with one resolution and label texts with two or more granularities, etc. In addition, the label texts in the training set can be based on one or more languages. For example, Figure 3A The label text in has both Chinese and English. This is also helpful to enhance the robustness of the model.
[0053] Exemplarily, during the training process of the convolutional neural network transformer model, one or more labels in a label text including multiple labels can be randomly selected to extract text features of the label text. This can enhance the robustness of the model. For example, Figure 3A The fine-grained label text includes 16 labels. During the training process of the convolutional neural network transformer model, one or more labels of the 16 labels can be randomly selected to extract text features of the fine-grained label text.
[0054] The samples used to train the convolutional neural network transformer model can be plant image text pairs. For example, in order to identify the species of plants in plant images, the plant image text pairs can include at least one of a pair of plant images and plant Latin names, or a pair of plant images and plant feature label sets; in order to identify the diseases of plants in plant images, the plant image text pairs can include at least one of a pair of plant images and plant disease names, or a pair of plant images and disease feature label sets. For non-limiting illustrative purposes, Figure 3A , Figure 3B The training data shown in each of can constitute four plant image-text pairs.
[0055] The training process of the convolutional neural network transformer model based on contrastive learning of plant image-text pairs is as follows. For the plant image-text pairs input to the convolutional neural network transformer model, the image encoder extracts image features, and the text encoder extracts text features. Assuming that a training batch contains N plant image-text pairs, the image encoder will extract N image features, and the text encoder will also extract N text features. The N image features and N text features are combined in pairs to obtain N 2 samples. For each image feature, there is 1 positive sample and (N-1) negative samples; for each text feature, there is 1 positive sample and (N-1) negative samples. In general, there are N positive samples and (N 2 -N) negative samples. The training goal can be to maximize the similarity of N positive samples (for example, the cosine similarity of text features and image features can be directly calculated). The training process is equivalent to a multi-classification task, and the cross entropy loss can be calculated.
[0056] Through contrastive learning, the expressive power of the visual features of the convolutional neural network transformer model can be enhanced, thereby improving the performance of the multimodal large language model on visual tasks, and ultimately improving the plant recognition ability of the entire plant recognition model.
[0057] In some embodiments, for example, reference Figure 2B, the plant recognition model 200 may also include a second visual model 220 different from the first visual model 210, and the second visual model 220 is configured to receive a plant image to extract a second image feature of the plant image. Thus, the multimodal large language model 230 can be configured to receive the first image feature, the second image feature and the question text to identify the plant in the plant image, thereby outputting an answer text about identifying the plant in the plant image. For example, the second visual model 220 may be a multimodal contrastive language-image pre-training (CLIP) model. The CLIP model is a deep learning model that aims to achieve interaction between natural language processing and computer vision. The second visual model 220 can directly adopt a pre-trained CLIP model without necessarily having to be retrained with data specifically in the field of plant recognition. By adding the second visual model 220, the generalization of the plant recognition model 200 can be enhanced, which is also conducive to improving the plant recognition performance of the plant recognition model 200.
[0058] In some embodiments, method 100 may also include: in response to the plant recognition model being unable to provide answer text regarding identifying the plant in the plant image, outputting an interactive question regarding identifying the plant in the plant image; obtaining a reply to the interactive question, and: in response to the reply including a reply image, providing image features extracted from the reply image using the first visual model (and the second visual model, if any) to the multimodal large language model, and / or in response to the reply including a reply text, providing the reply text to the multimodal large language model; and outputting the answer text regarding identifying the plant in the plant image newly provided by the plant recognition model.
[0059] For example, when a plant recognition model, especially a multimodal large language model, fails to converge, the confidence of the output result is not enough, the precision of the output result is not enough, etc., it can be considered that the plant recognition model cannot provide an answer text for identifying plants in plant images. This may be due to a variety of reasons, such as there are many plants in the plant image and it is not known which plant is being asked, the plants in the plant image are too small to be distinguished, and the description of the question text is too vague. In this case, more information (especially highly distinguishable information) can be obtained by asking interactive questions to generate accurate and reliable answers. For example, assuming that the obtained question text includes a question text about identifying the species of plants in plant images, the interactive question may include one or more of a close-up image of one or more characteristic parts of the requesting plant, the shooting time of the plant image, and the shooting location of the plant image. The answer text may include the species of the plant, such as the Latin name of the plant. Assuming that the acquired question text includes question text about identifying the disease of the plant in the plant image, the interactive question may include one or more of requesting close-up images of one or more diseased parts of the plant, the shooting time of the plant image, the shooting location of the plant image, and the maintenance details of the plant. The answer text may include the disease of the plant, and may also include one or more of the cause of the disease, the treatment method of the disease, and the maintenance suggestions for the plant.
[0060] Furthermore, a chain of interactive questions can be designed, and then interactive questions are outputted in sequence along the chain until the information obtained is sufficient to provide an answer text for identifying the plant in the plant image. For example, for a question about identifying the species of the plant in the plant image, the time and location of the plant image can be asked first, and if the answer text cannot be outputted, a close-up image of the characteristic part of the plant can be further requested.
[0061] For non-limiting illustrative purposes, for example, reference Figure 4 . The user gives a photo of a plant and asks what the plant is. Since only genus X can be determined from the photo provided by the user but which species under genus X it is, the user is requested to provide the time and place where the photo was taken. After the user answers that it was taken at place Y last March, since an accurate and reliable answer cannot be provided (for example, the specific species cannot be confirmed), the user is further requested to provide photos of the plant from other angles, such as close-ups of leaves. In response to the new photo provided by the user, it is found that it is sufficient to provide an accurate and reliable answer, so the answer text is output to the user.
[0062] Additionally or alternatively, in some embodiments, method 100 may also include: in response to the plant recognition model being unable to provide answer text regarding identification of the plant in the plant image, accessing an external plant knowledge base to obtain additional information regarding the plant image and the question text, and: in response to the additional information including an additional image, providing image features extracted from the additional image using the first visual model (and the second visual model, if any) to the multimodal large language model, and / or in response to the additional information including additional text, providing the additional text to the multimodal large language model; and outputting the answer text regarding identification of the plant in the plant image newly provided by the plant recognition model.
[0063] Through the above-mentioned interactive forms, the model can use prior knowledge, additional information and reasoning capabilities on the basis of its original recognition capabilities to achieve improved recognition accuracy and reliability.
[0064] In addition, the plant recognition task may only need to focus on a special part of the image to complete the recognition. For example, the leaves of some plants may be very distinctive, so just looking at the leaves can basically determine the type of plant; when diagnosing a disease for a plant, it may be possible to complete the diagnosis by only focusing on the diseased part. However, due to the resolution of the model image encoder, these special parts are sometimes not captured by the model, which may affect the recognition accuracy. Therefore, the visual thinking chain technology can be further used to help the model search for special parts in the image, so that the model can combine global information and key area information as well as other information (for example, descriptions provided by users, etc.) for recognition.
[0065] To this end, the target detection capability of a multimodal large language model can be trained. In some embodiments, the plant recognition model is also trained with a second multimodal data, which may include images, questions asking about the location of objects in the images, and answers to the questions. Similarly, in the second multimodal data used to train the plant recognition model, plant images and questions can be used as training samples, and the answers to the questions can be used as annotations for the samples. During the training process, the plant recognition model learns how to understand the relationship between images and text, and how to generate answers related to them. Exemplarily, the object may include a plant, or one or more characteristic parts of a plant, or one or more diseased parts of a plant.
[0066] Thus, in some examples, after the plant image and the question text are input into the plant recognition model, the plant recognition model is further configured to: generate a question asking the location of the object in the plant image based on the plant image and the question text by the multimodal large language model, and generate an answer to the location of the object in the plant image based on the plant image and the generated question; cut out a partial image of the area where the object is located from the plant image according to the location of the object in the plant image; receive the partial image by the first visual model to extract the third image feature; receive the first image feature, the third image feature and the question text by the multimodal large language model to identify the plant in the plant image. In some examples, if the plant recognition model includes a second visual model, the plant recognition model can be further configured to: receive the partial image by the second visual model to extract the fourth image feature, and receive the first image feature, the second image feature, the third image feature, the fourth image feature and the question text by the multimodal large language model to identify the plant in the plant image. For example, the partial image is enlarged (e.g., interpolated, etc.) before being received by the visual model to become clearer.
[0067] For non-limiting illustrative purposes, for example, reference Figure 5 . The user gives a photo of a plant and asks what is going on with the plant's problem A. Based on the photo and question description provided by the user, the model asks itself "Where does problem A appear in the plant image?" and then answers itself "The area in the plant image where problem A appears." It then crops out the partial image of "the area in the plant image where problem A appears" and enlarges it, and processes it together with the question text. After confirming that the plant has problem A, the user is further requested to provide more information to help diagnose the cause, such as the location and the frequency of maintenance operations such as watering. After the user answers that it is in Y location and waters 2-3 times a week, the answer is generated by combining the various information.
[0068] In addition to incorporating the visual thinking chain technology into the multimodal large language model, the visual thinking chain technology can also be applied by making the plant recognition model additionally include a target detection model and other means. For example, the target detection model can be used to detect special parts in the image, and the local image where the special parts are located can be cropped (for example, according to the detection frame output by the target detection model). For example, the cropped local image can also be subjected to an amplification operation such as interpolation to make it clear, and then the local image is sent to the visual model to extract image features for use by the multimodal large language model.
[0069] The present disclosure also provides an electronic device in another aspect. Figure 6 , which shows a schematic block diagram of an electronic device 600 according to some embodiments of the present disclosure. Figure 6As shown, the electronic device 600 includes (one or more) processors 602 and a memory 604 storing computer executable instructions, which, when executed by the (one or more) processors 602, cause the (one or more) processors 602 to perform the method according to any of the foregoing embodiments of the present disclosure. The (one or more) processors 602 may be, for example, a central processing unit (CPU) of the electronic device 600. The (one or more) processors 602 may be any type of general-purpose processor, or may be a processor specifically designed for plant identification, such as an application-specific integrated circuit ("ASIC"). The memory 604 may include various computer-readable media accessible by the (one or more) processors 602. In various embodiments, the memory 604 described herein may include volatile and non-volatile media, removable and non-removable media. For example, the memory 604 may 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-transient computer-readable media. The memory 604 may store instructions that, when executed by the processor 602, enable the processor 602 to perform the method according to any of the foregoing embodiments of the present disclosure. In some embodiments, the electronic device 600 may be implemented as a smart phone, a smart camera, a computer, and the like.
[0070] The present disclosure also provides a non-transitory storage medium having computer executable instructions stored thereon, which, when executed by a computer, enables the computer to execute the method according to any of the aforementioned embodiments of the present disclosure.
[0071] The present disclosure also provides a computer program product, which may include instructions, and when the instructions are executed by a processor, the method described in any of the foregoing embodiments of the present disclosure may be implemented. The instructions may be any set of instructions to be executed directly by one or more processors, such as machine code, or any set of instructions to be executed indirectly, such as a script. The instructions may be stored in an object code format for direct processing by one or more processors, or stored in any other computer language, including scripts or collections of independent source code modules that are interpreted on demand or compiled in advance.
[0072] Figure 7A schematic block diagram of a computer system 700 on which an embodiment of the present disclosure may be implemented is shown. The computer system 700 includes a bus 702 or other communication mechanism for transmitting information, and a processing device 704 coupled to the bus 702 for processing information. The computer system 700 also includes a memory 706 coupled to the bus 702 for storing instructions to be executed by the processing device 704, which may be a random access memory (RAM) or other dynamic storage device. The memory 706 may also be used to store temporary variables or other intermediate information during the execution of instructions to be executed by the processing device 704. The computer system 700 also includes a read-only memory (ROM) 708 or other static storage device coupled to the bus 702 for storing static information and instructions for the processing device 704. A storage device 710 such as a magnetic disk or optical disk is provided and coupled to the bus 702 for storing information and instructions. The computer system 700 may be coupled to an output device 712 via the bus 702 for providing output to a user, such as, but not limited to, a display (such as a cathode ray tube (CRT) or a liquid crystal display (LCD)), a speaker, etc. An input device 714 such as a keyboard, a mouse, a microphone, etc. is coupled to the bus 702 for transmitting information and command selections to the processing device 704. The computer system 700 may perform embodiments of the present disclosure. Consistent with certain implementations of the present disclosure, the results are provided by the computer system 700 in response to the processing device 704 executing one or more sequences of one or more instructions contained in the memory 706. Such instructions may be read into the memory 706 from another computer-readable medium such as the storage device 710. Execution of the sequence of instructions contained in the memory 706 causes the processing device 704 to perform the methods described herein. Alternatively, hard-wired circuitry may be used instead of or in combination with software instructions to implement the present teachings. Therefore, implementations of the present disclosure are not limited to any particular combination of hardware circuitry and software. In various embodiments, the computer system 700 can be connected to one or more other computer systems such as the computer system 700 across a network via a network interface 716 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. The term "computer-readable medium" as used herein refers to any medium that participates in providing instructions to the processing device 704 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 disks or disks such as storage devices 710. Volatile media include dynamic memories such as memory 706. Transmission media include coaxial cables, copper wires, and optical fibers, including wiring that includes bus 702.Common forms of computer-readable media or computer program products include, for example, floppy disks, flexible disks, hard disks, tapes, or any other magnetic media, CD-ROMs, digital video disks (DVDs), Blu-ray disks, any other optical media, thumb drives, memory cards, RAMs, PROMs and EPROMs, flash EPROMs, any other memory chips or boxes, or any other tangible media from which a computer can read. Various forms of computer-readable media may be involved when carrying one or more sequences of one or more instructions to processing device 704 for execution. For example, the instructions may initially be carried on a disk 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 700 may receive data over a telephone line and convert the data into an infrared signal using an infrared transmitter. An infrared detector coupled to bus 702 may receive the data carried in the infrared signal and place the data on bus 702. Bus 702 carries the data to memory 706, from which processing device 704 retrieves the instructions and executes them. For example, instructions received by memory 706 may be stored on storage device 710 either before or after execution by processing device 704 .
[0073] One or more exemplary embodiments of the present disclosure are described above. Other embodiments are within the scope of the appended claims. In some cases, the actions or steps recorded in the claims can be performed in an order different from that in the embodiments and still achieve the desired results. In addition, the processes depicted in the drawings do not necessarily require the specific order or continuous order shown to achieve the desired results. In some embodiments, multitasking and parallel processing are also possible or may be advantageous.
[0074] The systems, devices, modules or units described in the above embodiments may be implemented by computer chips or entities, or by products with certain functions. A typical implementation device is a server system. Of course, the present disclosure does not exclude that with the development of computer technology in the future, the computer that implements the functions of the above embodiments may be, for example, a personal computer, a laptop computer, a vehicle-mounted human-computer interaction device, a cellular phone, a camera phone, a smart phone, a personal digital assistant, a media player, a game console, a tablet computer, a wearable device or any combination thereof.
[0075] The terms "comprises", "includes" or any other variations thereof are intended to cover non-exclusive inclusion, so that a process, method, product or apparatus comprising a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, product or apparatus. In the absence of further restrictions, it is not excluded that there are other identical or equivalent elements in the process, method, product or apparatus comprising the elements. For example, if the words "first", "second" and the like are used to indicate names, they do not indicate any particular order.
[0076] For the convenience of description, the above devices are described in various modules according to their functions. Of course, when implementing one or more embodiments of the present disclosure, the functions of each module can be implemented in the same or more software and / or hardware, or the module implementing the same function can be implemented by a combination of multiple sub-modules or sub-units, etc. 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. For example, 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.
[0077] The present disclosure is described with reference to the flowchart and / or block diagram of the method, device (system), and computer program product according to the embodiment of the present disclosure. It should be understood that each process and / or box in the flowchart and / or block diagram, as well as the combination of the process and / or box 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 function specified in one process or multiple processes in the flowchart and / or one box or multiple boxes in the block diagram.
[0078] 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 particular manner, so that the instructions stored in the computer-readable memory produce an article of manufacture including an instruction device that implements the functions specified in one or more flows of a flowchart and / or one or more blocks of a block diagram. These computer program instructions may also be loaded onto a computer or other programmable data processing device so that a series of operating steps are performed on the computer or other programmable device to produce a computer-implemented process, so that the instructions executed on the computer or other programmable device provide steps for implementing the functions specified in one or more flows of a flowchart and / or one or more blocks of a block diagram.
[0079] Those skilled in the art will appreciate that one or more embodiments of the present disclosure may be in the form of a complete hardware embodiment, a complete software embodiment, or an embodiment combining software and hardware. Furthermore, one or more embodiments of the present disclosure may be in the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program codes.
[0080] 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, etc. 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 through a communications network. In a distributed computing environment, program modules may be located in local and remote computer storage media, including storage devices.
[0081] The same or similar parts between the various embodiments of the present disclosure can refer 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 refer to the partial description of the method embodiment. In the description of the present disclosure, the description of the reference terms "one embodiment", "some embodiments", "example", "specific example", or "some examples", "exemplary", etc. means 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 target 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 a suitable 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 the different embodiments or examples without contradiction.
[0082] In addition, when used in the present disclosure, the words "herein," "above," "below," "hereunder," "above," and words of similar meaning shall refer to the present disclosure as a whole rather than to any particular portion of the present disclosure. Furthermore, unless expressly stated otherwise or understood otherwise in the context of use, conditional language used herein, such as "may," "might," "for example," "such as," and the like, is generally intended to express 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 require features, elements, and / or states in any way, or whether such features, elements, and / or states are included or performed in any particular embodiment.
[0083] The above description is only an example of one or more embodiments of the present disclosure, and is not intended to limit one or more embodiments of the present disclosure. For those skilled in the art, one or more embodiments of the present disclosure may have various changes and variations. Any modification, equivalent substitution, improvement, etc. made within the spirit and principle of the present disclosure shall be included in the scope of the claims.
Claims
1. A plant identification method, comprising: Acquire a plant image and a question text regarding identifying the plant in the plant image; Inputting the plant image and the question text into a plant recognition model, the plant recognition model comprising a first visual model and a multimodal large language model, the first visual model being configured to receive the plant image to extract a first image feature of the plant image, the multimodal large language model being configured to receive the first image feature and the question text to recognize the plant in the plant image, the plant recognition model being trained with multimodal data, the multimodal data comprising a plant image, a question about recognizing the plant in the plant image, and an answer to the question; as well as Outputting answer text provided by the plant recognition model regarding recognition of the plant in the plant image.
2. The plant identification method according to claim 1, wherein: The plant recognition model also includes a second visual model different from the first visual model, the second visual model is configured to receive the plant image to extract second image features of the plant image, and the multimodal large language model is configured to receive the first image features, the second image features and the question text to identify the plant in the plant image.
3. The plant identification method according to claim 1 or 2, wherein: The first visual model is a convolutional neural network transformer model, which is trained by contrastive learning using plant image-text pairs.
4. The plant identification method according to claim 3, wherein: The convolutional neural network transformer model is first pre-trained using plant image-text pairs alone through contrastive learning, and then jointly trained with the multimodal large language model using the multimodal data.
5. The plant identification method according to claim 3, wherein: The training set of the convolutional neural network transformer model includes plant images with one or more resolutions and label texts with one or more granularities.
6. The plant identification method according to claim 5, wherein: During the training process of the convolutional neural network transformer model, one or more labels in a label text including multiple labels are randomly selected to extract text features of the label text.
7. The plant identification method according to claim 3, wherein: The acquired question text includes question text about identifying the type of the plant in the plant image, the multimodal data includes a plant image, a question asking about the type of the plant in the plant image, and an answer indicating the type of the plant in the plant image, and the plant image-text pair includes at least one of a pair of a plant image and a plant Latin name, and a pair of a plant image and a set of plant feature labels.
8. The plant identification method according to claim 3 or 7, wherein: The acquired question text includes question text about identifying the diseases of the plant in the plant image, the multimodal data includes a plant image, a question asking about the diseases of the plant in the plant image, and an answer indicating the diseases of the plant in the plant image, and the plant image-text pair includes at least one of a pair of a plant image and a plant disease name, and a pair of a plant image and a set of disease feature labels.
9. The plant identification method according to claim 1, further comprising: In response to the plant recognition model being unable to provide an answer text regarding recognition of the plant in the plant image, outputting an interactive question regarding recognition of the plant in the plant image; Get responses to the interactive questions, and: In response to the reply including a reply image, providing image features extracted from the reply image using the first visual model to the multimodal large language model, and / or In response to the reply including reply text, providing the reply text to the multimodal large language model; and Outputting answer text newly provided by the plant recognition model regarding recognition of the plant in the plant image.
10. The plant identification method according to claim 2, further comprising: In response to the plant recognition model being unable to provide an answer text regarding recognition of the plant in the plant image, outputting an interactive question regarding recognition of the plant in the plant image; Get responses to the interactive questions, and: In response to the reply including a reply image, providing image features extracted from the reply image using the first visual model and the second visual model to the multimodal large language model, and / or In response to the reply including reply text, providing the reply text to the multimodal large language model; and Outputting answer text newly provided by the plant recognition model regarding recognition of the plant in the plant image.
11. The plant identification method according to claim 9 or 10, wherein: The obtained question text includes question text about identifying the type of plant in the plant image, and the interactive question includes requesting one or more of a close-up image of one or more characteristic parts of the plant, the shooting time of the plant image, and the shooting location of the plant image.
12. The plant identification method according to claim 9 or 10, wherein: The obtained question text includes question text about identifying the disease of the plant in the plant image, and the interactive question includes requesting one or more of close-up images of one or more diseased parts of the plant, the shooting time of the plant image, the shooting location of the plant image, and the maintenance details of the plant.
13. The plant identification method according to claim 12, wherein: The answer text includes the symptom of the plant, and the answer text further includes one or more of the cause of the symptom, the treatment method of the symptom, and maintenance suggestions for the plant.
14. The plant identification method according to claim 1, wherein: The plant recognition model is also trained with second multimodal data comprising images, questions asking about the locations of objects in the images, and answers to the questions.
15. The method according to claim 14, wherein: After the plant image and the question text are input into the plant recognition model, the plant recognition model is further configured to: generating, by the multimodal large language model, a question asking about the location of an object in the plant image based on the plant image and the question text, and generating an answer to the location of the object in the plant image based on the plant image and the generated question; Cutting out a partial image of the area where the object is located from the plant image according to the position of the object in the plant image; The first visual model receives the local image to extract a third image feature; The first image feature, the third image feature and the question text are received by the multimodal large language model to identify the plant in the plant image.
16. The method according to claim 2, wherein: The plant recognition model is also trained with second multimodal data, the second multimodal data comprising an image, a question asking about the location of an object in the image, and an answer to the question, and wherein, upon inputting the plant image and the question text to the plant recognition model, the plant recognition model is configured to: generating, by the multimodal large language model, a question asking about the location of an object in the plant image based on the plant image and the question text, and generating an answer to the location of the object in the plant image based on the plant image and the generated question; Cutting out a partial image of the area where the object is located from the plant image according to the position of the object in the plant image; The first visual model receives the local image to extract a third image feature; Receiving the partial image by the second visual model to extract a fourth image feature; The first image feature, the second image feature, the third image feature, the fourth image feature and the question text are received by the multimodal large language model to identify the plant in the plant image.
17. The method according to claim 15 or 16, wherein: The partial image is enlarged before being received by the vision model.
18. The method according to claim 15 or 16, wherein: The object includes a plant, or one or more characteristic parts of a plant, or one or more diseased parts of a plant.
19. The plant identification method according to claim 2, wherein: The second visual model is a multimodal contrastive learning pre-trained CLIP model.
20. The plant identification method according to claim 1, further comprising: In response to the plant recognition model being unable to provide an answer text regarding the recognition of the plant in the plant image, accessing an external plant knowledge base to obtain additional information regarding the plant image and the question text, and: In response to the additional information including an additional image, providing image features extracted from the additional image using the first visual model to the multimodal large language model, and / or In response to the additional information including additional text, providing the additional text to the multimodal large language model; and Outputting answer text newly provided by the plant recognition model regarding recognition of the plant in the plant image.
21. The plant identification method according to claim 2, further comprising: In response to the plant recognition model being unable to provide an answer text regarding the recognition of the plant in the plant image, accessing an external plant knowledge base to obtain additional information regarding the plant image and the question text, and: In response to the additional information including an additional image, providing image features extracted from the additional image using the first visual model and the second visual model, respectively, to the multimodal large language model, and / or In response to the additional information including additional text, providing the additional text to the multimodal large language model; and Outputting answer text newly provided by the plant recognition model regarding recognition of the plant in the plant image.
22. An electronic device comprising: one or more processors; as well as A memory storing computer executable instructions which, when executed by the one or more processors, cause the one or more processors to perform the plant identification method according to any one of claims 1 to 21.
23. A non-transitory storage medium having computer executable instructions stored thereon, which when executed by a computer cause the computer to perform the plant identification method according to any one of claims 1 to 21.
24. A computer program product, comprising instructions, which, when executed by a processor, implement the plant identification method according to any one of claims 1 to 21.
Citation Information
Cited By
Crop leaf disease diagnosis method and system driven by large language model
CN119785223A
A Large Language Model-Driven Crop Leaf Disease Diagnosis Method and System
CN119785223B
Hydrangea macrophylla canopy growth condition intelligent identification method based on multi-modal computer vision
CN120541584A
Intelligent identification method for crown layer growth of large-leaf hydrangea based on multi-modal computer vision
CN120541584B
