Pig digestive tract epidemic disease diagnosis method and system based on deep learning
Through deep learning-based methods, combined with Mask RCNN, convolutional neural network and machine learning model, a pig digestive tract disease diagnosis system is built, which solves the subjectivity and complexity of traditional diagnostic methods, achieves high-accuracy diagnosis, and provides technical support for the pig breeding industry.
Patent Information
- Application Number
- CN202510080429.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-01-20
- Publication Date
- 2025-05-13
AI Technical Summary
The traditional diagnosis methods for digestive tract disease in pigs have problems such as strong subjectivity, low efficiency and poor accuracy. The laboratory diagnosis methods are complex, time-consuming and expensive, and require professional equipment and personnel.
Using a deep learning-based method, a combined model is constructed through Mask RCNN model, convolutional neural network and machine learning model to diagnose digestive tract disease in pigs. The system includes a data acquisition module and a diagnostic model construction module. Through the integration of image information and case information, it realizes accurate identification of digestive tract disease in pigs.
It improves the diagnostic accuracy of pig digestive tract disease, reduces the subjectivity and complexity of diagnosis, and provides new technical support for the pig breeding industry.
Smart Images

Figure CN119991613A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of intelligent diagnosis of pig digestive tract diseases, and in particular to a method and system for diagnosing pig digestive tract diseases based on deep learning. Background Art
[0002] Pig farming is an important part of animal husbandry. Pig farming not only plays an important role in ensuring the safe supply of meat, but is also an important industry related to the national economy and people's livelihood, and plays a vital role in China's agricultural production.
[0003] In the process of pig farming, many diseases often occur, among which digestive tract diseases are the most common and most harmful diseases. Porcine epidemic diarrhea, porcine transmissible gastroenteritis, yellow diarrhea of piglets, white diarrhea of piglets, ileitis, and clostridial enteritis of piglets are the most common digestive tract diseases of piglets and the main cause of piglet death. The economic losses of pig farms caused by digestive tract diseases exceed 10 billion yuan each year, bringing huge economic losses to the pig farming industry. Early, rapid and accurate diagnosis is the key to pig disease prevention and control.
[0004] Traditional diagnostic methods make a preliminary or confirmed diagnosis by observing clinical symptoms and pathological changes and combining them with epidemiology. This method relies heavily on the expertise and experience of frontline veterinary personnel, and has the disadvantages of strong subjectivity, low efficiency, and poor accuracy. In addition, the expertise and experience of veterinary experts are difficult to quickly replicate, and there is a shortage of frontline veterinary experts. Laboratory diagnostic methods use advanced technology and sophisticated test instruments to overcome the shortcomings of traditional diagnostic methods, achieve early diagnosis of epidemics, and have higher accuracy and specificity. Laboratory diagnostic methods are one of the most commonly used and most effective methods for diagnosing pig diseases. Among them, multiplex quantitative PCR and enzyme-linked immunosorbent assay are widely used in the diagnosis of pig digestive tract diseases. By detecting the genes or antibodies of pathogens, a high diagnostic rate can be achieved. However, the operation is complicated, time-consuming, and has poor timeliness. It is expensive and requires professional equipment and well-trained personnel.
[0005] With the development of computer technology and artificial intelligence, a large number of research reports on intelligent diagnosis systems for pig diseases have emerged. Early intelligent diagnosis systems for pigs were often built and developed based on expert systems and ontology theory, which improved the efficiency of diagnosis to a certain extent and improved the digital level of diagnosis of pig diseases. However, they have weak generalization ability, poor flexibility, lack of autonomous learning ability, inability to process unstructured data such as images, voice, and text, and inability to solve domain problems well, which limits their promotion and application in clinical practice.
[0006] In recent years, with the development of deep learning, image recognition and classification based on deep learning have been widely used in animal growth monitoring, behavior analysis, quality assessment, etc. In the field of intelligent diagnosis, image recognition and classification based on deep learning are mainly focused on the research of dogs, cats, chickens and other animals. Facts show that it is feasible to use image recognition based on deep learning for the diagnosis of animal diseases, which can help clinical veterinarians diagnose diseases more quickly and accurately and improve the treatment effect. However, there is little research on image recognition and classification based on deep learning in the field of intelligent diagnosis of pigs. Summary of the invention
[0007] In order to solve the above problems, the purpose of the present invention is to provide a deep learning-based diagnosis technology for pig digestive tract diseases, aiming to improve the diagnostic accuracy of pig digestive tract diseases through intelligent means and provide new technical support for the pig farming industry.
[0008] In order to achieve the above technical objectives, the present application provides a method for diagnosing pig digestive tract diseases based on deep learning, comprising the following steps:
[0009] The datasets were collected using porcine epidemic diarrhea, porcine transmissible gastroenteritis, porcine proliferative enteropathy, yellow diarrhea in piglets, white diarrhea in piglets, and clostridial enteritis in piglets as disease cases;
[0010] Based on the Mask RCNN model, convolutional neural network and machine learning model, a combined model was constructed, the model was trained through the data set, and a diagnostic model was constructed for diagnosing pig digestive tract diseases.
[0011] Preferably, in the process of acquiring the data set, images with at least one small intestinal lesion feature of small intestinal serosal congestion, small intestinal wall bleeding, small intestinal wall thinning, small intestinal wall thinning with bleeding, small intestinal wall hyperplasia, small intestinal mucosal hyperplasia, small intestinal mucosal hemorrhagic hyperplasia and small intestinal mucosal bleeding are collected as the data set.
[0012] Preferably, in the process of acquiring the data set, the collected images are expanded by rotating and mirror-flipping at different angles and the features of small intestinal lesions are marked to form the data set.
[0013] Preferably, in the process of constructing the combined model, the lesion area of the image is segmented by using the Mask RCNN model.
[0014] Preferably, in the process of constructing the combined model, feature extraction is performed on the segmented image lesion area through a convolutional neural network, wherein the convolutional neural network is one of AlexNet, DenseNet, GoogleNet, ResNet and VGGNet.
[0015] Preferably, in the process of selecting a convolutional neural network, one of DenseNet and GoogleNet is selected as the convolutional neural network to perform feature extraction on the lesion area of the segmented image.
[0016] Preferably, in the process of constructing the combined model, based on the features extracted by the convolutional neural network and then integrated with the case information, the final disease classification is performed through the machine learning model to complete the identification of pig digestive tract diseases, wherein the machine learning model is one of NB, KNN, SVM, RF and XGBoost.
[0017] Preferably, in the process of selecting a machine learning model, random forest RF is selected as the machine learning model.
[0018] Preferably, in the process of selecting a machine learning model, one of KNN and SVM can also be selected as the machine learning model.
[0019] The present invention also discloses a deep learning-based pig digestive tract disease diagnosis system, which is used to implement the above-mentioned deep learning-based pig digestive tract disease diagnosis method. The system comprises:
[0020] The data collection module is used to collect data sets based on porcine epidemic diarrhea, porcine transmissible gastroenteritis, porcine proliferative enteropathy, yellow diarrhea of piglets, white diarrhea of piglets and clostridial enteritis of piglets as epidemic disease cases;
[0021] The diagnostic model building module is used to build a combined model based on the Mask RCNN model, convolutional neural network and machine learning model, train the model through the data set, and build a diagnostic model for diagnosing pig digestive tract diseases.
[0022] The present invention discloses the following technical effects:
[0023] The present invention accurately identifies 6 different pig digestive tract diseases by fusing image information with case information. The present invention uses Mask RCNN to segment the diseased part of the image, and uses CNN to extract the feature information of the segmented image. At the same time, the relevant case information is also encoded and converted into a model that can be used for machine learning. The image information and case information are integrated together as training data for machine learning, which can obtain better classification performance and generalization ability, providing new technical support for the pig farming industry. BRIEF DESCRIPTION OF THE DRAWINGS
[0024] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings required for use in the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.
[0025] Figure 1 It is the classification of porcine small intestine lesion images described in the present invention;
[0026] Figure 2 is a flow chart of the identification framework of the present invention;
[0027] Figure 3 This is the pig small intestine lesion image classification relationship diagram described in the present invention. DETAILED DESCRIPTION
[0028] To make the purpose, technical scheme and advantages of the embodiments of the present application clearer, the technical scheme in the embodiments of the present application will be clearly and completely described below in conjunction with the drawings in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, rather than all of the embodiments. The components of the embodiments of the present application generally described and shown in the drawings here can be arranged and designed in various different configurations. Therefore, the following detailed description of the embodiments of the present application provided in the drawings is not intended to limit the scope of the application claimed for protection, but merely represents the selected embodiments of the present application. Based on the embodiments of the present application, all other embodiments obtained by those skilled in the art without making creative work belong to the scope of protection of the present application.
[0029] like Figure 1-3 As shown, the present invention provides a deep learning-based diagnosis technology for pig digestive tract diseases, which specifically includes the following processes:
[0030] 1. Materials and methods
[0031] 1.1 Dataset
[0032] The present invention selected 6 swine digestive tract diseases with high morbidity and serious harm as research objects, and collected relevant cases and their small intestine anatomical images.
[0033] 1.1.1 Case Dataset
[0034] The disease cases collected in the present invention mainly include porcine epidemic diarrhea (PED), transmissible gastroenteritis of pigs (TGE), porcine proliferative enteropathy (PPE), yellow scour of newborn piglets (YSNP), white scour of piglets (WSP), and clostridialenteritis of piglets (CEP), with a total of 266 cases. Among them, there were 117 cases of porcine epidemic diarrhea, which is a highly contagious enteric infectious disease of pigs caused by porcine epidemic diarrhea virus, with watery diarrhea and vomiting as the main clinical features; 68 cases of porcine transmissible gastroenteritis, which is a highly contagious enteric disease of pigs caused by porcine transmissible gastroenteritis virus, with vomiting, severe diarrhea and high mortality of piglets within 2-3 weeks of age as the main features; 20 cases of porcine proliferative enteropathy, which is an infectious enteric disease caused by the obligate intracellular parasite Lawsonia intracellularis, with the proliferation of ileal and colonic crypt epithelial cells leading to thickening of the intestinal mucosa as the main pathological feature; 30 cases of piglet yellow scour, which is caused by a There were 22 cases of piglet white diarrhea, which is also a digestive tract infectious disease of pigs caused by some serotypes of pathogenic Escherichia coli. It is common in piglets between 1 and 7 days old and is characterized by severe diarrhea, yellow watery stools and rapid death. There were 9 cases of piglet clostridial enteritis, which is a highly lethal enterotoxemia in piglets under 3 days old caused by Clostridium perfringens type C and is characterized by red stools, diffuse bleeding and necrosis of the small intestinal mucosa, rapid onset, short course and high mortality.
[0035] All case information covers 12 characteristics including age at onset, season of onset, morbidity, mortality, course of disease, body temperature, appetite, physical signs, skin condition, eye manifestations, digestive system symptoms and characteristics of small intestinal lesions.
[0036] 1.1.2 Image Datasets:
[0037] The images collected by the present invention cover 8 small intestinal lesion characteristics of small intestinal serosal congestion, small intestinal wall bleeding, small intestinal wall thinning, small intestinal wall thinning and bleeding, small intestinal wall hyperplasia, small intestinal mucosal hyperplasia, small intestinal mucosal hemorrhage and hyperplasia, and small intestinal mucosal bleeding. Among them, there are 18 images of small intestinal serosal congestion, 25 images of small intestinal wall bleeding, 23 images of small intestinal wall thinning, 7 images of small intestinal wall thinning and bleeding, 5 images of small intestinal wall hyperplasia, 10 images of small intestinal mucosal hyperplasia, 10 images of small intestinal mucosal hemorrhage and hyperplasia, and 8 images of small intestinal mucosal bleeding, totaling 106 images.
[0038] Figure 1 The typical features of these 8 small intestinal lesions are shown, among which Figure A is a typical picture of small intestinal serosa congestion. The appearance characteristics of small intestinal serosa congestion are mainly manifested in the dilation and filling of capillaries in the serosa layer, prominent texture, and bright red serosa; Figure B is a typical picture of small intestinal wall bleeding. The appearance characteristics of small intestinal wall bleeding are mainly manifested in the damage of small intestinal mucosal capillaries, blood entering the intestinal cavity, and the small intestinal segment is dark red; Figure C is a typical picture of small intestinal wall thinning. The appearance characteristics of small intestinal wall thinning are mainly manifested in the intestinal wall becoming weak or even transparent, losing the original toughness and elasticity of the intestine; Figure D is a typical picture of small intestinal wall bleeding and thinning. The appearance characteristics of small intestinal wall bleeding and thinning are mainly manifested in the intestinal wall turning red due to bleeding, the intestinal wall becoming thin and transparent, and losing its normal Tough and elastic; Figure E is a typical picture of small intestinal wall hyperplasia. The appearance characteristics of small intestinal wall hyperplasia are mainly manifested as thickening of the intestinal wall, the intestinal tube is shaped like a soft water pipe, the surface is uneven, and it is rough or granular; Figure F is a typical picture of small intestinal mucosal hyperplasia. The appearance characteristics of small intestinal mucosal hyperplasia are mainly manifested as thickening of the mucosal surface, the mucosal surface becomes uneven, and longitudinal and transverse wrinkles can be seen; Figure G is a typical image of small intestinal mucosal hemorrhagic hyperplasia. The appearance characteristics of small intestinal mucosal hemorrhagic hyperplasia are mainly manifested as red or dark red mucosa, thickening of the mucosal layer, rough and uneven mucosal surface, and the appearance of transverse or longitudinal wrinkles; Figure H is a typical image of small intestinal mucosal bleeding. The appearance characteristics of small intestinal mucosal bleeding are mainly manifested as bright red or dark red dots, sheets or diffuse bleeding foci on the mucosal surface.
[0039] 1.1.3 Data preprocessing:
[0040] The image data set was expanded by rotating and mirroring at different angles. Mask RCNN training must use a labeled training set. The present invention uses Labelme software to manually label diseases, and the data outside the label is regarded as background.
[0041] 1.2 Identification Framework:
[0042] The overall structure of the recognition framework proposed by the present invention is as follows Figure 2As shown in the figure. The process starts with the acquisition of small intestine images. The images are first processed by Mask RCNN. The main task is to detect and segment the target area in the small intestine image to obtain refined segmentation data. Next, the segmented image data is further analyzed using a convolutional neural network (CNN), focusing on extracting disease-related lesion features. These features are derived based on the depth information of the image and are used in subsequent diagnostic steps.
[0043] At the same time, the system also collects relevant case information, which is encoded and converted into a format that can be recognized and used by machine learning models. In this process, lesion characteristics and case information are processed separately as two parallel data sources, and finally integrated in the information merging link, combining image data with case data.
[0044] Next, the combined information is comprehensively analyzed through the trained machine learning model. The model will learn and identify possible disease types based on the input images and case features. Finally, the system gives a disease diagnosis result based on these multimodal information, realizing intelligent diagnosis of small intestinal diseases. The entire process effectively combines image processing, deep learning and traditional case information analysis, making the diagnosis more accurate and efficient.
[0045] 1.3 Key technologies:
[0046] 1.3.1Mask RCNN:
[0047] Mask RCNN is an advanced deep learning framework that is widely used in object detection and instance segmentation. It is an extension of Faster RCNN, adding a branch for generating object segmentation masks, so that each detected object can not only be identified, but also be segmented in detail to the pixel level. The entire model first extracts features from the input image through a deep convolutional neural network, and uses multiple layers of convolution and nonlinear activation functions to learn hierarchical feature representations. These features contain important information in the image and are very important for subsequent object detection and segmentation. After the feature map is generated, the region proposal network (RPN) is responsible for generating candidate regions on the feature map, usually called "anchor boxes". RPN generates multiple anchor boxes on the feature map by sliding windows, and uses a deep learning model to perform binary classification on each anchor box to determine whether it contains an object, and performs bounding box regression to accurately adjust the position and size of the anchor box. The loss function of RPN can be expressed as:
[0048] L RPN =L cls (p,p * )+λL reg (t,t * ) (1)
[0049] Among them, L cls (p,p * ) is the classification loss, L reg (t,t * ) is the bounding box regression loss, p is the predicted class probability, and p * is the true category label, t is the predicted bounding box regression value, and t * is the true bounding box regression value, and λ is a hyperparameter used to balance the classification loss and regression loss. In order to overcome the shortcomings of traditional ROIPooling in feature alignment, Mask RCNN introduced the ROIAlign operation to ensure that the extracted features maintain high resolution in space, thereby improving segmentation performance. The key to ROIAlign is to accurately extract features through bilinear interpolation. The formula is as follows:
[0050]
[0051] in, is the extracted feature, f(x′,y) is the feature value of a point in the feature map, R is the set of pixels in the candidate region, and bilinear(x,y; x′,y′) is the bilinear interpolation function. In each ROI, the loss of the segmentation mask is calculated as follows:
[0052]
[0053] Among them, L mask is the segmentation mask loss, N is the total number of pixels, and y i is the true mask label (1 or 0), is the predicted mask value. Ultimately, the total loss function of Mask RCNN is the weighted sum of the losses of each component, which can be expressed as:
[0054] L=L RPN +L cls +L mask (4)
[0055] The uniqueness of Mask RCNN lies in its triple branch structure. In addition to classification and bounding box regression, the model adds a segmentation mask branch to generate a binary mask for each candidate region, representing the specific shape of the object. This branch is processed by a fully convolutional network (FCN), and the output mask has the same spatial resolution as the candidate box, allowing the model to generate high-quality object segmentation results.
[0056] Mask RCNN performs well on multiple large datasets such as COCO and PASCAL VOC. Its flexibility enables it to handle a variety of complex scenes, including multi-object occlusion, background interference and other problems. In addition, Mask RCNN also has good scalability and can be combined with other deep learning models to adapt to more complex visual tasks.
[0057] 1.3.2CNN model:
[0058] Convolutional neural networks recognize features by simulating the way the human brain processes images. They are mainly composed of alternating convolutional layers and pooling layers, and usually also include fully connected layers. The convolutional layer divides the image into small blocks to capture local features and extracts rich information through different filter sizes, types, padding, and step sizes. The pooling layer extracts feature combinations to make the model more robust to small changes in the image, reduce overfitting and improve generalization capabilities. The fully connected layer integrates the extracted features to classify the image into different categories. The present invention selects five classic CNN models: AlexNet, DenseNet, GoogleNet, ResNet, and VGGNet.
[0059] AlexNet is a classic convolutional neural network (CNN) that achieved remarkable success in the 2012 ImageNet Challenge, marking a breakthrough in deep learning in the field of computer vision. The model consists of multiple convolutional layers, pooling layers, and fully connected layers, mainly including five convolutional layers and three fully connected layers. AlexNet uses larger convolution kernels and overlapping maximum pooling layers to effectively extract features from images, while using the ReLU activation function to accelerate network training and improve nonlinear representation capabilities. In addition, AlexNet also introduced the local response normalization (LRN) technology to enhance the generalization ability of the model. During the training process, AlexNet used data enhancement and Dropout techniques to reduce overfitting. This design enables AlexNet to perform well in processing complex image data, successfully capturing rich features from edges, textures to complex patterns.
[0060] The core design concept of DenseNet (Dense Convolutional Network) is to improve information flow and feature reuse by introducing dense connections. DenseNet consists of multiple dense blocks, each of which contains multiple convolutional layers, and establishes direct connections between each layer. This connection method enables each layer to receive the feature maps of all previous layers, thereby effectively reducing the gradient vanishing problem and improving the efficiency of feature transmission. In DenseNet, although the connection is increased, it actually reduces the amount of parameters required because each layer does not need to repeat the learned features. By using fewer filters and smaller network width, the model can learn features in the image more efficiently, from simple edges to complex shapes, significantly improving the performance of image classification tasks, especially when processing complex data sets, showing excellent generalization and robustness.
[0061] GoogleNet is an innovative convolutional neural network. Its core idea is to use the Inception module to implement parallel computation of convolution kernels of different sizes, thereby effectively capturing multi-scale features in images. The structure of GoogleNet consists of multiple Inception modules, each of which contains multiple convolution operations, such as 1×1, 3×3, and 5×5 convolutions, and combines these features through pooling layers. This design not only enhances the expressive power of the model, but also greatly reduces the number of parameters and improves computational efficiency. In addition, GoogleNet also introduces a global average pooling layer to replace the traditional fully connected layer, which effectively reduces the risk of overfitting and simplifies the model structure. Overall, GoogleNet, with its unique Inception structure and efficient parameter utilization, performs well in image classification and target detection tasks, and promotes the further development of deep learning technology in the field of computer vision.
[0062] The core concept of ResNet (residual network) is to build a very deep network by introducing a residual learning framework. The main innovation of ResNet is the use of skip connections, which allows the network to directly pass inputs to subsequent layers, which can effectively solve the gradient vanishing and gradient exploding problems that occur as the network depth increases. Each residual unit is usually composed of multiple 3×3 convolutional layers. While these convolutional layers extract image features, the skip connections allow the input and output to be added, allowing the network to learn residual mapping. This structure not only improves training efficiency, but also enhances the robustness of the network, allowing ResNet to train deep models with hundreds or even thousands of layers, thereby achieving excellent performance in image recognition and object detection tasks.
[0063] VGGNet is known for its simple and unified structure. The design of VGGNet consists of multiple convolutional layers, which mainly use 3×3 convolution kernels, and the layers are connected through the maximum pooling layer. This design not only makes the feature extraction process of the model more detailed, but also makes the hierarchical structure of the network deeper. VGGNet is characterized by its depth, usually with 16 or 19 trainable layers, and the gradually increasing number of convolution kernels enables the model to capture rich information from low-level features to high-level features. This unified structure and layer-by-layer deepening design enable VGGNet to perform well in various image recognition tasks, especially when faced with complex image data, it can effectively extract detailed feature information and improve the recognition ability and generalization performance of the model.
[0064] 1.3.3 Machine Learning Model
[0065] Machine learning is a technology that enables computers to learn and improve autonomously through data-driven, so that computer systems can behave intelligently when faced with complex problems. It builds models by analyzing large amounts of data, extracting patterns and rules. These models can be used for prediction, classification or decision-making. Machine learning includes supervised learning, unsupervised learning and reinforcement learning, and is widely used in the fields of recognition and analysis. The present invention selects five machine learning models: NB, KNN, SVM, RF and XGBoost.
[0066] Naive Bayes (NB) is a supervised learning model based on Bayes' theorem. Its core idea is to classify new samples by calculating the class probability under given feature conditions
[27] . The NB model assumes that features are independent of each other, which simplifies the calculation process and remains efficient on large-scale data sets. Although this independence assumption may not hold in some cases, NB still shows excellent classification performance in many practical applications, especially in high-dimensional sparse data such as text data and feature selection problems. Its simplicity and speed make NB one of the benchmark models, suitable for rapid prototyping and preliminary analysis.
[0067] K-nearest neighbor (KNN) is an instance-based supervised learning model. Its core idea is to classify new samples into the majority category of its K nearest neighbors by calculating the distance between the new sample and the training sample. KNN performs well when processing small-scale data sets. Although it is easy to understand and implement, as the amount of data increases, the computational complexity and memory requirements of KNN also increase significantly, which may lead to a decrease in efficiency. KNN is very flexible in practical applications and is suitable for a variety of fields, but it may be affected by the "curse of dimensionality" in high-dimensional data, affecting the prediction effect.
[0068] Support vector machine (SVM) is a supervised learning model, the core idea of which is to separate data points of different categories by constructing a hyperplane. The key to SVM lies in its strategy of maximizing the margin, that is, selecting a hyperplane that maximizes the distance from the nearest support vector point to the hyperplane. To handle nonlinearly separable data, SVM introduces the kernel technique, which allows calculations to be performed in a high-dimensional feature space, thereby mapping complex decision boundaries to a linearly separable space. This flexibility makes SVM perform well in many applications, especially in scenarios with small samples and high-dimensional data, providing good classification performance and generalization capabilities.
[0069] Random Forest is an ensemble learning method that improves the accuracy and stability of the model by building multiple decision trees and combining their output results. Each tree is trained on a randomly selected subset of data and features. This randomness enables Random Forest to reduce overfitting while enhancing the robustness of the model. Finally, Random Forest integrates the prediction results of each tree by voting or averaging to obtain the final output. Due to its strong tolerance to data noise and outliers, Random Forest performs well in many fields, especially when dealing with complex data sets and high-dimensional features. It can effectively capture the potential patterns in the data and provide stable prediction performance.
[0070] XGBoost is an efficient gradient boosting decision tree model. Its core idea is to gradually build multiple weak learners (decision trees), combine their outputs, and optimize the loss function to improve the overall prediction performance
[31] . XGBoost introduces a regularization term to effectively reduce overfitting, and improves the accuracy and robustness of the model through fine processing of feature splitting. Due to its efficient computing and memory optimization, XGBoost performs well in large-scale data sets and complex problems, and is suitable for processing nonlinear relationships and high-dimensional features.
[0071] 2. Results and analysis:
[0072] 2.1 Experimental environment and evaluation criteria:
[0073] In the present invention, the performance of the model is evaluated by the detection rate, accuracy, precision, recall rate and F1 score of the model. These evaluation indicators can intuitively display the performance of the model and facilitate comparison of different methods. The evaluation indicator formulas are (5)-(9).
[0074]
[0075]
[0076] Among them, TP is true positive, which refers to the number of samples correctly predicted as positive by the model, TN is true negative, which refers to the number of samples correctly predicted as negative by the model, FP is false positive, which refers to the number of samples incorrectly predicted as positive by the model, and FN is false negative, which refers to the number of samples incorrectly predicted as negative by the model. The detection rate is the detection rate of whether the disease is diseased calculated without considering whether the disease type is correctly classified. It directly reflects the proportion of diseased samples detected by the model among all actually diseased samples. This indicator is particularly important in the field of disease diagnosis. Accuracy is a very intuitive evaluation standard that takes into account all types of results and directly measures the overall prediction effect of the model. Precision focuses on how many samples predicted as positive by the model are truly positive. A high precision means that the model is more reliable when predicting positive, and the false positive rate (FP) is low. Recall rate refers to the proportion of all samples that are actually positive that are correctly identified as positive by the model. It is sensitive to false negatives. However, a model with a high recall rate is not necessarily the best model. Other indicators must be combined to evaluate the overall performance of the model. The F1 score is the weighted harmonic mean of precision and recall, which is used to find a balance between precision and recall. The value range is between 0 and 1, where 1 means that both the precision and recall of the model are optimal.
[0077] 2.2Mask rcnn recognition results:
[0078] In order to better classify the features of small intestinal lesions, the present invention uses the Mask RCNN network to segment and extract the small intestinal lesion part in the small intestinal image for subsequent classification tasks. Mask RCNN is good at processing image segmentation problems. It can simultaneously identify and segment targets, which makes it very suitable for processing complex structures in small intestinal images. In the present invention, in order to improve the detection rate of Mask RCNN for small intestinal lesion areas, the number of classification categories of lesion images is gradually reduced. The classification relationship of pig small intestinal lesion images is as follows: Figure 3 The segmentation results are shown in Table 1.
[0079] First, the characteristics of small intestinal lesions were preliminarily classified into eight categories: small intestinal serosal congestion, small intestinal wall bleeding, small intestinal wall thinning, small intestinal wall thinning with bleeding, small intestinal wall hyperplasia, small intestinal mucosal hyperplasia, small intestinal mucosal hemorrhage and hyperplasia, and small intestinal mucosal bleeding. However, in the preliminary experiment, the detection rate of the model was only 35.21%, which was not ideal. The study found that due to the similarity of images between some categories, it was difficult to distinguish, resulting in a low overall performance of the model.
[0080] To solve this problem, we simplified the lesion feature categories. The lesion feature categories were reduced to 6 categories, that is, small intestinal mucosal hemorrhage and hyperplasia were merged into the small intestinal mucosal hyperplasia lesion feature, and small intestinal wall hemorrhage and thinning were merged into the small intestinal wall hemorrhage lesion feature. Under this classification method, the detection rate of the model was significantly improved to 66.20%, indicating that the simplified categories help improve the model's ability to distinguish.
[0081] Furthermore, we continued to simplify the categories and reduced the lesion feature categories to 3 categories, and merged the small intestinal serosal congestion, small intestinal wall hemorrhage, small intestinal wall thinning, and small intestinal wall hyperplasia into uncut small intestinal wall lesions. In this case, the detection rate of the model reached 94.30%. This shows that by reasonably reducing the categories, the performance of the model in processing small intestinal lesion images has been significantly improved.
[0082] In the final experiment, although the classification of small intestinal lesion features into three categories achieved a high detection rate, it still could not meet the precise requirements for category distinction in subsequent tasks. Therefore, we decided to combine the CNN network for more detailed classification in the future to further improve the recognition ability of the model.
[0083] Table 1 Mask RCNN detection rate under different number of categories
[0084]
[0085] 2.3CNN recognition results:
[0086] After the image data was segmented by Mask RCNN, an image containing only the small intestine area was obtained, removing the interference of the background. The segmented image was then input into multiple classic convolutional neural networks (CNNs) for more detailed disease classification. Specifically, the disease categories were compared according to 6 categories (congestion, thinning, mucosal bleeding, mucosal hyperplasia, small intestinal hyperplasia, small intestinal bleeding) and 8 categories (congestion, thinning, mucosal bleeding, mucosal hyperplasia, small intestinal hyperplasia, small intestinal bleeding, bleeding + thinning, bleeding + hyperplasia).
[0087] To achieve this goal, the present invention selected five classic CNN models, namely AlexNet, DenseNet, GoogleNet, ResNet and VGGNet. The main purpose of the experiment is to classify the segmented small intestine images through these models, and compare the results with the classification effects of the images before segmentation to explore the effect of segmentation on improving the classification accuracy. The research results are shown in Tables 2 and 3, showing the performance differences of the images before and after segmentation in different models.
[0088] The experimental results show that after segmentation, the classification accuracy of all CNN models has been improved. In general, the classification effect of segmented images is better than that of pre-segmented images, especially when the disease categories are simplified to 6 categories, the classification accuracy reaches a new high. In all experiments, the best performing models are DenseNet and GoogleNet. On the segmented small intestine images, GoogleNet has an accuracy of 96.74% in 8 categories and 97.67% in 6 categories. DenseNet has an accuracy of 95.81% in 8 categories and 96.74% in 6 categories.
[0089] When comparing the experimental results of the images before segmentation, the classification accuracy of the CNN models is generally low. For example, the accuracy of AlexNet in the 8-category classification task before segmentation is only 74.53%, while the performance of ResNet and VGGNet is only 73.58% and 79.72%. DenseNet and GoogleNet are still the most outstanding, and these two models are particularly suitable for the fine classification of small intestinal diseases.
[0090] Table 2 Disease classification results of different CNN models before segmentation
[0091]
[0092]
[0093] Table 3 Disease classification results of different CNN models after segmentation
[0094]
[0095] 2.4 Case Identification Results
[0096] The case features are converted into a format that can be input for machine learning through information encoding, fused with the image features identified by CNN, and passed to machine learning as training data, wherein the image information identified by CNN uses the feature information identified when the disease is divided into 8 categories and 6 categories respectively. After the machine learning model is trained, it can perform comprehensive recognition based on the input image and case information and determine the final disease type. In the present invention, experiments compare multiple machine learning types, including NB, KNN, SVM, RF and XGBoost.
[0097] The classification results of various machine learning are shown in Table 4. Random Forest (RF) has the highest accuracy and F1 score regardless of whether it uses the feature information identified in the 8-category or 6-category tasks, highlighting its strong generalization ability. In addition, KNN and SVM also perform well in overall accuracy, and NB has the worst classification effect. In general, the effect of most models using 8-category identification information is slightly better than that using 6-category identification information.
[0098] Table 4 Machine learning classification results
[0099]
[0100] About the effectiveness of Mask RCNN:
[0101] The key role of Mask RCNN in the present invention is that it improves the accuracy of small intestinal lesion image classification, especially when combined with the CNN model. Compared with directly classifying the original unsegmented image, the classification accuracy of the model is significantly improved by using the segmented image for training and testing. This is because the segmented image reduces the interference of complex background information and irrelevant parts, allowing the CNN model to more accurately identify and classify lesion features. Compared with the method of directly using CNN to extract image information for ML classification, the method of the present invention first undergoes segmentation processing to achieve better results.
[0102] When processing complex images, the optimization of Mask RCNN segmentation not only improves the image quality, but also provides a better foundation for subsequent fine classification, allowing CNN to process the lesion area more efficiently and achieve better classification results.
[0103] On the effectiveness of CNN:
[0104] In the present invention, the CNN model shows good performance in disease classification of segmented small intestine images. This is because CNN can focus on the lesion area to learn its deeper feature information. Through these key areas, CNN can learn the detailed features of the lesion site and extract more discernible deep information, such as shape, color and texture. This learning method makes CNN more accurate in identifying disease characteristics and can distinguish subtle differences in lesion areas, thereby significantly improving the model's ability to identify different types of disease characteristics and classification accuracy. In particular, deep learning models such as DenseNet and GoogleNet can show higher accuracy and stronger feature extraction capabilities when processing fine classification tasks.
[0105] By using CNN for fine-grained classification, the model can not only identify more lesion types, but also make more accurate judgments between multiple categories. Therefore, CNN further improves the classification accuracy in the present invention and fully proves its high efficiency in image classification.
[0106] On the effectiveness of machine learning:
[0107] Combining feature information with traditional machine learning methods further enhances the performance of disease classification. In the present invention, RF can provide high accuracy and good F1 score whether using CNN feature information of 8 categories or 6 categories, showing its excellent generalization ability and adaptability to complex data. The accuracy of the RF model in the 8-category task is 87.97%, and the accuracy in the 6-category task is 86.47%. Its overall performance is ahead of other machine learning models, and it shows high stability in identifying different diseases. Other machine learning models, such as KNN and SVM, also perform well in classification accuracy.
[0108] In the case of complex data and many categories, machine learning models are able to better learn and distinguish the characteristics of different lesions. This is because they can automatically extract useful patterns from the data and identify the differences between different categories. Especially in high-dimensional feature space, machine learning algorithms can improve the classification and generalization capabilities of multi-category lesions by optimizing and adjusting model parameters, thereby effectively distinguishing disease categories.
[0109] The present invention is described with reference to flowcharts and / or block diagrams of methods, devices (systems), and computer program products according to embodiments of the present invention. It should be understood that each process and / or block in the flowchart and / or block diagram, as well as the combination of processes and / or blocks in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing device to produce a machine, so that the instructions executed by the processor of the computer or other programmable data processing device generate instructions for implementing the processes in the flowchart and / or block diagram. Figure 1 A process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.
[0110] In the description of the present invention, it should be understood that the terms "first" and "second" are used for descriptive purposes only and should not be understood as indicating or implying relative importance or implicitly indicating the number of the indicated technical features. Thus, a feature defined as "first" or "second" may explicitly or implicitly include one or more of the features. In the description of the present invention, the meaning of "plurality" is two or more, unless otherwise clearly and specifically defined.
[0111] Obviously, those skilled in the art can make various changes and modifications to the present invention without departing from the spirit and scope of the present invention. Thus, if these modifications and variations of the present invention fall within the scope of the claims of the present invention and their equivalents, the present invention is also intended to include these modifications and variations.
Claims
1. A method for diagnosing pig digestive tract diseases based on deep learning, characterized in that: The following steps are involved: The datasets were collected using porcine epidemic diarrhea, porcine transmissible gastroenteritis, porcine proliferative enteropathy, yellow diarrhea in piglets, white diarrhea in piglets, and clostridial enteritis in piglets as disease cases; Based on the Mask RCNN model, convolutional neural network and machine learning model, a combined model is constructed, the model is trained through the data set, and a diagnostic model is constructed for diagnosing pig digestive tract diseases.
2. According to claim 1, a method for diagnosing pig digestive tract diseases based on deep learning, characterized in that: In the process of acquiring the data set, images with at least one small intestinal lesion feature of small intestinal serosal congestion, small intestinal wall bleeding, small intestinal wall thinning, small intestinal wall thinning with bleeding, small intestinal wall hyperplasia, small intestinal mucosal hyperplasia, small intestinal mucosal hemorrhagic hyperplasia and small intestinal mucosal bleeding are collected as the data set.
3. According to claim 2, a method for diagnosing pig digestive tract diseases based on deep learning, characterized in that: In the process of acquiring the data set, the collected images are expanded by using rotations and mirror flips at different angles and the small intestinal lesion features are marked to form the data set.
4. According to claim 3, a method for diagnosing pig digestive tract diseases based on deep learning is characterized in that: In the process of building the combined model, the Mask RCNN model is used to segment the lesion area of the image.
5. According to claim 4, a method for diagnosing pig digestive tract diseases based on deep learning is characterized in that: In the process of constructing the combined model, features of the segmented image lesion area are extracted through a convolutional neural network, wherein the convolutional neural network is one of AlexNet, DenseNet, GoogleNet, ResNet and VGGNet.
6. A method for diagnosing pig digestive tract diseases based on deep learning according to claim 5, characterized in that: In the process of selecting the convolutional neural network, one of DenseNet and GoogleNet is selected as the convolutional neural network to perform feature extraction on the segmented image lesion area.
7. A method for diagnosing pig digestive tract diseases based on deep learning according to claim 6, characterized in that: In the process of constructing the combined model, based on the features extracted by the convolutional neural network and the fusion of case information, the final disease classification is performed through the machine learning model to complete the identification of pig digestive tract diseases, wherein the machine learning model is one of NB, KNN, SVM, RF and XGBoost.
8. A method for diagnosing pig digestive tract diseases based on deep learning according to claim 7, characterized in that: In the process of selecting a machine learning model, random forest RF is selected as the machine learning model.
9. A method for diagnosing pig digestive tract diseases based on deep learning according to claim 8, characterized in that: In the process of selecting a machine learning model, you can also select one of KNN and SVM as the machine learning model.
10. A deep learning-based pig digestive tract disease diagnosis system, characterized in that: The system is used to implement a method for diagnosing pig digestive tract diseases based on deep learning as described in claims 1-9, and the system comprises: The data collection module is used to collect data sets based on porcine epidemic diarrhea, porcine transmissible gastroenteritis, porcine proliferative enteropathy, yellow diarrhea of piglets, white diarrhea of piglets and clostridial enteritis of piglets as epidemic disease cases; The diagnostic model building module is used to build a combined model based on the Mask RCNN model, the convolutional neural network and the machine learning model, train the model through the data set, and build a diagnostic model for diagnosing pig digestive tract diseases.