Neural Modelling in the Exploration of the Biomethane Potential from Cattle Manure: A Case Study on Herds Structure from Wielkopolskie, Podlaskie, and Mazowieckie Voivodeships in Poland

In the presented study, data on the size and structure of cattle herds in Wielkopolskie, Podlaskie, and Mazowieckie voivodeships in 2019 were analyzed and subjected to modelling with the use of artificial intelligence, namely artificial neural networks (ANNs). The potential amount of biogas (m3) from cattle manure and slurry for the analyzed provinces was as follows: for the Mazowieckie Voivodeship, 800,654,186 m3; for the Podlaskie voivodeship, 662,655,274 m3; and for the Wielkopolskie voivodeship, 657,571,373 m3. Neural modelling was applied to find the relationship between the structure of the herds and the amount of generated slurry and manure (biomethane potential), as well as to indicate the most important animal types participating in biogas production. In each of the analyzed cases, the three-layer MLP perceptron with a single hidden layer proved to be the most optimal network structure. Sensitivity analysis of the generated models concerning herd structure showed a significant contribution of dairy cows to the methanogenic potential for both slurry and manure. The amount of slurry produced in the Mazowieckie and Wielkopolskie voivodeships was influenced in turn by heifers (both 6–12 and 12–18 months old) and bulls 12–24 months old, and in the Podlaskie voivodeship by calves and heifers 6–12 months old. As for manure, in addition to cows, bulls 12–24 months old and heifers 12–18 represented the main factor for Mazowieckie and Wielkopolskie voivodeships, and heifers (both 6–12 and 12–18 months old) for Podlaskie voivodeship.


Introduction
Biomethane plays an important role in meeting the European Union (EU) 2030 greenhouse gas emissions reduction target and will help in achieving net-zero emissions by 2050. Additionally, biomethane increases European energy security by reducing the dependency on Russian natural gas and can alleviate energy cost pressure on households and companies [1].
The 2020 EU natural gas consumption is 400 bcm (billion cubic meters), 155 bcm of which was imported from Russia. Therefore, searching for alternative energy sources is of great importance [1].
Animal manure can be a good raw material for biogas production as an additional energy source for producing heat and/or electricity [2][3][4].
Poland is one of leaders in the European Union in animal breeding [5]. In Poland, in 2019, there were 6358 thousand LSU (Livestock Unit) of cattle including 2461 thousand LSU of cows. Within the polish voivodships, most cattle were raised in: Mazowieckie, with 558.8 thousand heads; Podlaskie, with 457.2 thousand LSU; and Wielkopolskie, with 279.3 thousand LSU [6]. Polish agriculture produced 99 million tons of feces from cows and pigs, including 78 million tons of manure [7]. In comparison, in the European Union and UK, animal farming generated more than 1.4 billion tons of manure annually in the 2016-2019 [8]. Six major countries (Germany, Spain, France, Italy, Poland, United Kingdom) produce about 68% of the total manure, while Ireland (84 million tons) and the Netherlands (73 million tons) also make important contributions [9]. More than 75% of the produced manure comes from cattle, while approximately 12% comes from pigs and chickens [10].
Manure management, i.e., the acquisition, storage, processing, and use of natural fertilizers, affects the profitability of livestock operations and can affect environmental quality [11]. Polish agriculture is a large producer of atmospheric emissions of CH 4 and N 2 O [12]. Most CH 4 comes from manure produced by cattle (54%) and pigs (31%). N 2 O emissions from manure management amounted to 9.4 kt in 2019 and have decreased by 32% since 1988, which is mainly related to the decline in livestock populations. In this category, direct emissions account for about 49% and indirect emissions 51% of N 2 O emissions [13].
Among Baltic Sea countries, Poland ranks second in terms of the number of biogas plants, biofuel installed capacity, and pellet plants [14]. It is planned in near future that in Poland troublesome waste in the form of manure and slurry will be disposed of by agricultural biogas plants located mostly near large animal farms [15]. Due to the high cattle population, Poland takes a leading position among the European Union countries in terms of the amount of manure produced. However, its use in this country is primarily limited to fertilizing farmland [16]. Animal manure has a high biomethane potential and cattle manure is reported as the most promising [5].
The first known calculations of the biomethane potential based on cattle excrement data in Poland from 2018 were made in 2021 [7]. The visualization concerning voivodeships included in this study is presented on Figure 1.
The previously published data on possibilities of biogas production in Poland based on the data concerning livestock and poultry population in 2010-2016 indicates Wielkopolskie, Mazowieckie, and Podlaskie voivodeships as the biggest potential biogas producers. However, authors indicated that in order to reach such a potential, the building of biogas plants is required, especially in Podlaskie voivodeship [5].
Estimations of biogas potential in Europe show that up to 41 bcm of biomethane in 2030 and 151 bcm in 2050 could be available. It is predicted that Germany would become the leading producer of biogas in 2030, followed by France and Italy. In the ranking of possible biogas producers, Poland is ranked fifth [1].
In the topic of biogas, neural networks have been used in many aspects, such as biogas yield optimization [17,18] or biogas production prediction [19][20][21]. ANNs have been previously used to model an anaerobic fermentation process [17,18], for biogas production integrated with wastewater purification considering both technological aspects of the process and treated wastewater quality [22], or for biogas production from food, fruits, and vegetables wastes [23], as well as from mixed lignocellulosic co-substrates [21]. ANN model was mainly used defining the optimum region in biogas production [24][25][26]. ANN combined with non-linear regression models were developed to predict the biogas production rate from anaerobic hybrid reactor [20,21,27,28] and as an element of the optimization strategy for biogas production from wastes [24]. Concerning biogas from animal wastes, ANNs were used for the optimization of production from poultry [26] or cattle manure [29][30][31]. ANNs were also used to model and predict the synergistic effect between anaerobic digestion and aerobic process in order to achieve maximum biogas production [32].
To date, there are no publications on the application of artificial intelligence, including artificial neural networks in assessing the impact of cattle herd structure on the amount of biogas extracted from manure or slurry (biomethane potential). Therefore, the aim of the presented research was to conduct a case study of biomethane potential for the Wielkopolskie, Podlaskie, and Mazowieckie voivodeships in Poland. The aim was to find the relationship between the structure of the herds and the amount of the generated slurry and manure (biomethane potential). The data were subjected to neural modelling to indicate the most important animal types participating in biogas production. To date, there are no publications on the application of artificial intelligence, including artificial neural networks in assessing the impact of cattle herd structure on the amount of biogas extracted from manure or slurry (biomethane potential). Therefore, the aim of the presented research was to conduct a case study of biomethane potential for the Wielkopolskie, Podlaskie, and Mazowieckie voivodeships in Poland. The aim was to find the relationship between the structure of the herds and the amount of the generated slurry and manure (biomethane potential). The data were subjected to neural modelling to indicate the most important animal types participating in biogas production.

Obtaining Data for Modelling
Three voivodeships characterized by the highest number of cattle raised and a high expected biogas potential were selected for the study: Podlaskie, Mazowieckie, and Wielkopolskie voivodeships (see Figure 1). Podlaskie voivodeship, located in the northeastern part of Poland, covers an area of 20,187,02 km². Mazowieckie voivodeship is the largest in terms of area and population, located in the central and eastern part of Poland which covers an area of 35,558,47 km², and Wielkopolskie voivodeship is located in central-western Poland covering an area of 29,826,50 km². Data for modeling were obtained through the following procedures [7]: 1. Collection of data from the Agency for Restructuring and Modernization of Agriculture (raw data disclosed by the Agency at the request of A. Wawrzyniak). The data concerned livestock production in rural areas by municipality/province. The

Obtaining Data for Modelling
Three voivodeships characterized by the highest number of cattle raised and a high expected biogas potential were selected for the study: Podlaskie, Mazowieckie, and Wielkopolskie voivodeships (see Figure 1). Podlaskie voivodeship, located in the north-eastern part of Poland, covers an area of 2,018,702 km 2 . Mazowieckie voivodeship is the largest in terms of area and population, located in the central and eastern part of Poland which covers an area of 3,555,847 km 2 , and Wielkopolskie voivodeship is located in central-western Poland covering an area of 2,982,650 km 2 .
Data for modeling were obtained through the following procedures [7]:

1.
Collection of data from the Agency for Restructuring and Modernization of Agriculture (raw data disclosed by the Agency at the request of A. Wawrzyniak). The data concerned livestock production in rural areas by municipality/province. The data obtained concerned cattle counts in the provinces of Poland selected for the study.

2.
Averaging of cattle numbers in province-level data converted to livestock unit (LSU) using conversional factors from the 2010 GUS Agricultural Census [33] dedicated to cattle and specific livestock systems (as in Table 1).

3.
Calculation of the amount of waste generated from keeping cattle. Calculations performed separately for manure and for slurry. Calculations were made on the basis of literature data [33].
The following equation was used to calculate amount of slurry: while the equation as below was used for calculation of the amount of manure: where:  Table 1.
The amount of obtained biogas was calculated on the basis of [35]. It was assumed for cattle that:  Therefore, the potential amount of biogas obtained for cattle P b (m 3 ) was calculated as follows: where: P G : average amount of biogas containing 60% methane from a unit amount of animal feces (m 3 ·(tons or m 3 ) −1 ) L G : estimated amount of slurry (m 3 ) L o : estimated amount of manure (tons)

Simulation Studies
Data consisted of 108, 308, and, 213 cases, respectively, for Podlaskie, Mazowieckie, and Wielkopolskie voivodeships. The data were divided into teaching, validating, and test sets in a 2:1:1 ratio, which was 54/27/27, 154/77/77, and 107/53/53/, respectively, for Podlaskie, Mazowieckie, and Wielkopolskie voivodeships. The neural network had 7 independent input variables (input: 1, 2, . . . . . . , 7) and 1 output variable (one from O-1 through O-2, either for slurry as for manure for the examined voivodeship) (marked as in Table 2). The structure of the input set was adjusted to the requirements of the ANN simulator implemented in the commercial STATISTICA package (v13.3, Statsoft, Cracow, Poland).  Table 3 shows the exemplary structure of training file for Podlaskie voivodeship. The ANN simulator was focused on 4 standard ANN topologies: Linear, GRNN (generalized regression neural network), MLP (multi-layer perceptron), and RBF (radial basis function). In all the created networks, the input layer consisted of 7 neurons with a linear PSP (postsynaptic function) and a linear activation function. The hidden layers consisted of a different number of sigmoid neurons, i.e., having a linear PSP function and a logistic activation function. Single sigmoid neuron was obtained as the output of the networks. The generated neural models were trained by the method was BP (back propagation-back propagation of errors) in 5 cycles of 1200 epochs and optimized with the CG (conjugate gradients) algorithm for 200 epochs. In the process of training the network, the Levenberg-Marquardt algorithm was used, tuning the network through 50 epochs. The following parameters were adopted in the learning process with the BP error back propagation algorithm: decreasing learning coefficient (from η = 0.3 to η = 0.03), momentum factor α = 0.4.
The structure and complexity of the ANN (artificial neural network) was determined after several test runs. In our case, 100 networks were tested and 20 were retained. The system automatically assessed the effectiveness of the best network as excellent (under condition that low regression coefficient and correlation approaching to 1 was obtained). The degree of accuracy required for prediction usually varies from application to application. However, roughly, it was assumed that the standard deviation quotient equal to 0.1 (or less) proved a good regression realization by the generated ANN, and above 0.7 (or more) disqualified the generated neural model. Regression statistics were determined independently by standard: for the training and test sets.

Biomethane Potential in the Analysed Voivodeships
Analysis of the data from the Agency for Restructuring and Modernization of Agriculture in 2013-2018 showed that the structure of livestock was as follows: pigs 64-72%; cattle 27-34%; sheep approximately 1%, and goats less than 1%. The highest percentage of cattle breeding was recorded in 2019 in the Mazowieckie, Podlaskie, and Wielkopolskie voivodeships.
The highest potential for biogas production from cattle manure in Poland in 2019 occurred in the Mazowieckie Voivodeship. The potential amount of biogas (m 3 ) from cattle manure and slurry in 2019 for the analyzed provinces was as follows: for the Mazowieckie Voivodeship, 800,654,186 m 3 ; for the Podlaskie Voivodeship, 662,655,274 m 3 ; and for the Wielkopolskie Voivodeship, 657,571,373 m 3 . Detailed analyses can be found in Supplementary Materials File S1 tables (SF1).

Results on ANN Simulation
Although The ANN simulator was focused on four different ANN topologies: linear, GRNN (generalized regression neural network), MLP (multi-layer perceptron), and RBF (radial basis function), the generated topologies selected as optimal were ANNs of the MLP (multi-layer perceptron). A graphical representation of the structure of the generated networks is shown in Figure 2 and the regressions statistics of the obtained optimal neural models in Table 4.  Table 2. Table 4. Regression statistics of the obtained optimal neural models. S.D: ratio-quotient of standard deviations determined for errors and for data. Correlation standard: Pearson correlation coefficient between the results given by the generated neural model and the actual output values.

Learning File Validation File
Test File Type of Neural Network Podlaskie voivodeship Figure 2. Structures of the generated MPL-type networks obtained for modeling the amounts of slurry or manure in the examined voivodeships, as indicated. Input and output variables are as described in Table 2. Table 5 shows the sensitivity analysis for each of the seven input variables separately for the training and validation files. The compliance of indications for both subfiles is an indicator of the correctness of the assessment of the sensitivity.
Sensitivity is given in the form of three parameters, namely Rank, Error, and Quotient. The key issue in the sensitivity analysis is to define the "importance" of variables. In ANNs, the input variables are ordered according to the loss suffered by the network when the variable is turned off. The basic error is the Error, indicating the quality of the generated ANN in the absence of a given variable. A large value indicates that the network loses a lot without this variable. The quotient is the result of dividing the Error by the error obtained using all the variables. Sensitivity analysis gives an insight into the utility (significance level) of an individual input variable (the lower the variable's rank, the higher the level of its significance in the generated neural model), indicating variables that (without losing network quality) can be omitted and key variables that should not be omitted.

Biomethane Potential in the Analysed Voivodeships
The largest amount of cattle-derived manure was produced in Wielkopolskie, Podlaskie, and Mazowieckie voivodeships, accounting for 45% of the total manure in Poland. This is in consistence with the previous publication based on data from 2018 year where the same voivodeships were indicated as the largest cattle breeders. The amount of manure and slurry from livestock production depends on the size of livestock farms, and thus the amount of breed animals. Our calculations show that the examined voivodeships produced the most cattle manure, namely 51% of the manure in Poland.
The total production of cattle manure and slurry exceeds 76 million Mg per 2018 year. The apparent leaders included three voivodeships: Mazowieckie, Wielkopolskie, and Podlaskie [7]. Similar studies have been previously performed on data from 2010-2016 by Kozłowski et al. [5].
The highest potential for biogas production from cattle manure in Poland in 2019 occurred in the Mazowieckie Voivodeship. The potential amount of biogas [m 3 ] from cattle manure and slurry in 2019 for the analyzed provinces was as follows: for the Mazowieckie Voivodeship, 800,654,186 m 3 ; for the Podlaskie Voivodeship, 662,655,274 m 3 ; and for the Wielkopolskie Voivodeship, 657,571,373 m 3 . Detailed analyses can be found in Supplementary Materials File S1 tables (SF1).
The obtained values for biogas potential (amount of biogas in m 3 ) were lower from that previously calculated for the examined voivodeships, differing by 5.11%, 1.12%, and 1.75%, respectively, for Podlaskie, Wielkopolskie, and Mazowieckie voivodeships. The main reason for the differences in biogas potential compared to the previous evaluation is a gradual decrease in the pig population in Poland along with the increase in the cattle population [34][35][36].
Due to extensive agriculture, Poland is characterized by a large availability of organic waste streams that can be utilized for energy. Unfortunately, due to the lack of stable support for the development of this renewable energy sector in Poland in previous years, as of today, only 123 agricultural biogas plants operate in it (as of December 2022). The annual capacity of these installations for the production of agricultural biogas is approximately 335.335 million m 3 to generate electricity. In total, 732.645 GWh of electricity was produced from agricultural biogas, of which approximately 607.708 GWh was sold to obliged sellers and other recipients [37].

ANN Simulation
The formulated prediction problem as the effect of a herd structure on the biogas production was best solved by the ANN of the multilayer perceptron type. The conducted analysis allowed for the conclusion that, for the correct prediction of the amount of produced biogas, the knowledge contained in the variables representing the information on the amount of manure produced by cows, heifers, calves, and bulls is sufficient.
Regression analysis of the generated neural models showed that the best predictive ability was achieved by the neural topology of the three-layer perceptron type containing 2-7 neurons in the hidden layer. Variables ranked from 1 to 3 (Table 5) include information on the type of animals that have the greatest impact on the amount of biogas generated. Sensitivity analysis of the model concerning herd structure showed a significant contribution of dairy cows to the methanogenic potential for all the examined voivodeships for both slurry and manure. The amount of slurry produced in the Mazowieckie and Wielkopolskie voivodeships was influenced in turn by heifers (both 6-12 and 12-18 months old) and bulls 12-24 months old, while in the Podlaskie voivodeship by calves and heifers 6-12 months old. As for manure, in addition to cows, bulls 12-24 months old and heifers 12-18 were the main factor for Mazowieckie and Wielkopolskie voivodeships, and heifers (both 6-12 and 12-18 months old) for Podlaskie voivodeship.
For dairy cows, the first 100 days of lactation represent the most demanding period in feeding. Heifers over 12 months of age were another significant factor. This is probably related to the nutritional requirements of this group of animals in the herd: young heifers should consume 6-9 kg of dry matter of feed per day, and the weight gain from protein should already be 0.4 kg greater than its gain from energy. This is the group of animals in the herd with the highest nutritional requirements and therefore one that needs the most intensive feeding [34]. Calves right after birth are fed colostrum and then powdered milk or whey. Feeding animals with forage is common in breeding herds [35].
The only exception in the presented results are early-maturing bulls. This difference may be due to the fact that in young animals the daily weight gain is mainly dominated by meat tissue. The older the animal gets, the more often they deposit fat rather than protein, resulting in an increase in adipose tissue. This results in an increase in energy requirements [36][37][38].
The analysis showed clear differences between Podlaskie and other voivodeships. In addition to the factor related to nutrition, the location of the far-regional factors and the economic situation can have an impact on the obtained results. A common practice of farms in Poland is to arrange feed rations based on the feeds that are available on the farm/region [39,40]. The methanogenic potential in the herd will therefore depend on the category of animals. The method of feeding (depending on the availability of feeds and their price) can be an additional factor. The differing animal keeping systems are also notable.
In a broader perspective, research on the influence of herd structure on the amount of biogas harvested may allow breeders to more carefully select the number and structure (type) of animals. We suspect that the way animals are breeding in the eastern and western parts of Poland may affect the amount of the obtained biogas. This is an issue we intend to study in more detail on data from across Poland.

Conclusions
The potential amount of biogas (m 3 ) from cattle manure and slurry in 2019 for the analyzed provinces was as follows: for the Mazowieckie Voivodeship, 800,654,186 m 3 ; for the Podlaskie Voivodeship, 662,655,274 m 3 ; and for the Wielkopolskie Voivodeship, 657,571,373 m 3 .
The results of the network sensitivity analysis indicate a significant contribution of dairy cows in the herd structure in maximizing both slurry and manure production. The next categories of animals are heifers of different weight, calves, and bulls.
The obtained research results confirm the that artificial neural networks can be an effective tool in supporting the process of forecasting biogas production from cattle feces based on the structure of the herd.