Assessment of the Content of Dry Matter and Dry Organic Matter in Compost with Neural Modelling Methods

: Neural image analysis is commonly used to solve scientiﬁc problems of biosystems and mechanical engineering. The method has been applied, for example, to assess the quality of foodstuffs such as fruit and vegetables, cereal grains, and meat. The method can also be used to analyse composting processes. The scientiﬁc problem lets us formulate the research hypothesis: it is possible to identify representative traits of the image of composted material that are necessary to create a neural model supporting the process of assessment of the content of dry matter and dry organic matter in composted material. The effect of the research is the identiﬁcation of selected features of the composted material and the methods of neural image analysis resulted in a new original method enabling effective assessment of the content of dry matter and dry organic matter. The content of dry matter and dry organic matter can be analysed by means of parameters specifying the colour of compost. The best developed neural models for the assessment of the content of dry matter and dry organic matter in compost are: in visible light RBF 19:19-2-1:1 (test error 0.0922) and MLP 14:14-14-11-1:1 (test error 0.1722), in mixed light RBF 30:30-8-1:1 (test error 0.0764) and MLP 7:7-9-7-1:1 (test error 0.1795). The neural models generated for the compost images taken in mixed light had better qualitative characteristics.


Introduction
The handling of sewage sludge generated during the treatment of domestic wastewater in urbanised areas is an important problem of waste management nowadays. The amount of sewage sludge increases proportionally to the number and efficiency of sewage treatment plants [1]. It is estimated that by 2020 the amount of sewage sludge generated in the European Union exceeded 13 million tonnes annually [2]. Sewage sludge handling and disposal in highly developed and industrialised countries is both an economic and logistic problem, and above all, it is an environmental problem [3]. Combustion, anaerobic digestion, and composting are the most common sewage sludge handling methods [4,5].
The sewage sludge combustion process is characterised by a favourable energy balance. However, the high content of water in sewage sludge generates considerable demand for heat, which means that this process is not economically attractive [6].
Anaerobic digestion is often used to stabilise sewage sludge. However, this method has some serious disadvantages, such as low-emission methane production and low decomposition of organic matter contained in the sludge, which results in longer retention time and increases the costs of mixing [7]. Apart from that, the digestate from the methane digestion of sewage sludge requires an additional stabilisation process to prevent the bioaccumulation of heavy metals in the soil [8,9].
On the other hand, composting is commonly considered a very good method of organic matter stabilisation [5,10]. During the composting process, pathogens are de-stroyed at the thermophilic phase, and during mineralisation and humification, organic matter is transformed into humic substances. As a result, the volume of substrates is reduced [11][12][13]. At present, composting is the simplest and cheapest method of handling sewage sludge [4,14]. Due to the high content of water and nitrogen, sewage sludge cannot be composted without admixtures [15]. Materials with high content of dry matter and rich in carbon are usually added to sludge so as to ensure an adequate C:N ratio [16].
From the point of view of waste neutralisation and handling, temperature is one of the factors that have the greatest influence on the composting process and the final compost composition. Apart from that, the composting process and compost quality are also affected by the following key parameters: the C:N ratio, oxygen concentration, pH, moisture content, particle size, and substrate porosity [17][18][19]. In terms of physical and chemical characteristics proper compost should be characterised by stability so that it can be used as a fertiliser without negative effect on the environment [20,21]. Therefore, the composting of sewage sludge not only solves the problem of its handling but it also enables soil fertilisation with valuable organic matter [20,21].
The composting process includes a number of interacting factors such as: the composition of organic and inorganic matter, the number of microorganisms and the overall process conditions [22]. During the process the physical and chemical parameters of compost are changing. The most important parameters are: dry matter (moisture) and dry organic matter. Changes in the content of dry matter depend on the humidity of substrates and weather conditions during the composting process [23]. The optimal moisture of the substrate mixture for the composting process is 45-50%. It is very difficult to achieve the optimal humidity during the composting process, especially when the process takes place in unroofed heaps [24,25]. The initial low moisture of the compost mixture (even below 30%) may result in rapid dehydration of the heap and bioprocesses will be stopped. In consequence, a biologically unstable matter is formed [26]. On the other hand, too high initial humidity of compost (above 80%) results in anaerobic decomposition [24], which is the cause of increased odour emission. Therefore, it is necessary to monitor the content of dry matter (moisture content) during the entire composting process. In practice, the stabilisation of moisture content of the composted material is monitored by measuring the temperature inside the heap. It provides information as to whether the compost heap needs aeration or water should be added [25].
The analysis of available literature and publications cited shows that currently, apart from the traditional method of measuring the dry matter content (by drying and weighing and by roasting at a temperature of 550 • C) [27,28] and temperature monitoring in heaps [25], there is no other easy to use and reliable method of assessment of the content of dry matter and dry organic matter in the composting process.
Determining the content of dry matter and dry organic matter in compost substrates and compost is very time-consuming. It requires special laboratory equipment and consumes large amounts of energy. Therefore, it is justified to develop and apply new tools and methods which will quickly and effectively enable measurement of the content of dry matter and dry organic matter in compost without using specialised equipment. The analysis of literature led us to assume that a decision support system based on neural image analysis could be a new method used for this purpose.
Having analysed the current state of knowledge, the scientific problem was formulated as the following question: Can artificial intelligence methods such as neural modelling be used to quickly and effectively assess the content of dry matter and dry organic matter based on the information encoded in a graphical form, i.e., in a digital photography of compost?
The scientific problem let us formulate the research hypothesis: it is possible to identify representative traits of the image of composted material, which are necessary to create a neural model supporting the process of assessment of the content of dry matter and dry organic matter in composted material.
Currently, there is no scientific information on the use of indirect methods such as image analysis in determining the physical and chemical parameters of the photographed material which is being studied.
The aim of the research was to check the possibility of replacing the long-term process of determining the composition of compost by a simpler, indirect method.

Materials and Methods
In the process of neural image analysis, it is important to acquire appropriate characteristics, encoded in digital images, which would adequately specify the study material. The first step in neural image analysis is to acquire an image, for example, with a digital camera. Samples with known properties must be photographed under constant and stable conditions, which are specific to the material tested. Next, the obtained images are processed and their characteristics are acquired. These data are systematised and used in the form of a training set in simulators of artificial neural networks.
The following tasks needed to be done to achieve the aim of the study: 1. collection and preparation of compost samples, 2.
acquisition of digital images, 3.
processing the photographs and using IT systems (special software) enabling the extraction of their characteristics, 4.
laboratory measurement of the content of dry matter and dry organic matter in the compost samples under analysis, 5.
processing the acquired data into the form of training sets of neural models, 6.
verification of the models and checking the proposed method.

Research Material
The neural modelling methods and the use of computer image analysis methods were tested on three types of compost. The composts were prepared on a technical scale in an unroofed sewage sludge composting plant. The composts were made from the following mixtures: • sewage sludge and maize stover, • sewage sludge and rapeseed straw, • sewage sludge and wheat straw.
Sewage sludge with maize stover, rapeseed straw and wheat straw was composted in heaps between June and September 2014. Seven series of analyses were conducted at that time. The research material consisted of 84 samples, which were collected every 10 days. Each time, 4 samples of each type of material were analysed. Samples consisting of compost collected from three constant places of the heap were collected for laboratory analysis.

Image Acquisition Methodology
Digital images of compost were acquired in specially prepared light chambers sized 570 × 570 × 570 mm [38,39]. The lighting in the chambers was constant and the same for all the samples tested. Compost was photographed in two types of light: visible light and mixed light.
The visible light chamber was equipped with four 15 W lamps that emitted light with a colour temperature of 6500 K. The mixed-light chamber was also equipped with four lamps. Two of them (in the front and rear part of the chamber) emitted visible light with a colour temperature of 6500 K. The other two lamps (on the left and right of the chamber) emitted UV-A rays. The lamps were placed in the upper part of both chambers. The inner lateral surfaces of the chambers were covered with reflective foil, which was placed 100 mm from the upper edge.
A NIKON D7000 DSLR camera equipped with a prime AF-S DX NIKKOR 35 mm f/1.8 G lens was used for image acquisition. The parameters of the camera were the same for all photographed samples. The exposure parameters were determined with a grey card, using the built-in light meter of the camera. The aperture for all photographed samples was set at f/5.6. In visible light, the shutter speed was set at 1/6 s. In mixed light, the shutter speed was set at 1.3 s. The camera matrix recorded images at ISO 100. Samples sized 200 × 150 mm were placed in the centre of the chamber and they were photographed. Images with a resolution of 4928 × 3264 pixels were recorded in the RAW format.
The images were processed with the NIKON ViewNX 2 software. Their contrast was increased by 10 units, and then the photographs were converted into the JPEG format. At the next stage, the compost sample was separated from the rest of the image. It eliminated the background and elements generating noise.

Laboratory Analyses of Composts
The content of dry matter in the composts was measured by drying and weighing at a temperature of 105 ± 1 °C, according to the standard EN 12880:2004. The content of dry organic matter was measured by calculating the loss during the roasting of the compost samples at a temperature of 550 ± 25 °C, according to the standard EN 12879:2004. The samples were weighed on a laboratory scale WLC 0.6/A/2, with an accuracy of 0.01 g.

Laboratory Analyses of Composts
The content of dry matter in the composts was measured by drying and weighing at a temperature of 105 ± 1 • C, according to the standard EN 12880:2004. The content of dry organic matter was measured by calculating the loss during the roasting of the compost samples at a temperature of 550 ± 25 • C, according to the standard EN 12879:2004. The samples were weighed on a laboratory scale WLC 0.6/A/2, with an accuracy of 0.01 g.

Neural Image Analyses of Composts
At this stage of the research, the data from the computer image analysis and the information about the content of dry matter and dry organic matter in the compost, acquired from the laboratory analysis, were combined into one file. The resulting file, which combined data from the computer image analysis and the results of the laboratory analysis, was a training set for neural modelling.
The STATISTICA 7.1 program was used for neural modelling. First, the 'automatic designer' function was used. It enabled initial analysis of the results and determined the most adequate neural model to predict the content of dry matter and dry organic matter in the compost under study.
In the simulator, network tests of the following types: MLP (Multi-Layer Perceptron), RBF (Radial Basic Function), PNN (Probabilistic Neural Network), GRNN (Generalized Regression Neural Network. The data set was divided into three parts: a training set, a validation set and a test set. The data set was divided according to the standard 2:1:1 ratio. The learning set is used to train the network, the validation set is used to tune the network parameters and check its optimal setting. The test set is completely separated, and it does not participate in the network learning and validation process, it is used to determine the network operation for completely new data-samples.

Dry Matter
The content of dry matter in the composts was predicted by analysing the digital images in visible light and in mixed light. The content of dry matter in visible light was best predicted with RBF models (Radial Basic Function), where the learning error, validation error, and test error amounted to 10%. Error is RMS, it is Root Mean Square error-frequently used measure of the differences between values (sample or population values) predicted by a model or an estimator and the values observed.

Dry Matter
The content of dry matter in the composts was predicted by analysing the digital images in visible light and in mixed light. The content of dry matter in visible light was best predicted with RBF models (Radial Basic Function), where the learning error, validation error, and test error amounted to 10%. Error is RMS, it is Root Mean Square errorfrequently used measure of the differences between values (sample or population values) predicted by a model or an estimator and the values observed.
The RBF 19:19-2-1:1 network (Figure 2) exhibited the best prediction properties. Its parameters were as follows: learning error 0.0973, validation error 0.1002 and testing error 0.0922 (Table 1). The learning quality of the network was 0.8395, the validation quality was 0.8661 and the test quality was 0.8867. In order to function, the model needed the following 19 input variables (in the descending order of significance): mean saturation, standard deviation of saturation, standard deviation of luminance, mean luminance without black colour, standard deviation of luminance without black colour, standard deviation of blue colour without black colour, Its parameters were as follows: learning error 0.0973, validation error 0.1002 and testing error 0.0922 (Table 1). The learning quality of the network was 0.8395, the validation quality was 0.8661 and the test quality was 0.8867. In order to function, the model needed the following 19 input variables (in the descending order of significance): mean saturation, standard deviation of saturation, standard deviation of luminance, mean luminance without black colour, standard deviation of luminance without black colour, standard deviation of blue colour without black colour, mean red colour without black colour, standard deviation of red colour without black colour, mean green colour, standard deviation of green colour, mean green colour without black colour, median green colour without black colour, standard deviation of the green colour without black colour, mean blue colour, standard deviation of blue colour, mean blue colour without black colour, median blue colour without black colour, mean red colour, median red colour.
The analysis of the neural model sensitivity showed that the mean value of red colour without black pixels was the most important input variable. The least important variables were: median luminance without black colour, mean green colour, median luminance, mean luminance without black colour, and mean luminance. Table 2 shows the top 5 networks generated during modelling and selected RBF 19:19-2-1:1 model. The RBF models exhibited the best prediction properties regarding the content of dry matter in mixed light. Their learning error characteristics did not exceed 10%. The RBF 30:30-8-1:1 model (Figure 3) exhibited the best prediction properties.  The RBF models exhibited the best prediction properties regarding the content of dry matter in mixed light. Their learning error characteristics did not exceed 10%. The RBF 30:30-8-1:1 model (Figure 3) exhibited the best prediction properties. Its parameters were as follows: learning error 0.0976, validation error 0.0948 and testing error 0.0764. The learning quality of the model was 0.0917, the validation quality was 0.9999 and the test quality was 0.9999 (Table 3). In order to function, the model needed the following 30 input variables (in the descending order of significance): mean blue colour without black colour, mean blue colour, median blue colour without black colour, median blue colour, mean red colour without black colour, mean red colour, median red colour, median red colour without black colour, standard deviation of red colour, standard deviation of red colour without black col- Its parameters were as follows: learning error 0.0976, validation error 0.0948 and testing error 0.0764. The learning quality of the model was 0.0917, the validation quality was 0.9999 and the test quality was 0.9999 (Table 3). In order to function, the model needed the following 30 input variables (in the descending order of significance): mean blue colour without black colour, mean blue colour, median blue colour without black colour, median blue colour, mean red colour without black colour, mean red colour, median red colour, median red colour without black colour, standard deviation of red colour, standard deviation of red colour without black colour, mean green colour without black colour, mean green colour, median green colour without black colour, median green colour, standard deviation of green colour without black colour, standard deviation of green colour, standard deviation of blue colour, standard deviation of blue colour without black colour, median saturation, median saturation without black colour, mean saturation, standard deviation of saturation without black colour, standard deviation of saturation, median luminance without black colour, median luminance, mean luminance, mean luminance without black colour, standard deviation of luminance without black colour, standard deviation of luminance.
The generated neural models enabled assessment of the content of dry matter in the composted material by image analysis. In visible light the RMS error for the test set was about 9%, and in mixed light-about 7.5%.
The RBF network was the optimal topology for the neural model used for the assessment of the dry matter content in compost. The RBF 30:30-8-1:1 built by analysing the image of composts in mixed light, was the optimal neural model for the assessment of the dry matter content in composts. Table 4 shows the top 5 networks generated during modelling and selected RBF 30:30-8-1:1.

Dry Organic Matter
The content of dry organic matter in the composts was predicted by analysing the image in visible light and in mixed light, using the same method as for the prediction of the dry matter content. The content of dry organic matter in visible light was best predicted with MLP models (Multi-Layer Perceptron), where the learning error, validation error, and test error did not exceed 20%. The MLP 14:14-14-11-1:1 model (Figure 4) exhibited the best prediction properties. The generated neural models enabled assessment of the content of dry matter in the composted material by image analysis. In visible light the RMS error for the test set was about 9%, and in mixed light-about 7.5%.
The RBF network was the optimal topology for the neural model used for the assessment of the dry matter content in compost. The RBF 30:30-8-1:1 built by analysing the image of composts in mixed light, was the optimal neural model for the assessment of the dry matter content in composts. Table 4 shows the top 5 networks generated during modelling and selected RBF 30:30-8-1:1.

Dry Organic Matter
The content of dry organic matter in the composts was predicted by analysing the image in visible light and in mixed light, using the same method as for the prediction of the dry matter content. The content of dry organic matter in visible light was best predicted with MLP models (Multi-Layer Perceptron), where the learning error, validation error, and test error did not exceed 20%. The MLP 14:14-14-11-1:1 model (Figure 4) exhibited the best prediction properties. Its parameters were as follows: learning error 0.1639, validation error 0.192, and testing error 0.1722. The learning quality of the network was 0.9563, the validation quality was 0.9761, and the test quality was 0.9522 (Table 5).  Its parameters were as follows: learning error 0.1639, validation error 0.192, and testing error 0.1722. The learning quality of the network was 0.9563, the validation quality was 0.9761, and the test quality was 0.9522 (Table 5). In order to function, the model needed the following 14 input variables (in the descending order of significance): median luminance, median saturation, standard deviation of red colour without black colour, mean blue colour, mean saturation, mean luminance, standard deviation of red colour, standard deviation of luminance, median saturation without black colour, standard deviation of blue colour, median green colour, standard deviation of saturation without black colour, median blue colour without black colour, median red colour. Table 6 shows the top 5 networks generated during modelling and selected MLP 14:14-14-11-1:1. The MLP models used for image analysis in mixed light were the best predictors of the content of dry organic matter, as the learning error, validation error, and test error did not exceed 18%. The MLP 7:7-9-7-1:1 model ( Figure 5) exhibited the best prediction properties.
Agriculture 2021, 11, x FOR PEER REVIEW 9 of 13 deviation of saturation without black colour, median blue colour without black colour, median red colour. Table 6 shows the top 5 networks generated during modelling and selected MLP 14:14-14-11-1:1. The MLP models used for image analysis in mixed light were the best predictors of the content of dry organic matter, as the learning error, validation error, and test error did not exceed 18%. The MLP 7:7-9-7-1:1 model ( Figure 5) exhibited the best prediction properties. Its parameters were as follows: learning error 0.1792, validation error 0.1592 and testing error 0.1795. The learning quality of the model was 0.9649, the validation quality was 0.9457, and the test quality was 0.9723 (Table 7). In order to function, the model needed the following 14 input variables (in the descending order of significance): mean red colour, mean saturation, mean red colour without black colour, mean saturation without black colour, median red colour, median red colour without black colour, standard deviation of blue colour without black colour.
The generated neural models enabled assessment of the content of dry organic matter in the composted material. In visible light, the RMS error for the test set was about 17%, and in mixed light-about 18%.
The analysis showed that the MLP network was the optimal topology for the neural Its parameters were as follows: learning error 0.1792, validation error 0.1592 and testing error 0.1795. The learning quality of the model was 0.9649, the validation quality was 0.9457, and the test quality was 0.9723 (Table 7). In order to function, the model needed the following 14 input variables (in the descending order of significance): mean red colour, mean saturation, mean red colour without black colour, mean saturation without black colour, median red colour, median red colour without black colour, standard deviation of blue colour without black colour.
The generated neural models enabled assessment of the content of dry organic matter in the composted material. In visible light, the RMS error for the test set was about 17%, and in mixed light-about 18%.
The analysis showed that the MLP network was the optimal topology for the neural model used for the assessment of the dry organic matter content in compost. The MLP 7:7-9-7-1:1 was the optimal model for the assessment of the dry organic matter content in composts. Table 8 shows the top 5 networks generated during modelling and selected MLP 7:7-9-7-1:1. %clearpage Table 8. The quality characteristics of the MLP 7:7-9-7-1:1 model and the other models generated in this part of the study.

Neural Model
Learning Quality  Table 9 presents a summary of the best models for determining the content of dry matter and dry organic matter of the compost under study, depending on the lighting conditions. Noteworthy is the fact that in determining the dry matter best proved to be RBF type neural networks-which indicates the nonlinear nature of the problem, while for dry organic matter best proved to be MLP type neural networks. Table 9. The best neural models for the assessment of the content of dry matter and dry organic matter in compost.

Discussion
Currently, there is no scientific information on the use of indirect methods such as image analysis in determining the physical and chemical parameters of the photographed compost. In the case of the conducted research, it turned out that the compost parameters can be determined by digital image-on the information of material's colour characteristicswithout the use of special laboratory equipment.
There is not much information and data in other publications with which to compare our results. Kujawa et al. [40] researched the maturity of compost made from sewage sludge and maize stover by image analysis. The images were obtained in three different lighting variants, i.e., visible light (VIS), ultraviolet light in the range of 315-400 nm (UV-A), and mixed light (MIX) that was a combination of both sources. The classification error of the developed neural models ranged from 1.56% to 4.43%. They stated that the MLP network was the optimal topology for neural modelling. Their research results also indicated that the models obtained by visible light analysis (VIS) were characterised by a greater classification error than the models built by compost image analysis in mixed light.
Kujawa et al. [41] also conducted research using convolutional neural networks to classify the maturity of compost based on sewage sludge and rapeseed straw. They conclude that the combination of VIS and UV-A light in the acquiring images showed the features which enabled the best classification of the stage of early maturity of the compost.
MLP neural networks have also been used to determine the parameters of other agricultural products by image analysis. For example, they have been used to identify potato cultivars [42] and to classify the marbling of lamb carcasses [36]. Neural modelling is used where solving a scientific problem is not possible using traditional algorithms. Networks of MLP type and especially RBF indicate nonlinear nature of the problem, which is characteristic of life science problems. The generated networks are characterised by simplicity, and the main purpose of conducting the research was to see if it is possible to determine dry matter and dry organic matter in the compost under study. In the course of the research, a set of indicators was identified that allows us to determine the properties of interest using only a digital image.
The use of artificial intelligence methods-but not in identical studies-was indicated by the team of Martelo-Vidal and Vázquez [43], who also conducted studies in different types of light. On the other hand, more work deals with waste sorting, e.g., using deep learning methods [44] and prediction related to oxygen exchange as in the work of Yildiz and Degirmenci [45]. Neural modelling has not been used so far in research such as that presented in this paper.

Conclusions
The research results led to the conclusions that computer image analysis and neural modelling can be adequate tools used for assessment of the content of dry matter and dry organic matter in compost without the need for time-consuming and expensive laboratory analyses.
The presented preliminary research and results allow us to conclude that it is worth continuing the research on the use of this method and its implementation in real conditions. The developed artificial neural network models may be in the future the kernel of an expert system, which will be able to support the assessment of dry matter and dry organic matter content of compost. With an assumed accuracy level of about 95% of the network quality and an RMSE error of about 10%, the new method can be an interesting and low-cost alternative for measuring the indicated parameters to time-consuming and expensive laboratory tests.
The identification of selected features of the composted material and the methods of neural image analysis resulted in a new original method enabling effective assessment of the content of dry matter and dry organic matter. The content of dry matter and dry organic matter can be analysed by means of parameters specifying the colour of compost. The RBF models exhibited the best prediction properties regarding the content of dry matter in mixed light. The analysis showed that the MLP network was the optimal topology for the neural model used for the assessment of the dry organic matter content in compost.
The research was conducted on three types of compost. This indicates the possibility of using this method to determine a content of dry matter and dry organic matter in composts from different substrates. This demonstrates the high utility value of this research.
The models presented here may also work for other images where compost is depicted-but testing the accuracy of these models would need to be done first. It is recommended that tests be conducted for a larger number of test samples and with modelling using deep neural networks and convolutional networks.