Livestock and poultry epidemic disease diagnosis method and device, electronic equipment and storage medium

Through the multi-modal interactive diagnostic model, combined with image and text data, it solves the problems of low efficiency and poor accuracy in livestock and poultry disease diagnosis in the existing technology, achieves more efficient and accurate diagnostic results, and adapts to industrialization and scale. development.

CN118538397APending Publication Date: 2024-08-23BEIJING RES CENT FOR INFORMATION TECH & AGRI
View PDF 0 Cites 3 Cited by

Patent Information

Application Number
CN202410712576.4
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-06-04
Publication Date
2024-08-23

AI Technical Summary

Technical Problem

The diagnosis efficiency of livestock and poultry disease diagnosis methods in the existing technology is low and the results are greatly affected by subjective experience, making it difficult to ensure accuracy.

Method used

A multi-modal interactive fusion diagnosis model based on image data and text data is adopted, including a feature extraction module, a single-modal representation differentiation module, a feature fusion module and a result output module, using convolutional neural networks, BiLSTM and BERT/ViT models. Feature extraction and fusion generate more accurate disease diagnosis results.

Benefits of technology

It has achieved more accurate and efficient diagnosis of livestock and poultry diseases, has wider adaptability and stronger robustness, is suitable for the development of industrialized and large-scale livestock and poultry breeding, and promotes the healthy development of the livestock and poultry breeding industry.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118538397A
    Figure CN118538397A
Patent Text Reader

Abstract

The invention provides a livestock and poultry epidemic disease diagnosis method and device, electronic equipment and a storage medium, and relates to the technical field of smart agriculture, and the method comprises the steps: inputting target image data and target text data into a livestock and poultry epidemic disease diagnosis model, and obtaining an epidemic disease diagnosis result of a to-be-diagnosed livestock and poultry target output by the livestock and poultry epidemic disease diagnosis model; the target image data comprises image data of a to-be-diagnosed livestock and poultry target, and the target text data comprises text data used for describing the state of the to-be-diagnosed livestock and poultry target; the livestock and poultry epidemic disease diagnosis model is obtained by training on the basis of sample image data, sample text data and an epidemic disease diagnosis result of a sample livestock and poultry target, the sample image data comprises image data of the sample livestock and poultry target, and the sample text data comprises text data used for describing the state of the sample livestock and poultry target. According to the livestock and poultry epidemic disease diagnosis method and device, the electronic equipment and the storage medium provided by the invention, livestock and poultry epidemic diseases can be diagnosed more accurately and more efficiently, and the adaptability of livestock and poultry epidemic disease diagnosis is wider.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of smart agricultural technology, and in particular to a livestock and poultry disease diagnosis method, device, electronic equipment and storage medium. Background Art

[0002] With the continuous improvement of the modernization level of animal husbandry, animal husbandry is developing towards industrialization, scale, intensification, standardization, greening and intelligence. Animal and poultry diseases are one of the important factors affecting the healthy and stable development of animal husbandry.

[0003] In the related art, the diagnosis and treatment of livestock and poultry diseases usually rely on on-site observation by veterinarians or breeders. However, the above traditional livestock and poultry disease diagnosis methods have low diagnostic efficiency, and the disease diagnosis results are greatly affected by the subjective experience of the diagnostic personnel, making it difficult to ensure the accuracy of the disease diagnosis results.

[0004] Therefore, how to diagnose livestock and poultry diseases more accurately and efficiently is a technical problem that needs to be solved urgently in this field. Summary of the invention

[0005] The present invention provides a method, device, electronic device and storage medium for diagnosing livestock and poultry diseases, which are used to solve the defect that it is difficult to accurately and efficiently diagnose livestock and poultry diseases in the prior art, and to achieve more accurate and efficient diagnosis of livestock and poultry diseases.

[0006] The present invention provides a method for diagnosing livestock and poultry diseases, comprising: obtaining target image data and target text data, wherein the target image data includes image data of a livestock and poultry target to be diagnosed, and the target text data includes text data for describing the state of the livestock and poultry target to be diagnosed; inputting the target image data and the target text data into a livestock and poultry disease diagnosis model, and obtaining the disease diagnosis result of the livestock and poultry target to be diagnosed output by the livestock and poultry disease diagnosis model; wherein the livestock and poultry disease diagnosis model is obtained by training based on sample image data, sample text data and the disease diagnosis result of a sample livestock and poultry target, wherein the sample image data includes image data of the sample livestock and poultry target, and the sample text data includes text data for describing the state of the sample livestock and poultry target.

[0007] According to a livestock and poultry disease diagnosis method provided by the present invention, the livestock and poultry disease diagnosis model includes: a feature extraction module, a single modality representation differentiation module, a feature fusion module and a result output module; the target image data and the target text data are input into the livestock and poultry disease diagnosis model to obtain the disease diagnosis result of the livestock and poultry target to be diagnosed output by the livestock and poultry disease diagnosis model, including: inputting the target image data and the target text data into the feature extraction module to obtain the first image feature data and the first text feature vector output by the feature extraction module; Input the first text feature vector into the unimodal representation differentiation module to obtain the second text feature data output by the unimodal representation differentiation module; input the second text feature data and the first image feature data into the feature fusion module to obtain the feature fusion data output by the feature fusion module; input the feature fusion data into the result output module to obtain the disease diagnosis result of the livestock and poultry target to be diagnosed output by the result output module.

[0008] According to a livestock and poultry disease diagnosis method provided by the present invention, the single-modal representation differentiation module is constructed based on a convolutional neural network and a BiLSTM network, and the single-modal representation differentiation module includes an embedding unit, a convolutional network unit and a recurrent neural network unit connected in sequence, and the convolutional network unit is residually connected to the recurrent neural network unit; the first text feature vector is input into the single-modal representation differentiation module to obtain the second text feature data output by the single-modal representation differentiation module, including: inputting the first text feature vector into the embedding unit to obtain the first word feature vector output by the embedding unit; inputting the first word feature vector into the convolutional network unit to obtain the second word feature vector output by the convolutional network unit; after fusing the first word feature vector and the second word feature vector, the fusion result is output to the recurrent neural network unit to obtain the second text feature data output by the recurrent neural network unit.

[0009] According to a method for diagnosing livestock and poultry diseases provided by the present invention, the feature fusion module includes a normalization unit, a first branch unit, a second branch unit, a gate control unit and a feedforward neural network unit; the first branch unit is constructed based on a multi-head attention mechanism, and the second branch unit is constructed based on a self-attention mechanism; the second text feature data and the first image feature data are input into the feature fusion module to obtain feature fusion data output by the feature fusion module, including: inputting the second text feature data and the first image feature data into the normalization unit to obtain third text feature data and second image feature data output by the normalization unit; inputting the second image feature data and the third text feature data into the first branch unit to obtain first fused feature data output by the first branch unit, inputting the third text feature data into the second branch unit to obtain second fused feature data output by the second branch unit; inputting the first fused feature data and the second fused feature data into the gate control unit to obtain third fused feature data output by the gate control unit; inputting the third fused feature data into the feedforward neural network unit to obtain the feature fusion data output by the feedforward neural network unit.

[0010] According to a livestock and poultry disease diagnosis method provided by the present invention, the feature extraction module includes: a text feature extraction unit and an image feature extraction unit, the text feature extraction unit is constructed based on a BERT model, and the image feature extraction unit is constructed based on a ViT model; the target image data and the target text data are input into the feature extraction module to obtain the first image feature data and the first text feature vector output by the feature extraction module, including: inputting the target text data into the text feature extraction unit to obtain the first text feature vector output by the text feature extraction unit, and inputting the target image data into the image feature extraction unit to obtain the first image feature data output by the image feature extraction unit.

[0011] According to a livestock and poultry disease diagnosis method provided by the present invention, the sample image data and the sample text data are obtained based on the following steps: obtaining the original image data of the sample livestock and poultry target and the original text data used to describe the status of the sample livestock and poultry target; performing image preprocessing on the original image data to obtain the sample image data, and performing text preprocessing on the original text data to obtain the sample text data; wherein the image preprocessing includes resolution modulation, rotation, scaling, cropping, removal and affine transformation; the text preprocessing includes word segmentation, denoising, part-of-speech tagging, entity recognition, random deletion, random insertion, random exchange and synonym replacement.

[0012] According to a livestock and poultry disease diagnosis method provided by the present invention, the disease diagnosis result is used to indicate whether the livestock and poultry target is suffering from the disease. When the disease diagnosis result indicates that the livestock and poultry target is suffering from the disease, the disease diagnosis result is also used to indicate the type of disease suffered by the livestock and poultry target; the image data of the sample livestock and poultry target includes the symptom image and / or anatomical image of the sample livestock and poultry; the state of the sample livestock and poultry target includes at least one of the appearance state, physical sign state, mental state, symptom state and behavioral state of the sample livestock and poultry target during the illness.

[0013] The present invention also provides a livestock and poultry disease diagnosis device, comprising: a data acquisition module, used to acquire target image data and target text data, the target image data including image data of the livestock and poultry target to be diagnosed, and the target text data including text data for describing the status of the livestock and poultry target to be diagnosed; a disease diagnosis module, used to input the target image data and the target text data into a livestock and poultry disease diagnosis model, and acquire the disease diagnosis result of the livestock and poultry target to be diagnosed output by the livestock and poultry disease diagnosis model; wherein the livestock and poultry disease diagnosis model is trained based on sample image data, sample text data and the disease diagnosis result of the sample livestock and poultry target, the sample image data including the image data of the sample livestock and poultry target, and the sample text data including text data for describing the status of the sample livestock and poultry target.

[0014] The present invention also provides an electronic device, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein when the processor executes the program, any of the above-mentioned methods for diagnosing livestock and poultry diseases is implemented.

[0015] The present invention also provides a non-transitory computer-readable storage medium on which a computer program is stored. When the computer program is executed by a processor, the method for diagnosing livestock and poultry diseases as described above is implemented.

[0016] The present invention also provides a computer program product, comprising a computer program, wherein when the computer program is executed by a processor, the method for diagnosing livestock and poultry diseases as described above is implemented.

[0017] The livestock and poultry disease diagnosis method, device, electronic device and storage medium provided by the present invention input image data of the livestock and poultry target to be diagnosed and text data used to describe the status of the livestock and poultry target to be diagnosed into a livestock and poultry disease diagnosis model to obtain the disease diagnosis result of the livestock and poultry target to be diagnosed output by the livestock and poultry disease diagnosis model. The above-mentioned livestock and poultry disease diagnosis model is trained based on the image data of the sample livestock and poultry target, the text data used to describe the status of the sample livestock and poultry target and the disease diagnosis result of the sample livestock and poultry target. The livestock and poultry disease diagnosis model can be based on multi-modal interactive fusion and utilize multi-source heterogeneous data to more accurately and efficiently diagnose livestock and poultry diseases. The livestock and poultry disease diagnosis has wider adaptability, stronger robustness, and is easier to promote. It can better adapt to the development trend of industrialized and large-scale livestock and poultry breeding, and can better promote the healthy development of the livestock and poultry breeding industry. BRIEF DESCRIPTION OF THE DRAWINGS

[0018] Figure 1 It is a schematic diagram of the flow chart of the livestock and poultry disease diagnosis method provided by the present invention.

[0019] Figure 2 It is a schematic diagram of the model structure of the text feature extraction unit in the livestock and poultry disease diagnosis method provided by the present invention.

[0020] Figure 3 It is a schematic diagram of the model structure of the image feature extraction unit in the livestock and poultry disease diagnosis method provided by the present invention.

[0021] Figure 4 It is a schematic diagram of the model structure of the single-modal characterization differentiation module in the livestock and poultry disease diagnosis method provided by the present invention.

[0022] Figure 5 It is a schematic diagram of a flow chart of feature fusion of second text feature data and first image feature data by a feature fusion module in the livestock and poultry disease diagnosis method provided by the present invention.

[0023] Figure 6 It is a structural schematic diagram of the livestock and poultry disease diagnosis device provided by the present invention.

[0024] Figure 7 It is a structural schematic diagram of the electronic device provided by the present invention. DETAILED DESCRIPTION

[0025] In order to make the purpose, technical solution and advantages of the present invention clearer, the technical solution of the present invention will be clearly and completely described below in conjunction with the drawings of the present invention. Obviously, the described embodiments are part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.

[0026] In the description of the invention, it should be noted that, unless otherwise clearly specified and limited, the terms "installed", "connected", and "connected" should be understood in a broad sense, for example, it can be a fixed connection, a detachable connection, or an integral connection; it can be a mechanical connection or an electrical connection; it can be a direct connection, or it can be indirectly connected through an intermediate medium, or it can be the internal communication of two components. For ordinary technicians in this field, the specific meanings of the above terms in the present invention can be understood according to specific circumstances.

[0027] In the description of the present application, the terms "first", "second", etc. are used to distinguish similar objects, and are not used to describe a specific order or sequence. It should be understood that the data used in this way can be interchangeable under appropriate circumstances, so that the embodiments of the present application can be implemented in an order other than those illustrated or described here, and the objects distinguished by "first", "second", etc. are usually a class, and the number of objects is not limited. For example, the first object can be one or more. In addition, in the description of the present application, "and / or" represents at least one of the connected objects, and the character " / " generally represents that the front and back associated objects are in an "or" relationship.

[0028] It should be noted that with the continuous improvement of the modernization level of animal husbandry, animal husbandry is developing towards industrialization, scale, intensification, standardization, greening and intelligence. However, for a long time, livestock and poultry diseases have always hindered the healthy development of livestock and poultry farming.

[0029] In the related art, the diagnosis and treatment of livestock and poultry diseases usually rely on on-site observations by veterinarians or breeders. However, the above-mentioned traditional livestock and poultry disease diagnosis methods not only require a lot of manpower and financial resources, but also have low diagnostic efficiency. In addition, the diagnostic results of the above-mentioned traditional livestock and poultry disease diagnosis methods are greatly affected by the subjective experience of the diagnostic personnel, while the professional quality of grassroots veterinarians or breeders is limited, resulting in the low diagnostic accuracy of the above-mentioned traditional livestock and poultry disease diagnosis methods. Therefore, relying solely on veterinarians or breeders for on-site diagnosis and treatment can no longer meet the increasing and increasingly complex livestock and poultry disease diagnosis needs.

[0030] In the related technology, after observing abnormal symptoms in livestock and poultry, breeders can also input the above abnormal symptoms into a pre-established knowledge base. The above knowledge base can output diagnostic results matching the above abnormal symptoms based on the correspondence between the abnormal symptoms and livestock and poultry diseases.

[0031] However, the above-mentioned traditional animal and poultry disease diagnosis methods have the following problems: first, the decision rules of the above-mentioned knowledge base cannot be dynamically updated, and the diagnostic performance is often affected; second, the knowledge sources of the above-mentioned knowledge base are heterogeneous, and the above-mentioned knowledge base only matches according to the correspondence between abnormal symptoms and animal and poultry diseases, resulting in unreliable diagnostic results based on the above-mentioned knowledge base; finally, the above-mentioned knowledge base can only use single data or knowledge for matching, which has great limitations for the diagnosis of complex animal and poultry diseases.

[0032] Figure 1 Schematic diagram of the process of diagnosing livestock and poultry diseases provided by the present invention. Figure 1 The method for diagnosing livestock and poultry diseases of the present invention is described. Figure 1 As shown, the method includes: step 101, acquiring target image data and target text data, wherein the target image data includes image data of livestock and poultry targets to be diagnosed, and the target text data includes text data for describing the status of the livestock and poultry targets to be diagnosed.

[0033] It should be noted that the executor of the embodiment of the present invention is a livestock and poultry disease diagnosis device.

[0034] Specifically, the livestock and poultry targets to be diagnosed in the embodiments of the present invention are the diagnostic objects of the livestock and poultry disease diagnosis method provided by the present invention. Based on the livestock and poultry disease diagnosis method provided by the present invention, it is possible to diagnose whether the livestock and poultry targets to be diagnosed are suffering from a disease, and based on the livestock and poultry disease diagnosis method provided by the present invention, it is possible to diagnose the type of disease suffered by the livestock and poultry targets to be diagnosed.

[0035] It should be noted that the livestock and poultry targets to be diagnosed in the embodiment of the present invention may be livestock, and the livestock and poultry targets to be diagnosed may also be poultry. The livestock and poultry targets to be diagnosed in the embodiment of the present invention may be living livestock and poultry targets, and the livestock and poultry targets to be diagnosed may also be non-living livestock and poultry targets.

[0036] It is understandable that the livestock and poultry targets to be diagnosed in the embodiment of the present invention can be determined according to actual needs. The livestock and poultry targets to be diagnosed in the embodiment of the present invention are not specifically limited.

[0037] In the embodiment of the present invention, image data and text data used to describe the target state of livestock and poultry to be diagnosed can be obtained in a variety of ways as target image data and target text data. For example, in the embodiment of the present invention, the target image data and the target text data can be obtained based on the user's input; or, in the embodiment of the present invention, the target image data and the target text data sent by other electronic devices can also be received. In the embodiment of the present invention, the specific method for obtaining the target image data and the target text data is not limited.

[0038] It should be noted that the image data of the livestock and poultry targets in the embodiments of the present invention may include appearance images, posture images, behavior images, symptom images and anatomical images of the livestock and poultry targets.

[0039] Among them, the above-mentioned appearance image can be an image showing the overall appearance of the above-mentioned livestock and poultry target, and the above-mentioned appearance image can also be an image showing the local appearance of a certain part of the livestock and poultry target; the above-mentioned body image can be an image showing the body shape of the livestock and poultry target; the above-mentioned behavior image can be an image showing the behavior of the livestock and poultry target; the above-mentioned anatomical image is an image showing the anatomical structure of the livestock and poultry target; the above-mentioned symptom image can be a picture showing the external manifestations or symptoms of livestock and poultry when suffering from an epidemic disease.

[0040] It should be noted that the state of the livestock and poultry target in the embodiment of the present invention may include one or more of the health state, appearance state, physical state, mental state and behavioral state of the livestock and poultry target. The state of the livestock and poultry target in the embodiment of the present invention may also include at least one of the appearance state, physical state, mental state, symptom state and behavioral state of the livestock and poultry target during illness.

[0041] Accordingly, based on the text data used to describe the state of the livestock and poultry target, the state of the livestock and poultry target can be understood. For example, the text data used to describe the state of the livestock and poultry target may include: "The livestock and poultry target is depressed, has a reduced or lost appetite, has a fever of 41°C, and has varying degrees of breathing difficulties."

[0042] Step 102: input the target image data and the target text data into the livestock and poultry disease diagnosis model, and obtain the disease diagnosis result of the livestock and poultry target to be diagnosed output by the livestock and poultry disease diagnosis model; Among them, the livestock and poultry disease diagnosis model is trained based on sample image data, sample text data and disease diagnosis results of sample livestock and poultry targets. The sample image data includes image data of sample livestock and poultry targets, and the sample text data includes text data used to describe the status of the sample livestock and poultry targets.

[0043] It can be understood that in the embodiment of the present invention, the number of sample livestock and poultry targets is multiple, and the greater the number of sample livestock and poultry targets, the higher the diagnostic accuracy of the livestock and poultry disease diagnosis model trained based on the image data of the sample livestock and poultry targets and the text data used to describe the status of the sample livestock and poultry targets.

[0044] It can be understood that the sample livestock and poultry targets in the embodiment of the present invention include sample livestock and poultry targets of the same type as the livestock and poultry targets to be diagnosed.

[0045] It should be noted that the disease diagnosis result of the livestock and poultry target to be diagnosed output by the livestock and poultry disease diagnosis model in the embodiment of the present invention may only include whether the livestock and poultry target to be diagnosed is sick, and the disease diagnosis result of the livestock and poultry target to be diagnosed may also include the type of disease suffered by the livestock and poultry target to be diagnosed. The embodiment of the present invention does not limit the disease diagnosis result of the livestock and poultry target to be diagnosed output by the livestock and poultry disease diagnosis model.

[0046] As an optional embodiment, the disease diagnosis result is used to indicate whether the livestock and poultry target is suffering from a disease. When the disease diagnosis result indicates that the livestock and poultry target is suffering from a disease, the disease diagnosis result is also used to indicate the type of disease the livestock and poultry target is suffering from. The image data of the sample livestock and poultry targets include symptom images and / or anatomical images of the sample livestock and poultry; the status of the sample livestock and poultry targets includes at least one of the appearance status, physical sign status, mental state, symptom status and behavioral status of the sample livestock and poultry targets during the illness.

[0047] It should be noted that the image data of the sample livestock and poultry target in the embodiment of the present invention may include at least one of an appearance image, a body image, and a behavior image of the sample livestock and poultry target.

[0048] As an optional embodiment, the sample image data and the sample text data are obtained based on the following steps: obtaining original image data of the sample livestock and poultry target and original text data for describing the status of the sample livestock and poultry target.

[0049] Specifically, in the embodiments of the present invention, the original image data used to describe the state of the sample livestock and poultry target and the original text data used to describe the state of the sample livestock and poultry target can be obtained in a variety of ways. For example, in the embodiments of the present invention, the original image data of the state of the sample livestock and poultry target and the original text data used to describe the state of the sample livestock and poultry target can be obtained based on the user's input; or, in the embodiments of the present invention, the original image data of the state of the sample livestock and poultry target and the original text data used to describe the state of the sample livestock and poultry target sent by other electronic devices can also be received. In the embodiments of the present invention, the specific method of obtaining the original image data of the state of the sample livestock and poultry target and the original text data used to describe the state of the sample livestock and poultry target is not limited.

[0050] Perform image preprocessing on the original image data to obtain sample image data, and perform text preprocessing on the original text data to obtain sample text data; Among them, image preprocessing includes resolution modulation, rotation, scaling, cropping, removal and various affine transformations; text preprocessing includes word segmentation, denoising, part-of-speech tagging, entity recognition, random deletion, random insertion, random exchange and various synonym replacements.

[0051] Specifically, after obtaining the original image data of the target state of the sample livestock and poultry, the resolution of the above original image data can be adjusted to 224×224, and the above original image data can be enhanced by image enhancement methods such as rotation, scaling, cropping and reflection transformation. The SSIM similarity algorithm can also be used to remove similar images in the above original image data to obtain sample image data.

[0052] After obtaining the original text data used to describe the status of the sample livestock and poultry targets, the text data can be cleaned and preprocessed using tools such as LTP and Jieba word segmentation. The text data preprocessing can include denoising, word segmentation, part-of-speech tagging, and entity recognition.

[0053] In order to avoid overfitting of sample data in model training, in an embodiment of the present invention, data enhancement operations can also be performed on the above-mentioned original text data. For example, an EDA (Easy data augmentation) enhancement method can be used to randomly delete, randomly insert, randomly exchange and replace synonyms of the above-mentioned original text data to obtain sample text data.

[0054] After obtaining the image data of the sample livestock and poultry targets and the text data used to describe the status of the sample livestock and poultry targets, the identification information of the sample livestock and poultry targets can be used to establish an association between the sample image data, the sample identification data, and the disease diagnosis results of the sample livestock and poultry targets, and then obtain the sample data and sample labels corresponding to the above-mentioned sample livestock and poultry targets.

[0055] After obtaining the sample data and sample labels corresponding to the sample livestock and poultry targets, the sample data and sample labels corresponding to the sample livestock and poultry targets can be grouped according to the type of epidemic disease, and labels can be added to the groups corresponding to each epidemic disease type.

[0056] After grouping the sample data and sample labels corresponding to the sample livestock and poultry targets, they can be divided into training set, validation set, and test set according to 7:1:2 for model training, model validation, and model evaluation. The sample data and sample labels corresponding to the sample livestock and poultry targets can also be processed into a JSON file for later call.

[0057] After obtaining the image data of sample livestock and poultry targets and the text data used to describe the status of the sample livestock and poultry targets, the initial model can be trained using the image data of the sample livestock and poultry targets and the text data used to describe the status of the sample livestock and poultry targets as sample data, and the epidemic disease diagnosis results of the sample livestock and poultry targets as sample labels corresponding to the sample data, and the trained initial model can be determined as the livestock and poultry disease diagnosis model.

[0058] The embodiment of the present invention inputs image data of livestock and poultry targets to be diagnosed and text data used to describe the status of the livestock and poultry targets to be diagnosed into a livestock and poultry disease diagnosis model to obtain the disease diagnosis results of the livestock and poultry targets to be diagnosed output by the livestock and poultry disease diagnosis model. The above-mentioned livestock and poultry disease diagnosis model is trained based on the image data of sample livestock and poultry targets, the text data used to describe the status of the sample livestock and poultry targets, and the disease diagnosis results of the sample livestock and poultry targets. The livestock and poultry disease diagnosis model can be based on multi-modal interactive fusion, and can use multi-source heterogeneous data to more accurately and efficiently diagnose livestock and poultry diseases. The livestock and poultry disease diagnosis has wider adaptability, stronger robustness, and is easier to promote. It can better adapt to the development trend of industrialized and large-scale livestock and poultry breeding, and can better promote the healthy development of the livestock and poultry breeding industry.

[0059] As an optional embodiment, the livestock and poultry disease diagnosis model includes: a feature extraction module, a single modality representation differentiation module, a feature fusion module and a result output module; Input the target image data and the target text data into the livestock and poultry disease diagnosis model to obtain the disease diagnosis result of the livestock and poultry target to be diagnosed output by the livestock and poultry disease diagnosis model, including: input the target image data and the target text data into the feature extraction module to obtain the first image feature data and the first text feature vector output by the feature extraction module.

[0060] Specifically, after the target image data and the target text data are input into the feature extraction module, the feature extraction module can perform feature extraction on the target image data and the target text data, and then obtain the first image feature data and the first text feature vector output by the feature extraction module.

[0061] As an optional embodiment, the feature extraction module includes: a text feature extraction unit and an image feature extraction unit, the text feature extraction unit is constructed based on the BERT model, and the image feature extraction unit is constructed based on the ViT model; Inputting target image data and target text data into a feature extraction module, and obtaining first image feature data and a first text feature vector output by the feature extraction module, including: inputting target text data into a text feature extraction unit, and obtaining a first text feature vector output by the text feature extraction unit; inputting target image data into an image feature extraction unit, and obtaining a first image feature data output by the image feature extraction unit.

[0062] It should be noted that the text feature extraction unit in the embodiment of the present invention is constructed based on the bert-base-chinese model in the BERT (Bidirectional Encoder Representations from Transformers) model.

[0063] Figure 2 : is a schematic diagram of the model structure of the text feature extraction unit in the livestock and poultry disease diagnosis method provided by the present invention. The model structure of the text feature extraction unit in the embodiment of the present invention is as follows: Figure 2 shown.

[0064] Among them, the Bert-base-chinese model is a variant of the BERT model, a version pre-trained specifically for the Chinese language. The Bert-base-chinese model uses the same architecture and training method as the standard English BERT model, but uses Chinese text data to train model parameters during the pre-training phase. Therefore, the Bert-base-chinese model can better understand and process Chinese text and is suitable for Chinese natural language processing tasks.

[0065] It should be noted that in the embodiment of the present invention, the word list length of the text feature extraction unit is 21128, the hidden layer dimension is 768, and the 12th layer hidden representation is extracted to obtain its word vector representation.

[0066] It should be noted that the text feature extraction unit in the embodiment of the present invention may include a word segmentation sub-unit and a text feature extraction sub-unit.

[0067] After the target text data is input into the word segmentation subunit in the text feature extraction unit, the word segmentation subunit can divide the above target text data into discrete units such as words or subwords (Tokenize), embed a learnable Token ([CLS]) for the final hidden state representation classification, and a Token ([SEP]) is used to distinguish different sentence sequences. The position code ([POS]) is embedded together, and the addition is the input of the text feature extraction subunit. Then, the output of the last hidden layer of the text feature extraction subunit can be taken as the first text feature vector.

[0068] The target text data in the embodiment of the present invention can be expressed as t∈R L×|V| , where L represents the length of the sample text data, and L is less than 512.

[0069] The target text data t∈R can be extracted by the text feature extraction unit L×|V| Mapped to the first text feature vector F t ∈R L×H . Where L represents the dimension of the hidden layer in the text feature extraction unit, which is 768 here. That is, the target text data t∈R L×|V| Mapped to a (L+2)×768 first text feature vector, the formal expression of the first text feature vector is: F t = Bert(t, θ Bert ) It should be noted that the image feature extraction unit in the embodiment of the present invention is constructed based on the ViT-b / 16 model provided by Hugging Face. Figure 3 : is a schematic diagram of the model structure of the image feature extraction unit in the livestock and poultry disease diagnosis method provided by the present invention. The model structure of the image feature extraction unit in the embodiment of the present invention is as follows Figure 3 shown.

[0070] Among them, Hugging Face is an open source platform that provides natural language processing (NLP) and computer vision (CV) models, with the goal of making the use of artificial intelligence models simpler and more convenient. ViT-b / 16 is a deep learning model based on the Transformer architecture provided by Hugging Face, which is specifically used to process computer vision tasks. Its full name is Vision Transformer baseline with a 16x16 patch size. Vision Transformer (ViT) is a method that applies the Transformer model commonly used in natural language processing to the field of computer vision. The ViT model can divide an image into patches of fixed size, and then encode these patches using a Transformer model to capture feature information in the image. After pre-training, the ViT model can be fine-tuned on various computer vision tasks, such as image classification, object detection, image segmentation, etc.

[0071] The target image data in the embodiment of the present invention can be represented as a picture x∈R H×W×C , where (H, W) represents the resolution of the target image data and C represents the number of channels.

[0072] After the target image data is input into the image feature extraction unit, the image feature extraction unit may flatten the target image data into a sequence of N 16×16 2D patches, where N=HW / P 2 , (P,P) is the resolution of the tile, and the feature of each tile can be expressed as

[0073] Similarly, the learnable Token ([CLS]) is embedded into the process of converting each patch in the target image data into a vector representation (Patch Embedding), where [CLS] ∈ R 1×768 Finally, the first image feature data X output by the image feature extraction unit can be obtained v ∈R (N+1)×768 The formal expression of the first image feature data is: X v =ViT(x,θV iT ) The first text feature vector is input into a unimodal representation differentiation module, and second text feature data output by the unimodal representation differentiation module is obtained.

[0074] Specifically, after the first text feature vector is input into the unimodal representation differentiation module, the unimodal representation differentiation module may perform feature extraction on the first text feature vector, and further obtain the second text feature data output by the unimodal representation differentiation module.

[0075] As an optional embodiment, the unimodal representation differentiation module is constructed based on a convolutional neural network and a BiLSTM network, and the unimodal representation differentiation module includes an embedding unit 401, a convolutional network unit 402, and a recurrent neural network unit 403 connected in sequence, and the convolutional network unit 402 is residually connected to the recurrent neural network unit 403; Inputting the first text feature vector into the unimodal representation differentiation module to obtain the second text feature data output by the unimodal representation differentiation module includes: inputting the first text feature vector into the embedding unit 401 to obtain the first word feature vector output by the embedding unit 401.

[0076] Figure 4 : is a schematic diagram of the model structure of the single-modal characterization differentiation module in the livestock and poultry disease diagnosis method provided by the present invention. The model structure of the single-modal characterization differentiation module in the embodiment of the present invention is as follows: Figure 4 shown.

[0077] It should be noted that the embedding unit 401 in the embodiment of the present invention can be constructed based on the BERT model.

[0078] Specifically, after the first text feature vector is input into the embedding unit 401, the embedding unit 401 may perform feature extraction and ReLU nonlinear activation function calculation on the first text feature vector to obtain a first word feature vector, and then obtain the first word feature vector output by the embedding unit 401.

[0079] The first word feature vector is input into the convolutional network unit 402, and the second word feature vector output by the convolutional network unit 402 is obtained.

[0080] It should be noted that the convolutional network unit 402 in the embodiment of the present invention may be composed of convolutional layers and pooling layers that are alternately cascaded in sequence. The convolutional layer may perform convolution calculations on the input data, and the pooling layer may perform pooling calculations on the input data.

[0081] It should be noted that the number of convolutional layers and the number of pooling layers in the embodiment of the present invention are the same. The number of convolutional layers and the number of pooling layers in the embodiment of the present invention can be determined based on prior knowledge and / or actual conditions. The number of convolutional layers and the number of pooling layers in the embodiment of the present invention are not specifically limited.

[0082] After the first word feature vector is input into the convolutional network unit 402, the convolutional layer and the pooling layer in the convolutional network unit 402 can perform convolution calculations and pooling calculations on the input data in sequence, and then the second word feature vector output by the convolutional network unit 402 can be obtained.

[0083] Define the residual as the original input: Residual=F t The formal expression of convolutional layer and pooling layer calculation is: h t-1 =Conv1D(F t ;kernel m ) h t =ReLU(h t-1 ) After connecting the residual to the convolutional network: x t =h t +Residual, kernel represents the convolution kernel; m represents the convolution kernel size; h t-1 represents the output of the convolutional layer, h t Represents the output after the ReLU activation function; stride represents the step length; After the first word feature vector and the second word feature vector are fused, the fusion result is output to the recurrent neural network unit 403, and the second text feature data output by the recurrent neural network unit 403 is obtained.

[0084] It should be noted that, considering that the text data used to describe the status of livestock and poultry targets is usually a sequence of words or characters, and the above words or characters usually have time training, the livestock and poultry disease diagnosis model needs to consider the contextual information in the above target text data when diagnosing livestock and poultry diseases based on the target text data.

[0085] Bidirectional long short-term memory network (BiLSTM) is a deep learning model commonly used in sequence modeling tasks. BiLSTM network is a variant of long short-term memory network (LSTM). BiLSTM network can effectively capture long-term dependencies in sequence data. Unlike traditional unidirectional LSTM networks, BiLSTM networks usually consist of two independent LSTM networks, one LSTM network is responsible for forward propagation (from the beginning to the end of the sequence), and the other LSTM network is responsible for backward propagation (from the end of the sequence to the beginning). During training, the two LSTM networks are trained independently, but their outputs are connected when used to provide complete bidirectional information. For each time step, the BiLSTM model considers the information before and after the current moment at the same time. This bidirectional information transmission mechanism enables the model to understand the entire sequence more comprehensively and better capture contextual information.

[0086] Therefore, in the embodiment of the present invention, the recurrent neural network unit 403 is constructed based on the BiLSTM grid, which can better extract the context information in the target text data.

[0087] The forward LSTM unit in the recurrent neural network unit 403 is composed of an input gate i t 、Forget gate t , output gate o t It consists of three gate functions and cell states. The specific calculation formula is as follows: i t =σ(W i x t +U i h t-1 +b i ) f t =σ(W f x t +U f h t-1 +b f ) o t =σ(W o x t +U o h t-1 +b o ) In the formula, x t Indicates the current data input, h t is the current hidden layer input, h t-1 is the output of the previous hidden layer, W i , W f , W o is the corresponding weight coefficient, b i , b f , bo is the corresponding bias term, and σ is the sigmoid activation function.

[0088] Cell state candidate values It can be calculated by the following formula: Where W c , U c represents the corresponding weight coefficient matrix, b c is the bias term, and tanh is the hyperbolic sine activation function.

[0089] According to the previous cell state value C t-1 and cell state candidate values The current cell state value c can be calculated t , the specific calculation formula is as follows: The current state output h of the forward LSTM unit t It can be calculated by the following formula: h t =o t tanh(c t ) Similarly, the reverse LSTM output is calculated, and the combined bidirectional hidden state is output as the final result: h t =[h f,t ;h b,t ] To avoid overfitting, Dropout is used to reduce the overfitting that may occur in stacked units. Finally, the bidirectional output features are used as text feature inputs.

[0090] X t =FC(Dropout(h t )) Among them, Dropout means discarding neurons, and FC means fully connected layer.

[0091] The second text feature data and the first image feature data are input into a feature fusion module to obtain feature fusion data output by the feature fusion module.

[0092] Specifically, after the second text feature data and the first image feature data are input into the feature fusion module, the feature fusion module can perform feature fusion on the second text feature data and the first image feature data, and then obtain feature fusion data output by the feature fusion module.

[0093] Figure 5FIG. 1 is a flow chart of the feature fusion module in the livestock and poultry disease diagnosis method provided by the present invention fusing the second text feature data and the first image feature data. As an optional embodiment, Figure 5 As shown, the feature fusion module includes a normalization unit 501, a first branch unit 502, a second branch unit 503, a gate control unit 504 and a feedforward neural network unit 505; the first branch unit 502 is constructed based on a multi-head attention mechanism, and the second branch unit 503 is constructed based on a self-attention mechanism; Inputting the second text feature data and the first image feature data into a feature fusion module, and obtaining feature fusion data output by the feature fusion module, includes: inputting the second text feature data and the first image feature data into a normalization unit 501, and obtaining third text feature data and second image feature data output by the normalization unit 501.

[0094] It should be noted that in order to further integrate text features and image features, a feature fusion module is constructed based on a multi-head attention mechanism in the embodiment of the present invention. The feature fusion module can repeatedly strengthen the text modality with low-level features from another source modality by learning the attention between the two modal features.

[0095] Among them, the multi-head attention mechanism is a technology developed on the basis of the attention mechanism. In the traditional attention mechanism, the context information is obtained by weighted summing the hidden states of each position in the sequence. The multi-head attention mechanism introduces multiple attention heads, each of which learns different attention weights to capture different aspects of the input sequence. By concatenating or weighted summing the outputs of multiple attention heads, a more comprehensive and rich context representation can be obtained.

[0096] like Figure 5 As shown, after the second text feature data and the first image feature data are input into the normalization unit 501, the normalization unit 501 embeds the position information into the second text feature data and the first image feature data in order to allow the feature sequence to carry time information. For the second text feature data and the first image feature data of different modalities, the formal representations are: Among them, X m Represents the characteristic data of each mode, PE m Indicates that each modal position is embedded in Embedding. For the subsequent network input, m represents each modality.

[0097] Perform layer standardization, formally expressed as: Among them, LN represents the mean, variance, and standardization operations; is the output of layer normalization.

[0098] The second image feature data and the third text feature data are input into the first branch unit 502 to obtain the first fused feature data output by the first branch unit 502 ; the third text feature data is input into the second branch unit 503 to obtain the second fused feature data output by the second branch unit 503 .

[0099] For the first branch unit 502, the Query, Key, and Value vectors are defined as in, is a weight coefficient matrix used for multi-head attention mechanism calculation. The second image feature data is defined as a query, the third text feature data is defined as a key and a value, and multiple attention heads are concatenated to obtain an attention score. The calculation formula is as follows: Among them, head i =Attention(Q, K, V),

[0100] For the second branch unit 503, define the Query, Keys, and Values ​​vectors in, is the weight coefficient matrix. The third text feature data is input into the second branch unit 503, and the calculation formula is as follows: Among them, head i =Attention(Q, K, V),

[0101] The first fused feature data and the second fused feature data are input into the gate control unit 504 , and the third fused feature data output by the gate control unit 504 is obtained.

[0102] Specifically, in the embodiment of the present invention, a gate control is introduced to control the outputs of the first branch unit 502 and the second branch unit 503 .

[0103] It should be noted that after the first fused feature data and the second fused feature data are input into the gate control unit 504, the gate control unit 504 may calculate the first fused feature data and the second fused feature data based on the following formula to obtain the third fused feature data: in, is the gating vector, represents the projection matrix, h c ||h s It is a concat operation on two vectors, σ represents the ReLU activation function, Represents component-wise multiplication.

[0104] The third fused feature data is input into the feedforward neural network unit 505 to obtain the feature fusion data output by the feedforward neural network unit 505.

[0105] Specifically, after the third fusion feature data is input into the feedforward neural network unit 505, the position-based feedforward neural network unit 505 includes two linear transformations, with a ReLU activation function calculation in the middle. The specific calculation formula is as follows: FFN(x)=ReLU(xW1+b1)W2+b2 Among them, W1 and W2 represent the learnable weight matrices, and b1 and b2 are bias terms.

[0106] The feature fusion data is input into the result output module to obtain the disease diagnosis result of the livestock and poultry target to be diagnosed output by the result output module.

[0107] Specifically, after acquiring the feature fusion data, the feature fusion data may be input into a result output module.

[0108] The result output module can determine and output the disease diagnosis result of the livestock and poultry target to be diagnosed based on the above-mentioned feature fusion data, and then the disease diagnosis result of the livestock and poultry target to be diagnosed output by the result output module can be obtained.

[0109] It should be noted that, in the process of training the initial model, in the embodiment of the present invention, the received output is passed through a fully connected layer through a cross entropy loss function and a softmax activation function to obtain the confidence of each type of livestock and poultry disease, and the loss function calculation formula is as follows: Among them, n represents the number of training samples, x represents the label dimension, y represents the sample label, and a represents the predicted value output by the initial model in training.

[0110] The Softmax activation function is used to calculate the confidence of each class, and the calculation formula is as follows: Optionally, the model parameters of the livestock and poultry disease diagnosis model in the embodiment of the present invention include: the convolution kernel length in the convolutional network unit 402 is set to 3, the pooling step size is set to 2, the dimension of the recurrent neural network unit 403 is set to 384, and the number of layers is set to 1. In the feature fusion module, the attention head is set to 4, the number of blocks is set to 2, and the multi-layer perceptron dimension is set to 2048. The cross entropy loss function is used as the objective function for optimization, AdamW is used as the optimizer, the initial learning rate is set to 1e-3, the batch size is set to 64, the epoch is set to 30, the patience is set to 6, the Drop out rate is set to 0.5, and after the model converges, the weights are saved in .pth format for later reasoning.

[0111] In order to facilitate the understanding of the livestock and poultry disease diagnosis method provided by the present invention, the livestock and poultry disease diagnosis method provided by the present invention is described below by using an example.

[0112] In this example, the pytorch model class is initialized, and the pre-trained model weights are loaded to perform forward propagation diagnosis and prediction. Among them, in this embodiment, six neurological diseases are selected as examples: porcine blue ear disease, contagious pleuropneumonia, mycoplasma disease, Haemophilus parasuis disease, pseudorabies, and streptococcal disease. For the six diseases mentioned above, the user inputs text data to describe the status of the livestock and poultry to be diagnosed, and attaches a symptom image or anatomical image of the livestock and poultry to be diagnosed to realize the diagnosis of livestock and poultry diseases. Among them, the text data used to describe the status of livestock and poultry to be diagnosed may include "the disease mainly occurs in sows, and is manifested as depression, decreased or loss of appetite, fever of 41°C, varying degrees of breathing difficulties, miscarriage, premature birth, stillbirth, mummification, and weak piglets. The abortion rate of sows can reach 40%, the stillbirth rate can reach more than 25%, and the mummification rate can reach 15%. Some newborn piglets show symptoms such as breathing difficulties, movement disorders and mild paralysis. The mortality rate is significantly increased within 1 week after delivery (50% to 80%). A small number of sows show postpartum agalactia, stagnant placenta and increased vaginal secretions."

[0113] In order to illustrate the technical effect of the livestock and poultry disease diagnosis method provided by the present invention, the livestock and poultry disease diagnosis model provided by the present invention and the traditional machine learning model were compared on a common data set. The comparison results are shown in Table 1. Table 1. Experimental results of baseline model comparison

[0114] It can be seen from Table 1 that the livestock and poultry disease diagnosis model provided by the present invention is superior to the traditional machine learning model in all dimensions.

[0115] Figure 6 This is a schematic diagram of the structure of the livestock and poultry disease diagnosis device provided by the present invention. Figure 6The livestock and poultry disease diagnosis device provided by the present invention is described. The livestock and poultry disease diagnosis device described below and the livestock and poultry disease diagnosis method provided by the present invention described above can be referred to each other. Figure 6 As shown, a data acquisition module 601 and a disease diagnosis module 602.

[0116] The data acquisition module 601 is used to acquire target image data and target text data, wherein the target image data includes image data of the livestock and poultry target to be diagnosed, and the target text data includes text data used to describe the status of the livestock and poultry target to be diagnosed; the disease diagnosis module 602 is used to input the target image data and target text data into the livestock and poultry disease diagnosis model, and acquire the disease diagnosis result of the livestock and poultry target to be diagnosed output by the livestock and poultry disease diagnosis model; Among them, the livestock and poultry disease diagnosis model is trained based on sample image data, sample text data and disease diagnosis results of sample livestock and poultry targets. The sample image data includes image data of sample livestock and poultry targets, and the sample text data includes text data used to describe the status of the sample livestock and poultry targets.

[0117] Specifically, the data acquisition module 601 and the disease diagnosis module 602 are electrically connected.

[0118] The livestock and poultry disease diagnosis device in the embodiment of the present invention inputs the image data of the livestock and poultry target to be diagnosed and the text data used to describe the state of the livestock and poultry target to be diagnosed into the livestock and poultry disease diagnosis model to obtain the disease diagnosis result of the livestock and poultry target to be diagnosed output by the livestock and poultry disease diagnosis model. The above-mentioned livestock and poultry disease diagnosis model is trained based on the image data of the sample livestock and poultry target, the text data used to describe the state of the sample livestock and poultry target, and the disease diagnosis result of the sample livestock and poultry target. The livestock and poultry disease diagnosis model can be based on multi-modal interactive fusion, and multi-source heterogeneous data can be used to more accurately and efficiently diagnose livestock and poultry diseases. The livestock and poultry disease diagnosis has wider adaptability, stronger robustness, and is easier to promote. It can better adapt to the development trend of industrialized and large-scale livestock and poultry breeding, and can better promote the healthy development of the livestock and poultry breeding industry.

[0119] Figure 7 An example of a physical structure diagram of an electronic device is shown in FIG. Figure 7As shown, the electronic device may include: a processor 710, a communication interface 720, a memory 730 and a communication bus 740, wherein the processor 710, the communication interface 720 and the memory 730 communicate with each other through the communication bus 740. The processor 710 may call the logic instructions in the memory 730 to execute the livestock and poultry disease diagnosis method, which includes: obtaining target image data and target text data, wherein the target image data includes image data of the livestock and poultry target to be diagnosed, and the target text data includes text data for describing the state of the livestock and poultry target to be diagnosed; inputting the target image data and the target text data into the livestock and poultry disease diagnosis model, and obtaining the disease diagnosis result of the livestock and poultry target to be diagnosed output by the livestock and poultry disease diagnosis model; wherein the livestock and poultry disease diagnosis model is obtained by training based on sample image data, sample text data and the disease diagnosis result of the sample livestock and poultry target, wherein the sample image data includes image data of the sample livestock and poultry target, and the sample text data includes text data for describing the state of the sample livestock and poultry target.

[0120] In addition, the logic instructions in the above-mentioned memory 730 can be implemented in the form of a software functional unit and can be stored in a computer-readable storage medium when it is sold or used as an independent product. Based on such an understanding, the technical solution of the present invention, in essence, or the part that contributes to the prior art or the part of the technical solution, can be embodied in the form of a software product, and the computer software product is stored in a storage medium, including a number of instructions for a computer device (which can be a personal computer, a server, or a network device, etc.) to perform all or part of the steps of the method described in each embodiment of the present invention. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), disk or optical disk and other media that can store program codes.

[0121] On the other hand, the present invention also provides a computer program product, which includes a computer program, and the computer program can be stored on a non-transitory computer-readable storage medium. When the computer program is executed by a processor, the computer can execute the livestock and poultry disease diagnosis method provided by the above-mentioned methods, and the method includes: obtaining target image data and target text data, the target image data including image data of the livestock and poultry target to be diagnosed, and the target text data including text data used to describe the state of the livestock and poultry target to be diagnosed; inputting the target image data and the target text data into a livestock and poultry disease diagnosis model, and obtaining the disease diagnosis result of the livestock and poultry target to be diagnosed output by the livestock and poultry disease diagnosis model; wherein the livestock and poultry disease diagnosis model is trained based on sample image data, sample text data and disease diagnosis results of sample livestock and poultry targets, the sample image data including image data of the sample livestock and poultry targets, and the sample text data including text data used to describe the state of the sample livestock and poultry targets.

[0122] On the other hand, the present invention also provides a non-transitory computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, is implemented to execute the livestock and poultry disease diagnosis method provided by the above-mentioned methods, the method comprising: obtaining target image data and target text data, the target image data comprising image data of the livestock and poultry target to be diagnosed, and the target text data comprising text data for describing the state of the livestock and poultry target to be diagnosed; inputting the target image data and the target text data into a livestock and poultry disease diagnosis model, and obtaining the disease diagnosis result of the livestock and poultry target to be diagnosed output by the livestock and poultry disease diagnosis model; wherein the livestock and poultry disease diagnosis model is trained based on sample image data, sample text data and the disease diagnosis result of the sample livestock and poultry target, the sample image data comprises image data of the sample livestock and poultry target, and the sample text data comprises text data for describing the state of the sample livestock and poultry target.

[0123] The device embodiments described above are merely illustrative, wherein the units described as separate components may or may not be physically separated, and the components displayed as units may or may not be physical units, that is, they may be located in one place, or they may be distributed on multiple network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the scheme of this embodiment. Ordinary technicians in this field can understand and implement it without paying creative labor.

[0124] Through the description of the above implementation methods, those skilled in the art can clearly understand that each implementation method can be implemented by means of software plus a necessary general hardware platform, and of course, it can also be implemented by hardware. Based on this understanding, the above technical solution is essentially or the part that contributes to the prior art can be embodied in the form of a software product, and the computer software product can be stored in a computer-readable storage medium, such as ROM / RAM, a disk, an optical disk, etc., including a number of instructions for a computer device (which can be a personal computer, a server, or a network device, etc.) to execute the methods described in each embodiment or some parts of the embodiments.

[0125] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention, rather than to limit it. Although the present invention has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or make equivalent replacements for some of the technical features therein. However, these modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the embodiments of the present invention.

Claims

1. A method for diagnosing livestock and poultry diseases, characterized in that: include: Acquire target image data and target text data, wherein the target image data includes image data of the livestock and poultry target to be diagnosed, and the target text data includes text data for describing the state of the livestock and poultry target to be diagnosed; Inputting the target image data and the target text data into a livestock and poultry disease diagnosis model, and obtaining a disease diagnosis result of the livestock and poultry target to be diagnosed output by the livestock and poultry disease diagnosis model; Among them, the livestock and poultry disease diagnosis model is trained based on sample image data, sample text data and disease diagnosis results of sample livestock and poultry targets, the sample image data includes image data of the sample livestock and poultry targets, and the sample text data includes text data used to describe the status of the sample livestock and poultry targets.

2. The method for diagnosing livestock and poultry diseases according to claim 1, characterized in that: The livestock and poultry disease diagnosis model includes: a feature extraction module, a single-mode representation differentiation module, a feature fusion module and a result output module; The step of inputting the target image data and the target text data into a livestock and poultry disease diagnosis model to obtain a disease diagnosis result of the livestock and poultry target to be diagnosed output by the livestock and poultry disease diagnosis model comprises: Inputting the target image data and the target text data into the feature extraction module, and obtaining the first image feature data and the first text feature vector output by the feature extraction module; Inputting the first text feature vector into the unimodal representation differentiation module to obtain second text feature data output by the unimodal representation differentiation module; Inputting the second text feature data and the first image feature data into the feature fusion module, and obtaining feature fusion data output by the feature fusion module; The feature fusion data is input into the result output module to obtain the disease diagnosis result of the livestock and poultry target to be diagnosed output by the result output module.

3. The method for diagnosing livestock and poultry diseases according to claim 2, characterized in that: The unimodal representation differentiation module is constructed based on a convolutional neural network and a BiLSTM network, and the unimodal representation differentiation module includes an embedding unit, a convolutional network unit, and a recurrent neural network unit connected in sequence, and the convolutional network unit is residually connected to the recurrent neural network unit; the first text feature vector is input into the unimodal representation differentiation module to obtain the second text feature data output by the unimodal representation differentiation module, including: Input the first text feature vector into the embedding unit to obtain a first word feature vector output by the embedding unit; input the first word feature vector into the convolutional network unit to obtain a second word feature vector output by the convolutional network unit; After the first word feature vector and the second word feature vector are fused, the fusion result is output to the recurrent neural network unit, and the second text feature data output by the recurrent neural network unit is obtained.

4. The method for diagnosing livestock and poultry diseases according to claim 2, characterized in that: The feature fusion module includes a normalization unit, a first branch unit, a second branch unit, a gate control unit and a feedforward neural network unit; the first branch unit is constructed based on a multi-head attention mechanism, and the second branch unit is constructed based on a self-attention mechanism; The step of inputting the second text feature data and the first image feature data into the feature fusion module and obtaining the feature fusion data output by the feature fusion module includes: Inputting the second text feature data and the first image feature data into the normalization unit, and acquiring third text feature data and second image feature data output by the normalization unit; Input the second image feature data and the third text feature data into the first branch unit, obtain the first fused feature data output by the first branch unit, input the third text feature data into the second branch unit, obtain the second fused feature data output by the second branch unit; Inputting the first fused feature data and the second fused feature data into the gate control unit, and obtaining third fused feature data output by the gate control unit; The third fused feature data is input into a feedforward neural network unit to obtain the feature fusion data output by the feedforward neural network unit.

5. The method for diagnosing livestock and poultry diseases according to claim 2, characterized in that: The feature extraction module includes: a text feature extraction unit and an image feature extraction unit, wherein the text feature extraction unit is constructed based on a BERT model, and the image feature extraction unit is constructed based on a ViT model; The step of inputting the target image data and the target text data into the feature extraction module and obtaining the first image feature data and the first text feature vector output by the feature extraction module comprises: Input the target text data into the text feature extraction unit, obtain the first text feature vector output by the text feature extraction unit, The target image data is input into the image feature extraction unit, and the first image feature data output by the image feature extraction unit is acquired.

6. The method for diagnosing livestock and poultry diseases according to claim 1, characterized in that: The sample image data and the sample text data are obtained based on the following steps: Acquire original image data of the sample livestock and poultry target and original text data used to describe the status of the sample livestock and poultry target; perform image preprocessing on the original image data to acquire the sample image data, and perform text preprocessing on the original text data to acquire the sample text data; Among them, the image preprocessing includes multiple ones of resolution modulation, rotation, scaling, cropping, removal and affine transformation; the text preprocessing includes multiple ones of word segmentation, denoising, part-of-speech tagging, entity recognition, random deletion, random insertion, random exchange and synonym replacement.

7. The method for diagnosing livestock and poultry diseases according to any one of claims 1 to 6, characterized in that: The disease diagnosis result is used to indicate whether the livestock and poultry target is suffering from a disease. If the disease diagnosis result indicates that the livestock and poultry target is suffering from a disease, the disease diagnosis result is also used to indicate the type of disease that the livestock and poultry target is suffering from; The image data of the sample livestock and poultry targets include symptom images and / or anatomical images of the sample livestock and poultry; the status of the sample livestock and poultry targets includes at least one of the appearance status, physical sign status, mental state, symptom status and behavioral status of the sample livestock and poultry targets during the illness.

8. A device for diagnosing livestock and poultry diseases, characterized in that: include: A data acquisition module, used to acquire target image data and target text data, wherein the target image data includes image data of the livestock and poultry target to be diagnosed, and the target text data includes text data for describing the status of the livestock and poultry target to be diagnosed; A disease diagnosis module, used for inputting the target image data and the target text data into a livestock and poultry disease diagnosis model, and obtaining a disease diagnosis result of the livestock and poultry target to be diagnosed output by the livestock and poultry disease diagnosis model; Among them, the livestock and poultry disease diagnosis model is trained based on sample image data, sample text data and disease diagnosis results of sample livestock and poultry targets, the sample image data includes image data of the sample livestock and poultry targets, and the sample text data includes text data used to describe the status of the sample livestock and poultry targets.

9. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein: When the processor executes the program, the livestock and poultry disease diagnosis method as described in any one of claims 1 to 7 is implemented.

10. A non-transitory computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the method for diagnosing livestock and poultry diseases as described in any one of claims 1 to 7 is implemented.

Citation Information

Cited By

  • Method for constructing intelligent breeding multi-mode Internet of Things information collection and early warning model

    CN116760719A

  • Livestock and poultry epidemic disease image recognition method and device and electronic equipment

    CN119027983A

  • Method, device and electronic equipment for identifying images of livestock and poultry diseases

    CN119027983B