Introduction

Wheat is one of the main staple foods in the world. Wheat grain and wheat products are very important for the food processing industry [1]. Wheat kernels consist of the endosperm in 80–85%, bran in 13–17% and germ in 2–3% on a dry matter basis. The chemical composition of kernels is an important parameter which determines their nutritional value [2, 3]. Wheat kernels typically contain 67% of starch, 13% of protein, approx. 8% of arabinoxylan, 0.8% of β-glucan and 2% of cellulose [4, 5]. Wheat grain and wheat products have high nutritional value and deliver health benefits [6, 7]. The selection of grains with high qualitative parameters significantly influences the quality of food products [8].Grains are processed into foods such as bread, biscuits and pasta. Wheat is also used in other industries for the production of animal feed, cosmetics, bio-plastics and biofuels [1]. Significant losses for the industry can be associated with occurrence of fungal infections of grain, especially caused by fungi of the genus Fusarium. Wheat kernels infected with fungi of the genus Fusarium appear shrivelled; they are lightweight, chalky and covered with mycelia with white or pink discoloration [9]. Fungi of the genus Fusarium cause cereal diseases such as Fusarium head blight (FHB) which decreases yields and has serious economic consequences [10]. FHB disease is caused by several Fusarium species, including mainly Fusarium graminearum, Fusarium culmorum, Fusarium avenaceum and Fusarium poae, as well as Fusarium equiseti, Fusarium langsethiae and Fusarium sporotrichioides. The occurrence of individual fungal species is influenced by weather conditions and crop rotation [11]. Infected grain contains harmful mycotoxins such as deoxynivalenol (DON) and its derivatives (15AcDON, 3AcDON), nivalenol (NIV), zearalenone (ZEA) and fumonisins produced by Fusarium species. Mycotoxin-contaminated grain is harmful for humans and animals, and it is not suitable for the production of food and feed [10]. Mycotoxins can cause diseases of the liver, kidneys, nervous system and immune system [12]. Fungal infection is identified with the use of different methods and techniques. Mycotoxins and fungal secondary metabolites may be detected by chemical methods such as liquid chromatography (LC), thin layer chromatography (TLC), gas chromatography–mass spectrometry (GC–MS) and high-performance liquid chromatography (HPLC). Fusarium may be identified mainly by molecular methods such as real-time polymerase chain reaction (RT-PCR). Other methods for fungal infection identification include microbiological methods involving fungal cultures, microscopic methods, visual assessments, and image analysis involving flatbed scanners, hyperspectral imaging and methods based on thermal properties [13,14,15,16,17,18].

Digital image analysis supports the determination of the morphological, textural and optical parameters in the acquired images, and their qualitative and quantitative interpretation [19,20,21,22,23]. Jirsa and Polišenska [15] relied on digital image analysis to distinguish between Fusarium-infected and healthy wheat kernels based on a classification model with colour descriptors R (red), G (green), B (blue) in the RGB colour space and descriptor H (Hue) in the HSL (Hue, Saturation, Luminance) colour space. Image analysis has also been used to describe discolouration of barley kernels and thus it is a highly useful method for detecting kernels affected by fungi [24]. Menesatti et al. [25] applied morphometric image analysis based on elliptic Fourier analysis to describe the shape of healthy and Fusarium-infected wheat kernels. The cited authors classified the analysed kernels into healthy, shrivelled and chalky groups.

Hyperspectral imaging combines traditional imaging and spectroscopy, and it supports the acquisition of spatial, spectral and multi-constituent data, as well as three-dimensional (3-D) images with two spatial dimensions and one spectral dimension. Images are acquired mainly by point, line and area scanning. Hyperspectral imaging methods are used to measure reflectance, transmittance, absorption, fluorescence and phosphorescence [26, 27]. Delwiche and Kim [28] detected fungal infections in kernels by hyperspectral imaging based on measurements of reflectance in the range of 425–860 nm. They found that infected kernels were generally characterised by higher reflectance values than healthy kernels. Polder et al. [13] analysed transmission spectral images of wheat kernels artificially contaminated with F. culmorum in the range of 430–900 nm and 900–1750 nm. Severely infected kernels absorbed more light than less-contaminated kernels. The near-infrared (NIR) range was more suitable for identifying infected kernels than the visible (VIS) range. Delwiche et al. [29] and Shahin and Symons [30] relied on Vis/NIR hyperspectral imaging to assess fungal infections in wheat kernels based on reflectance analysis. Barbedo et al. [31] used hyperspectral imaging with reflectance measurements in the wavelength range of 528–1785 nm to develop an algorithm for detecting wheat kernels infected with Fusarium fungi, and to estimate the concentration of deoxynivalenol (DON). The cited authors considered the use of only kernel fractions which are less susceptible to specular reflection to eliminate washed out segments from the image. However, according to Delwiche et al. [29], analyses performed on whole kernels usually deliver more accurate results.

The aim of this study was to develop classification models based on selected textural parameters for distinguishing between wheat kernels infected by fungi and healthy kernels. Attempts were also made to compare the classification accuracy of models based on textural parameters from hyperspectral images and images acquired with a flatbed scanner. The presented experiments constitute the initial stage of research aiming to develop models for the determination of fungal chemotypes and/or fungal species based on selected textural features of wheat kernels. The results will be used to determine: (1) the optimal imaging technique for identifying Fusarium-infected kernels, (2) the side of wheat kernels (ventral or dorsal) on which fungal-induced changes are more pronounced, and (3) the optimal wavelength range of hyperspectral images and colour channels for detecting fungal infections in kernels.

Materials and methods

Materials

The experimental materials comprised the grain of two wheat varieties. The samples (5 kg) were obtained from plant breeding stations in Poland. Naturally infected and healthy kernels were manually selected from bulk samples. The infected kernels were characterised by clear visible symptoms of advanced infection with fungi of the genus Fusarium (species F. graminearum). They were pink, chalky white and shrivelled. The healthy kernels were brownish and shiny.

Image acquisition using a hyperspectral imaging system

Images were acquired with the use of a hyperspectral imaging system composed of a 400–1100-nm spectrophotometer (Vis/NIR—visible/near-infrared) and a CCD camera (IDS Imaging Development Systems GmbH UI 1245LE). The resolution of the spectral head (Ocean Optics) was < 40 µm, resolution in X axis was 130 mm, resolution in Y axis was 0.03 mm, and spectral resolution was 1.5 nm. The illumination consisted of Dolan-Jenner MI-150 Fiber Optic Illuminator and additional infrared lamp in the 600–1100 nm range. Kernels were scanned on ventral and dorsal sides. Three kernels were in camera’s field of view and were imaged simultaneously in the hyperspectral imaging system. Sixty images, including 30 images of infected kernels and 30 images of healthy kernels, were acquired for each variety and each side. A total of 240 images were obtained.

Image acquisition using a flatbed scanner

Images were acquired with the use of the Epson Perfection 4490 Photo flatbed scanner (UK) and SilverFast Ai Studio Epson v6.6.1r6 scanning software (LaserSoft Imaging, Inc., USA). Infected and healthy kernels were scanned on ventral and dorsal sides to produce images with 500 × 700 pixels and 1200 dpi resolution. The kernels were scanned individually. The images were saved in .tiff format. Similarly to hyperspectral imaging, a total of 240 images were acquired, including 30 images of infected and 30 images of healthy kernels for each variety and each side.

Image processing

Hyperspectral images and scanned images were processed using MaZda software (Łódź University of Technology, Institute of Electronics, Poland). The regions of interest (ROIs) in hyperspectral images and scanned images were single kernels positioned on the ventral or dorsal side. Kernel images and the corresponding ROIs are presented in Fig. 1. Textural parameters were calculated in MaZda. The programme supports quantitative textural analysis and the determination of the following groups of textural features: histogram-based textural features, gradient-based features, co-occurrence matrix-based features, run-length matrix-based features and textural parameters based on an autoregressive model and Haar wavelet transform. Detailed information about analysis of image textures in MaZda application was reported by Szczypiński et al. [32]. Approximately 200 textures from kernel images were computed at selected wavelengths in hyperspectral imaging, and approximately 200 textures from each colour channel were computed for each ROI in colour images. Selected parameters were included in classification models.

Fig. 1
figure 1

Images of the same infected kernel acquired with the use of a hyperspectral imaging system (a) with the corresponding ROIs (b), and with the use of a flatbed scanner (c) with the corresponding ROIs (d); healthy kernel acquired with the use of a hyperspectral imaging system (e), and with the use of a flatbed scanner (f)

Statistical analysis

A statistical analysis was carried out with the use of WEKA 3.9 software (Machine Learning Group, University of Waikato) [33]. Classification models based on textural attributes were developed to distinguish infected wheat kernels from healthy kernels. In hyperspectral images, the analyses were performed for every selected wavelength (550, 710 and 850 nm). Wavelength of 710 nm was selected as an intermediate wavelength in the examined range. In the range of 550–850 nm, the pixels in the images were most clearly visible. The quality of the images was the best and it influenced the results of the classification. In the literature, authors used different wavelengths for classifying Fusarium-damaged kernels. These differences may depend on the species of fungi of the genus Fusarium and the hyperspectral imaging system used for the image acquisition, because individual species can cause some other symptoms and each imaging system can give a slightly different image depending on the type of spectrophotometer, resolution, illumination. Delwiche and Kim [28] reported that the optimal wavelengths for detection of Fusarium-infected wheat kernels were: 550, 568, 605, 623, 660, 697, 715 and 733 nm. These wavelengths are within the range used in our study. According to Shahin and Symons [34], the wavelengths of 494, 578, 639 and 678 nm were highly accurate for classification of Fusarium-damaged wheat kernels. Bauriegel and Herppich [35] reported that Fusarium infections caused the changes in carotenoid and chlorophyll contents, which are visible as the spectral modifications in wavelengths of 500–533 and 550–560 nm (detection of carotenoids) and 560–675 and 682–733 nm (detection of chlorophylls). Dammer et al. [36] used the wavelengths of 670 and 800 nm for detection of wheat kernels infected with Fusarium. However, Jaillais et al. [37] observed that wavelengths of 875 and 950 nm were useful for estimating the degree of wheat kernel contamination by Fusarium and additionally, wavelength of 360 nm was relevant to distinguish between infected and healthy kernels based on shape. The authors could apply another imaging system and kernels infected with another species of the genus Fusarium, which caused other symptoms than in our studies. It could have caused differences in wavelengths. Olesen et al. [38] demonstrated that healthy and Fusarium spp.-infected seeds of spinach had high mean value of intensity (above 110) at wavelengths 850–970 nm. However, spinach seeds have different chemical composition and structure of surface than wheat kernels, which could have influenced the differences in chosen wavelengths.

In the case of scanned images using flatbed scanner, it was found that the highest classification accuracies were observed for textures from colour channels R (red in the RGB model), L* (lightness in the Lab* model) and Y (luminance, brightness in the XYZ model). Therefore, textures from these channels were included in the classification models. The models were designed separately for kernels of each variety, positioned on the ventral and the dorsal side. Each data set was composed of 60 variables (images of 30 infected and 30 healthy kernels) and approximately 200 textures from the images acquired at each wavelength or colour channel. Attribute selection was carried out to generate at least ten times more variables than attributes (textures). Six textures were selected from hyperspectral images acquired at selected wavelengths or from individual colour channels. The Ranker search method with the OneR classifier were used for this purpose [33, 39]. This approach allowed for the ranking (ordering) of attributes according to the correctness of the classification by performing evaluations on single attributes. Models combining textures from ventral and dorsal sides of wheat kernels were built in the next stage of analysis. The resulting data sets contained 120 variables (images of 60 infected and 60 healthy kernels, acquired on both sides) and approximately 200 textures for each image. Twelve textures from hyperspectral images acquired at selected wavelengths (550, 710 and 850 nm) and from colour images in R, L, Y channels were selected. Selected Bayes (Bayes Net), Function (LDA), Lazy (K Star), Rules (PART) and Decision Tree (LMT) classifiers were used. The classifiers were tested by tenfold cross-validation [33,34,35,36,37,38,39]. The search method, classifiers and the validation method were selected based on highest classification accuracy.

Results

In the first stage of the analysis, the classification models based on six attributes from selected wavelengths (hyperspectral images) and colour channels (colour images) for discriminating between infected and healthy wheat kernels were built separately for ventral and dorsal sides of kernels of each wheat variety. The results of a discriminant analysis for the ventral side are presented in Table 1 and for the dorsal side in Table 2.

Table 1 The results of a classification analysis of infected and healthy wheat kernels based on textural attributes from images acquired at selected wavelengths and colour channels for kernels positioned on the ventral side
Table 2 Classification accuracy of infected and healthy wheat kernels based on textures from images acquired at selected wavelengths and individual colour channels for kernels positioned on the dorsal side

Classification for kernels positioned on the ventral side

In the models developed for the ventral side (Table 1), classification accuracy for hyperspectral images ranged from 78 to 97% for wheat variety 1 and from 78 to 100% for variety 2. In scanned images, classification accuracy reached 100% for both varieties (95–100% for variety 1 and 97–100% for variety 2). The scanned images were characterised by somewhat higher classification accuracy than hyperspectral images. The classification accuracy of textures from hyperspectral images of variety 1 was below 100%. These differences in accuracy may be due to better resolution of flatbed scanner than hyperspectral system and obtaining better quality colour images. In the available literature, there are no data on the comparison of classification accuracies of Fusarium-infected and healthy wheat kernels based on features from hyperspectral images and flatbed scanner images. Singh et al. [40] compared the results of discrimination of healthy wheat kernels and kernels infected with Penicillium spp. species, Aspergillus glaucus and Aspergillus niger based on features from hyperspectral imaging system and colour area scan camera. The authors found that the classification accuracy for hyperspectral images was in the range of 88.7–98.3% and for colour images ranged from 85.7 to 100.0% (colour features) and from 89.3 to 100.0% (combined colour and textural features). Similar to the results obtained in own research, colour images provided higher classification accuracies than hyperspectral images.

The classification of infected and healthy wheat kernels based on the textures calculated from hyperspectral images was influenced by wavelength. Images obtained at 850 nm were characterised by the lowest classification accuracy which was determined at 78–85% for variety 1 and at 78–91% for variety 2. The classification based on textures from the images acquired at 550 and 710 nm was characterised by 100% accuracy for all classifiers for variety 2. Infected and healthy kernels of variety 1 were classified with 90–95% accuracy for images obtained at 550 nm and with 90–97% accuracy for images obtained at 710 nm. In the analysed colour channels of scanned images, 100% accuracy was achieved for both wheat varieties for selected classifiers. Kernels of variety 1 were classified with 95–100% accuracy and kernels of variety 2—with 97–100% accuracy. The scatterplots of selected textures from hyperspectral and colour images confirmed the classification of infected and healthy wheat kernels (Fig. 2). Two exemplary textures from hyperspectral images (wavelength 710 nm) named HMean and SGNonZeros, which classified kernels with 100% accuracy, were selected. For colour images (channel R), two textures named RHMean and RHPerc90, which correctly classified the infected and healthy kernels in 100% were chosen.

Fig. 2
figure 2

Scatterplots of selected attributes (textures: YSGNonZeros, HMean, RHPerc90, RHMean) of infected and healthy wheat kernels from hyperspectral (wavelength 710 nm) a and colour images (channel R) b (circle (blue)—infected, square (red) – healthy)

Classification for kernels positioned on the dorsal side

The classification accuracy of infected and healthy wheat kernels positioned on the dorsal side (Table 2) in hyperspectral images was determined at 78–97% for variety 1 and at 78–98% for variety 2. Analyses of models based on textures from hyperspectral images did not produce 100% classification accuracy. The highest classification accuracy was observed for images obtained at 550 nm and the lowest classification accuracy—for images acquired at 850 nm. Kernels were classified with higher accuracy based on textures from scanned images than hyperspectral images. However, 100% accuracy was achieved only for variety 1. In analyses of variety 1, the lowest classification accuracy was 92% (channel Y, Rules PART classification method). The scanned images of infected and healthy kernels of variety 2 were classified with 95–98% accuracy. Texture map images also revealed clear differences between infected and healthy kernels (Fig. 3).

Fig. 3
figure 3

Texture map images of dorsal side of selected infected and healthy wheat kernels: a channel L, mean texture, healthy kernel; b channel L, mean texture, infected kernel; c channel Y, mean texture, healthy kernel; d channel Y, mean texture, infected kernel

Combined classification for kernels positioned on the ventral and dorsal sides

Models combining textures from the ventral and dorsal sides of wheat kernels were developed in the next stage of the analysis. The resulting classification accuracies are presented in Table 3. Only scanned images of variety 1 kernels were classified with 100% accuracy with the use of selected classifiers and based on colour channels R, L and Y. The lowest classification accuracy was 96%. In scanned images of variety 2 kernels, infected and healthy kernels were classified with an accuracy of 94–98%. The models based on textures from hyperspectral images were characterised by lower accuracy which was determined at 76–94% for variety 1 and 78–98% for variety 2. Similarly to the classification analyses performed separately for ventral and dorsal sides, in the model combining textures for both sides of wheat kernels, the lowest accuracy was observed for images obtained at 850 nm, and the highest accuracy—for images obtained at 550 nm. The combination of textures from images of ventral and dorsal sides of wheat kernels did not improve the results compared to each side separately, probably due to the reduction of total accuracy caused by the results for dorsal side.

Table 3 Classification accuracy of infected and healthy wheat kernels based on combined textures for ventral and dorsal sides

Discussion

Classification accuracy was influenced by the position of the analysed wheat kernels and wheat variety. Accuracy was higher for kernels positioned on the ventral than the dorsal side. The presence of a crease on the ventral side due to the incision in the wheat kernels can promote fungal growth. Kernels positioned on the ventral side were classified with 100% accuracy based on textures from hyperspectral images and scanned images for variety 2 and based on textures from scanned images for variety 1. When positioned on the dorsal side, kernels were classified with 100% accuracy based only on textures from the scanned images of variety 1. The flatbed scanner had better resolution than hyperspectral system, which could also result in higher classification results for images from flatbed scanner. Nevertheless, our results are highly promising because a flatbed scanner is a far less expensive, more readily available and popular imaging tool than a spectrophotometer. In most published studies, Fusarium-infected and healthy wheat kernels have been classified with the use of digital image analyses, but there is a general scarcity of research based on textural features. Jirsa and Polišenska [15] developed a discrimination model based on colour descriptors (R, G, B, H) which was characterised by 85% classification accuracy. Healthy wheat kernels were classified correctly in 80% of cases, and kernels with visual symptoms of a fungal infection (whitish, pinkish and normally sized kernels, and whitish, pinkish and shrivelled kernels) were discriminated with 90% total accuracy. In a study by Menesatti et al. [25], total classification accuracy reached 68.4% for healthy, shrivelled and chalky wheat kernels infected with F. culmorum, and 56.9% for kernels infected with F. graminearum.

In the available literature, infected kernels have been classified with high accuracy based on hyperspectral images. However, those studies relied on measurements of reflectance rather than analyses of textures on the surface of wheat kernels. Compared to the literature data in our own studies even higher classification accuracies were obtained. Delwiche et al. [29] classified Fusarium-damaged and healthy wheat kernels with around 95% average accuracy. Shahin and Symons [30] discriminated Fusarium-infected and healthy wheat kernels with approximately 90% total accuracy. Barbedo et al. [31] identified infected and healthy kernels with an accuracy higher than 91% based on the calculated Fusarium index (FI, proportion of pixels in a kernel with values greater than 0.58). Singh et al. [40] compared the applicability of a short-wave near-infrared (NIR) hyperspectral imaging system with a colour area scan camera to discriminate healthy wheat kernels and kernels infected with Penicillium spp. species, A. glaucus and A. niger. The classification based on features from hyperspectral images did not achieve 100% accuracy. The authors relied on linear discriminant analysis and determined the maximum classification accuracy of infected and healthy kernels in the range of 97.3–100.0% based on combined features from hyperspectral images and top ten features selected from colour images. Textural parameters from NIR and colour images were combined to eliminate a high rate of false positive errors associated with NIR images.

Conclusions

Classification models for discriminating healthy wheat kernels and kernels infected with fungi were developed based on textural parameters. Kernels were classified with greater accuracy based on textures from images acquired with the use of a flatbed scanner than a hyperspectral system. In analyses of textural parameters from the ventral side of kernels, classification accuracy reached 100% for both varieties based on scanned images and 100% for only one variety based on hyperspectral images. The classification accuracy of infected and healthy wheat kernels positioned on the dorsal side reached 100% only in scanned images and only for kernels of one variety. Similarly, in models combining the textures from ventral and dorsal sides of wheat kernels, 100% accuracy was achieved only in scanned images and only for one wheat variety. The analyses of textures from hyperspectral images did not produce 100% classification accuracy in models based on textures from the dorsal side or in models combining textures from both sides. In this study, classification accuracy was influenced by the side of wheat kernels, and it was higher for the ventral than the dorsal side. Additionally, hyperspectral images were most accurate when acquired at 550 nm and least accurate when obtained at 850 nm. In scanned images, the classification accuracy of infected and healthy kernels did not differ significantly between the analysed colour channels.