Next Article in Journal
Enzymolysis-Driven Development of a Gut-Targeted Aronia melanocarpa Meal Replacement Powder with Glycemic Control and Microbial Homeostasis Benefits
Previous Article in Journal
Impact of Apple Pulp on Textural Characteristics, Microstructure, Volatile Profile, and Sensory Acceptance of Yogurts
Previous Article in Special Issue
Synergistic Treatment with Ozone Water and Morpholine Fatty Acid Salts Improves Postharvest Quality in Mandarin Oranges
 
 
Font Type:
Arial Georgia Verdana
Font Size:
Aa Aa Aa
Line Spacing:
Column Width:
Background:
Article

Non-Destructive Detection of Pomegranate Blackheart Disease via Near-Infrared Spectroscopy and Soft X-ray Imaging Systems

1
School of Food and Biological Engineering, Jiangsu University, Xuefu Road 301, Zhenjiang 212013, China
2
School of Electrical and Information Engineering, Jiangsu University, Xuefu Road 301, Zhenjiang 212013, China
*
Author to whom correspondence should be addressed.
Foods 2025, 14(14), 2454; https://doi.org/10.3390/foods14142454
Submission received: 24 May 2025 / Revised: 6 July 2025 / Accepted: 10 July 2025 / Published: 12 July 2025

Abstract

Pomegranate blackheart disease, as an internal disease affecting the global pomegranate industry, is difficult to identify externally and urgently requires non-destructive detection methods for rapid diagnosis. This study established discriminative models for blackheart disease severity in pomegranates by using near-infrared (NIR) spectroscopy and soft X-ray imaging techniques. The results showed that the optimal NIR-based discriminative model, constructed with a Random Forest (RF) algorithm based on spectra preprocessed by the second-derivative (D2) denoising and a Competitive Adaptive Reweighted Sampling (CARS) algorithm, achieved a prediction set accuracy of 86.00%; the optimal soft X-ray imaging-based discriminative model, built with an RF algorithm using textural features extracted from images preprocessed by median filtering and a Contrast-Limited Adaptive Histogram Equalization (CLAHE) algorithm combined with gray-level co-occurrence matrix (GLCM) and gray-gradient co-occurrence matrix (GGCM) algorithms, reached a prediction set accuracy of 93.10%. In terms of model performance, the model based on soft X-ray imaging exhibited superior performance. Both techniques possess distinct advantages and limitations yet enable non-destructive detection of pomegranate blackheart disease. Further technical optimizations in the future could provide enhanced support for the healthy development of the pomegranate industry.

1. Introduction

Pomegranate, indigenous to Central Asia (notably Iran and Afghanistan), is rich in diverse vitamins and polyphenols. Its sweet–tart flavor profile and documented dermatological benefits contribute to its broad consumer appeal. The fruit is extensively consumed fresh and processed into multiple value-added forms—including juices, jams, jellies, vinegar, wines, seed oils, and nutraceutical extracts—which enjoy substantial market acceptance globally.
However, pomegranates are susceptible to contamination by pathogenic fungi during harvesting and transportation, which can result in reduced fruit quality and yield. Pomegranate blackheart disease [1,2], also referred to as heart rot, is a major pathogen-induced disease that significantly affects pomegranate production worldwide. This internal disease is caused by infection with Alternaria species, which degrade the fruit’s cuticle and cell walls, triggering a series of physiological changes in the host tissue [3]. Upon opening the infected fruit, brown (soft) to black (dry) rot of the arils is observed. Notably, the external, hard skin of the fruit often appears healthy, masking the internal decay [4]. Due to the internal rot, infected fruit produces a hollow sound when struck, in contrast to the dull sound emitted by healthy fruit.
Currently, no effective control measures exist to prevent the spread of this disease, and healthy pomegranates can also become infected during storage, leading to significant losses. Once infected fruit enters the market, it not only negatively impacts the pomegranate industry but also poses food safety risks. Consequently, consumers may reject the affected pomegranates, resulting in a damaged brand reputation [5]. This rejection can adversely affect the long-term sales of pomegranate suppliers and cause substantial financial losses for pomegranate growers. According to reports, the losses of pomegranate products caused by Alternaria species could be substantial, with over 50% of the fruits in some areas being infected by blackheart disease [2].
However, because blackheart disease primarily affects the internal tissue, infected fruit often lacks external visual symptoms, making it challenging to identify at early stages. Presently, detection of pomegranate blackheart disease is largely reliant on expert analysis, where specialists use their experience to differentiate between healthy and infected fruit [6]. This method is highly subjective and prone to false positives or negatives, in addition to being time-consuming and labor-intensive. Therefore, there is a pressing need for the development of rapid, non-destructive detection technologies capable of assessing the internal condition of pomegranates and identifying infection [7].
Zhang et al. [8] employed nuclear magnetic resonance imaging (NMR) technology to analyze magnetic resonance (MR) images of both infected and healthy pomegranate fruits. Their study revealed that the edge of the false seed coat in the lesion area appeared blurred, whereas the healthy false seed coat was clearly delineated. Using the signal intensities in the image, the partial least squares discriminant analysis (PLS-DA) model was able to correctly identify the presence of black heart in pomegranate fruit with an accuracy of over 92%. Arendse et al. [9] employed X-ray computed tomography (CT) coupled with high-density reference phantoms, and the researchers established a non-destructive classification framework for pomegranate black heart disease. Crucially, the study revealed an inverse density–pathology correlation where disease severity escalates with diminishing tissue density. However, both aforementioned studies are constrained by suboptimal detection throughput, fundamentally compromising their translational viability for industrial implementation. In a similar vein, Myresiotis et al. [10] established a rapid detection method for Alternaria toxins in pomegranate samples, utilizing a quick, easy, cheap, effective, rugged, and safe method (QuEChERS) approach which yielded favorable results. The overall average recoveries ranged from 82.0% to 109.4% and the relative standard deviations were from 1.2% to 10.9%. However, this study mandates the implementation of destructive methodology to achieve its objectives. Munera et al. [11] established a blackheart disease detection model for pomegranates by integrating X-ray imaging with image processing algorithms, achieving a classification accuracy of 93.3%. Nevertheless, their sample acquisition methodology and image processing pipeline require further refinement. Therefore, to better serve industrial inspection settings, it is essential to achieve rapid, non-destructive detection of pomegranate blackheart disease.
The principle of NIR spectroscopy originates from the selective absorption of specific NIR wavelengths by hydrogen-containing groups in substances. This non-destructive analytical method combines NIR spectrometers, chemometrics, and mathematical modeling, with notable applications in detecting internal defects in fruits for agricultural quality assurance [12]. NIR spectroscopy has been successfully applied to apple moldy core disease detection [13], online non-destructive identification of internal mold infestation in sand pears [14], fungal contamination monitoring in walnut kernels [15], and pest infestation detection within fruits [16], providing effective solutions for internal disease and quality assessment. Furthermore, NIR spectroscopy demonstrates extensive applications in quantitative analysis, including in moisture content determination in black garlic and bread [17,18], soluble solids content (SSC) measurement in apples [19], total acidity assessment in Shanxi aged vinegar [20], and pH value detection in cocoa beans [21].
Soft X-ray imaging utilizes differential X-ray attenuation across materials of varying densities. The penetrating radiation intensity attenuates proportionally to encountered density gradients, with detectors converting transmitted signals into digital data. Computational analysis of these signals’ spatial distribution enables the reconstruction of internal density variations. This non-destructive technique allows for effective visualization and quantitative assessment of internal defects in fruits and agricultural products [22]. Matsui et al. [23] developed an automated detection model for stem-end rot in Hass avocado fruits using soft X-ray imaging technology. Van et al. [24] achieved automated segmentation of internal healthy and diseased tissues in citrus fruits through soft X-ray image acquisition. Francisca et al. [25] employed soft X-ray imaging combined with a Convolutional Neural Network (CNN) to precisely localize the position of seed decay within mango fruits.
Although NIR spectroscopy and soft X-ray imaging technology have demonstrated effective applications in internal quality inspections of other fruits, their utilization in detecting pomegranate blackheart disease has not yet been identified. As two rapid and non-destructive detection methods, the successful implementation of these technologies for pomegranate blackheart disease detection would significantly reduce costs and enhance efficiency compared to conventional detection approaches. Therefore, this study employed NIR spectroscopy and soft X-ray imaging technology combined with machine learning algorithms to establish detection models for pomegranate blackheart disease and systematically evaluated the performance of the models.

2. Materials and Methods

Figure 1 illustrates the experimental workflow. It comprised the following five sequential phases: (1) preparation of disease-infected pomegranate samples by artificial inoculation with pathogenic fungi; (2) acquisition of transmittance spectra from internal pomegranate tissues; (3) acquisition of internal soft X-ray images of pomegranate samples; (4) destructive verification of disease severity in pomegranate samples; (5) parallel processing of spectral datasets and X-ray image features followed by the construction of independent discriminant models.

2.1. Samples Preparation

In September 2024, 192 healthy pomegranates of similar sizes and free from pests and diseases were purchased from a pomegranate orchard in Mengzi, Yunnan. The fruits were transported to the laboratory via cold-chain logistics and stored at 25 °C for 24 h to equilibrate to ambient temperature. Compared with healthy samples, diseased samples present significantly higher acquisition challenges due to the impracticality of obtaining substantial diseased samples through manual harvesting. Reliance on destructive sampling methods for diseased samples collection would eliminate the possibility of subsequent non-destructive testing, whereas the application of high-cost imaging techniques (e.g., magnetic resonance imaging, computed tomography) for sample acquisition results in low acquisition efficiency and constrained sample quantities per session. Therefore, standardized experimental protocols for artificial disease induction must be established to systematically generate pathological sample data. Among these, 96 pomegranates were inoculated with fungal suspensions as the infected group, while the remaining 96 served as the healthy control group (without fungal inoculation). The experimental procedures are detailed in the follow paragraphs.

2.1.1. Fungal Cultivation

Under aseptic conditions, the Alternaria alternata slant culture was opened, and fungal colonies were extracted using an inoculating hoe. The colonies were fragmented with an inoculating shovel and transferred to Potato Dextrose Agar (PDA) plates. The plates were sealed for one week until the fungal colonies fully covered the medium surface (as shown in Figure 2).

2.1.2. Fungal Inoculation

Alternaria alternata mycelia were transferred to a pre-prepared 10 mL sterile saline solution in a centrifuge tube. The tube was tightly sealed and vortexed at high speed for 10 min to homogenize the suspension. The spore concentration was quantified using a hemocytometer and adjusted to 3 × 105 CFU/mL for subsequent injection. Prior to injection, the pomegranate surfaces were sterilized with 5% sodium hypochlorite solution to prevent microbial contamination. Fungal inoculation was performed by injecting the suspension into the calyx region using a sterile syringe. Single injections were administered using 1 mL disposable syringes with a dosage of 0.3 mL per injection. To ensure experimental reliability, syringes were strictly prohibited from reuse to prevent cross-contamination.
Based on Ezra’s research [26], Alternaria alternata exhibits accelerated growth under 20 °C and high-humidity conditions, reaching peak activity around the sixth day. Therefore, the disease development process was conducted in a constant temperature and humidity chamber maintained at 20 °C and 90% RH. Preliminary experiments revealed that pomegranates inoculated with the fungus developed near-complete blackheart disease decay by the fifth day under optimal conditions (Figure 3). To align with practical diagnostic needs focusing on early- and mid-stage disease identification, the 96 infected pomegranates were further subdivided into three groups. To enable simultaneous detection experiments on pomegranates with varying disease severity levels at the same time point, three groups of pomegranates were inoculated with fungi at different time intervals. Among these, the group inoculated first developed the longest disease progression period and most severe symptoms, whereas the group inoculated last exhibited the shortest disease progression period and mildest symptom development. The grouping of pomegranate samples is listed in Table 1.

2.2. NIR Spectroscopy Acquisition

The custom spectral acquisition system developed at the authors’ institution is illustrated in Figure 4. It consists of two symmetrically arranged halogen lamps with cooling fans, and a food-grade silicone tray fixed at the center to secure fruit positioning and provide light shielding. The entire setup is enclosed within an aluminum alloy chamber to prevent interference from ambient light. The SE2050 spectrometer (OtO Photonics Inc., Taiwan, China) and other detection components are housed at the base, while a collimating lens positioned at the center of the silicone tray interfaces with the spectrometer to capture transmitted spectral data through the pomegranates.
The light sources were positioned 20 cm above the baseplate at a 45° angle relative to the vertical normal. Instrumental parameters were configured as follows: integration time of 500 ms, scan averaging count of 3, and smoothing width of 5. The spectrometer was connected to a computer via a USB cable, enabling real-time transmission of acquired spectral data to the computer system.

2.3. Soft X-Ray Image Acquisition

Following spectral data acquisition, all pomegranate samples were securely packaged in anti-collision soft foam and immediately transported to Wuxi UNICOMP Technology Co., Ltd. (Wuxi, China). Imaging was performed using a UNX3015-S system (as shown in Figure 5), which integrates a conveyor belt and an X-ray imaging assembly. Operational parameters were set as follows: tube voltage at 80 kV, tube current at 2 mA, and gamma value at 1. To prevent the rotational movement of pomegranates during conveyor belt transport, a low-density polyethylene foam board (6 cm thick) was affixed to the belt, featuring an 8 cm diameter central aperture to securely embed each fruit. Preliminary trials established a maximum conveyor speed of 0.4 m/s, as higher velocities risked sample rotation and compromised image quality. After parameter optimization, sequential imaging was conducted for all samples.

2.4. Destructive Verification

After completing non-destructive testing (NDT) on pomegranate samples, the specimens were cut along the calyx and cross-sectional images were captured vertically using an industrial camera. The internal seed regions of the pomegranate were segmented, and based on expert evaluation, the blackheart disease areas within the images were identified. The pixel ratio of the diseased regions to the total cross-sectional area of the pomegranate was calculated to quantitatively characterize the actual infection level. The disease severity obtained through destructive testing was recorded and served as the dataset foundation for subsequent discriminant model development.

2.5. Preprocessing of NIR Spectroscopy

To enhance the quality of spectral data, the Local Outlier Factor (LOF) algorithm and the Mahalanobis distance method were employed to eliminate outliers from sample spectra [27,28,29]. A Partial Least Squares Discriminant Analysis (PLS-DA) model was established on the remaining dataset after outlier elimination [30,31,32]. The effectiveness of outlier removal was evaluated using metrics including testing set accuracy, F1-score, five-fold average accuracy, and five-fold average F1-score.
During practical NIR spectroscopic measurements, factors including particle size inhomogeneity, surface texture variations in samples, and minor environmental fluctuations during measurement may introduce noise interference, compromising both spectral data quality and the accuracy of subsequent analytical results. These interferences pose significant challenges to subsequent data analysis and feature extraction processes. To mitigate adverse effects induced by noise, five distinct denoising methodologies were implemented on spectral data after outlier removal. The specific methods used are as follows: Multiplicative Scatter Correction (MSC), Standard Normal Variate (SNV) transformation, Savitzky–Golay (SG) smoothing algorithm, and derivative algorithms (first derivative and second derivative) [33]. Based on the outlier-removed spectral data and different denoising processing algorithms, classification models for pomegranate blackheart disease were established by integrating Random Forest (RF) and Support Vector Machine (SVM) algorithms [34].
To further optimize the model’s performance, three algorithms—Competitive Adaptive Reweighted Sampling (CARS), Successive Projections Algorithm (SPA), and Principal Component Analysis (PCA)—were employed to enhance the model’s performance [35,36,37,38]. The model performance was evaluated using accuracy rates, F1-scores, and confusion matrices from both training and prediction sets [39]. The entire preprocessing and modeling procedures were implemented using MATLAB 2023b (MathWorks, Natick, MA, USA) software.

2.6. Preprocessing of Soft X-Ray Image

The threshold segmentation method was employed to separate pomegranate subjects from the background. By setting an appropriate grayscale threshold, image pixels were categorized into two groups: those with grayscale values exceeding the threshold and those below it. Through iterative experimental adjustments in this study, the optimal grayscale threshold was ultimately determined as 200. This process effectively isolated pomegranate specimens from the background, eliminating interference while highlighting structural information of the fruit subjects. The segmentation procedure is visually demonstrated in Figure 6.
The segmented images were subsequently subjected to noise reduction using a median filtering algorithm for soft X-ray images, followed by contrast enhancement through the Contrast-Limited Adaptive Histogram Equalization (CLAHE) algorithm [40,41]. As an advanced version of traditional histogram equalization, the CLAHE algorithm adaptively performs histogram equalization on different image regions, thereby mitigating the local over-enhancement issues inherent in conventional methods.
Texture features were extracted based on the gray-level co-occurrence matrix (GLCM) and the gray-gradient co-occurrence matrix (GGCM), generating 21 texture characteristic parameters whose computational formulas are detailed in Table 2 [42,43]. Among these, No.1–No.6 represent texture features derived from the GLCM, where angular second moment quantifies textural homogeneity and coarseness, correlation measures gray-level similarity along row or column directions, entropy indicates randomness in image information content, contrast reflects image clarity and textural depth, homogeneity describes textural fineness and complexity, while variance characterizes deviations in gray-level distribution. No.7–No.21 correspond to features extracted from the GGCM, which provide additional feature parameters for developing enhanced classification models.
Classification models for pomegranate blackheart disease were established by integrating these texture features with Random Forest (RF) and Support Vector Machine (SVM) algorithms [44,45]. Model performance was evaluated using accuracy rates and F1-scores from both training and testing sets as evaluation metrics. The entire preprocessing and modeling procedures were implemented using MATLAB 2023b (MathWorks, Natick, MA, USA) software.

3. Results and Discussion

3.1. Destructive Testing Results of Pomegranate Disease Severity

The internal tissue coloration of pomegranates is more complex compared to fruits like apples. To extract infected regions from cross-sectional images, this study converts RGB images of pomegranate sections into the HSV color space. The seed-containing regions within the pomegranate are segmented, and morphological operations are applied to remove background noise. Subsequently, the complete aril regions are reconstructed through iterative morphological dilation operations. Guided by expert evaluations, areas with brightness values below a predefined threshold are identified as blackheart disease regions. The pixel ratio of these diseased areas to the entire cross-sectional area is calculated to serve as a quantitative representation of the true infection severity. The image processing workflow for pomegranate cross-sections is illustrated in Figure 7.
As an internal pathological condition, blackheart disease has traditionally been evaluated using qualitative assessment methods. To enhance the discrimination of infection severity, this study employed destructive detection methods combined with image processing techniques to quantify the actual infection extent, which was subsequently classified into distinct severity grades. These categorized grades served as the output parameters for the discrimination models of pomegranate blackheart disease established through NIR spectroscopy/soft X-ray imaging technologies. The specific classification criteria are detailed in Table 3. Based on the dual classification of the area ratio of internal disease regions detected through destructive testing and the number of days after inoculation, this approach maintains an equal number of pomegranate samples for each disease severity category.

3.2. Descriptive Analysis of Healthy and Infected Pomegranate Samples

Figure 8 displays both raw and mean spectral absorbance curves from all 192 pomegranate specimens spanning diverse infection severity grades. Although the overall spectral trends between healthy and infected specimens demonstrated similarity, statistically significant differences in absorbance were observed within specific wavelength ranges. Notably, healthy specimens exhibited distinct absorption peaks within both 725–750 nm and 750–775 nm spectral regions. In the 850–875 nm range, healthy samples manifested the most rapid rate of absorbance variation, whereas this rate progressively decreased with escalating infection severity, reaching its most attenuated state in Grade 3 specimens. Based on these descriptive observations, we hypothesize that derivative preprocessing algorithms may exert beneficial impacts on subsequent modeling analyses.
As shown in Figure 9, the soft X-ray images of pomegranate samples underwent preprocessing with median filtering and Contrast-Limited Adaptive Histogram Equalization (CLAHE). The postprocessed images exhibit significantly enhanced textural distinctions. Visual inspection of soft X-ray images across sample groups reveals that healthy pomegranates display tightly packed arils with uniform seed distribution in the images, attributable to the consistent density and structural integrity of uninfected tissues. In contrast, blackheart disease-infected samples exhibit localized hypodense regions or dark patches in the images, corresponding to fungal colonization sites where the cellular architecture undergoes progressive degradation. This pathological progression leads to seed dehydration and structural collapse, manifesting as reduced grayscale values and diminished textural complexity. However, such qualitative assessments remain inherently subjective and lack the capacity for precise quantitative staging of infection severity. Consequently, advanced computational approaches are required to extract objective, quantifiable features through systematic image analysis.

3.3. NIR Spectroscopy-Based Discriminant Model

3.3.1. Outlier Elimination

Following standardized NIR spectroscopy preprocessing protocols, spectral outliers were systematically eliminated as the initial step to ensure data integrity. Both the Local Outlier Factor (LOF) algorithm and the Mahalanobis distance method employ threshold-based elimination of data points exhibiting significant deviations. The removal of outliers can effectively mitigate the impact of human-induced or random errors, thus enhancing data quality.
As illustrated in Figure 10, the LOF algorithm retained 185 data points after removing 192 outliers, whereas the Mahalanobis distance method retained 181 data points. Notably, the anomalies detected by both methods predominantly originated from healthy pomegranate samples. This phenomenon may arise from class imbalance, where healthy samples numerically dominate other categories. In such cases, the majority class (healthy samples) typically exhibits a wider distribution within the data matrix, resulting in sparser inter-point distances that are computationally predisposed to outlier identification.
The performance metrics of the partial least squares discriminant analysis (PLS-DA) models constructed using the datasets remaining after applying two distinct outlier elimination algorithms are summarized in Table 3. As indicated in Table 4, the PLS-DA model derived from Mahalanobis distance-filtered data demonstrates superior performance compared to that based on Local Outlier Factor (LOF)-processed data. Specifically, the Mahalanobis distance approach yields higher classification accuracy on the test set, improved five-fold cross-validation mean accuracy, and enhanced F1-scores relative to the LOF method. However, a marginally lower F1-score observed in the test set may arise from stochastic variations in test set partitioning during simulation. Consequently, the Mahalanobis distance-filtered dataset was selected for subsequent blackheart disease detection trials in pomegranates due to its robust modeling performance.

3.3.2. Spectral Denoising

According to the processing results of different denoising algorithms shown in Figure 11, it can be observed that smoothing-based algorithms such as SNV, SG, and MSC can regularize the variation trends of spectral curves. The SNV algorithm effectively mitigates inter-sample physical variations; the SG smoothing algorithm eliminates high-frequency noise while preserving spectral trends; and the MSC algorithm standardizes spectral baselines.
However, this smoothing effect may potentially weaken characteristic features in specific spectral regions, thereby affecting modeling accuracy. Furthermore, the D1 (first derivative) algorithm accentuates absorption peak positions, and the D2 (second derivative) algorithm more effectively suppresses baseline drift.
To evaluate the efficacy of various denoising algorithms, we concurrently developed discrimination models for blackheart disease using both RF and SVM approaches. The denoised spectral data served as model inputs, whereas the outputs corresponded to pomegranate infection severity grades. The performance metrics of these algorithms are comprehensively summarized in Table 5.
As shown in Table 5, the discrimination model combining the second-derivative (D2) algorithm with the RF algorithm achieved optimal performance, with a prediction set accuracy of 84%. The choice of preprocessing methods significantly influenced the performance of RF in the discrimination model. In contrast, the D2 algorithm exhibited suboptimal performance in the SVM model, yielding a prediction set accuracy of only 72%. This phenomenon can be attributed to the derivative algorithm potentially enhancing the nonlinear structural relationships between features, thereby facilitating more effective data partitioning by RF. Conversely, SVM’s performance is highly dependent on sensitivity to feature scaling and reliance on high-dimensional information, leading to limited effectiveness under the same preprocessing condition. Concurrently, we observed a generalized performance degradation in SVM models constructed from denoised preprocessed data. This phenomenon was attributed to shifts in the optimal hyperparameter space induced by preprocessing operations, thereby necessitating further refinement of SVM hyperparameter tuning protocols.
Experimental results indicated that some predictions achieved an F1-score of 100% yet suboptimal accuracy, potentially due to class imbalance influencing model behavior. When data classes were imbalanced, the model tended to prioritize majority-class predictions. For instance, perfect precision and recall (both 100%) for healthy pomegranate samples would yield an F1-score of 100%, whereas misclassifications in blackheart disease samples across different infection stages led to reduced overall accuracy. To mitigate this bias, the number of healthy samples was adjusted from 96 to 32, matching the 32 blackheart disease samples (categorized by infection duration), thereby ensuring balanced datasets and enhancing experimental reliability.

3.3.3. Feature Wavelength Selection

Following the adjustment of healthy sample size, spectral data were subjected to wavelength selection using CARS, SPA, and PCA algorithms, yielding 62, 50, and 8 feature wavelengths, respectively. Training and test sets were partitioned in a 7:3 ratio, and RF algorithm-based classification models for pomegranate blackheart disease were subsequently established. The performance metrics of these models are summarized in Table 6.
Figure 12 illustrates the feature wavelength selection process of the CARS algorithm. The analysis suggests that the CARS algorithm, through iterative adaptive reweighting, prioritizes stable and influential spectral features, thereby exhibiting enhanced noise resistance. Its adaptive mechanism effectively mitigates the impact of data noise, contributing to robust performance. In contrast, the SPA showed higher sensitivity to spectral noise, leading to suboptimal projection calculations due to interference from noisy signals. Meanwhile, PCA dimensionality reduction resulted in insufficient interpretability of original spectral features, limiting the classification accuracy of the model.
As shown in Table 6, the RF model incorporating CARS-based feature selection demonstrated superior performance, achieving a test set accuracy of 86.00%. Analysis of the confusion matrix results from the D2-CARS-RF model in Figure 13 revealed that misclassifications in the test set predominantly occurred between samples infected for Grade 2 and Grade 3. This is likely due to minimal differences in disease severity between these two stages, resulting in high data similarity that compromised the model’s classification performance.

3.4. Soft X-Ray Imaging-Based Discriminant Model

Using the computational formulas provided in Table 2 and the preprocessed images of all samples, the textural features of all samples were calculated. The mean values of each textural feature across different sample groups are presented in Table 7.
Using the textural feature data of all samples as the input and the infection severity grades of pomegranates as the output, RF and SVM classification models were constructed. The dataset was partitioned into training and test sets at a 7:3 ratio, with the training set utilized for model training and hyperparameter optimization and the test set reserved for evaluating model performance.
Through systematic experimentation, the hyperparameters of both RF and SVM models were optimized to identify optimal configurations for the experimental data. For the RF model the number of decision trees was set to 100 and the number of randomly selected features (mtry) was fixed at two. For the SVM model, comparative trials with different kernel functions (linear, polynomial, and radial basis function (RBF)) revealed that the RBF kernel achieved superior performance on this dataset. The optimal hyperparameters for SVM were determined as regularization parameter C = 10 and kernel coefficient γ = 0.1, which collectively enhanced classification accuracy.
To validate the models’ capability to generalize to unseen samples, the performance of both the RF and SVM models was rigorously evaluated on the test set. The key performance metrics are summarized in Table 8. As shown in Table 8, the RF model achieved the highest performance on the test set, with an overall accuracy of 93.10%. The confusion matrix of the RF model is shown in Figure 14. Analysis of the confusion matrix revealed that the model achieved perfect classification accuracy (100%) for Grade 0 and Grade 2 samples. However, predictions for Grade 1 and Grade 3 samples each exhibited two misclassifications. The model demonstrated robust performance in identifying healthy pomegranates and those with Grade 2 blackheart disease infections, whilst showing minor inaccuracies in classifying Grade 1 and Grade 3 infected samples. Nevertheless, when evaluated through comprehensive metrics (overall accuracy and F1-score), the RF model exhibited strong classification capability. These findings collectively indicate that the RF model effectively discriminates pomegranate samples at different stages of blackheart disease progression.

3.5. NIR Spectroscopy vs. Soft X-Ray Imaging

Based on the experimental findings of this study, both detection technologies successfully discriminated pomegranate blackheart disease across varying infection severities, providing two novel approaches for pathological detection. The results demonstrated that the RF model exhibited optimal performance when combining either technique. Among the top-performing models, the discrimination model based on soft X-ray imaging achieved superior efficacy, attaining 93.10% prediction set accuracy and a 98.11% F1-score.
However, model performance was influenced by multiple factors including hardware specifications, sample size, and algorithm compatibility. Consequently, future research optimizations should focus on employing higher-precision spectrometers and soft X-ray imaging equipment, expanding the experimental sample size for modeling, and integrating advanced deep learning algorithms. Current detection methods rely solely on off-the-shelf commercial devices. Future adoption of custom-engineered spectrometers or soft X-ray imaging systems coupled with in-house developed software could substantially reduce ancillary costs and enhance the cost-effectiveness of detection methodologies.
Both detection techniques possess distinct advantages. NIR spectroscopy fundamentally reflects the internal chemical properties of pomegranates by detecting the response of hydrogen-containing groups to light at different wavelengths. During transmission-mode detection, future studies could combine chemometric methods to simultaneously evaluate physicochemical indices (e.g., pH, soluble solid content, and titratable acidity) while diagnosing blackheart disease. Soft X-ray imaging primarily identifies internal physical characteristics by detecting density variations across different regions of pomegranates. With the integration of conveyor belts and high-precision imaging devices, this technique holds potential for continuous high-throughput detection of large sample batches. Simultaneously, future research could employ information fusion techniques to construct discriminative models by integrating data from dual sensors, thereby further enhancing model accuracy.

4. Conclusions

In this study, pomegranate samples with blackheart disease at different infection stages were prepared through artificial fungal inoculation. Transmission-mode NIR spectroscopy was employed to collect spectral data from healthy and infected samples, while soft X-ray imaging was simultaneously applied to acquire internal structural images. Visual assessment of average absorbance differences across infection stages revealed significant spectral variations in the 725–775 nm and 850–875 nm wavelength ranges. Comparative analysis of soft X-ray images demonstrated that healthy pomegranates exhibited distinct seed texture features, which progressively diminished with increasing disease severity.
Blackheart disease prediction models were developed based on NIR spectral data and preprocessing methods, incorporating five denoising algorithms. The model utilizing second-derivative preprocessing demonstrated the best predictive performance, achieving a prediction set accuracy of 84.00% and an F1-score of 98.11%. Further optimization through three feature wavelength selection algorithms identified the D2-CARS-RF model as optimal with 62 selected wavelengths, attaining a prediction set accuracy of 86.00% and an F1-score of 89.33%.
For soft X-ray image analysis, preprocessing techniques including median filtering and CLAHE were implemented. Twenty-one textural features were extracted from all samples using GLCM and GGCM methods to establish classification models. The RF model exhibited superior performance, achieving a prediction set accuracy of 93.10% and an F1-score of 98.11%. The established model demonstrated robust performance in discriminating pomegranate blackheart disease across varying infection severities.
This study proposes two novel methodologies for blackheart disease discrimination, validating NIR spectroscopy and soft X-ray imaging as valuable tools for assessing disease progression. Technical strengths and limitations were systematically analyzed based on experimental outcomes. Industrial implementation of these techniques could enhance consumer safety, protect commercial interests, and promote sustainable development in the pomegranate industry.

Author Contributions

Conceptualization, X.H. and R.N.; methodology, S.Y.; software, R.N. and Q.F.; validation, X.H., R.N., and X.T.; formal analysis, R.N.; investigation, S.Y.; resources, X.Z. and C.D.; data curation, R.N.; writing—original draft preparation, R.N. and X.H.; writing—review and editing, R.N., Q.F., and X.Z.; visualization, S.Y.; supervision, X.T.; project administration, X.H.; funding acquisition, X.T. and X.H. All authors have read and agreed to the published version of the manuscript.

Funding

This research was funded by the Natural Science Foundation of Jiangsu Province (BK20230523) and Postgraduate Research & Practice Innovation Program of Jiangsu Province (SJCX23_2093).

Institutional Review Board Statement

Not applicable.

Informed Consent Statement

Not applicable.

Data Availability Statement

The original contributions presented in the study are included in the article, further inquiries can be directed to the corresponding author.

Conflicts of Interest

The authors declare no conflicts of interest.

References

  1. Kahramanoglu, I.; Usanmaz, S.; Nizam, I. Incidence of heart rot at pomegranate fruits caused by Alternaria spp. in Cyprus. Afr. J. Agric. Res. 2014, 9, 905–907. [Google Scholar]
  2. Tziros, G.T.; Lagopodi, A.L.; Tzavella-Klonari, K. Alternaria alternata fruit rot of pomegranate (Punica granatum) in Greece. Plant Pathol. 2008, 57, 379. [Google Scholar] [CrossRef]
  3. Ezra, D.; Kirshner, B.; Gat, T.; Shteinberg, D.; Kosto, I. Heart rot of pomegranate, when and how does the pathogen cause the disease? Acta Hortic. 2015, 1089, 167–171. [Google Scholar] [CrossRef]
  4. Perelló, A.; Moreno, M.; Sisterna, M.; Tziros, G.T.; Lagopodi, A.L.; Tzavella-Klonari, K. Alternaria infectoria species-group associated with black point of wheat in Argentina. Plant Pathol. 2008, 57, 379. [Google Scholar] [CrossRef]
  5. Jaeger, S.R.; Antúnez, L.; Ares, G.; Johnston, J.W.; Hall, M.; Harker, F.R. Consumers’ visual attention to fruit defects and disorders: A case study with apple images. Postharvest Biol. Technol. 2016, 116, 36–44. [Google Scholar] [CrossRef]
  6. Vicent, A.; Bartual, J.; Mira, J.L. Notas preeliminares sobre el corazón negro de la granada causado por Alternaria. Agrícola Vergel Frutic. Hortic. Floric. 2015, 34, 349–352. [Google Scholar]
  7. Nouri, B.; Mohtasebi, S.S.; Rafiee, S. Quality detection of pomegranate fruit infected with fungal disease. Int. J. Food Prop. 2020, 23, 9–21. [Google Scholar] [CrossRef]
  8. Zhang, L.; McCarthy, M.J. Black heart characterization and detection in pomegranate using NMR relaxometry and MR imaging. Postharvest Biol. Technol. 2012, 67, 96–101. [Google Scholar] [CrossRef]
  9. Arendse, E. Estimation of the density of pomegranate fruit and their fractions using X-ray computed tomography calibrated with polymeric materials. Biosyst. Eng. 2016, 148, 148–156. [Google Scholar] [CrossRef]
  10. Myresiotis, C.K.; Testempasis, S.; Vryzas, Z.; Karaoglanidis, G.S.; Papadopoulou-Mourkidou, E. Determination of mycotoxins in pomegranate fruits and juices using a QuEChERS-based method. Food Chem. 2015, 182, 81–88. [Google Scholar] [CrossRef]
  11. Munera, S.; Rodríguez-Ortega, A.; Cubero, S.; Aleixos, N.; Blasco, J. Automatic detection of pomegranate fruit affected by blackheart disease using X-ray imaging. LWT 2025, 215, 117248. [Google Scholar] [CrossRef]
  12. Xie, L.J.; Wang, A.C.; Xu, H.R.; Fu, X.P.; Ying, Y.B. Applications of near-infrared systems for quality evaluation of fruits: A review. Trans. ASABE 2016, 59, 399–419. [Google Scholar]
  13. Jiang, X.; Ge, K.; Liu, Z.; Chen, N.; Ouyang, A.; Liu, Y.; Huang, Y.; Li, J.; Hu, M. Non-destructive online detection of early moldy core apples based on Vis/NIR transmission spectroscopy. Chem. Biol. Technol. Agric. 2024, 11, 63. [Google Scholar] [CrossRef]
  14. Zhang, Q.; Huang, W.Q.; Wang, Q.Y.; Wu, J.Z.; Li, J.B. Detection of pears with moldy core using online full-transmittance spectroscopy combined with supervised classifier comparison and variable optimization. Comput. Electron. Agric. 2022, 200, 107231. [Google Scholar] [CrossRef]
  15. An, M.H.; Cao, C.M.; Wang, S.S.; Zhang, X.C.; Ding, W.Y. Non-destructive identification of moldy walnut based on NIR. J. Food Compos. Anal. 2023, 121, 105407. [Google Scholar] [CrossRef]
  16. Jamshidi, B. Ability of near-infrared spectroscopy for non-destructive detection of internal insect infestation in fruits: Meta-analysis of spectral ranges and optical measurement modes. Spectrochim. Acta Part A Mol. Biomol. Spectrosc. 2020, 225, 117479. [Google Scholar] [CrossRef] [PubMed]
  17. Tian, X.; Fang, Q.; Zhang, X.; Yu, S.; Dai, C.; Huang, X. Visualization of Moisture Content, Reducing Sugars, and Chewiness in Bread During Oral Processing Based on Hyperspectral Imaging Technology. Foods 2024, 13, 3589. [Google Scholar] [CrossRef]
  18. Yu, S.; Huang, X.; Xu, F.; Ren, Y.; Dai, C.; Tian, X.; Wang, L.; Zhang, X. Production monitoring and quality characterization of black garlic using Vis-NIR hyperspectral imaging integrated with chemometrics strategies. Spectrochim. Acta Part A Mol. Biomol. Spectrosc. 2025, 326, 125182. [Google Scholar] [CrossRef]
  19. Guo, Z.; Chen, X.; Zhang, Y.; Sun, C.; Jayan, H.; Majeed, U.; Watson, N.J.; Zou, X. Dynamic Nondestructive Detection Models of Apple Quality in Critical Harvest Period Based on Near-Infrared Spectroscopy and Intelligent Algorithms. Foods 2024, 13, 1698. [Google Scholar] [CrossRef]
  20. Zhang, X.; Huang, X.; Harrington Aheto, J.; Xu, F.; Dai, C.; Ren, Y.; Wang, L.; Yu, S. Rapid non-destructive monitoring and quality assessment of the fumigation process of Shanxi aged vinegar based on Vis-NIR hyperspectral imaging combined with multiple chemometric algorithms. Spectrochim. Acta Part A Mol. Biomol. Spectrosc. 2024, 320, 124539. [Google Scholar] [CrossRef]
  21. Teye, E.; Huang, X.; Sam-Amoah, L.K.; Takrama, J.; Boison, D.; Botchway, F.; Kumi, F. Estimating cocoa bean parameters by FT-NIRS and chemometrics analysis. Food Chem. 2015, 176, 403–410. [Google Scholar] [CrossRef] [PubMed]
  22. Mahanti, N.K.; Pandiselvam, R.; Kothakota, A.; Ishwarya, S.P.; Chakraborty, S.K.; Kumar, M.; Cozzolino, D. Emerging non-destructive imaging techniques for fruit damage detection: Image processing and analysis. Trends Food Sci. Technol. 2022, 120, 418–438. [Google Scholar] [CrossRef]
  23. Matsui, T.; Kamata, T.; Koseki, S.; Koyama, K. Development of automatic detection model for stem-end rots of ‘Hass’ avocado fruit using X-ray imaging and image processing. Postharvest Biol. Technol. 2022, 192, 111996. [Google Scholar] [CrossRef]
  24. Van Dael, M.; Lebotsa, S.; Herremans, E.; Verboven, P.; Sijbers, J.; Opara, U.L.; Cronje, P.J.; Nicolaï, B.M. A segmentation and classification algorithm for online detection of internal disorders in citrus using X-ray radiographs. Postharvest Biol. Technol. 2016, 112, 205–214. [Google Scholar] [CrossRef]
  25. Tempelaere, A.; Van Doorselaer, L.; He, J.; Verboven, P.; Nicolai, B.M. BraeNet: Internal disorder detection in ‘Braeburn’ apple using X-ray imaging data. Food Control. 2024, 155, 110092. [Google Scholar] [CrossRef]
  26. Ezra, D.; Shulhani, R.; Shtienberg, D. A method for quantifying the response of asymptomatic pomegranate fruit to Alternaria alternata, the causal agent of black heart disease of pomegranate. Acta Hortic. 2019, 1254, 257–262. [Google Scholar] [CrossRef]
  27. Xiang, S.; Nie, F.; Zhang, C. Learning a Mahalanobis distance metric for data clustering and classification. Pattern Recognit. 2008, 41, 3600–3612. [Google Scholar] [CrossRef]
  28. Liu, H.; Zhang, S.; Wu, Z.; Li, X. Outlier detection using local density and global structure. Pattern Recognit. 2025, 157, 110947. [Google Scholar] [CrossRef]
  29. Muhr, D.; Affenzeller, M. Little data is often enough for distance-based outlier detection. Procedia Comput. Sci. 2022, 200, 984–992. [Google Scholar] [CrossRef]
  30. Zhang, L.; Zhang, S.; Sun, M.; Wang, Z.; Li, H.; Li, Y.; Li, G.; Lin, L. Blood species identification using Near-Infrared diffuse transmitted spectra and PLS-DA method. Infrared Phys. Technol. 2016, 76, 587–591. [Google Scholar] [CrossRef]
  31. Zhang, Z.; Pu, Y.; Wei, Z.; Liu, H.; Zhang, D.; Zhang, B.; Zhang, Z.; Zhao, J.; Hu, J. Combination of interactance and transmittance modes of Vis/NIR spectroscopy improved the performance of PLS-DA model for moldy apple core. Infrared Phys. Technol. 2022, 126, 104366. [Google Scholar] [CrossRef]
  32. Guo, Z.; Guo, C.; Chen, Q.; Ouyang, Q.; Shi, J.; El-Seedi, H.R.; Zou, X. Classification for Penicillium expansum Spoilage and Defect in Apples by Electronic Nose Combined with Chemometrics. Sensors 2020, 20, 2130. [Google Scholar] [CrossRef] [PubMed]
  33. Ren, Y.; Huang, X.; Aheto, J.H.; Wang, C.; Ernest, B.; Tian, X.; He, P.; Chang, X.; Wang, C. Application of volatile and spectral profiling together with multimode data fusion strategy for the discrimination of preserved eggs. Food Chem. 2021, 343, 128515. [Google Scholar] [CrossRef]
  34. Yu, S.; Huang, X.; Wang, Y.; Wang, L.; Chang, X.; Ren, Y.; Zhang, X. Characterization and quantification of the taste profiles of black garlic via a novel multi-channel colorimetric sensor array and chemometrics. J. Food Compos. Anal. 2025, 138, 107005. [Google Scholar] [CrossRef]
  35. Falade, T.D.O.; Sultanbawa, Y.; Fletcher, M.T.; Fox, G. Near Infrared Spectrometry for Rapid Non-Invasive Modelling of Aspergillus-Contaminated Maturing Kernels of Maize (Zea mays L.). Agriculture 2017, 7, 77. [Google Scholar] [CrossRef]
  36. Kong, H.; Wang, J.; Lin, G.; Chen, J.; Xie, Z. Analysis of Nutritional Content in Rice Seeds Based on Near-Infrared Spectroscopy. Photonics 2025, 12, 481. [Google Scholar] [CrossRef]
  37. Wang, J.; Zhou, X.; Liu, Y.; Sun, J.; Guo, P.; Lv, W. An efficient nondestructive detection method of rapeseed varieties based on hyperspectral imaging technology. Microchem. J. 2025, 210, 112913. [Google Scholar] [CrossRef]
  38. Hu, L.; Yin, C.; Ma, S.; Liu, Z. Rapid detection of three quality parameters and classification of wine based on Vis-NIR spectroscopy with wavelength selection by ACO and CARS algorithms. Spectrochim. Acta Part A Mol. Biomol. Spectrosc. 2018, 205, 574–581. [Google Scholar] [CrossRef]
  39. Sokolova, M.; Lapalme, G. A systematic analysis of performance measures for classification tasks. Inf. Process. Manag. 2009, 45, 427–437. [Google Scholar] [CrossRef]
  40. Rifai, A.M.; Raharjo, S.; Utami, E.; Ariatmanto, D. Analysis for diagnosis of pneumonia symptoms using chest X-ray based on MobileNetV2 models with image enhancement using white balance and contrast limited adaptive histogram equalization (CLAHE). Biomed. Signal Process. Control. 2024, 90, 105857. [Google Scholar] [CrossRef]
  41. Nguyen-Tat, T.B.; Hung, T.Q.; Nam, P.T.; Ngo, V.M. Evaluating pre-processing and deep learning methods in medical imaging: Combined effectiveness across multiple modalities. Alex. Eng. J. 2025, 119, 558–586. [Google Scholar] [CrossRef]
  42. Haralick, R.M. Statistical and structural approaches to texture. Proc. IEEE 1979, 67, 786–804. [Google Scholar] [CrossRef]
  43. Qiao, S.; Tian, Y.; Song, P.; He, K.; Song, S. Analysis and detection of decayed blueberry by low field nuclear magnetic resonance and imaging. Postharvest Biol. Technol. 2019, 156, 110951. [Google Scholar] [CrossRef]
  44. Guru, D.S.; Nandini, D. Mango Internal Defect Detection using NIR Spectroscopy Data. Procedia Comput. Sci. 2025, 258, 947–960. [Google Scholar] [CrossRef]
  45. Nyasulu, C.; Diattara, A.; Traore, A.; Ba, C.; Diedhiou, P.M.; Sy, Y.; Raki, H.; Peluffo-Ordóñez, D.H. A comparative study of Machine Learning-based classification of Tomato fungal diseases: Application of GLCM texture features. Heliyon 2023, 9, e21697. [Google Scholar] [CrossRef]
Figure 1. Flowchart of the pomegranate blackheart disease detection experiment.
Figure 1. Flowchart of the pomegranate blackheart disease detection experiment.
Foods 14 02454 g001
Figure 2. Cultivated Alternaria alternata.
Figure 2. Cultivated Alternaria alternata.
Foods 14 02454 g002
Figure 3. Cross-sectional views of pomegranates at different days after infection with blackheart disease. (a) Healthy; (b) 1 day after infection; (c) 3 days after infection; (d) 5 days after infection.
Figure 3. Cross-sectional views of pomegranates at different days after infection with blackheart disease. (a) Healthy; (b) 1 day after infection; (c) 3 days after infection; (d) 5 days after infection.
Foods 14 02454 g003
Figure 4. Spectral acquisition system.
Figure 4. Spectral acquisition system.
Foods 14 02454 g004
Figure 5. Soft X-ray imaging device.
Figure 5. Soft X-ray imaging device.
Foods 14 02454 g005
Figure 6. The segmentation process of pomegranate soft X-ray images. (a) Original image. (b) The image after threshold segmentation.
Figure 6. The segmentation process of pomegranate soft X-ray images. (a) Original image. (b) The image after threshold segmentation.
Foods 14 02454 g006
Figure 7. Image processing workflow for pomegranate cross-sections: (a) original RGB cross-sectional image (b) HSV color space conversion; (c) seed region extraction; (df) morphological operations; (g) seed segmentation; and (h) pathological region segmentation.
Figure 7. Image processing workflow for pomegranate cross-sections: (a) original RGB cross-sectional image (b) HSV color space conversion; (c) seed region extraction; (df) morphological operations; (g) seed segmentation; and (h) pathological region segmentation.
Foods 14 02454 g007
Figure 8. Spectral profiles of pomegranate specimens. (a) Absorbance curves of all specimens; (b) mean absorbance curves across infection severity grades.
Figure 8. Spectral profiles of pomegranate specimens. (a) Absorbance curves of all specimens; (b) mean absorbance curves across infection severity grades.
Foods 14 02454 g008
Figure 9. Soft X-ray image preprocessing (original image, after median filtering and CLAHE), (ac) healthy specimens, (df) Grade 1 infected specimens, (gi) Grade 2 infected specimens, and (jl) Grade 3 infected specimens.
Figure 9. Soft X-ray image preprocessing (original image, after median filtering and CLAHE), (ac) healthy specimens, (df) Grade 1 infected specimens, (gi) Grade 2 infected specimens, and (jl) Grade 3 infected specimens.
Foods 14 02454 g009
Figure 10. Removal of outliers, (a) LOF algorithm, (b) marginal distance algorithm.
Figure 10. Removal of outliers, (a) LOF algorithm, (b) marginal distance algorithm.
Foods 14 02454 g010
Figure 11. The spectral denoising processing results of pomegranate samples. (a) Raw spectral data. (b) Spectral preprocessed by the SNV algorithm. (c) Spectral preprocessed by the MSC algorithm. (d) Spectral preprocessed by the SG algorithm. (e) Spectral preprocessed by the D1 algorithm. (f) Spectral preprocessed by the D2 algorithm.
Figure 11. The spectral denoising processing results of pomegranate samples. (a) Raw spectral data. (b) Spectral preprocessed by the SNV algorithm. (c) Spectral preprocessed by the MSC algorithm. (d) Spectral preprocessed by the SG algorithm. (e) Spectral preprocessed by the D1 algorithm. (f) Spectral preprocessed by the D2 algorithm.
Foods 14 02454 g011
Figure 12. Process of optimal wavelength selection based on the CARS algorithm.
Figure 12. Process of optimal wavelength selection based on the CARS algorithm.
Foods 14 02454 g012
Figure 13. Confusion matrix of the prediction set for the optimal discrimination model of pomegranate blackheart disease established using NIR technology.
Figure 13. Confusion matrix of the prediction set for the optimal discrimination model of pomegranate blackheart disease established using NIR technology.
Foods 14 02454 g013
Figure 14. Confusion matrix of the prediction set for the optimal discrimination model of pomegranate blackheart disease established using soft X-ray imaging technology.
Figure 14. Confusion matrix of the prediction set for the optimal discrimination model of pomegranate blackheart disease established using soft X-ray imaging technology.
Foods 14 02454 g014
Table 1. Fungal inoculation experimental protocol for pomegranates.
Table 1. Fungal inoculation experimental protocol for pomegranates.
Fungal Inoculation Time PointHarvest Time PointInfection TimeQuantityStorage Conditions
//0 day96Ambient temperature and humidity
Day 3Day 41 day 3220 °C, 90% RH
Day 2Day 42 days 3220 °C, 90% RH
Day 1Day 43 days3220 °C, 90% RH
Table 2. Image texture feature calculation formula.
Table 2. Image texture feature calculation formula.
No.Texture FeatureFormula
1Angular Second Moment i j P ( i , j ) 2
2Correlation i j ( ( i j ) P ( i , j ) μ x μ y ) / σ x σ y
3Entropy i j P ( i , j ) log p ( i , j )
4Contrast i j ( i j ) 2 P ( i , j )
5Homogeneity i j P ( i , j ) / ( 1 + i j )
6Variance i j P i , j     i i j P i , j     i 2
7Small Gradient Advantage T 1 = i j H i , j j 2 / i j H i , j
8Large Gradient Advantage T 2 = i j j 2 H i , j / i j H i , j
9Gray Non-uniformity T 3 = i j H i , j 2 / i j H i , j
10Gradient Non-uniformity T 4 = j i H i , j 2 / i j H i , j
11Energy E = i j P i , j 2
12Gray Mean μ 1 = i i j P i , j
13Gradient Mean μ 2 = j j i P i , j
14Gray Variance 1 = i i μ 1 2 j P i , j
15Gradient Variance 2 = j j μ 2 2 i P i , j
16Correlation T 5 = 1 1 2 i j i μ 1 j μ 2 P i , j
17Gray Entropy T 6 = i j P i , j log j P i , j
18Gradient Entropy T 7 = j i P i , j log i P i , j
19Hybrid Entropy T 8 = i j P i , j log P i , j
20Inertia T 9 = i j i , j 2 P i , j
21Inverse Difference Moment T 10 = i j P i , j / ( 1 + ( i j ) 2 )
μ x —row mean of the gray-level co-occurrence matrix; μ y —column mean of the gray-level co-occurrence matrix; σ x —row standard deviation of the gray-level co-occurrence matrix; σ y —column standard deviation of the gray-level co-occurrence matrix; P(i,j)—element value at position (i,j) of the gray-level co-occurrence matrix; H(i,j)—element value at position (i,j) of the gray-level gradient co-occurrence matrix.
Table 3. Statistical results of disease severity in pomegranate samples.
Table 3. Statistical results of disease severity in pomegranate samples.
Disease Severity (Grade)Infection TimeDisease Severity (%)Quantity
00 day096
11 day 3.2–7.832
22 days 7.9–18.632
33 days18.7–30.432
Table 4. Performance of PLS-DA models constructed using data remaining after applying two outlier elimination algorithms.
Table 4. Performance of PLS-DA models constructed using data remaining after applying two outlier elimination algorithms.
AlgorithmsTest Set
Accuracy
F1-ScoreFive-Fold
Cross-Validation Mean Accuracy
Five-Fold Cross-
Validation Mean F1-Score
Number of Correct
Classifications
Number of Incorrect Classifications
LOF52.11%45.33%66.71%65.38%9586
Mahalanobis distance54.54%44.91%73.72%67.11%9982
Table 5. Performance metrics of the pomegranate blackheart disease discrimination models established based on raw spectra and five denoising algorithms.
Table 5. Performance metrics of the pomegranate blackheart disease discrimination models established based on raw spectra and five denoising algorithms.
ModelsTraining Set
Accuracy
Training Set
F1-Score
Test Set
Accuracy
Test Set F1-Score
RF87.17%93.75%56.00%78.57%
SNV-RF94.01%95.72%56.00%77.41%
MSC-RF93.16%96.72%68.00%89.65%
SG-RF83.76%92.53%62.00%83.33%
D1-RF99.14%100.0%82.00%100.0%
D2-RF99.14%100.0%84.00%98.11%
SVM89.74%100.0%80.00%96.29%
SNV-SVM78.63%98.30%74.00%98.24%
MSC-SVM79.48%97.71%70.00%87.50%
SG-SVM88.03%100.0%82.00%100.0%
D1-SVM89.74%98.38%66.00%100.0%
D2-SVM90.50%99.13%72.00%90.90%
Table 6. Performance metrics of the pomegranate blackheart disease discrimination models established based on full-wavelength spectra and three feature selection algorithms.
Table 6. Performance metrics of the pomegranate blackheart disease discrimination models established based on full-wavelength spectra and three feature selection algorithms.
ModelsWavelength NumberTraining Set
Accuracy
Training Set
F1-Score
Test Set
Accuracy
Test Set F1-Score
D2-RF95899.14%100.0%84.00%98.11%
D2-CARS-RF6297.43%99.13%86.00%89.33%
D2-SPA-RF5095.21%98.26%80.00%83.33%
D2-PCA-RF879.48%77.71%74.00%78.24%
Table 7. Mean values of textural features across infection severity grades.
Table 7. Mean values of textural features across infection severity grades.
No.Texture FeatureGrade 0 (Healthy)Grade 1Grade 2Grade 3
1Angular second
Moment
0.38620.43710.39980.4066
2Correlation−33.20−23.31−32.92−30.41
3Entropy7.1516.7326.9696.695
4Contrast2.913 × 1062.542 × 1062.791 × 1062.526 × 106
5Homogeneity1.7071.7451.7211.745
6Variance6.1585.7646.0665.778
7Small gradient
Advantage
0.75230.72170.76940.8144
8Large gradient
Advantage
0.63490.69780.60110.5316
9Gray non-uniformity4742523148304405
10Gradient
Non-uniformity
3.476 × 1043.241 × 1043.625 × 1044.035 × 104
11Energy0.06630.07330.06760.0616
12Gray mean48.7243.4848.3345.43
13Gradient mean0.63490.57790.60110.5316
14Gray variance37.6236.0337.1434.45
15Gradient variance2.1762.0722.1742.106
16Correlation22.4222.4620.9419.34
17Gray entropy1.7181.6661.7021.692
18Gradient entropy0.39720.33720.37870.3451
19Hybrid entropy1.9891.8961.9621.929
20Inertia3705309336293178
21Inverse difference
moment
0.24830.26940.25040.2349
Table 8. Performance metrics of the pomegranate blackheart disease discrimination model established based on texture feature parameters.
Table 8. Performance metrics of the pomegranate blackheart disease discrimination model established based on texture feature parameters.
ModelsGradeNumber of SamplesNumber of ErrorsAccuracyF1-Score
RF028093.10%98.11%
1102
280
3122
SVM031081.03%67.91%
11111
270
390
Disclaimer/Publisher’s Note: The statements, opinions and data contained in all publications are solely those of the individual author(s) and contributor(s) and not of MDPI and/or the editor(s). MDPI and/or the editor(s) disclaim responsibility for any injury to people or property resulting from any ideas, methods, instructions or products referred to in the content.

Share and Cite

MDPI and ACS Style

Nie, R.; Huang, X.; Tian, X.; Yu, S.; Dai, C.; Zhang, X.; Fang, Q. Non-Destructive Detection of Pomegranate Blackheart Disease via Near-Infrared Spectroscopy and Soft X-ray Imaging Systems. Foods 2025, 14, 2454. https://doi.org/10.3390/foods14142454

AMA Style

Nie R, Huang X, Tian X, Yu S, Dai C, Zhang X, Fang Q. Non-Destructive Detection of Pomegranate Blackheart Disease via Near-Infrared Spectroscopy and Soft X-ray Imaging Systems. Foods. 2025; 14(14):2454. https://doi.org/10.3390/foods14142454

Chicago/Turabian Style

Nie, Rongke, Xingyi Huang, Xiaoyu Tian, Shanshan Yu, Chunxia Dai, Xiaorui Zhang, and Qin Fang. 2025. "Non-Destructive Detection of Pomegranate Blackheart Disease via Near-Infrared Spectroscopy and Soft X-ray Imaging Systems" Foods 14, no. 14: 2454. https://doi.org/10.3390/foods14142454

APA Style

Nie, R., Huang, X., Tian, X., Yu, S., Dai, C., Zhang, X., & Fang, Q. (2025). Non-Destructive Detection of Pomegranate Blackheart Disease via Near-Infrared Spectroscopy and Soft X-ray Imaging Systems. Foods, 14(14), 2454. https://doi.org/10.3390/foods14142454

Note that from the first issue of 2016, this journal uses article numbers instead of page numbers. See further details here.

Article Metrics

Back to TopTop