## 2 Materials and Methods
### Image Processing and Features Extraction  
Each of the acquired images was extensively analysed, resulting in values for 25 colour and 5 texture parameters. Some of these parameters were obtained from the images in their original form (24-bit JPEG format). However, to obtain some of them, the following transformations were performed:  
* Image conversion from a 24-bit RGB colour space model to an 8-bit grey scale (256 grey levels); the brightness of each pixel was determined as the weighted sum of the R, G, and B components according to the following relationship: \[\text{GS}=0.2989\text{R}+0.5870\text{G}+0.1140\text{B},\] (1)
* Greyscale image binarisation using 4 threshold values: 0.05, 0.1, 0.15, and 0.20;
* Conversion from the RGB model to the HSV model.  
The greyscale images were used in the texture analysis process. For each image, a grey-level co-occurrence matrix (GLCM) was created. Eight pixel brightness classes were included, and the neighbourhood was considered as one pixel, symmetrically along the 4 main directions: 0, 45, 90, and 135\({}^{\circ}\). A full list of the obtained colour and texture parameters is presented in Table 2.  
The colour and texture parameters were extracted from the acquired images in an automated manner. For this purpose, the Compost Image Analysis software (version 2.0, [PERSON], Poznan, Poland), developed in the MATLAB programming language, was used. The formulas presented in [16] were used to determine the texture parameters.  
Based on the extracted image parameters, as well as additional information on the composted material, 10 datasets were developed for the training of neural models to determine the total solids content of the composted material. For training of models to determine the volatile solids content, the separate 10 datasets were prepared. The additional information on the composted material was as follows:  
\begin{table}
\begin{tabular}{c c c c c} \hline \hline \multirow{2}{*}{**No.**} & **Parameter** & \multirow{2}{*}{**Colour Model**} & **Number of** & \multirow{2}{*}{**Description of Parameters**} \\  & **Category** & & & **Parameters** & \\ \hline
1 & colour & RGB (original) & 9 & mean, median, and standard deviation \\  & & & & of the R, G, and B components \\
2 & colour & greyscale & 3 & mean, median, and standard deviation \\  & & & & of a pixel’s brightness \\
3 & colour & binary & 4 & the percentage of white colour in an \\
4 & colour & HSV & 9 & mean, median, and standard deviation \\  & & & & of the H, S, and V components \\
5 & texture & greyscale & 5 & entropy, brightness, contrast, energy, and homogeneity \\ \hline \hline \end{tabular}
\end{table}
Table 2: Colour and texture parameters extracted from the images.  
Figure 2: Example images taken at the beginning (**left**) and the end (**right**) of each composting experiment ((**a**—experiment 1; (**b**)—experiment 2; (**c**)—experiment 3; (**d**)—experiment 4; (**e**)—experiment 5; (**f**)—experiment 6; (**g**)—experiment 7; (**h**)—experiment 8).  
* Sewage sludge percentage;
* Maize straw type (0--untreated, 1--ensiled);
* Compost maturity stage (0--immutance compost, 1--compost at early maturity). An integral part of the datasets was the expected output information of the neural network on the total solids or the volatile solids content determined during the laboratory tests. Each dataset was composed of 1536 independent cases and was divided in a 2:1:1 ratio into training (768 cases), validation (384 cases), and test (384 cases) subsets. The datasets varied in terms of the input parameters (Table 3).