Computer Image Analysis as a Method of Evaluating the Quality of Selected Fine-Grained Food Mixtures

: This work presents the possibility of using computer image analysis to assess the quality of ﬁne-grained food mixtures. The research was carried out using a mixture of wheat ﬂour and algae. These types of ingredients are used, among others, to produce pasta, which is a functional food due to its enrichment with algae. The tests were carried out for mixtures with different shares of algae: 2%, 3% and 4% w / w . Mixing was carried out in a 3D mixer (Turbula ® mixer), in which 20, 40 and 60 mL mixing vessels were placed. At the end of the process, samples were taken from four parts (sectors) of the mixing vessels, and then photos were taken with a digital camera. For this purpose, a specially prepared chamber was used, ensuring stable conditions for taking photos. The obtained images were analyzed in the Patan ® program, determining the color on the RGB-256 scale. The obtained values were compared with the previously prepared reference specimen (simple linear regression formula). Based on this, it was possible to determine the share of algae in the samples taken and thus to estimate the homogeneity of the tested mixtures. The obtained results indicate the high reliability of the proposed solution.


Introduction
Many food products are in the form of mixtures, which in many cases, may consist of a few or even several ingredients, e.g., spice mixtures and instant products. Interest in these types of products has increased over the last 20 years [1]. A popular statement says that food products that have undergone significant grinding are of low quality and less valuable [2].
Mixing in the food industry refers to the process of combining two or more ingredients in order to achieve a certain level of homogeneity. It is one of the most important production steps affecting the quality of the final product. Food powders can have different characteristics such as particle size, brittleness, viscosity, etc. This diversity favors the segregation process (opposite to mixing) and limits the potential to create homogeneous mixtures [1][2][3]. Moreover, it affects the powder behavior during multiple processes such as storage, transport, mixing and compression [4]. The literature on powder mixing is quite broad, but the understanding of the process (especially the mixture state during mixing, the tendency to separate or the kinetics) is still insufficient and needs to be improved [5,6]. It is therefore required to conduct research in order to provide efficient tools that will improve process efficiency and solve the most common problems [2]. One of the key issues is determining the mixing time that will allow obtaining a mixture of the correct quality (homogeneity and uniformity). Defining the right time in terms of quality and economics is a direct result of kinetics [6][7][8]. It is especially important before the product leaves the processing line. This allows for an appropriate reaction and corrective measures to be taken in order to achieve the appropriate homogeneity of the mixture [9,10].
Assessing the homogeneity of powders is a major challenge for engineers. Quality, in this case, is a subjective notion, and there is no single universal definition of homogeneity.
the Turbula ® mixer. The main research problem was formulated into the question: Will image analysis in the RGB scale be precise enough (sufficient) to capture the difference in the color of the mixture samples with a slight share of the tracer (a few percent)? The answer to this question is important for the possibility of using this tool in industrial conditions, where additives are present in slight amounts (a few percent).

Materials and Methods
The first step of the research was the development of a pattern (standard specimen) in which a given share of algae (% w/w) was represented by a color number calculated by RGB values. For this, a set of powder mixtures (wheat flour and algae) from 0% to 10% w/w of the main component (algae) in 1% intervals was prepared. From each mixture, three samples were taken and placed in the chamber prepared for taking pictures. The samples were different in color ( Figure 1). The obtained photos were analyzed in the dedicated Patan ® program (by Krótkiewicz), determining for each sample three values, respectively, for the RGB scale. Then, the color number (R*65,536 + G*256 + B) was calculated [31]. It turned out that the obtained RGB values for the samples were different depending on the given wt.% of the algae. Moreover, it can be described by a negative linear correlation, where the color number decreases with the proportion of algae share. The intensity of the linear correlation is very high, with a Pearson's correlation coefficient of −0.9792. Based on this, a simple linear regression was used (least-squares fitting) for the color number and algae proportion variables ( Figure 2). This mathematical representation yielded a very high coefficient of determination of 0.9588 and was then used to determine the share of algae in the tested samples. The procedure for obtaining the photos and computer image analysis was the same for all the performed tests, i.e., during the evaluation of the tracer fraction in mixtures of algae with wheat flour (the methodology is described later in the paper).
Mixing of powders containing algae of different fractions (2%, 3% and 4% w/w) and wheat flour was carried out. Wheat flour is an ingredient commonly used in the food industry, and algae are an excellent additive for improving the health properties of the final product, giving the possibility to include it in the so-called functional food category [32]. The characteristics of the ingredients used are presented in Table 1. Algae (chlorella), in this case, was treated as a key ingredient. In powder technology, the assessment of homogeneity is most often based on measuring the concentration of the selected key ingredient (the so-called tracer). Depending on the type of tracer, its content is marked differently [3].
prepared. The dependence of the color number (obtained by analyzing the image samples) on the percentage share of the tracer (algae) was determined. Then, the m matical relationship was used to assess the share of algae (in% w/w) after mixing Turbula ® mixer. The main research problem was formulated into the question: Will analysis in the RGB scale be precise enough (sufficient) to capture the difference color of the mixture samples with a slight share of the tracer (a few percent)? The a to this question is important for the possibility of using this tool in industrial cond where additives are present in slight amounts (a few percent).

Materials and Methods
The first step of the research was the development of a pattern (standard spec in which a given share of algae (% w/w) was represented by a color number calculat RGB values. For this, a set of powder mixtures (wheat flour and algae) from 0% t w/w of the main component (algae) in 1% intervals was prepared. From each mi three samples were taken and placed in the chamber prepared for taking picture samples were different in color ( Figure 1). The obtained photos were analyzed in th icated Patan ® program (by Krótkiewicz), determining for each sample three valu spectively, for the RGB scale. Then, the color number (R*65,536 + G*256 + B) was calcu [31]. It turned out that the obtained RGB values for the samples were different depe on the given wt.% of the algae. Moreover, it can be described by a negative linear co tion, where the color number decreases with the proportion of algae share. The int of the linear correlation is very high, with a Pearson's correlation coefficient of −0 Based on this, a simple linear regression was used (least-squares fitting) for the color ber and algae proportion variables ( Figure 2). This mathematical representation yie very high coefficient of determination of 0.9588 and was then used to determine the of algae in the tested samples. The procedure for obtaining the photos and comput age analysis was the same for all the performed tests, i.e., during the evaluation tracer fraction in mixtures of algae with wheat flour (the methodology is described in the paper).
Mixing of powders containing algae of different fractions (2%, 3% and 4% w/w wheat flour was carried out. Wheat flour is an ingredient commonly used in the fo dustry, and algae are an excellent additive for improving the health properties of th product, giving the possibility to include it in the so-called functional food categor The characteristics of the ingredients used are presented in Table 1. Algae (chlorel this case, was treated as a key ingredient. In powder technology, the assessment of h geneity is most often based on measuring the concentration of the selected key ingre (the so-called tracer). Depending on the type of tracer, its content is marked diffe [3].   The weighed-out amounts of the individual ingredients were placed in a 20, 40 and 60 mL mixing vessel with a 65% filling ratio (Table 2). However, the flour was placed in the lower part of the vessel and algae in the upper part. The vessel was made of plastic. The mixing process was carried out in the Turbula ® T2C mixer (Willy A. Bachofen AG Maschinenfabrik, Basel, Figure 3). This model has a mixing chamber (cage) that can hold a vessel with a capacity of up to 2 L and a rotational speed from 22 to 96 rpm [33]. The technical parameters of the unit and the mixing vessel used for the tests are presented in Table 3.   The weighed-out amounts of the individual ingredients were placed in a 20, 40 and 60 mL mixing vessel with a 65% filling ratio (Table 2). However, the flour was placed in the lower part of the vessel and algae in the upper part. The vessel was made of plastic. The mixing process was carried out in the Turbula ® T2C mixer (Willy A. Bachofen AG Maschinenfabrik, Basel, Figure 3). This model has a mixing chamber (cage) that can hold a vessel with a capacity of up to 2 L and a rotational speed from 22 to 96 rpm [33]. The technical parameters of the unit and the mixing vessel used for the tests are presented in Table 3.   The time of mixing was 45 s. After the process was completed, samples were taken from four parts (sectors) of the mixing vessel (three samples from each sector). Then, samples were placed in the chamber on prepared plates with circular holes 23 mm in diameter and 5 mm high. The weight of a single sample was 1 mg. The chamber was made of a material resistant to daylight. Therefore, it guaranteed the invariability of parameters during the acquisition of images, which is very important [34]. The samples were evenly illuminated with two T5 8W/642 lamps. The photos were taken with a digital camera (16 MP Panasonic Lumix DMC G7, Hamburg, Germany), which was installed in the upper part of the chamber, directly above the mixture samples. Then, based on the dedicated Patan ® program (by Krótkiewicz), RGB-256 scale values were determined for each sample photo. The obtained values (R, G and B) were converted into a color number in accordance with the previously presented formula. In the next step, the previously prepared standard was used ( Figure 2). Based on the proposed formula of simple linear regression, the fraction of algae in the taken samples was estimated. Based on this, the content of the key ingredient (algae) was obtained for each series of tests, i.e., depending on the amount of algae introduced and the capacity of the mixing vessel. The obtained data were then used to calculate the coefficient of variation (100 × standard deviation/mean) as a homogeneity index.
The whole procedure is summarized in Figure 4. Each test was performed in three repetitions.  The time of mixing was 45 s. After the process was completed, samples were taken from four parts (sectors) of the mixing vessel (three samples from each sector). Then, samples were placed in the chamber on prepared plates with circular holes 23 mm in diameter and 5 mm high. The weight of a single sample was 1 mg. The chamber was made of a material resistant to daylight. Therefore, it guaranteed the invariability of parameters during the acquisition of images, which is very important [34]. The samples were evenly illuminated with two T5 8W/642 lamps. The photos were taken with a digital camera (16 MP Panasonic Lumix DMC G7, Hamburg, Germany), which was installed in the upper part of the chamber, directly above the mixture samples. Then, based on the dedicated Patan ® program (by Krótkiewicz), RGB-256 scale values were determined for each sample photo. The obtained values (R, G and B) were converted into a color number in accordance with the previously presented formula. In the next step, the previously prepared standard was used ( Figure 2). Based on the proposed formula of simple linear regression, the fraction of algae in the taken samples was estimated. Based on this, the content of the key ingredient (algae) was obtained for each series of tests, i.e., depending on the amount of algae introduced and the capacity of the mixing vessel. The obtained data were then used to calculate the coefficient of variation (100 × standard deviation/mean) as a homogeneity index.
The whole procedure is summarized in Figure 4. Each test was performed in three repetitions.  Step-by-step experimental procedure.

Results
The results of algae fraction and the coefficient of variation are presented in Table 4.  Step-by-step experimental procedure.

Results
The results of algae fraction and the coefficient of variation are presented in Table 4.           Table 4 shows the results of the color number obtained from the RGB values for the images of the mixture samples and the corresponding algae share estimated based on the simple linear regression formula (Figure 2). Analyzing the presented results, it can be observed that in each case, the tracer fraction was obtained close to the preset amount, especially for 3 %and 4% algae (Table 4, Figures 5-7). The average values for the 2% algae input were 2.76%, 2.69% and 4.09% for the 20, 40 and 60 mL mixing vessels, respectively. Whereas for the target content of algae equals o 3%, the average values of the key ingredient were 3.48%, 3.46% and 4.04%; for the target content, of 4% they were 3.80%, 3.96% and 3.98%, respectively. The biggest differentiation of the results (deviation from the mean value) was noted for the 2% and 3% algae mixtures mixed in a 20 mL vessel. For these cases, the maximum values of the standard deviation of 1.14 and 0.53, respectively, were obtained. However, the lowest differentiation occurs in the case of the 4% mixtures mixed in 40 (SD = 0.03) and 60 mL (SD = 0.02) vessels. It can also be observed that in the case of smaller amounts of the key component (2% and 3% of the preset amount), the determination of its fraction based on the analysis of the RGB image leads to the overestimation of its amount in the samples. This is visible especially in the case of mixing wheat flour with 2% algae in a 60 mL vessel. In this case, the computer analysis of the image of the samples showed more than twice as much as the set amount (average value of 4.09%, Table 4, Figure 7). This may be due to the imperfection of the computer image analysis. It seems that with the small share of the coloring substance (algae), grayscale image analysis is not able to accurately detect the differences in the samples' colors. This problem does not occur during mixing with the greater share of the tracer (for example, 4%). Analyzing the mixing process itself and the obtained algae share, that the key component tends to occupy a specific location (sector) in the mixing vessel was not observed. This may be caused, among other things, by the slight differentiation of the mixed materials in terms of particle size (Table 1). In Figures 5-7, the sample number corresponds to the number of  Table 4 shows the results of the color number obtained from the RGB values for the images of the mixture samples and the corresponding algae share estimated based on the simple linear regression formula (Figure 2). Analyzing the presented results, it can be observed that in each case, the tracer fraction was obtained close to the preset amount, especially for 3 %and 4% algae (Table 4, Figures 5-7). The average values for the 2% algae input were 2.76%, 2.69% and 4.09% for the 20, 40 and 60 mL mixing vessels, respectively. Whereas for the target content of algae equals o 3%, the average values of the key ingredient were 3.48%, 3.46% and 4.04%; for the target content, of 4% they were 3.80%, 3.96% and 3.98%, respectively. The biggest differentiation of the results (deviation from the mean value) was noted for the 2% and 3% algae mixtures mixed in a 20 mL vessel. For these cases, the maximum values of the standard deviation of 1.14 and 0.53, respectively, were obtained. However, the lowest differentiation occurs in the case of the 4% mixtures mixed in 40 (SD = 0.03) and 60 mL (SD = 0.02) vessels. It can also be observed that in the case of smaller amounts of the key component (2% and 3% of the preset amount), the determination of its fraction based on the analysis of the RGB image leads to the overestimation of its amount in the samples. This is visible especially in the case of mixing wheat flour with 2% algae in a 60 mL vessel. In this case, the computer analysis of the image of the samples showed more than twice as much as the set amount (average value of 4.09%, Table 4, Figure 7). This may be due to the imperfection of the computer image analysis. It seems that with the small share of the coloring substance (algae), grayscale image analysis is not able to accurately detect the differences in the samples' colors. This problem does not occur during mixing with the greater share of the tracer (for example, 4%). Analyzing the mixing process itself and the obtained algae share, that the key component tends to occupy a specific location (sector) in the mixing vessel was not observed. This may be caused, among other things, by the slight differentiation of the mixed materials in terms of particle size (Table 1). In Figures 5-7, the sample number corresponds to the number of sectors from which three samples of the mixture were taken. However, it is worth emphasizing that the obtained mixture was analyzed only in one dimension, i.e., horizontally. No vertical analysis was performed. Although the two-dimensional observation is an important issue for the correct assessment of the quality of the final product [35], this was not the objective of the study at this stage. The aim of the tests was to verify the usefulness of the image analysis on the RGB scale to assess the share of tracer in the two-component powder mixtures and thus to assess the homogeneity of these mixtures. Referring to the standard specimen prepared in the first step, it can be concluded that this method is simple and reliable. A very high linear correlation of the variables (color number, algae share) and a highly reliable model (simple linear regression) were obtained. However, the accuracy of the method depends on the share of coloring substance (algae). The results concerning the homogeneity of the tested mixtures based on the image analysis of samples are presented in Figure 8. Figure 8 shows the results of the coefficient of variation (CV) depending on the preset amount of the key ingredient (2%, 3% and 4% w/w) and the volume of the mixing vessel (20, 40 and 60 mL). The coefficient of variation determines the degree of variety of the tracer share in the samples taken. For an ideal (homogeneous) state of mixing (distribution of the tracer in the mixture), the CV value is 0. In response to the greater variety of the tracer share in the collected samples, this coefficient also increases. In the pharmaceutical industry, the CV serves as the official standard for the mixing of marketed drugs, and its admissible value is 6% [36]. There is no such standard for the food industry; however, in practice, it is often used [1,37]. The coefficient is also a determinant of feed homogeneity, and its acceptable level is CV ≤ 10% [38]. The results of the coefficient of variation obtained (Table 4, Figure 8) show that only in one case did the homogeneity of the mixture exceed the acceptable level (CV = 12.13%). It concerns mixing 2% algae in the mixture using a 20 mL vessel. This is certainly due to the previously indicated large diversity of the results (max SD = 1.14, Table 4). The remaining results (range between 2.13% and 4.94%) indicate the correct degree of wheat flour and algae mixing (6% was not exceeded). These data not only indicate a slight variation in the share of algae in the samples taken (and thus good homogeneity) but also confirm the usefulness of the proposed method of the research. Image analysis and the referencing of the data with the obtained pattern give repeatable results (only slight diversification). However, it is worth optimizing the method in terms of image acquisition and/or processing especially in the case of a small share of key components.

Discussion
This study describes the possibility of using computer image analysis to determine the content of the key component (algae) based on the taken samples. The use of this tool in mixing granular materials is not a novelty. However, it is worth noticing that in the case of fine-grained materials (powders), the vision methods are constantly being improved. Some solutions use highly specialized tools, especially tomographic techniques, such as image analysis, focused on the use of the positron emission particle tracking (PEPT) technique [39,40]. This technique is used to track particles while being mixed; however, its accuracy decreases as the particle speed increases. Moreover, this method is quite expensive [41]. Spectroscopic techniques are also quite popular, especially near-infrared spectroscopy (NIR), which is the cheapest in this group (but still quite expensive). This method has found its application especially in the pharmaceutical industry. Research in this area was carried out, among others, by Wahl et al. to analyze the homogeneity of tablets obtained in industrial tablet press [42]. Osorio et al. used it to analyze the mixing process of pharmaceutical powders [43], whereas He et al. used it to assess the effect of cohesion and granule size on the heterogeneity of pharmaceutical powders [44]. The advantages of this method are reasonable costs and the online/continuous monitoring of samples. On the other hand, the disadvantage is the difficulty of detecting smaller components of the mixture or limited light penetration into the sample. Vision techniques also include methods based on image analysis of the samples taken. They most often require interference with the mixed materials in order to take samples (which is a disadvantage of the method) but are characterized by simplicity and low cost. Another disadvantage is a considerable limitation in the case of mixing components of a similar color [41]. The method presented in this paper also belongs to this group. At this stage, the problem of the need for invasive sampling certainly remains unsolved. It is worth noticing, however, that the first tests give highly promising results and the method at this point has advantages such as low cost and easy performance. It is also worth noticing that the mixed ingredients are contained in food mixtures used by the industry. What is more, the selection of different proportions of the key component was made based on wheat pastas available on the market with the addition of algae. This is an additional advantage of this study. Moreover, no additional/foreign markers were introduced into the powder mixture. Thanks to that, it is possible to use it in industrial conditions, and the method itself takes on proenvironmental features (no waste production). Sampling can take place at any required point of the production line (for example, from the mixer or from bags with the final product), as well as image acquisition and its analysis in an adopted laboratory. So far, the methods based on image analysis required the introduction/use of mixing an ingredient with a color that distinguishes it from other ingredients. Most often, it consisted of dyeing a selected component such as couscous groats in black [23] or maize with a fluorescent substance [34]. The use of the so-called "wet method" can lead to the production of wastes, which, in turn, has a negative impact on the environment. Moreover, the application of a coloring component makes this method quite limited. The obtained content of algae based on grayscale and simple linear regression model ( Figure 2) can be used to assess the homogeneity of fine-grained components. Similar observations have been made by Realpe et al. during the evaluation of the fraction of lactose and blue lactose based on image analysis and a model using partial least-squares. The authors developed a calibration model prepared using powder mixtures from 0% to 100% w/w of the main component in 10% intervals [22]. Therefore, the question arose whether it is possible to develop a model in a narrower range, i.e., from 0% to 10% w/w of the main component in 1% intervals. What is the purpose of looking for such a solution? The answer is that in food production, additives such as dyes, preservatives and others are used in small amounts (a few percent of the mixture). Therefore, obtaining this type of tool will allow using it in industrial practice for a quick assessment of the homogeneity of the mixed system and thus the effective determination of the right time of mixing. In the work of Realpe et al., a highly reliable (R 2 > 0.9) model was obtained [22].
The presented studies are pilot studies, and the results are highly promising. On top of that, based on the authors' experience, it seems possible to develop a method to obtain a palette of standards, which will then be used to assess the homogeneity of fine-grained mixtures (for example, pastas fortified with algae, spinach, paprika and others) not only in laboratory conditions. Therefore, tests with different powder components are planned, the methodology will be clarified (especially in the field of the acquisition of sample images), and the procedure for using the proposed tool will be defined. The key component is certainly the issue related to the acquisition of images (the need to separate external factors, as well as digital camera parameters and settings). However, when it comes to RGB data acquisition (analysis of the acquired image), it seems that there is no need to use the Patan ® program used by the authors. Another (more widely available) program can probably be used. However, this requires additional analysis. Moreover, it is planned to conduct image analysis based on the CIE L*a*b* method. The usefulness and effectiveness of this method have been confirmed in tests on food products [21,45,46].

•
The authors obtained a model (simple linear regression) to predict the concentration of algae in a mixture with wheat flour. This model is highly reliable, with an R 2 value of 0.9588.

•
The share of key components affects the accuracy of the presented method. Greater differentiation of the results and deviation from the settled amount of algae were noted for the 2% mixture than for the 3% and 4% mixtures.
• Only in one case (mixture with 2% algae mixed in a 20 mL vessel) did the obtained mixture not have good homogeneity (CV = 12.13%). The coefficient of variation for the remaining mixtures showed good homogeneity (CV < 6%).

•
The obtained results indicate the possibility of using the RGB scale for image analysis to assess the homogeneity of the two-component powder mixture (in this case, wheat flour-algae). However, the possibilities of the described method seem to be dependent on the share of the coloring component. A small amount of additives (like algae) can be a limitation of this method. Moreover, tests were carried out on two-component systems, so it is not known if (and how) they can be used in multicomponent mixtures.

•
The presented results are a preliminary element of the planned work. The next step will require a closer look at the acquisition and analysis of the image. It is possible that there are available techniques to improve the accuracy of this method for mixtures with a small share of key components. Moreover, tests with other flours, such as maize and rice, or the starch of these flours with additivities, paprika, spinach, tomato and beetroot, are planned.

•
The authors believe it is possible to develop a method to assess the homogeneity of fine-grained mixtures (for example, pastas fortified with algae, spinach, paprika and others) that can be used in industrial conditions (of course also in laboratory conditions).