DOI : 10.5281/zenodo.23530214
- Open Access

- Authors : Anmol Rajesh Patil, Bhargav M, Bhuvan M, Hitesh H, Prof. Thejeswini A.M, Dr. R Rajkumar
- Paper ID : IJERTV15IS100660
- Volume & Issue : Volume 15, Issue 10 , October – 2026
- Published (First Online): 21-10-2026
- ISSN (Online) : 2278-0181
- Publisher Name : IJERT
- License:
This work is licensed under a Creative Commons Attribution 4.0 International License
Hybrid Deep Learning Framework for Liver Tumor Detection
Hybrid Deep Learning Framework for Liver Tumor Detection
Anmol Rajesh Patil
Dept. of Computer Science, Global Academy of Technology Bengaluru, India
Bhargav M
Dept. of Computer Science Global Academy of Technology Bengaluru, India
Bhuvan M
Dept. of Computer Science Global Academy of Technology Bengaluru, India
Hitesh H
Dept. of Computer Science Global Academy of Technology Bengaluru, India
Prof. Thejeswini A.M
Assistant Professor, CSE Global Academy of Technology Bengaluru, India
Dr. R Rajkumar
HOD, CSE, Global Academy of Technology Bengaluru, India
Abstract – Hepatocellular carcinoma (HCC) remains a signif- icant cause of cancer-related mortality, emphasizing the impor- tance of reliable computational methods for early risk assessment and tumour identication. Existing computer-aided diagnostic approaches frequently analyse clinical information and medical images separately, limiting the integration of their complemen- tary diagnostic contributions. This study proposes a sequential framework for liver tumour risk assessment and segmentation, combining clinical evaluation with CT-based image analysis through two independently developed learning modules. The clinical module employs Extreme Gradient Boosting (XGBoost) to analyse patient clinical parameters and estimate the risk of liver tumour pathology. Based on the resulting risk assessment, cases identied as high risk are directed to the subsequent imaging stage for further analysis. The imaging module adopts a two-and-a-half-dimensional (2.5D) segmentation architecture that integrates an ImageNet-pretrained ConvNeXt-Tiny encoder with a U-Net decoder to delineate tumour regions in CT images. By combining adjacent slices into a multi-channel input, the model incorporates inter-slice contextual information while retaining a two-dimensional processing strategy. To improve interpretability, Seg-Grad-CAM is employed to generate visual explanations of the segmentation process by identifying inuential encoder features and incorporating the predicted tumour-probability mask into the activation maps. The clinical and imaging modules remain architecturally independent, allowing each model to operate according to its respective learning objective without joint op- timisation. The framework is evaluated using the Liver Tumor Segmentation (LiTS) dataset and a synthetic clinical cohort to assess its segmentation and clinical risk-prediction performance, respectively. The proposed approach establishes a structured diagnostic workow that combines clinical risk stratication, automated tumour delineation, and visual interpretability, of- fering a potential foundation for computer-assisted liver tumour assessment.
Index TermsHepatocellular carcinoma (HCC), Liver tumour segmentation, XGBoost, ConvNeXt-Tiny, 2.5D U-Net, Seg-Grad- CAM, Clinical risk assessment, Computed tomography (CT).
-
Introduction
IVER cancer, of which hepatocellular carcinoma (HCC) is the principal primary form, remains a major chal-
lenge for diagnostic medicine. Articial intelligence (AI) is increasingly examined as an aid across the diagnostic pathway, from image interpretation to risk estimation [1], [2]. The practical value of detecting a liver tumor early lies in the treatment options it preserves. A lesion found while it is small and conned to the liver can be managed in ways that are no longer available once the disease has progressed. For this reason, surveillance and diagnostic workows for at-risk patients depend on tools that ag suspicious ndings reliably and early, and that communicate those ndings in a form a clinician can check.
In practice, two broad categories of evidence inform an HCC work-up. The rst is serum laboratory testing. Alpha- fetoprotein (AFP), its lectin-reactive fraction (AFP-L3%), and des-gamma-carboxy prothrombin (DCP, also called PIVKA- II) are tumor-associated markers. Albumin, total bilirubin, and platelet count reect the underlying condition of the liver, which is frequently compromised by chronic viral hepatitis or cirrhosis. The second category is cross-sectional imaging, most commonly computed tomography (CT), which allows a lesion to be located, delineated, and measured directly. The two categories answer different questions. Laboratory values indicate whether biochemical risk is elevated but cannot say where a lesion is. Imaging shows where a lesion is and how large it is, but CT review is time-consuming, and small or low-contrast lesions are easy to miss on a single slice.
Conventional practice interprets these evidence streams sep- arately and leaves their synthesis to the treating clinician. Manual review of lab reports requires transcribing values from heterogeneous report layouts. Manual CT reading requires slice-by-slice inspection of volumes that can contain hundreds of slices. Both are labor-intensive, and both depend on the reader. Deep learning has substantially advanced automated analysis of liver CT: convolutional neural networks (CNNs) have been used to detect tumors [3], [4], and segmentation networks have been used to delineate the liver and its le- sions [5], [6]. In parallel, machine-learning models trained on
structured clinical data have been proposed to estimate liver cancer risk [7], [8]. However, the image-only models tend to be computationally heavy and do not always t into a clinicians everyday routine, while models built only on clinical data lack the spatial evidence that imaging provides.
These observations have motivated hybrid and multimodal approaches that draw on both clinical and imaging informa- tion [9][12]. Such systems are motivated by the comple- mentarity described above. The design question they raise, however, is not only whether to use both modalities but how to combine them. Joint-embedding fusion architectures merge clinical and imaging representations into a single learned prediction. This can be effective, but it also makes it difcult to attribute a conclusion to one source of evidence or the other. That property matters for a decision-support tool, whose role is to help a clinician reason, not to replace that reasoning with an unexplained verdict. Explainability methods such as gradient-weighted class activation mapping (Grad-CAM) [13] and attention mechanisms [14] address part of this concern for imaging models, but they are typically demonstrated on classication networks and not on segmentation networks, which produce no single class score to explain.
This work addresses that gap with an implemented, staged framework, in which clinical and imaging evidence are each assessed by a dedicated and inspectable component and then presented together without being fused. The framework fol- lows the order of a typical diagnostic encounter. First, a laboratory report is uploaded and its markers are extracted by optical character recognition (OCR). The user conrms the values, which are then assessed by a transparent, threshold- based rule engine and, independently, by a gradient-boosted decision-tree (XGBoost) classier whose individual trees can be inspected. When the evidence indicates elevated risk, the workow proceeds to CT analysis. There, a U-Net segmen- tation network with a ConvNeXt-Tiny encoder operates on
2.5D inputs of three adjacent slices and predicts a tumor mask. Tumor location, size, and intensity statistics are then derived from that mask, and a segmentation-adapted Grad- CAM (Seg-Grad-CAM) highlights the image regions that drove the prediction.
An earlier design of the project did fus modalities: a neural clinical model produced an embedding that was combined with imaging features. That design was retired when the clinical model was replaced by XGBoost, because a gradient-boosted tree ensemble does not produce the differentiable embedding such a fusion network needs. The present framework therefore treats the stages as independent by design, and this paper reports each stage on its own terms.
The contributions of this paper are as follows:
-
A staged, non-fused clinical and imaging decision- support architecture. OCR-based lab-report parsing, a deterministic rule engine, a standalone clinical XGBoost model, and a CT segmentation model each produce their own verdict.
-
A 2.5D liver tumor segmentation pipeline built on an ImageNet-pretrained ConvNeXt-Tiny encoder and a U- Net decoder. It is trained on a volume-level, leakage- safe split of the full LiTS dataset and optimized with
a combined binary cross-entropy and Tversky loss that deliberately weights missed tumor pixels more heavily.
-
A Seg-Grad-CAM explainability module for a segmen- tation network. It backpropagates from the aggregated tumor probability, hooks an intermediate encoder stage whose resolution suits small lesions, and gates the result- ing map by the models own predicted tumor probability.
-
A leakage-safe clinical modeling pipeline over eleven laboratory and demographic features: a stratied split, preprocessing tted on the training data only, cross- validated hyperparameter search within the training split, early stopping on a validation split, and a single evalu- ation on the test split.
-
A complete implementation as a FastAPI service with a React front end, covering human-in-the-loop correction of OCR output, decision-tree inspection, derived tumor measurements.
The remainder of this paper is organized as follows. Sec- tion II reviews related work and identies the research gap. Section III describes the imaging and clinical data. Section IV presents the methodology of each stage. Section V describes the system implementation. Section VI denes the evaluation protocol and metrics. Section VII reports the results. Sec- tion VIII discusses them. Section ?? states the limitations, and Section IX concludes the paper and outlines future work.
-
-
Related Work
This section organizes prior work into ve themes that correspond to the components of the proposed framework: deep learning for liver tumor detection in CT, liver and tumor segmentation, clinical-data-driven risk prediction, hybrid and multimodal integration, and explainability. It closes by stating the gap this work addresses.
-
Deep Learning for Liver Tumor Detection in CT
The application of deep learning to radiology for cancer detection has been reviewed broadly [15], and tumor detec- tion techniques based on deep learning have been surveyed across organ sites [16]. In the liver specically, CNN-based detection of tumors in CT images has been reported [3], and deep-learning-based medical image analysis for liver cancer detection has been studied as a general framework [4]. Com- prehensive reviews of AI in liver cancer diagnosis place these imaging methods within the wider diagnostic workow [1], and reviews of AI-based medical diagnosis systems more generally discuss the conditions under which such tools can support clinical decisions [2]. Architectural diversity has also grown. Attention-based CNNs have been proposed to direct the network toward lesion-relevant regions [14], and vision transformers have been applied to liver tumor detection in CT [17]. Across these works, the common input is the CT image alone, and the common output is a detection or classi- cation decision.
-
Liver and Tumor Segmentation
Detection establishes whether a tumor is present. Segmen- tation establishes where it is and how large it is, which is the
information needed for measurement and localization. Auto- mated liver segmentation with deep learning has been studied in its own right [6], and multi-scale deep-learning approaches have been proposed for liver tumor segmentation to handle lesions that vary widely in size [5]. A survey of deep-learning- based liver tumor segmentation and classication summarizes the progression of these methods and the evaluation practices used to compare them [18]. Two recurring difculties motivate several design choices in this paper. First, liver tumors are small relative to the image, so tumor pixels form a small minority class. Second, lesion appearance on a single slice can be ambiguous. The rst difculty bears on the choice of loss function and on how evaluation metrics should be read. The second motivates providing context from adjacent slices to an otherwise two-dimensional network.
-
Clinical-Data-Driven Risk Prediction
A separate line of work estimates liver cancer risk from structured clinical data. Clinical data-driven risk prediction models for liver cancer detection have been developed [7]. Deep learning has been applied to liver disease classication from clinical data [8]. Hybrid machine-learning models have been used for cancer prediction from clinical datasets [19], and machine-learning techniques for clinical data analysis in healthcare have been reviewed [20]. These models operate on quantities such as serum markers, liver-function tests, and patient history. They are inexpensive to compute and are available early in the diagnostic pathway, but they cannot localize a lesion.
-
Hybrid and Multimodal Integration
Several recent works combine clinical and imaging data. Deep-learning-based liver tumor detection using hybrid clini- cal and imaging data has been reported [9]. Multimodal deep- learning frameworks for liver cancer diagnosis combine CT with clinical data [10]. Hybrid AI models integrate structured clinical features with imaging for liver tumor detection [11]. More broadly, hybrid AI systems for medical diagnosis using clinical and imaging data have been described as a general design pattern [12]. These works share the premise that the two modalities are complementary. They differ in where the combination happens, whether at the feature level, at the decision level, or through a learned joint representation. A learned joint representation requires both branches to produce compatible, differentiable embeddings, which constrains the choice of the clinical model.
-
Explainability in Liver Cancer AI
For clinical adoption, a models output must be interpretable by the clinician who acts on it. Grad-CAM has been combined with CNNs for explainable liver cancer detection [13], produc- ing heatmaps that indicate which image regions contributed to a classication. Attention-based networks offer a related, architecture-level route to interpretability [14]. Both routes are most naturally dened for networks that output a class score. A segmentation network outputs a dense per-pixel map instead,
and adapting gradient-based explanation to that output requires choosing a scalar target and a feature layer, choices that the classication setting leaves implicit. On the clinical side, tree- based models offer a different kind of transparency, because their individual decision paths can be read directly.
-
Research Gap
Three observations follow from this review. First, imaging- only and clinical-only systems each capture part of the di- agnostic picture, which motivates the hybrid systems of [9] [12]. Second, when integration is implemented as learned fusion, it becomes harder to attribute a conclusion to one evidence stream, and it restricts the clinical component to models that emit differentiable embeddings. This excludes tree ensembles, whose structure can otherwise b inspected. Third, gradient-based explainability has mainly been demonstrated for classication networks [13], whereas localization and size estimation require a segmentation network. What remains less explored is an end-to-end, implemented pipeline that (i) begins from the lab report a clinician actually receives, (ii) assesses clinical risk with components that are each inspectable, (iii) segments tumors with an imaging model that uses inter-slice context, (iv) explains the segmentation output itself, and (v) presents the separate verdicts together without collapsing them into a single fused score. The framework described in the following sections is designed to address this combination of requirements.
-
-
Materials and Data
The framework uses two independent data sources: a public CT segmentation dataset for the imaging stage and a syn- thetically generated clinical cohort for the clinical stage. The two are not paired. No clinical record corresponds to any CT volume, which is consistent with the independent-stage design described in Section I.
-
CT Imaging Data: LiTS
The segmentation model is trained and evaluated on the Liver Tumor Segmentation (LiTS) dataset, distributed as pre- extracted PNG slices. The dataset comprises 131 CT volumes (identiers 0130) and approximately 58.6k axial slices in total. Each slice is stored as a 256 × 256 image, accompanied by two binary masks with pixel values in {0, 1}: a liver mask and a lesion (tumor) mask. The three le types reside in a single directory and are paired by volume and slice indices encoded in their lenames. The projects scope is tumor localization, not full liver segmentation. Only the tumor mask is used as a training target. The liver mask is not used as a training target.
A companion index le distributed with the PNG release includes per-slice mask empty ags and its own train/test partition. Neither is used. Spot checks during development found the emptiness ags to be inconsistent with the actual mask content, and the partition covered only 91 of the 131 volumes and did not match the required 70/15/15 ratio. Tu- mor presence is instead computed directly from mask pixels throughout the pipeline.
-
Volume-Level Data Partitioning
Adjacent CT slices within a volume are highly similar. If slices from the same volume were distributed across the training and test partitions, the model would be evaluated on near-duplicates of its training data, and the reported scores would be inated. To prevent this leakage, the partitioning operates on whole volumes: every slice of a given volume is assigned to exactly one of the training, validation, or test splits. Volumes are rst stratied by whether they contain any tumor-positive slice, again determined from mask pixels. Each stratum is then shufed with a xed seed (42) and divided in a 70/15/15 ratio, so that tumor-bearing volumes are represented proportionally in every split. The resulting assignment is persisted to disk. A verication routine conrms that no volume identier appears in more than one split.
-
Full LiTS Training Dataset
The segmentation model is trained on the full LiTS dataset. All approximately 58.6k slices of the 131 volumes are used, and every slice remains in the split assigned to its volume in Section III-B: the 92 training volumes supply the training sam- ples, the 20 validation volumes are used for model selection and early stopping, and the 19 test volumes are held out for the nal evaluation. No slice is discarded, so the training data include tumor-bearing slices, liver slices without tumor, and slices outside the liver. Slices without tumor supply negative context, which teaches the model to return an empty mask when no lesion is present.
Using every slice of every volume also preserves slice-to- slice adjacency throughout each volume, which the 2.5D input depends on. For each center slice, the previous and next slices of the same volume are always available, except at the rst and last slices of a volume, where the center slice is repeated in the missing neighbor channel. Because the split is dened at the volume level and no volume is reassigned, the full dataset inherits the leakage protection of the volume-level partition.
-
Clinical Data: Synthetic HCC Cohort
The clinical stage uses a synthetic tabular dataset of 5,000 patients, one row per patient, with balanced classes. The data are generated programmatically by the projects own generator. Its distributions are modeled on published diagnostic-accuracy characteristics of AFP, AFP-L3%, and DCP and on typical laboratory proles in cirrhosis and chronic viral hepatitis. The data are not real patient data and are used for model prototyping and education only.
The HCC-negative cohort is built from overlapping clinical scenarios chosen so that it is not trivially separable from the positive cohort. The scenarios comprise healthy individuals; hepatitis B or C carriers without HCC; cirrhosis with or with- out viral etiology; abnormal liver-function tests without HCC; and deliberate marker false positives, in which AFP, DCP, AFP-L3%, or several markers are elevated without HCC. The HCC-positive cohort is generated per patient from conditional distributions. Cirrhosis is the principal axis (approximately 60% of positives are cirrhotic); etiology is split roughly evenly
TABLE I
Clinical Feature Set, Reference Ranges, and Class-Wise
Medians in the Synthetic Cohort
Feature
Unit
Normal range
HCC=0
HCC=1
AFP
ng/mL
< 20
3.40
70.00
AFP-L3
%
< 10
4.30
14.25
DCP (PIVKA-II)
mAU/mL
< 40
23.60
100.00
Albumin
g/dL
3.55.0
3.90
3.20
Total bilirubin
mg/dL
0.11.2
0.88
1.92
Platelet count
×109/L
150450
200
125
Age
years
1890
48
60
Sex
M/F
(categorical)
HBV status
0/1
(binary)
HCV status
0/1
(binary)
Cirrhosis status
0/1
0
1
between hepatitis B, hepatitis C, and non-viral causes; and a latent disease-stage variable (early, intermediate, or advanced) biases marker levels and liver-function values. A fraction of positives is generated as AFP-negative HCC, reecting the known imperfect sensitivity of AFP.
Each record carries the eleven features listed in Table I, a patient identier, and the binary HCC label. The table also reports the class-wise medians computed from the gen- erated dataset, which illustrate the separation the generator encodes. The positive class has higher tumor-marker levels, lower albumin and platelet counts, higher bilirubin, and a higher prevalence of cirrhosis. The dataset contains no missing values. The clinical data are partitioned by a stratied 70/15/15 split with seed 42 into 3,500 training, 750 validation, and 750 test patients, each split balanced at 50% HCC-positive. Because each row is a distinct patient with no repeat visits, a row-wise stratied split is free of leakage. The patient-level split is persisted with the patient identiers or auditability.
-
Synthetic Laboratory Reports
To exercise the OCR stage end to end, the project includes a generator of synthetic hepatology laboratory reports in PDF form. The reports contain a ctional letterhead, a patient and accession metadata block, and result tables for the tumor markers, the hepatic panel, and viral and cirrhosis status. Patient values are drawn from the same statistical distributions used for the clinical dataset. A candidate report is retained only if both the trained clinical XGBoost model and the deterministic rule engine condently agree with its intended label. This construction ensures that the printed values, the rule-engine score, and the XGBoost verdict on each report are consistent. Ten such reports are included, ve labeled HCC- positive and ve HCC-negative. They are used as realistic test inputs for the complete workow and not as a training or evaluation set.
-
-
Proposed Methodology
-
Overall System Architecture
This model is organized as three sequential stages that mirror a diagnostic encounter. The overall architecture is shown in Fig. 1. Two input pathways run in parallel. In the
clinical pathway, an uploaded laboratory report passes through OCR and marker extraction and is then assessed by the rule engine and the clinical XGBoost classier, which yield a clinical-risk verdict. In the imaging pathway, uploaded CT slices are assembled into a 2.5D stack and passed to the ConvNeXt-Tiny U-Net. Its output yields a tumor mask, the derived location and size, and a Seg-Grad-CAM explanation. Both pathways are served by a single FastAPI back end and presented side by side in a React front end.
The workow is gated in the user interface. After the laboratory values have been conrmed and assessed, the CT stage is unlocked when the rule engine recommends imaging. The clinical XGBoost models recommendation is displayed alongside the rule engines verdict as independent supporting evidence. The remainder of this section describes each com- ponent in the order in which data ow through the system.
TABLE II
Rule-Engine Thresholds and Point Assignments
Marker
Condition
Points
AFP (ng/mL)
> 200 (markedly elevated)
+2
> 10 and 200 (mildly elevated)
+1
AFP-L3 (%)
> 10
+1
DCP (mAU/mL)
> 150 (markedly elevated)
+2
> 40 and 150 (elevated)
+1
Albumin (g/dL)
< 3.5
+1
Platelets (×109/L)
< 150
+1
Total bilirubin (mg/dL)
> 1.2
+1
CT recommended if total score 2 (at least one primary marker read).
L
points for each marker that exceeds its clinical threshold, as listed in Table II, and sums them into a score
-
Laboratory Report OCR and Parsing
Srule =
mM
pm(xm), (1)
The user uploads a laboratory report as a PDF or an image. A PDF is detected by its declared content type, its le extension, or its leading %PDF signature, which makes the detection robust to mislabeled uploads. Each PDF page is rasterized at 200 dpi with PyMuPDF, and the resulting page images, or the uploaded image directly, are passed to the Tesseract OCR engine. The recognized text is then parsed line by line with pattern-matching rules.
-
Marker extraction: For each marker, a set of label patterns identies its result row. For example, AFP is matched by alpha-fetoprotein or by the token AFP when it is not followed by L3; a negative look-ahead prevents the AFP-L3 row from being read as AFP. The reported value is taken as the rst numeric token that follows the matched label on the same line. On typical report layouts this token precedes the unit and reference-range columns. Qualitative results are parsed differently. Hepatitis B surface antigen and anti-HCV results are read as reactive or non-reactive, and cirrhosis status as present or absent. In each case the parser takes the leftmost match after the label, so that a reference-range column later on the same line (for example, Non-reactive) cannot overwrite the actual result.
-
Demographics extraction: Patient name, identier, age, sex, and study date are extracted by capturing the text that follows each label, bounded by the next known label on the line. This bound is needed because reports commonly place two labelvalue pairs on one line.
-
Missing values and human review: A eld that cannot be located with condence is returned as missing. It is never guessed at the OCR layer. The extracted values, the demographics, and the raw OCR text are presented in an editable review form, and the user must conrm or correct them before any assessment runs. This human-in-the-loop step is a deliberate safety measure, because OCR can misread digits.
-
-
Deterministic Rule Engine
The conrmed marker values are rst scored by a rule engine that contains no learned parameters. The engine assigns
where M is the set of available markers, xm is the conrmed
value of marker m, and pm(·) is the point function in Table II. Markers that are missing contribute nothing. The three primary tumor markers (AFP, AFP-L3%, DCP) can each contribute up to two points. The three supporting liver-function markers contribute at most one point each, reecting their role as indirect evidence. The engine recommends CT imaging when
Srule 2, (2)
provided that at least one primary tumor marker is available. If none of AFP, AFP-L3%, or DCP could be read, the engine returns an unknown risk level and asks the user to enter them, instead of issuing a triage decision from supporting markers alone. Alongside the score, the engine returns a ag for each marker (normal, borderline, high, or low) and a list of plain- language reasons for every point awarded, so that its verdict can be traced to specic values.
-
Clinical XGBoost Risk Model
In parallel with the rule engine, the conrmed values are passed to a learned clinical-risk model. Its design follows the observation that clinical data alone support useful risk prediction [7], [19], and it adds the transparency of a tree ensemble.
-
Feature contract and preprocessing: The model con- sumes the eleven features of Table I. These are the three tumor markers (AFP, AFP-L3%, DCP), the three liver-status values (albumin, total bilirubin, platelet count), two demographic values (age and sex), and three etiology ags (HBV, HCV, and cirrhosis status). The patient identier is excluded from the feature matrix. Preprocessing is implemented as a column transformer with three branches. Numeric features are median- imputed and standardized. Binary status ags are imputed with the most frequent value. Sex is imputed with the most frequent value and one-hot encoded into a single indicator. The dataset contains no missing values; the imputers are retained so that the deployed model can accept the partially lled forms that OCR may produce. The transformer is tted on the training split only and then applied unchanged to the validation and
Fig. 1. Overall architecture of the model. The clinical pathway (top) extracts markers from an uploaded laboratory report by OCR and assesses them with a rule engine and an XGBoost classier over eleven clinical features. The imaging pathway (middle) builds a 2.5D three-slice stack and segments tumors with a ConvNeXt-Tiny U-Net producing the tumor mask, location, size, and a Seg-Grad-CAM map. Both pathways are served by a FastAPI back end and displayed side by side, without fusion, in a React/Vite front end.
test splits and at inference time. Standardization maps each numeric feature xj to
x train
the selected hyperparameters are persisted together, so that inference reproduces training exactly.
4) Decision rule and transparency: At inference, the model
= , (3)
xj
j j
train
j
returns p and recommends CT imaging when
p > 0.5. (5)
where train and train are the mean and standard deviation
j j Any feature that was missing is imputed by the training-
estimated on the training split. Using training-split statistics alone keeps the validation and test data from inuencing the preprocessing.
L
-
Model: The classier is a gradient-boosted ensemble of K regression trees trained with the binary logistic objective. For a preprocessed feature vector x, the predicted probability of HCC is
tted preprocessor and reported back in a list of missing features, so the user can see which inputs were lled in by the model. Because the tted booster names its features after the preprocessed columns, any individual tree of the ensemble can be exported as a nested JSON structure and rendered in the interface. This lets a user trace the split conditions along any decision path.
p =
K
k=1
fk(x)
1
, (z) = 1+ ez , (4)
-
-
2.5D CT Input Construction
where fk is the output of the k-th tree. The base conguration uses row and column subsampling rates of 0.8, a minimum child weight of 1, L2 regularization = 1, and a xed random seed of 42.
3) Training protocol: Hyperparameters are selected by grid search over tree depth {3, 4, 6}, learning rate {0.03, 0.05, 0.1}, and number of trees {200, 300, 500}. The search uses ve- fold stratied cross-validation, is scored by the area under the ROC curve, and is conned to the training split. The selected conguration was a maximum depth of 6, a learning rate of 0.05, and 200 trees. The nal model is retted on the training split with these parameters, and the validation split serves as the evaluation set for early stopping with a patience of 20 boosting rounds. The test split is used once, after training is complete. The trained booster, the tted preprocessor, and a metadata le recording the transformed feature order and
Stage 2 analyzes CT imaging. A single axial slice gives a two-dimensional view of what is a three-dimensional structure. A lesion that is ambiguous on one slice may be clearer when its neighbors are also visible, because real tumors extend across several consecutive slices. Fully volumetric networks capture this context, but at a much higher computational cost. The framework instead adopts a 2.5D input. For a center slice at index s in a volume with maximum slice index smax, the network input is the three-channel tensor
[ ]Xs = Ic(s1), Is, Ic(s+1) R3×256×256, (6)
where Ii denotes the grayscale slice i resized to 256 × 256 with bilinear interpolation, and c(i) = min(max(i, 0), smax) clamps the index at the ends of the volume. At the rst and last slices, the missing neighbor is replaced by a copy of the center slice.
Fig. 2. 2.5D input construction illustrated on validation volume 124 before normalization. The previous (slice 235), center (slice 236), and next (slice 237) axial slices form the three input channels of the segmentation network.
The three channels are normalized with the ImageNet channel means (0.485, 0.456, 0.406) and standard deviations
(0.229, 0.224, 0.225). This construction keeps the (3, H, W ) input shape that an ImageNet-pretrained encoder expects. The pretrained RGB lters are therefore reused without architec- tural change, while the channels now encode adjacent axial po- sitions instead of color. It replaces the projects earlier scheme, in which a single slice was replicated into all three channels,
which spent two of the three channels on redundant data. An
A 1 × 1 convolution then produces one channel of tumor logits Z R256×256. The per-pixel tumor probability is P = (Z). The primary implementation builds this network from a standard segmentation library that provides the U- Net with a ConvNeXt-Tiny encoder. A functionally equivalent hand-written decoder over the same encoder, with the channel widths shown in Fig. 3, is used automatically if that library is unavailable.
-
Loss Function
Tumor pixels are a small minority of the pixels in a CT slice. Measured on a sample of 300 training images from the tumor-bearing training pool, the ratio of non-tumor to tumor pixels was approximately 118:1. The loss therefore combines a pixel-wise classication term with a region-overlap term, and both terms are congured to favor recall:
L = wb LBCE + wr LTv, wb = wr = 0.5. (7)
The rst term is binary cross-entropy with a positive-class weight ,
example of the three input channels, before normalization, for a validation volume is shown in Fig. 2.
1) Data augmentation: During training only, geometric and
N
L = 1 L
BCE N
i=1
yi log pi + (1 yi) log(1 pi)L, (8)
photometric augmentations are applied identically to all three channels and to the target mask. These are a horizontal ip and a vertical ip, each with probability 0.5; a rotation by an angle drawn uniformly from [15, 15]; and brightness and contrast scaling by factors drawn from [0.9, 1.1]. In addition, an elastic deformation with magnitude = 20 and smoothness = 4 is applied with probability 0.5. A single displacement eld is drawn per sample and applied with bilinear interpolation to
where yi {0, 1} is the ground-truth label of pixel i,
pi = (zi) is the predicted probability, and N is the number of pixels in the batch. The weight is set to = 4. This is deliberately far below the raw imbalance ratio, because using the raw ratio would compound with the recall-favoring Tversky term and risk overshooting. The second term is the Tversky loss,
TPs + E
s
the image channels and with nearest-neighbor interpolation to
LTv = 1 TP
+ FPs
+ FNs
, (9)
+ E
the mask, followed by re-binarization, so the input and the
target stay spatially consistent. The elastic deformation was added as a regularizer, because earlier training rounds showed
with soft counts computed from probabilities:
TPs = L piyi, FPs = L pi(1yi), FNs = L(1pi)yi.
a persistent gap between training and validation Dice, which i i
pointed to overtting.
i
(10)
-
ConvNeXt-Tiny U-Net Segmentation Network
The segmentation network follows the U-Net encoder decoder design with skip connections, the design used through- out the liver segmentation literature [5], [6], [18]. Its encoder is ConvNeXt-Tiny, initialized with ImageNet-pretrained weights. The architecture is shown in Fig. 3.
-
Encoder: ConvNeXt-Tiny produces a four-stage feature hierarchy with 96, 192, 384, and 768 channels at 1/4, 1/8, 1/16, and 1/32 of the input resolution, respectively. For a
256 × 256 input, the deepest stage is therefore an 8 × 8 grid.
-
Decoder: Each decoder block upsamples its input by a factor of two, concatenates the encoder feature map of matching resolution through a skip connection, and applies
-
two 3 × 3 convolution, batch-normalization, and ReLU layers.
The skip connections carry high-resolution spatial detail from the encoder, which the decoder needs to delineate small lesion boundaries. Two further upsampling steps bring the 1/4- resolution decoder output back to the full iput resolution.
Here = 0.3, = 0.7, and E = 1 is a smoothing constant. The Dice loss is the special case = = 0.5, which penalizes false positives and false negatives equally. Setting > makes missed tumor pixels cost more than false alarms. This loss replaced an earlier BCE plus Dice combination. Under that earlier loss, test precision was already high but recall was low. A sweep of the binarization threshold showed that lowering the threshold recovered little recall, which indicated that the decit had to be addressed during training, not by post-hoc calibration. The code base also implements a focal- Tversky variant, L1/ with = 4/3, but it is disabled in the conguration reported here.
Tv
-
-
Training Protocol
The training conguration is summarized in Table III. The network is optimized with AdamW at a learning rate of 104 and a weight decay of 2 × 102. The weight decay was doubled from an earlier 102 as a further regularizer. Memory constraints on the training hardware ruled out a physical batch
Fig. 3. Architecture of the ConvNeXt-Tiny U-Net for 2.5D liver tumor segmentation. The ImageNet-pretrained ConvNeXt-Tiny encoder produces features with 96, 192, 384, and 768 channels at strides of 4, 8, 16, and 32. The U-Net decoder upsamples progressively and concatenates encoder features through skip connections (dashed). A 1 × 1 convolutional head outputs single-channel tumor logits at 256 × 256, which are converted to probabilities by a sigmoid.
TABLE III
Segmentation Training Configuration
Setting
Value
Encoder
ConvNeXt-Tiny (ImageNet- pretrained)
Input
3 × 256 × 256 (2.5D: [s
1, s, s + 1])
Output
1 × 256 × 256 tumor logits
Loss
0.5 BCE ( = 4) + 0.5
Tversky ( = 0.3, = 0.7)
Optimizer
AdamW, lr 104, weight de-
cay 2 × 102
Batch
8 per micro-batch × 4 accumu-
lation = 32
LR schedule
ReduceLROnPlateau (validation loss), patience 5, factor 0.5
Epochs / early stop
Max 100 epochs, patience 15 on validation Dice
Augmentation
Flips, ±15 rotation, ±10%
brightness/contrast; elastic ( = 20, = 4, p = 0.5)
Binarization threshold
0.5
Seed
42 (Python, NumPy, PyTorch, data loaders)
of 32. The model therefore processes micro-batches of eight and accumulates gradients over four micro-batches before each optimizer step, giving an effective batch size of 32. Batch- normalization statistics are still computed per micro-batch of eight. A plateau scheduler halves the learning rate when the validation loss has not improved for ve epochs. Training runs for at most 100 epochs, and early stopping is triggered when the validation Dice has not improved for 15 epochs. Early stopping and checkpoint selection monitor the validation Dice, not the validation loss, because Dice is the quantity of interest and the two do not always move together.
The validation Dice used for model selection is computed globally, by accumulating true positives, false positives, and false negatives over every validation pixel:
An earlier version of the training script averaged Dice over batches. That average is biased downward by batches whose ground-truth tumor region is small or empty, where the smoothing term dominates. The global form is also the form used in the nal test evaluation, so model selection and reporting are consistent. Two checkpoints are saved. A latest checkpoint is written after every epoch, together with the optimizer, scheduler, early-stopping state, and training history, so that interrupted training can resume exactly. A best check- point is written only when the validation Dice improves, and it is the checkpoint loaded by the deployed application. All random-number generators, including those of the data-loader workers, are seeded for reproducibility, within the determinism guarantees of the hardware back end.
-
Post-Processing and Tumor Characterization
At inference, the probability map P is binarized as
M (u, v) = J,[P (u, v) > 0.5] , (12)
and descriptors of the tumor are computed from the set = {(u, v) : M (u, v) = 1} of predicted tumor pixels. If is empty, the slice is reported as tumor-free. Otherwise, the system reports the pixel area A = || and its fraction of the 256 × 256 grid,
||
A% = 100 · , (13)
256 × 256
together with the centroid,
L
(u¯, v¯) = 1 (u, v), (14)
||
(u,v)
and the axis-aligned bounding box of . The centroid and the bounding box are rescaled to the coordinates of the original image and are also reported in normalized form. The minimum, mean, and maximum grayscale intensities (0255) of the original image inside the mask are also reported. These
2 TP
Diceval = 2 TP + FP + FN .
(11)
are raw image intensities, not calibrated Hounseld units, because the PNG input carries no DICOM rescale parameters.
The front end converts pixel measurements to physical units with an assumed in-plane pixel spacing of = 0.7 mm and an assumed slice thickness of t = 2.5 mm, because the true DICOM spacing is not available from PNG input. The derived quantities are width and height (w, h), area (A2), a single- slice volume estimate (A2t), a bounding-box perimeter 2(w+ h), and a dimensionless circularity
jet colormap and alpha-blended with weight 0.5 over the orig- inal slice. The gating restricts the displayed attention to pixels the model actually predicts as tumor. The resulting overlay should therefore be read as an explanation of the models own segmentation, not as an independent tumor detector.
-
-
System Implementation
C =
4A
2(w + h) 2
, (15)
This section describes how the methodology of Section IV is realized as a working application. It covers the software and
computed entirely in pixel units. The interface explicitly labels all millimeter values as approximate and based on assumed spacing.
-
Seg-Grad-CAM Explainability
L
Grad-CAM explains a classier by backpropagating a class score to a convolutional feature map [13]. The segmentation network has no class score, so a scalar target must be dened from its dense output. The framework uses the aggregated tumor probability,
y = Z(u, v) , (16)
u,v
which measures how much tumor the model sees in the slice. Summation is used instead of averaging so that the gradient remains appreciably non-zero when the predicted tumor region is small. Let Ak Rh×w be the k-th channel of a chosen encoder feature map. The channel importance weights and the raw class activation map are
a = 1 L y , L = ReLU L a Ak . (17)
hardware environment, the back-end service and its API, how the trained models are integrated, the user-facing workow, and the inference path of a request.
-
Software and Hardware Environment
The back end is written in Python. Model development uses PyTorch and torchvision, with the ConvNeXt-Tiny U-Net built through segmentation_models_pytorch over a timm encoder, and the clinical model uses XGBoost with scikit-learn preprocessing. Tabular I/O uses pandas and openpyxl. Image handling uses Pillow and OpenCV, OCR uses pytesseract over the Tesseract binary, and PDF rasterization uses PyMuPDF. Plots are produced with Matplotlib. The service layer uses FastAPI, the Uvicorn server, and Pydantic schemas. The front end is a React 19 single-page application built wth Vite and styled with Tailwind CSS. It uses framer-motion and GSAP for interface transitions, three.js for the landing-page anatomical visualization, and lucide-react for icons.
The segmentation model was trained on a laptop with an Apple M4 processor and 16 GB of unied memory, using PyTorchs Metal Performance Shaders (MPS) back end. Two
k
k hw
k
A
i,j ij
k accommodations were required on this platform. First, op- erations lacking MPS kernels are allowed to fall back to
-
Choice of feature stage: The deepest encoder stage is
an 8 × 8 map at 256 × 256 input, so each cell covers a 32 × 32-pixel region. LiTS tumors are frequently smaller than that; bounding boxes as small as 7 × 9 pixels were observed during development. A map at that resolution therefore cannot localize them. In practice it produced an all-zero map on one real tumor, border-located hotspots on another, and a strong false hotspot on a tumor-free slice. The framework instead hooks an intermediate stage whose map is 32 × 32 (8 × 8 pixels per cell), which is a closer match to small lesions, at the cost of somewhat less abstract features. The hooked tensor is obtained by running the encoder and decoder explicitly and retaining the gradient of the selected feature tensor. This is more reliable than registering hooks on an encoder module that returns a list of multi-scale features.
-
Probability gating: Because y aggregates over the whole image, the raw map L reects every region that changes the aggregate score, not only the tumor. The raw map is therefore upsampled bilinearly to 256 × 256 and multiplied pixel-wise by the models own predicted probability map:
L min L
the CPU through the corresponding PyTorch environment setting. Second, a batch-normalization back-propagation error on non-contiguous inputs, observed after the decoders skip- connection concatenation, is avoided by making the batch- normalization input contiguous, a change with no numeri- cal effect. The same memory limit motivated the gradient- accumulation scheme of Table III. At serving time, the segmentation engine loads onto a CUDA device when one is available and otherwise onto the CPU. The service has also been run from a Python 3.12 virtual environment on a Windows workstation.
-
-
Back-End Service and API
The FastAPI application loads both trained models once, in a start-up lifespan handler, so that no request pays the cost of loading a model. Loading is fault tolerant. If a model le is absent, the service logs a warning and starts anyway, and only the endpoints that depend on that model return HTTP 503 until the model has been trained. Cross-origin requests from local development origins are permitted through
L = Up(L) (Z),
L¯ =
. (18)
a pattern-based CORS policy that remains compatible with
max L min L
The gated map is minmax normalized. A constant map is returned as all zeros. The normalized map is rendered with a
credentialed requests. Interactive API documentation (Swagger UI and ReDoc) is generated automatically. The endpoints are listed in Table IV.
TABLE IV
REST API Endpoints of the Back End
Method
Endpoint
Function
GET
/
Health check and model-loaded ags
POST
/blood/extract
Stage 1a: OCR of a report; markers, demographics, 11 clinical features, raw text
POST
/blood/assess
Stage 1b: rule-engine score, ags, rea- sons, CT recommendation
POST
/clinical/predict
Stage 1c: XGBoost HCC-risk proba- bility and CT recommendation
GET
/clinical/tree/{i}
JSON export of tree i of the XGBoost ensemble
POST
/segment
Single-slice segmentation, location, size, Seg-Grad-CAM
POST
/analyze
2.5D analysis from three required ad- jacent slices
Request and response bodies are validated against Pydantic schemas. Upload types are checked: PDF, PNG, or JPEG for laboratory reports, and PNG or JPEG for CT slices. Empty uploads are rejected with HTTP 400. A missing Tesseract binary is reported as HTTP 503, and other failures as HTTP 500 with a diagnostic message.
-
Model Integration
Each model is wrapped in a singleton inference engine that owns its weights and its preprocessing.
-
Segmentation engine: The segmentation engine restores the best checkpoint into a ConvNeXt-Tiny U-Net built without downloading pretrained weights, puts the model in evaluation mode, and attaches the Seg-Grad-CAM module to the same model instance. Its preprocessing mirrors the training dataset exactly: each slice is converted to grayscale and resized to
256 × 256, the three slices are stacked in (previous, cen-
ter, next) order, and the stack is normalized with ImageNet statistics. Inference and training therefore see identically con- structed inputs.
-
Clinical engine: The clinical engine loads the XGBoost booster from its native JSON format, the tted preprocessor, and the metadata le. It builds a one-row frame in the exact training column order, leaves absent elds as missing values for the tted imputers, and returns the probability, the risk level, the CT recommendation, the list of imputed features, and a plain-language interpretation. For tree export, the engine counts trees directly from the boosters dump and not from a wrapper attribute, which is not restored when a model is loaded from disk. This guarantees that the valid index range reported to the interface matches the trees that can actually be exported.
-
-
User Interface and Application Workow
The front end presents a three-step workow tracked by a stepper component.
-
Steps 12: laboratory report: The user uploads a labo- ratory report. The extracted markers are shown in an editable review form with their units and reference ranges, together with a warning that OCR can misread digits and that the values
must be veried. On conrmation, the interface calls the rule- engine and clinical-model endpoints concurrently and displays both results. The rule engines CT recommendation gates the Proceed to CT action. The XGBoost result is shown as an independent risk probability, and a decision-tree viewer lets the user browse any tree of the ensemble by index and follow its split conditions.
-
Step 3: CT analysis: The CT upload area requires the
center slice together with its previous and next neighbors. Analysis starts only after all three have been supplied and the user explicitly requests it, and selecting les alone shows only a preview. A processing overlay reports progress during inference. The results view comprises panels for the original scan, the segmentation overlay, the Seg-Grad-CAM heatmap, the derived measurements with the spacing caveat.
-
-
Inference Pipeline
A complete analysis proceeds through the following sequence of requests. (i) The report is uploaded to
/blood/extract, which returns markers, demographics, the full clinical feature set, and the raw OCR text. (ii) The user-conrmed values are sent to /blood/assess and
/clinical/predict. (iii) If the rule engine recommends imaging, the three CT slices are sent to /analyze. That endpoint builds the 2.5D tensor, runs a gradient-free forward pass to obtain P , binarizes it with (12), and computes the de- scriptors of (13)(14) and the intensity statistics. It also render a red-tinted segmentation overlay and a binary mask image, and then runs a separate gradient-enabled pass to produce the Seg-Grad-CAM overlay of (18). Failure of the explanation step is logged and does not invalidate the segmentation result.
The /analyze endpoint requires all three slices by design. This guarantees that the model always receives the kind of input it was trained on, instead of a center slice duplicated into all channels. The single-image /segment endpoint remains available for convenience. It duplicates the center slice into the neighbor channels, which is the same edge case the model sees at the rst and last slices of each training volume, and it should therefore be regarded as a degraded path.
-
-
Evaluation Protocol and Metrics
The two learned models are evaluated independently, each on its own held-out test split, and each test split is used only once, after training. No metric in this paper combines the two stages. The segmentation model is evaluated on the 19 test volumes of the volume-level LiTS split (Section III-C). The clinical model is evaluated on the 750 patients of the synthetic cohort. The rule engine has no trainable parameters and is not scored as a classier; its thresholds are xed design inputs (Table II).
-
Segmentation Metrics
With TP, FP, FN, and TN denoting true-positive, false- positive, false-negative, and true-negative counts for the tumor class, the segmentation model is characterized by the following quantities. The Dice coefcient, the primary overlap metric, is
2 TP
Dice = , (19)
2 TP + FP + FN
and the intersection-over-union (Jaccard index) is
TABLE V
Test-Set Results of the ConvNeXt-Tiny 2.5D U-Net
TP
IoU =
TP + FP + FN
. (20)
Segmentation Model
Metric
Value
Dice coefcient (primary overlap metric)
0.8888
IoU (Jaccard)
0.7998
Precision
0.882
Recall / sensitivity
0.896
Accuracy
0.9799
Both measure the agreement between the predicted and the reference tumor, and they are related monotonically by IoU = Dice/(2 Dice). Precision and recall (sensitivity),
Precision =
TP TP + FP
, Recall =
TP TP + FN
, (21)
separate the two kinds of error: precision penalizes false alarms, and recall penalizes missed tumor. Accuracy,
TP + TN
Accuracy =
TP + FP + FN + TN
, (22)
counts correct decisions of both classes. It is strongly inu- enced by the size of the negative class.
All predictions are binarized at the threshold of 0.5 used in deployment.
-
Clinical Model Metrics
For the clinical XGBoost model, HCC-positive is the posi- tive class, and the predicted probability is thresholded at 0.5. Accuracy, precision, and recall are dened as in (21)(22) at the patient level. Recall is also reported under its clinical name, sensitivity. Specicity,
Fig. 4. Test-set metrics of the ConvNeXt-Tiny U-Net segmentation model: Dice coefcient, IoU, precision, recall, and accuracy.
so this agreement is an observation and not a demonstrated causal effect. Accuracy was 0.9799.
TN
Specicity =
TN + FP
, (23)
Accuracy (0.9799) is higher than the overlap metrics (0.8888 and 0.7998) because correct negative decisions dom-
measures the proportion of HCC-negative patients correctly identied as negative. The F1 score summarizes precision and recall. The threshold-independent area under the receiver op- erating characteristic curve (AUC) summarizes ranking quality across all operating points; the ROC curve plots the true- positive rate against the false-positive rate as the threshold varies. The test split is balanced (375 positive and 375 negative patients), so accuracy is not inated by class imbalance for this model.
-
-
Results and Performance Analysis
This section reports the documented outputs of the im- plemented models. Segmentation results are given rst (Sec- tions VII-AVII-D), followed by the clinical model (Sec-
inate the accuracy gure.
-
Confusion Matrix Analysis
The confusion matrix of the segmentation model on the test data is shown in Fig. 5. It records 823 true positives, 96 false negatives, 110 false positives, and 9,195 true negatives, for a total of 10,224 decisions: 919 actual positives and 9,305 actual negatives. The 919 actual positives correspond to the tumor-bearing slices of the 19 test volumes, and the 9,305 actual negatives to their tumor-free slices. This indicates that the matrix tabulates tumor presence at the level of individual slices.
The metrics of Table V follow directly from these counts through (19)(22):
tion VII-E) and the system-level outputs (Section VII-F).
2(823)
1646
Segmentation and clinical results are kept separate through-
Dice = = = 0.8888,
2(823) + 110 + 96 1852
out, because they come from different models evaluated on different data.
IoU =
823
= 823 + 110 + 96
823
823
1029
= 0.7998,
823
A. Segmentation Performance
The test-set metrics of the ConvNeXt-Tiny U-Net are listed in Table V and plotted in Fig. 4. The model reached a Dice coefcient of 0.8888 and an IoU of 0.7998. Precision was 0.882 and recall was 0.896, so on this test split the model recovered a slightly larger share of true tumor instances than it committed false alarms. This direction agrees with the recall- favoring Tversky weighting ( > ) described in Section IV. No ablation was performed that isolates the effect of the loss,
Precision = = 0.882, Recall = = 0.896,
823 + 110 823 + 96
823 + 9195
Accuracy = = 0.9799.
10224
The reported metrics are therefore internally consistent with the confusion matrix. Several observations follow from the counts. First, the two error types are of similar size: 96 missed positives against 110 false alarms. Neither error mode dominates. Second, the positive class accounts for 919 of 10,224 decisions (about 9%). This is why accuracy exceeds the
Fig. 5. Confusion matrix of the ConvNeXt-Tiny 2.5D + U-Net model on the test data: 823 true positives, 96 false negatives, 110 false positives, and 9,195 true negatives.
overlap metrics: the 9,195 true negatives contribute to accuracy but not to Dice or IoU. Third, of the 919 tumor-bearing cases, 823 were detected. The 96 misses are the more consequential error in a screening context, and Section VII-D examines a representative miss in detail. Because the matrix contains all four counts, specicity could also be computed from it. It is not reported here because it is not among the documented metrics of the segmentation model.
-
Representative 2.5D CT Inputs
The imaging stage analyzes CT in the 2.5D form dened in
(6). The /analyze endpoint therefore receives three adjacent axial slices from the same scan for every analysis, not a single image. Fig. 6 shows three such input sets from different CT scans. Each row, (a) to (c), contains three adjacent 256 × 256 grayscale slices supplied together as one input.
The rows illustrate why neighboring slices are informative. In Fig. 6a, a bright, heterogeneous focal region is visible in all three slices, but its extent and shape change from slice to slice. The 2.5D input exposes exactly this inter-slice continuity to the network. In Fig. 6b and 6c, the adjacent slices differ only subtly. The neighbor channels therefore add local three- dimensional context without changing the overall anatomy the network sees. The scans also differ in eld of view and in how large the body appears within te image, which is part of the input variation the model must handle. The gure documents the input format only; the model outputs for these particular inputs are not reported in this paper.
-
Failure Case Analysis
The worst-Dice validation volume, volume 116, contains a large lesion (2,597 px on slice 583) that the model missed entirely. This case was investigated by comparing it with two successfully segmented validation lesions. Fig. 7 shows each
(a)
(b)
(c)
Fig. 6. Representative 2.5D CT inputs to the imaging stage. Each row shows three adjacent axial slices (256 × 256) from one CT scan, supplied together to the /analyze endpoint as a single 2.5D input. (a)(c) Three different scans.
case with its ground truth, the raw (unthresholded) probability map, and the thresholded prediction.
For the missed lesion, the models probability remains essentially zero everywhere in the image. The maximum probability anywhere in the image is 0.006, and inside the reference lesion the maximum is 0.0005 and the mean 0.0001. The miss is therefore not a thresholding artifact: no choice of threshold would recover this lesion. In each successful case, by contrast, the maximum probability inside the lesion reaches 1.0, and the mean probability inside the lesion is between 0.8378 and 0.8849. The grayscale intensity range of the missed lesion (123148) overlaps that of successful volume 124 (130 148). A simple difference in lesion intensity therefore does not explain the failure, and the lesion is also large (2,597 px), so small size is not the explanation either. What the available diagnostics establish is that the model does not respond to this lesion at all. The underlying cause, such as an appearance or context specic to this volume that is under-represented in training, is not determined by the present analysis. The case illustrates that aggregate test metrics can coexist with complete per-lesion failures, which matters for how the systems output should be used (Section VIII).
-
Clinical XGBoost Model Performance
The test-set results of the clinical model on the 750 synthetic patients are listed in Table VI and plotted in Fig. 8. The model reached an accuracy of 0.9520, a precision of 0.9619, a recall
Fig. 7. Investigation of the missed validation lesion (volume 116, slice 583; volume-level Dice 0.0004) compared with two successful validation cases (volumes 124 and 76; volume-level Dice 0.87 and 0.87). Columns: CT slice, ground-truth mask with its grayscale intensity range, raw probability map with the maximum probability inside the ground truth, and the thresholded prediction.
TABLE VI
Test-Set Results of the Clinical XGBoost Model (n = 750
Synthetic Patients)
Metric
Value
Accuracy
0.9520
Precision
0.9619
Recall
0.9413
Sensitivity
0.9413
Specicity
0.9627
F1 score
0.9515
AUC
0.9931
Fig. 9. Confusion matrix of the clinical XGBoost model on the test split (threshold 0.5): 361 true negatives, 14 false positives, 22 false negatives, and
353 true positives.
Fig. 8. Test-set metrics of the clinical XGBoost model on 750 synthetic patients.
(sensitivity) of 0.9413, a specicity of 0.9627, an F1 score of 0.9515, and an AUC of 0.9931.
The corresponding confusion matrix is shown in Fig. 9. Of the 375 HCC-negative patients, 361 were correctly classied and 14 were false positives. Of the 375 HCC-positive patients,
353 were correctly classied and 22 were false negatives. The model thus errs somewhat more often by missing HCC than by raising false alarms, which agrees with its recall (0.9413) being lower than its specicity (0.9627). The HCC- negative cohort deliberately includes marker false-positive scenarios, and the HCC-positive cohort includes AFP-negative cases (Section III). These are the kinds of records for which classication from laboratory values is inherently ambiguous. The present analysis does not attribute the individual errors to specic scenarios.
The ROC curve in Fig. 10 rises steeply near the origin and
Fig. 10. ROC curve of the clinical XGBoost model on the test split (AUC
= 0.9931). The dashed diagonal is the random-classier reference.
Fig. 11. Training and validation log-loss of the clinical XGBoost model across boosting rounds.
stays close to the top-left corner, which corresponds to the AUC of 0.9931. The curve shows that the model separates the two classes well over a wide range of thresholds, not only at the deployed threshold of 0.5.
The training dynamics are shown in Fig. 11. Training and validation log-loss decrease together over the early boosting rounds. The validation loss then levels off while the training loss continues to decline slowly, producing a gap that widens gradually without the validation loss turning upward. This pattern is consistent with the ensemble continuing to t the training data while generalization remains stable, and with the early-stopping safeguard, which monitors the validation split. These results must be read against the nature of the data. The cohort is synthetic, and its class-conditional distributions were specied by the generator (Table I). The metrics therefore show how well the model recovers the structure encoded in that generator. They do not show diagnostic performance on
real patients.
-
System-Level Outputs
The deployed system produces, for each analysis, the struc- tured outputs dened in Section IV. From the laboratory
report, it produces the extracted markers and demographics, the rule-engine score with per-marker ags and reasons, and the XGBoost probability with its CT recommendation and any imputed features. From the CT slices, it produces the binary tumor mask, the segmentation overlay, the pixel area and its percentage of the image, the centroid, the bounding box, the in-mask intensity statistics, the millimeter estimates derived under the stated spacing assumptions, and the Seg-Grad- CAM overlay. Finally, it produces a sectioned, template-based clinical report. The synthetic laboratory reports described in Section III serve as realistic inputs for exercising this complete path. By construction, their rule-engine and XGBoost verdicts agree with their intended labels, so they are not used as an evaluation set. No quantitative evaluation of the OCR extraction accuracy, or of the Seg-Grad-CAM maps is included in this study.
-
-
Discussion
-
What the Segmentation Results Indicate
The segmentation models documented test metrics (Dice 0.8888, IoU 0.7998, precision 0.882, recall 0.896) and its confusion matrix support one main conclusion: on the LiTS volumes that were never seen in training, the model identies most tumor-bearing cases while keeping false alarms at a similar, modest level. Because the split is made at the volume level, this measures generalization to unseen patients scans, not memorization of neighboring slices, which is the failure mode that slice-level splitting would conceal. The near-balance between false negatives (96) and false positives (110), together with recall slightly above precision, suggests that the operating point at the deployed threshold of 0.5 does not strongly favor either error type.
Two qualications apply. First, the confusion-matrix anal- ysis indicates that these metrics tabulate tumor presence per slice. They therefore describe how reliably the system ags tumor-bearing slices. They do not by themselves quantify how precisely each lesions boundary is traced. The qualitative results address the boundary question. In the successful cass of Fig. 7, the thresholded predictions contain 541 pixels against 630 in the ground truth (volume 124) and 2,034 against 2,317 (volume 76). Detected lesions therefore tend to be matched closely or slightly under-segmented in extent, so the pixel areas and millimeter estimates derived from the mask should be treated as indicative and not as precise volumetry. Second, the failure analysis (Fig. 7) shows that high aggregate scores can coexist with individual lesions that the model does not respond to at all. For a screening-oriented tool, this is the most important caveat on the imaging results. A negative segmentation result on a single slice cannot be taken as evidence that the patient has no tumor.
-
Relationship Between Segmentation and Detection
The framework contains no separate CT classier. Detection is derived from segmentation: a slice is reported as tumor- bearing if and only if the binarized mask is non-empty. This design has a practical advantage. Every positive imaging verdict comes with a spatial support (a mask, a centroid, and
a bounding box) that a reader can check against the image, whereas a classiers positive verdict carries no location. The same coupling means that detection inherits every lesion the segmentation network fails to respond to, as in the missed case of Fig. 7. Detection is also tied directly to the binarization threshold. The documented failure case, however, shows that some misses occur at probabilities so low that no threshold would recover them. This observation agrees with the projects earlier nding that recall had to be improved through the training objective, not through threshold tuning (Section IV).
-
Role of Staged Hybrid Evidence
Earlier hybrid systems motivate the use of both clinical and imaging evidence [9][12]. The model uses both, but it deliberately does not fuse them into a single learned score. The documented results show why keeping the stages separate is informative. The two models are evaluated on different populations (synthetic patients and public CT volumes), have different error proles, and answer different questions. A fused score would hide these differences. In the staged design, a clinician sees an elevated laboratory risk and the imaging nding, or its absence, side by side, and can recognize dis- cordance: for example, a high clinical-risk probability together with a negative segmentation on the uploaded slices. Given the failure modes described above, such discordance is precisely the situation that calls for closer human review. The retirement of the earlier fusion design was driven by a technical con- straint, namely that tree ensembles produce no differentiable embedding. The resulting architecture nonetheless keeps each stages contribution attributable, which a fused design does not.
Within the clinical stage, the rule engine and the XGBoost model play complementary roles. The rule engine is fully deterministic, and its thresholds and point assignments can be audited line by line (Table II). The XGBoost model captures interactions among eleven features that a xed scoring rule cannot, and it still allows inspection of individual trees. Presenting both lets a user see when a learned model and a transparent heuristic agree, and when they do not.
-
Explainability
Explainability is provided in a form suited to each model. For the rule engine, the explanation is the list of reasons attached to each point. For the XGBoost model, it is the inspectable tree structure together with the list of imputed features. For the segmentation model, it is the gated Seg- Grad-CAM overlay. The design decisions in Seg-Grad-CAM respond to the conditions of the task, not to a generic recipe. The aggregated-probability target replaces the missing class score. The intermediate feature stage matches the scale of small LiTS lesions. The probability gating suppresses the diffuse attention that an image-wide target otherwise produces. The gating also has an important consequence. Because the map is multiplied by the models own prediction, it cannot highlight a lesion that the model failed to segment. For the missed case of Fig. 7, a gated map would be essentially empty. Seg-Grad-CAM in this framework therefore explains why the
model segmented what it segmented. It does not provide an independent check for missed lesions. This distinction should be conveyed to users so that an empty heatmap is not mistaken for reassurance.
-
Observed Strengths
Several properties of the implementation are supported directly by the project artifacts. The rst is leakage control. The imaging split is made at the volume level and veried so that no volume appears in more than one split. The clinical split is stratied and persisted, preprocessing is tted on training data only, hyperparameter search is conned to the training split, and each test split is used once. The second is transparency. Each stage produces its own verdict with rea- sons. The third is safety-oriented engineering: human review of OCR output, refusal to triage when no primary marker is available, required neighboring slices for 2.5D analysis, explicit caveats on intensity units and assumed spacing. The fourth is reproducibility, supported by xed seeds, persisted splits, stored hyperparameters, and resumable checkpoints.
-
Practical Implications
In its current form, it is best understood as a research and educational prototype of a staged decision-support workow. Taken together, the results suggest a usage pattern. Laboratory assessment can prioritize which patients imaging deserves attention. Segmentation can direct the reader to specic slices and regions and provide approximate size information. The explanation layers let each output be checked against its evidence. The documented failure modes indicate that the imaging output should serve as an aid to reading, not as a replacement for it, and that negative results in particular require corroboration.
-
-
Conclusion
This work presented an end-to-end decision-support frame- work for hepatocellular carcinoma that follows the order in which a clinician typically approaches a suspected case: serum biomarkers rst, imaging next, and a consolidated report last. Laboratory reports are digitised through OCR and pattern- based eld extraction. A verication step then lets the user correct any misread values before they inuence a decision. The conrmed markers are evaluated in two complementary ways: a transparent rule engine built on accepted clinical thresholds, which acts as the gate for imaging, and a gradient- boosted tree model that estimates HCC risk from tumour markers, liver function indices, viral status and demographic factors. For the imaging stage, a U-Net with an ImageNet- pretrained ConvNeXt-Tiny encoder segments lesions from CT. Its input stacks three adjacent axial slices, which supplies inter- slice context at the cost of a 2D network. A recall-oriented Tversky loss addresses the scarcity of tumour pixels, and a segmentation-adapted Grad-CAM, gated by the predicted lesion probability, shows clinicians which regions drove each prediction. The stages are served through a FastAPI backend and a React interface, and the outputs are summarised in
a generated report. Together, these elements show that a modular, interpretable pipeline running on modest hardware can bring biochemical and radiological evidence into a single workow without hiding the reasoning behind its outputs.
Several directions remain open. The clinical risk model should be retrained and validated on real, multi-centre patient records so that the relationships it has learned reect actual clinical populations, and the segmentation network should be tested prospectively on scans from different scanners and acquisition protocols. Extending the slice-stacking approach towards full volumetric modelling, addingMRI and contrast- phase information, and fusing clinical and imaging evidence into one jointly calibrated estimate are likely to improve the detection of small or atypical lesions. Integration with hospital information systems, structured feedback from radiologists, and formal evaluation of the explanation maps by domain experts would also be needed before the system could support routine screening. With these extensions, the framework could become a practical aid for earlier HCC detection, particularly in settings where specialist radiological expertise is limited.
References
-
V. Rao, P. Kulkarni, and S. Iyer, Articial intelligence in liver cancer diagnosis: A comprehensive review, IEEE Rev. Biomed. Eng., vol. 15,
pp. 210225, 2021.
-
R. Singh and M. Kumar, Articial intelligence-based medical diagnosis systems: A review, Comput. Biol. Med., vol. 123, 2020, Art. no. 103842.
-
A. Khan, M. Hassan, and S. Ahmed, CNN-based liver tumor detection in CT images, Multimedia Tools Appl., vol. 81, no. 5, pp. 65736588, 2022.
-
T. Nguyen, H. Pham, and J. Lee, Deep learning-based medical image analysis for liver cancer detection, IEEE Access, vol. 9, pp. 134567 134580, 2021.
-
J. Li, K. Wang, and Y. Zhang, Multi-scale deep learning approaches for liver tumor segmentation, IEEE Trans. Med. Imaging, vol. 42, no. 6, pp. 15501562, Jun. 2023.
-
R. Mehta and V. Shah, Automated liver segmentation techniques using deep learning, IEEE Access, vol. 10, pp. 4567845690, 2022.
-
S. Patel, D. Shah, and V. Rao, Clinical data-driven risk prediction models for liver cancer detection, Comput. Biol. Med., vol. 162, 2023, Art. no. 106945.
-
S. Das, A. Roy, and P. Ghosh, Deep learning for liver disease classi- cation using clinical data, Comput. Methods Programs Biomed., vol. 214, 2022, Art. no. 106563.
-
Y. Li, X. Chen, and H. Wang, Deep learning-based liver tumor detection using hybrid clinical and imaging data, IEEE Trans. Med. Imaging, vol. 44, no. 1, pp. 102115, Jan. 2025.
-
R. Kumar, S. Gupta, and A. Verma, Multimodal deep learning frame- work for liver cancer diagnosis using CT and clinical data, IEEE Access, vol. 13, pp. 4501245025, 2025.
-
L. Chen, M. Zhang, and Y. Zhao, Hybrid AI models for liver tumor detection integrating structured clinical features and imaging, IEEE J. Biomed. Health Informat., vol. 29, no. 2, pp. 890902, Feb. 2024.
-
D. Patel and A. Shah, Hybrid AI systems for medical diagnosis using clinical and imaging data, IEEE Access, vol. 9, pp. 9987699890, 2021.
-
T. Nguyen and K. Park, Explainable AI for liver cancer detection using Grad-CAM and CNN, IEEE Trans. Med. Imaging, vol. 42, no. 3, pp. 654666, Mar. 2023.
-
H. Wang, J. Li, and T. Zhou, Attention-based convolutional neural networks for liver lesion detection in CT images, IEEE Trans. Neural Netw. Learn. Syst., vol. 35, no. 4, pp. 17891801, Apr. 2024.
-
A. Verma, S. Jain, and P. Mishra, Deep learning applications in radiology for cancer detection, IEEE Access, vol. 8, pp. 145678 145690, 2020.
-
P. Sharma and R. Gupta, Tumor detection techniques using deep learning: A review, Multimedia Tools Appl., vol. 79, no. 29, pp. 21045 21060, 2020.
-
Y. Zhang, H. Chen, and X. Li, Vision transformer-based liver tumor detection in CT images, in Proc. IEEE Int. Symp. Biomed. Imaging (ISBI), 2022, pp. 345349.
-
P. Singh, R. Mehta, and K. Sharma, Deep learning-based liver tumor segmentation and classication: A survey, IEEE Access, vol. 12, pp. 112233112250, 2024.
-
M. Gupta, R. Singh, and A. Sharma, Hybrid machine learning models for cancer prediction using clinical datasets, IEEE Access, vol. 11, pp. 9032190335, 2023.
-
S. Iyer and R. Nair, Machine learning techniques for clinical data analysis in healthcare, Comput. Biol. Med., vol. 130, 2021, Art. no. 104245.
