Differentiation of common histological lesions in bovine liver using convolutional neural network-based deep learning Authors: Susumu Iwaide, Kumiko Kimura, Ryo Sugiura, Yu Oishi, Tomoyuki Shibahara Published: 2026 ABSTRACT AbstractBackground:Liver lesions occur in livestock due to various causes, including infection and poisoning. Liver diseases can affect multiple organs, making accurate and efficient pathological diagnosis essential. Therefore, a model capable of automatically classifying various lesions could assist in diagnosis.Aim:This study aimed to classify common lesions in bovine livers—lymphoma, necrosis, and fibrosis—using deep learning based on a convolutional neural network to develop a potential pathological diagnosis support model.Methods:We prepared 10 bovine cases for four groups: lymphoma, necrosis, fibrosis, and normal liver. After scanning the slides as whole slide images, we divided the images into patches and collected 50 patches per slide containing the target tissue. The patches were split into 2 groups: training cross-validation (80%) and test (20%) groups. A DenseNet-based convolutional neural network was trained via cross-validation, and its performance was evaluated with the test set.Results:The model achieved a classification accuracy of 84.5% on the test data with an average F1-score of 83.5% across the four labels. The precision and recall for each label were 92.6% and 50% (lymphoma), 95.8% and 92.0% (necrosis), 89.8% and 97.0% (fibrosis), and 69.7% and 99.0% (normal liver), respectively.Conclusion:Image classification using a deep learning model based on a convolutional neural network showed promising performance for classifying common lesions in bovine livers, particularly necrosis and fibrosis. However, further improvement is required for reliable lymphoma detection.Keywords: Cattle, Convolutional neural network, Digital pathology, Liver, Machine learning Introduction Livestock are affected by various diseases, including infectious diseases, poisoning, and tumors. Given that the liver receives 70%–80% of its blood flow via the portal vein and plays a central role in detoxification, it is particularly susceptible to lesions caused by poisoning or infection (Cullen and Stalker, 2015). Proliferative lesions in the liver include both primary and metastatic tumors, with metastatic lymphoma being the most common in cattle (Cullen et al., 2017), while necrosis and fibrosis represent frequent pathological responses to infection, toxins, or chronic injury with substantial implications for animal health and productivity. Diagnosis of diseased animals integrates multiple analyses, including clinical examination, blood tests, and pathogen detection. Histopathological analysis plays a key role in identifying microscopic tissue changes. Since it generally takes time to become proficient in pathological analysis, it is important to develop a model that improves diagnostic efficiency and supports pathologists to improve accuracy. In recent years, advances in whole slide imaging and artificial intelligence (AI) have accelerated the development of AI models for histopathology. AI algorithms for advanced image analysis have the potential to improve reproducibility (McGenity et al., 2024). AI models can predict image labels (image classification), identify specific elements at the object level (object detection), and assign labels to each pixel (segmentation) in histopathology. In human pathology, models such as convolutional neural networks (CNNs) and recurrent neural networks have been developed (McGenity et al., 2024). Although AI models have seen significant development in human pathology, particularly for proliferative diseases, their application to non-proliferative conditions remains limited (Martin et al., 2020). In veterinary pathology, AI research has primarily focused on companion animals for tumor differentiation (Fragoso-Garcia et al., 2023; Ii et al., 2024). To the best of our knowledge, there is a clear gap in the application of AI to improve the efficiency of pathological diagnosis in livestock, which are affected by a wide range of conditions, including infectious diseases, poisoning, and proliferative lesions. In this study, we aimed to develop a CNN to classify tissue images of common lesions in cattle livers to improve the efficiency of pathological diagnosis in livestock. The model automatically classified each tissue image patch into common histological lesions: lymphoma, necrosis, fibrosis, or normal liver, and its performance was evaluated. Materials and Methods Dataset The sample size was determined by the number of cases that met the inclusion criteria described later. A total of 44 bovine liver samples were obtained from existing archives in Japan, comprising 11 cases of hepatic lymphoma, 13 cases of hepatocellular necrosis, 10 cases of hepatic fibrosis, and 10 normal livers without any detectable lesions. However, one case of lymphoma and 3 cases of necrosis were excluded due to significant artifacts in the tissue specimens (described later). Diseased cases for model development were obtained from archives presented at periodical slide conferences in Japan, including the Annual Pathology Slide Seminars in the Animal Hygiene Workshop, Annual Seminars on Histopathological Diagnosis held by Kyushu Research Station of National Institute of Animal Health (NIAH), National Agriculture and Food Research Organization (NARO), and Annual Seminars on Histopathological Diagnosis in the Tohoku District, as well as from the diagnostic archives of the Gunma Livestock Health Laboratory, Tottori Prefectural Livestock Hygiene Service Center, and Tokushima Prefectural Livestock Hygiene Service Center. For each case, one hematoxylin and eosin (H&E)-stained specimen was prepared from formalin-fixed paraffin-embedded (FFPE) sections and used for model development. Specimens were prepared by personnel at NIAH or prefectural livestock hygiene centers across Japan. At the time of initial diagnosis, all cases were diagnosed by trained personnel, incorporating clinical analysis, special staining, immunohistochemistry, and pathogen screening. Briefly, the necrosis cases included 2 Daphniphyllum macropodum poisoning-affected cattle and 8 infected cattle. The fibrosis cases included congenital and acquired pathologies. All cases contained moderate to severe histological lesions. Detailed case information is provided in Supplementary Table 1. Table 1.Number of cases and images in the experiment.TotalTraining*TestCasesImagesCasesImagesCasesImagesLymphoma1050084002100Necrosis1050084002100Fibrosis1050084002100Normal liver1050084002100Total402,000321,6008400*GroupKFold cross-validation was performed for model training. Number of cases and images in the experiment. *GroupKFold cross-validation was performed for model training. For this study, weakly stained specimens were restained with H&E in the authors’ laboratory (NIAH) to ensure adequate staining. Specimens were scanned at × 40 magnification using a NanoZoomer S60 (Hamamatsu Photonics K.K., Hamamatsu, Japan) to generate whole slide images (WSIs). In one case of lymphoma and three cases of necrosis, poor-quality slides (e.g., those showing extensive artifacts such as tissue folds) were observed and excluded. The reference diagnosis for all lesions was reviewed and confirmed by a veterinary pathologist licensed by the Japanese College of Veterinary Pathologists (SI). Diagnostic discrepancies were not identified between the initial diagnoses and the assessments of the reference pathologist. Figure 1 shows the representative H&E images used in this study. Cases showing infiltration and proliferation of tumor cells between hepatocytes or masses adhering to the liver surface due to dissemination were selected for hepatic lymphoma. For necrosis, cases with multifocal or diffuse hepatocyte necrosis were selected; in some cases, the cause of death, such as infection or poisoning, was identified (Supplementary Table 1). Cases with extensive fibrosis in the perisinusoidal space of the liver were selected for hepatic fibrosis. Representative liver tissue. (A-D) Image patches of lymphoma (A), necrosis (B), fibrosis (C), and normal liver (D). Each patch is a square measuring 147 μm on each side. Sample preparation Because the size of a WSI is large (114,822 × 96,432 pixels) and GPU memory limitations prevented it from being fed directly into the model, training was performed using image patches extracted from the WSIs. Each WSI was divided into 665 × 665 pixel (147 × 147 µm2) square patches at 4.52 pixels/µm using the NDP toolkit (Hamamatsu Photonics K.K.). This pixel size was chosen to ensure that each patch sufficiently captures the spatial relationships between cells and the surrounding tissue architecture. We excluded patches with a white background at the tissue edge or containing more than 50% vascular cavity. Necrosis patches with significant fibrosis were excluded to avoid mixed or ambiguous histopathological patterns, allowing the model to learn the representative features of each disease category. A total of 2,000 patches were collected, with 50 patches per WSI. From these, 400 image patches derived from eight randomly selected cases per label (80%) were used for cross-validation, and the remaining patches from two cases per label (20%) were reserved as an independent test dataset (Table 1). Model construction Figure 2 shows the workflow of this study. For model development, GroupKFold cross-validation was implemented in scikit-learn (Pedregosa et al., 2011) to ensure that image patches from the same WSI were not simultaneously included in both training and validation sets. For cross-validation, all images were randomly divided into 5 folds. First, we evaluated DenseNet (Huang et al., 2017), ResNet-18 (He et al., 2015), VGG-16 (Simonyan and Zisserman, 2015), and Vision Transformer (Dosovitskiy et al., 2021) using a limited dataset to determine the most suitable architecture for our dataset. DenseNet achieved the highest validation accuracy. Therefore, a CNN with a DenseNet architecture was used to develop the model. Workflow of this study. Pathologists diagnosed slides from 40 cases with 4 labels (Step 1) and scanned them as whole-slide images (Step 2). Fifty image patches were extracted for each case (Step 3). The image patches were allocated to the cross-validation and test datasets (Step 4). Models were trained with cross-validation data (Step 5), and the test data performance was evaluated (Step 6). All image patches were resized to 224 × 224 pixels before analysis. Image patches were grouped based on case number (Supplementary Table 1), and a separate model was trained and saved for each fold. During training, a mini-batch of 32 images was loaded per iteration. Horizontal and vertical flipping were applied independently to each training image as a preprocessing step with a probability of 0.5. Training was performed using the Adam optimizer for up to 10 epochs with an initial learning rate of 1 × 10-3. When validation accuracy did not exceed its previous maximum for 5 consecutive epochs (patience = 5 epochs), early stopping was applied. Given the short training schedule, no learning rate scheduling was used. After cross-validation, the 5 trained models were used to label all test data, and the final predictions were obtained using a soft voting ensemble, in which the predicted class probabilities from each model were averaged. If the predicted label matched the predetermined label, it was considered correct; otherwise, it was counted as a false positive or false negative. Model performance was assessed by calculating accuracy, precision, recall, and F1-score. The model was implemented in PyTorch version 2.3.1+cu121 and trained on the “Shiho” high-performance computer at NARO. Ethical approval Normal liver samples, showing no microscopic lesions, were selected from archives of previously performed animal experiments at NIAH, NARO, conducted according to the regulations and guidelines of the Animal Ethics Committee of NIAH, NARO (protocols 17-027, 17-078, 18-006, 18-021, and 18-022). Results and Discussion Supplementary Table 2 shows the training history of the five models during cross-validation. The best accuracies for each fold were 0.9371, 0.7143, 0.6567, 0.8067, and 0.9000, respectively. In addition, the accuracy of the model was evaluated using test data, with the results summarized in Table 2. The overall accuracy was 84.5%. Precision and recall for each label were as follows: 92.6% and 50% (lymphoma), 95.8% and 92.0% (necrosis), 89.8% and 97.0% (fibrosis), and 69.7% and 99.0% (normal liver), respectively. Figure 3 shows the confusion matrix, and the average F1-score across the 4 labels was 83.5%. These results suggest that the developed model may have potential as a supportive tool for classifying lymphoma, necrosis, fibrosis, and normal liver in bovine livers. Table 2.Results of model evaluation (test).Precision (%)Recall (%)F1-score (%)SupportLymphoma92.650.064.9100Necrosis95.892.093.9100Fibrosis89.897.093.3100Normal liver69.799.081.8100Average87.384.583.5400Accuracy––84.5400 Results of model evaluation (test). The confusion matrix of the four-class classification model. The vertical and horizontal axes represent the true and predicted labels, respectively. Each cell shows the number of samples classified into each category; diagonal elements correspond to correctly classified samples. The darker color in each cell indicates higher counts, as shown in the right-hand scale. In previously reported disease classification tasks in which machine learning is applied to animal pathology, most studies use proliferative lesion diagnoses as labels (Fragoso-Garcia et al., 2023; Ii et al., 2024). In proliferative diseases, the classification of structures such as tumor cells in tissue sections often directly informs diagnosis. However, non-proliferative lesions, including infectious diseases or poisoning, account for several cases of livestock pathology. Diagnosing non-proliferating lesions requires careful interpretation of tissue changes (inflammation, degeneration, and necrosis). Therefore, a model capable of automatically classifying tissue lesions could support diagnosis and efficiently train veterinary pathologists with limited experience. In addition, in some diseases, identical necrotic lesions may contain disease-specific structures, such as hyphae (Jensen et al., 1994), which are important for diagnosis. Therefore, useful diagnostic support models could be developed by incorporating labels that reflect such etiological features. The lymphoma patch classification achieved a precision of 92.6%. This suggests that the model was able to learn images showing the uniform tumor cell clusters characteristic of lymphoma. However, the relatively low recall for lymphoma (50.0%) and precision for normal liver (69.7%) indicate that half of the lymphoma patches were misclassified, particularly as normal liver. There are two types of lymphoma in the liver: one occurs when tumor cells spread to the serosa, proliferating to form a mass, and the other occurs when tumor cells enter the liver via the bloodstream. Therefore, the low recall may be due to morphological similarities between infiltrative tumor cell proliferation and mild mononuclear cell infiltration in the Glisson’s sheath or perisinusoidal space of the normal liver (Fig. 4). Because precise classification of lymphoma based on liver histopathology with the current model is difficult, additional cases that include diverse image patterns must be accumulated to develop a more robust model. Representative image patches showing visually similar patterns from lymphoma (A) and normal liver (B). Each patch is a square measuring 147 μm on each side. Precision and recall for the labels necrosis and fibrosis ranged from 89.8% to 97.0%. This indicates that the model could learn the characteristic histopathological lesions of necrosis and fibrosis. Histopathologically, hepatic tissues affected by infectious agents or toxic substances exhibit distinct characteristics depending on disease progression. Tissue necrosis and acute inflammation occupy a wide area in acute conditions, whereas mononuclear cell infiltration and fibrosis develop over time in chronic conditions, eventually restoring normal liver architecture or progressing to hepatic fibrosis or scar formation, depending on the type and extent of injury (Cullen and Stalker, 2015). Bovine hepatic fibrosis occurs when hepatocyte injury is repeated due to poisoning or infection and is histologically characterized by significant fibrosis, lymphocyte infiltration, and bile duct hyperplasia (Van Wettere and Brown, 2021). Congenital hepatic fibrosis can occur in cattle without underlying disease (Bourque et al., 2001), making early diagnosis important for improving herd health management. A limitation of the present model is its difficulty in correctly classifying lymphoma and normal liver. Furthermore, to prepare datasets, necrosis patches with severe fibrosis were excluded to simplify the model. Another limitation is the small number of cases, which may reduce generalizability. High variation in the accuracy of each fold was observed in the cross-validation (0.6567–0.9371). That is, the sample size used in this study may not have been sufficient to construct a robust model. The accuracy of the model on previously unseen cases remains uncertain and warrants further investigation. Increasing the number of cases and images generally improves accuracy when encountering unknown samples. In the future, increasing the data set and enhancing image diversity—such as varying sample thickness and staining protocols—are expected to improve generalization and facilitate practical applications of the model. Conclusion In this study, we developed a CNN model to classify common lesions in bovine livers. The CNN model showed promising performance in classifying common lesions in bovine livers, particularly necrosis and fibrosis. However, further improvement is required for reliable lymphoma detection. Expanding the dataset, adding additional case categories, and increasing image diversity will enable the development of more practical models. Acknowledgments The authors would like to thank Ms Megumi Shimada for preparing the histological sections. The authors express their deep appreciation to Dr Tomokazu Yoshida for his technical assistance in developing the model. The authors would like to thank Dr Shozo Arai, Ms Tomomi Ozawa, Gunma Livestock Health Laboratory, Tottori Prefectural Kurayoshi Livestock Hygiene Service Center, and Tokushima Prefectural Livestock Hygiene Service Center for providing tissue samples. Funding The authors received no financial support for the research, authorship, and publication of this article. Authors’ contributions Susumu Iwaide: Conceptualization, Data Curation, Formal Analysis, Investigation, Methodology, Writing—Original Draft. Kumiko Kimura: Supervision, Validation, Writing—Review & Editing. Ryo Sugiura: Supervision, Software, Writing—Review & Editing. Yu Oishi: Supervision, Software, Writing—Review & Editing. Tomoyuki Shibahara: Project Administration, Supervision, Writing—Review & Editing. Conflicts of interest The authors declare no conflict of interest. Data availability The data that support the findings of this study are not openly available due to sensitivity reasons and are available from the corresponding author upon reasonable request. Supplementary Table 1.Case information of cattle in this study. No. Label Breed* Age** Histological diagnosis Diagnosis Allocation1LymphomaHolstein130dHepatic lymphomaHepatic lymphomaTraining2LymphomaHolstein6mHepatic lymphomaHepatic lymphomaTraining3LymphomaHolstein3mInfiltration and proliferation of T-cell-like lymphoid cells in liverHepatic lymphomaTraining4LymphomaHolstein5mHepatic B-cell lymphomaHepatic lymphomaTraining5LymphomaF19mHepatic lymphomaHepatic lymphomaTraining6LymphomaHolstein38mHepatic lymphomaHepatic lymphomaTraining7LymphomaHolstein70mHepatic lymphomaHepatic lymphomaTraining8LymphomaHolstein61mHepatic lymphomaHepatic lymphomaTraining9LymphomaHolstein2mHepatic lymphomaHepatic lymphomaTest10LymphomaHolstein7mInfiltration and proliferation of T-cell-like lymphoid cells in liverHepatic lymphomaTest11NecrosisJBNAHepatic centrilobular necrosis Daphniphyllum macropodum poisoningTraining12NecrosisJB6dHepatic multifocal necrosisZygomycete and Listeria monocytogenes infectionTraining13NecrosisHolsteinstillbirthHepatic multifocal necrosisBovine herpesvirus type 1 infectionTraining14NecrosisJB6dMultiple focal necrosis with thrombosis caused by Listeria monocytogenes serotype 4bListeriosis (septicemic type)Training15NecrosisHolstein43mMultiple focal necrosis caused by Listeria monocytogenes serotype 4bListeriosis (septicemic type)Training16NecrosisJB37dHepatic infarctionHepatic infarction, pulmonary thromboembolismTraining17NecrosisF114dHepatic multifocal necrosisSalmonellosisTraining18NecrosisJB17dNecrotizing vasculitis caused by Aspergillus species and multiple focal necrosis caused by Candida albicans with intranuclear inclusion bodies in the liverDeep fungal infections in calves caused by Candida albicans, Aspergillus species, and zygomycetes; bovine adenoviral infectionTraining19NecrosisJB10y4mCentrilobular hepatocellular necrosis with congestion and hemorrhage in the liverSuspected Daphniphyllum macropodum poisoningTest20NecrosisJS6dMultiple focal necrosis in the liver caused by Listeria monocytogenesListeriosis (septicemic type)Test21FibrosisHolstein13mHepatic fibrosisHepatic fibrosisTraining22FibrosisF18mHepatic fibrosisHepatic fibrosisTraining23FibrosisF10dHepatic lobular hypoplasia and fibrosisVentricular septal defect, congenital hepatic fibrosisTraining24FibrosisHolsteinstillbirthHepatic fibrosisHepatic fibrosisTraining25FibrosisJB3mHepatic fibrosisHepatic fibrosisTraining26FibrosisJB124mHepatic fibrosisHepatic fibrosisTraining27FibrosisF185dHepatic fibrosisHepatic fibrosisTraining28FibrosisHolsteinstillbirthHepatic fibrosisHepatic fibrosisTraining29FibrosisJB49dHepatic fibrosis with bile stasisCongenital extrahepatic biliary atresiaTest30FibrosisJB28dCongenital hepatic fibrosisCongenital hepatic fibrosisTest31NormalHolstein90dNo significant changesExperimental pneumonia caused by inoculation with BVDV and PmTraining32NormalHolstein67dNo significant changesExperimental pneumonia caused by inoculation with BVDVTraining33NormalHolstein65dNo significant changesExperimental pneumonia caused by inoculation with BVDV and PmTraining34NormalHolstein69dNo significant changesExperimental pneumonia caused by inoculation with BVDV and PmTraining35NormalHolstein68dNo significant changesExperimental pneumonia caused by inoculation with BVDV and PmTraining36NormalHolstein1y5mNo significant changesClinically normal cattleTraining37NormalHolstein2yNo significant changesCattle administered a rumen sensorTraining38NormalHolstein12yNo significant changesClinically normal cattleTraining39NormalHolstein5yNo significant changesCattle administered a rumen sensorTest40NormalHolstein5yNo significant changesNo significant changesTest*F1, Crossbred cattle; JB, Japanese black; JS, Japanese shorthorn.**d, day; m, month; y, year.BVDV, bovine viral diarrhea virus: Pm, Pasteurella multocida. Case information of cattle in this study. *F1, Crossbred cattle; JB, Japanese black; JS, Japanese shorthorn.**d, day; m, month; y, year.BVDV, bovine viral diarrhea virus: Pm, Pasteurella multocida. Supplementary Table 2.Training history of the constructed model. Fold Epoch Training loss Training accuracy Validation loss Validation accuracyFold 110.4890.8240.4550.851Fold 120.1880.9342.3160.563Fold 130.1180.9631.0080.720Fold 140.1010.9700.5760.817Fold 150.0670.9820.5830.851Fold 160.1230.9660.1720.937Fold 170.0820.9700.3260.889Fold 180.0590.9811.3590.683Fold 190.0450.9871.0040.811Fold 1100.0510.9830.4860.814Fold 210.4000.8742.5310.714Fold 220.1700.9382.1390.686Fold 230.1330.9541.9910.686Fold 240.0910.9731.2670.714Fold 250.1150.9661.7290.714Fold 260.0650.9781.6510.711Fold 270.0730.9781.6350.714Fold 280.0610.9781.9060.709Fold 290.0980.9622.0190.714Fold 2100.1020.9651.4900.691Fold 310.4710.8321.4080.507Fold 320.1450.9522.1300.657Fold 330.1270.9612.3790.640Fold 340.0980.9672.3480.630Fold 350.0990.9682.2110.580Fold 360.0820.9722.3730.630Fold 370.0620.9802.3210.520Fold 410.4510.8440.4690.807Fold 420.1370.9550.8190.707Fold 430.1020.9620.7610.703Fold 440.1040.9681.1970.653Fold 450.0860.9750.6250.750Fold 460.0550.9820.8330.720Fold 510.4720.8390.6040.750Fold 520.1490.9510.6580.853Fold 530.1250.9560.2480.900Fold 540.1090.9621.0940.703Fold 550.0780.9760.8360.833Fold 560.0600.9801.5350.693Fold 570.0530.9851.1540.813Fold 580.0490.9840.8910.833In the Folds 3, 4, and 5, early stopping was triggered because the valid accuracy did not exceed its previous maximum value for five consecutive epochs.The best validation accuracies of the Fold 1 to Fold 5 are 0.9371, 0.7143, 0.6567, 0.8067, and 0.9000, respectively. Average cross-validation accuracy is 0.8030. Training history of the constructed model. In the Folds 3, 4, and 5, early stopping was triggered because the valid accuracy did not exceed its previous maximum value for five consecutive epochs.The best validation accuracies of the Fold 1 to Fold 5 are 0.9371, 0.7143, 0.6567, 0.8067, and 0.9000, respectively. Average cross-validation accuracy is 0.8030. References Associated Data Data Availability Statement The data that support the findings of this study are not openly available due to sensitivity reasons and are available from the corresponding author upon reasonable request.