A Fuzzy-Expert enhanced NSGA-II approach for sustainable agricultural systems

Wait 5 sec.

IntroductionModern organic agriculture plays a crucial role in rural ecological civilization construction, environmental improvement, and sustainable socio-economic development1,2. The rational selection of crop types and planting strategies is crucial for efficient land management, economic benefit enhancement, and risk prevention—the case of Chehe Village in Shanxi Province illustrates this challenge: the village faces the coexistence of a single crop planting season and complex terrain (flat dry land, terraced fields, greenhouses), necessitating the development of targeted solutions to avoid yield declines caused by continuous cropping or risks associated with dispersed planting.In the face of climate change and population growth, adaptive cropping patterns are essential for balancing yield, resource efficiency, and sustainability3. Traditional static cropping systems struggle to address dynamic risks (weather, market fluctuations), necessitating data-driven solutions. This study proposes a framework based on NSGA-II-Monte Carlo simulation for designing adaptive cropping patterns to maximize profitability while minimizing spatial dispersion and uncertainty impacts.Multi-objective optimization has become a key tool in farmland planning, balancing profit, management costs, and sustainability4,5. Among various methods, NSGA-II stands out for its ability to efficiently solve Pareto optimality problems in agricultural contexts, such as integrating with the PLUS model to address ecological-economic trade-offs6,7,8. Although algorithms like MOPSO and MODE have global search advantages9,10, this study focuses on the combination of NSGA-II and Monte Carlo simulation—a method proven effective for uncertainty analysis in crop rotation and planning11,12.Recent advancements have integrated multi-objective optimization with machine learning (e.g., DMOO for high-dimensional problems13, DRL for dynamic systems14,15,16 and hybrid strategies (e.g., NSGA-II-GWO for agricultural optimization17. However, gaps remain in addressing dynamic demands, multi-dimensional planning, and crop complementarity18, particularly in terms of computational efficiency and model adaptability19,20,21.Addressing the challenges of uncertainty management (price fluctuations, climate risks) and complex constraint integration (crop rotation rules, land suitability) in agricultural multi-objective optimization, this study proposes an enhanced NSGA-II algorithm integrated with a fuzzy expert system (Fuzzy-Expert-NSGA-II). The core innovations include:(1) Rule-driven optimization: Designing 15 expert rules (ERB module) to encode agricultural expertise into hard constraints (e.g., rice cultivation restrictions on irrigated land) and soft constraints (e.g., legume crop rotation incentives);(2) Fuzzy uncertainty modeling: Quantifying the satisfaction of profit objectives and biodiversity objectives using membership functions (Formulas 12–13), and converting soft constraints into optimizable indicators (Formulas 14–16);(3) Adaptive search mechanism: Introduce hybrid local search (HALS) to dynamically adjust parameters (Formulas 17–18), combined with elite selection strategy (HERS) to improve the quality of the Pareto solution set.Fuzzy-Expert-NSGA-II modelThis section explains the arable land production optimization model, including the constraints required to achieve the target model and the final multi-objective equations.Relevant constraintsPlanting area constraintsFor the planting area constraint, due to the limited arable land, the planting must be matched to each limited land resource, ensuring that it does not exceed the maximum planting area for each piece of land. Thus, the following planting constraint is formulated:$$\sum\limits_{{l=1}}^{{41}} {{t_{ijkl}}} \leqslant {M_j}\begin{array}{*{20}{c}} {}&{i=1,2\begin{array}{*{20}{c}} ;&{} \end{array}j=1 \cdots 54\begin{array}{*{20}{c}} ;&{} \end{array}k=1,2,3 \cdots } \end{array}$$(1)In Eq. (1), \({t_{ijkl}}\) represents the planting area of the l crop in the kth year of the i quarter for the j piece of land since 2024, and \({M_j}\) represents the area of the jth piece of land.Additionally, since different types of arable land are used to grow different crops, the following constraints must be satisfied for each type of land:$$\left\{ \begin{gathered} \sum\limits_{{l=1}}^{{15}} {{t_{2jkl}}=0} \hfill \\ \sum\limits_{{l=35}}^{{43}} {{t_{1jkl}}=0} \hfill \\ \sum\limits_{{l=1}}^{{15}} {{t_{ijkl}}} \leqslant \sum\limits_{{j=1}}^{{26}} {{M_j}} \hfill \\ \sum\limits_{{l=16}}^{{34}} {{t_{1jkl}}} \leqslant \sum\limits_{{j=1}}^{{26}} {{M_j}} \hfill \\ \sum\limits_{{l=34}}^{{37}} {{t_{ijkl}}} \leqslant \sum\limits_{{j=27}}^{{34}} {{M_j}} \hfill \\ \sum\limits_{{l=38}}^{{41}} {{t_{ijkl}}} \leqslant \sum\limits_{{j=35}}^{{50}} {{M_j}} \hfill \\ \sum\limits_{{l=16}}^{{33}} {{t_{2jkl}}} \leqslant \sum\limits_{{j=50}}^{{54}} {{M_j}} \hfill \\ \end{gathered} \right.$$(2)In Eq. (2), crops 1 to 15 represent grain crops, excluding rice; crop 16 represents rice; crops 17 to 34 represent vegetable crops, excluding Chinese cabbage, white radish, and red radish; crops 35 to 37 represent Chinese cabbage, white radish, and red radish, respectively; and crops 38 to 41 represent edible fungi. Land 1 to 26 represents dry land, terraced fields, and hillside land; land 27 to 34 represents irrigated land; land 35 to 50 represents conventional greenhouses; and land 51 to 54 represents smart greenhouses.For convenience in formulating the equations, decision variables are further defined \({n_{ijk}}\).$${n_{ijkl}}=\left\{ \begin{gathered} 1\begin{array}{*{20}{c}} ,&{{t_{ijkl}}>0} \end{array} \hfill \\ 0\begin{array}{*{20}{c}} ,&{{t_{ijkl}}=0} \end{array} \hfill \\ \end{gathered} \right.$$(3)In Eq. (3),\({n_{ijk}}\) represents whether the l crop is planted in the k year of the i quarter for the j piece of land since 2024, with a value of 1 if planted and 0 if not planted.Additionally, since rice can only be grown on irrigated land, the following planting constraint is formulated in Eq. (4):$$\begin{gathered} {t_{ijk16}}=0\begin{array}{*{20}{c}} {}&{if\begin{array}{*{20}{c}} {{n_{ijk16}}=1}&{} \end{array}} \end{array}\begin{array}{*{20}{c}} {l34} \end{array} \hfill \\ {t_{ijk16}}>0\begin{array}{*{20}{c}} {}&{if\begin{array}{*{20}{c}} {{n_{ijk16}}=1}&{27 \leqslant l \leqslant 34} \end{array}} \end{array} \hfill \\ \end{gathered}$$(4)Planting rotation constraintsFor crops, it is necessary to consider that the same land cannot be used for continuous monoculture, and the soil containing leguminous plant rhizobia should be utilized to promote the growth of other crops.Therefore, considering that continuous single-crop planting is not allowed, the following constraints arise, as shown in Eq. (5). This formula imposes two constraints: planting cannot exceed 1 in two quarters of the year, i.e., planting cannot occur in both quarters; and planting this year cannot be repeated next year.$$\left\{ \begin{gathered} {n_{1jkl}}+{n_{2jkl}} \leqslant 1 \hfill \\ {n_{2jkl}}+{n_{1j(k+1)l}} \leqslant 1 \hfill \\ \end{gathered} \right.$$(5)Considering whether leguminous crops are planted, the following constraint is obtained:$$\sum\limits_{{k=1}}^{{3+T}} {n_{{ijkl}}^{d}} \geqslant 1$$(6)In Eq. (6), \(n_{{ijkl}}^{d}\) represents whether the l leguminous crop is planted in the k year of the i quarter for the j piece of land since 2024, with a value of 1 if planted and 0 if not planted. It is defined for positive integer periods.Expected sales constraintsIn cases where the total yield of crops in a season exceeds the corresponding expected sales volume, the excess cannot be sold normally, so special treatment is required. This paper establishes different constraint conditions for these two scenarios.Since the excess would lead to unsold products, causing waste, it is necessary to restrict the yield to not exceed the expected sales volume in such cases.$$\sum\limits_{{i=1}}^{2} {\sum\limits_{{j=1}}^{{54}} {{t_{ijkl}}} } \leqslant {p_{kl}}$$(7)In Eq. (7), \({p_{kl}}\) represents the expected sales volume of the l crop in the k year since 2024.Definition of uncertain factorsTo characterize the uncertainties in crop yield, sales volume, planting cost, and market price, we adopt the fuzzy stochastic modeling approach proposed by25, which allows for bounded fluctuation using fuzzy variables.After investigation, it was found that the expected sales volume of wheat and corn is projected to increase in the future, with a growth rate between 5% and 10%. For other crops, the expected sales volume is expected to vary by approximately ± 5% compared to 2023. Thus, the formula for future changes in sales volume is derived as follows Eq. (8):$${p_{(k+1)l}}={p_{kl}}(1+{\gamma _{kj}})$$(8)In Eq. (8), \({\gamma _{kl}}\) represents the growth rate of the sales volume of the l crop in the k year. For wheat and corn, it fluctuates between 5% and 10%; for other crops, it fluctuates within ± 5%.Additionally, the yield per acre of crops is affected by various factors, such as climate, and is subject to an annual variation of ± 10%. Therefore, the formula for future changes in yield per acre is derived as follows Eq. (9):$${m_{(k+1)l}}={m_{kl}}(1+{\delta _{kj}})$$(9)In Eq. (9), \({\delta _{kl}}\) represents the rate of change in the yield per acre of the l crop in the k year, which fluctuates within ± 10%.At the same time, the planting cost for each crop has changed, showing an upward trend with an average annual increase of 5%. Therefore, the formula for future changes in planting costs is derived as follows:$${c_{(k+1)l}}={c_{kl}}(1+{\varphi _{kj}})$$(10)In Eq. (10),\({\varphi _{kl}}\) represents the growth rate of the planting cost for the l crop in the k year, with a growth rate of 5%.For the sales price, the prices of grain crops tend to remain stable, while vegetable crops show a growth trend, increasing by approximately 5% per year. The sales price of edible fungi remains stable but declines, with a decrease rate between 1% and 5%. In particular, the price of morel mushrooms shows a significant decline, decreasing by 5%. Therefore, the formula for future changes in sales prices is as follows:$${u_{(k+1)l}}={u_{kl}}(1+{\lambda _{kj}})$$(11)In Eq. (11), \({\lambda _{kl}}\) represents the rate of change in the sales price of the l crop in the k year. For grain crops, this value is 0; for vegetable crops such as wheat and corn, it is approximately 5%; for edible fungi, it fluctuates between − 5% and − 10%, with morel mushrooms specifically having a value of −5%.Introduction of expert rulesIn order to process the corresponding constraints further, an update processing operation is performed, which is described in detail using the following Table 1.Introduction of fuzzy mathematicsTransforming profit and diversity objectives into fuzzy affiliation functions to deal with uncertainty in agriculture (e.g., price fluctuations, climate effects).Fuzzy objective functionThe transformation of soft constraints into fuzzy satisfaction degrees and the definition of a comprehensive fuzzy satisfaction objective follow the method of26, enabling multi-criteria balancing in crop planning.For the profit target, set the ideal profit \(f_{1}^{{\hbox{max} }}\) (the highest value in history), the minimum acceptable profit \(f_{1}^{{\hbox{min} }}\), and define the profit affiliation degree \({\mu _{{f_1}}}({\mathbf{X}})\) as Eq. (12):$${\mu _{{f_1}}}({\mathbf{X}})=\left\{ \begin{array}{*{20}{ll}}\quad 0& {\text{if}}\; {f_1}({\mathbf{X}}) \leqslant f_{1}^{{\hbox{min} }} \\ \frac{{{f_1}({\mathbf{X}}) - f_{1}^{{\hbox{min} }}}}{{f_{1}^{{\hbox{max} }} - f_{1}^{{\hbox{min} }}}}& {\text{if}}\; f_{1}^{{\hbox{min} }}{\mu _{{f_l}}}({{\mathbf{X}}_2})$$(26)The individuals are ranked according to their corresponding dominance relationships to form different Pareto ranks.Step 9:Mixed Elite SelectionFor the solutions in Step 7:Fuzzy Undominated Sorting for the same hierarchy, calculate their crowding distance in the target space as follows in Eq. (27):$${\text{C}}{{\text{D}}_s} = \mathop \sum \limits_{k = 1}^2 \frac{{{f_k}({{\mathbf{X}}_{s + 1}}) - {f_k}({{\mathbf{X}}_{s - 1}})}}{{f_k^{\max } - f_k^{\min }}}$$(27)For expert rule scoring, define the rule score as follows Eq. (28):$${\text{E}}{{\text{R}}_{\text{S}}}{\text{core}} = \mathop \sum \limits_{r \in \mathcal{R}} {w_r} \cdot \mathbb{I}({\mathbf{X}}{\text{ satisfied constraint }}r)$$(28)where \(\mathcal{R}\) is the key rule set (e.g., ER-01, ER-13) and \({w_r} \in \{ 1,2\}\).Combine the Pareto tier, congestion distance, fuzzy fitness, and expert rule score to select the next generation population. For the same Pareto hierarchy, this paper takes 0.5CD + 0.3Fuzzy + 0.2Expert to balance the distributivity, goal optimization and rule compliance to make the selection.Step 10: Selection of final solution based on fuzzy objective normalization methodAfter the main loop phase (T iterations), the optimal solution is selected from the Pareto optimal frontier. The fuzzy objective normalization method uniformly maps objectives of different magnitudes and orders of magnitude to the [0,1] interval by means of the affiliation function to achieve the elimination of the difference in magnitude (e.g., $10,000 profit vs. diversity index).The fuzzy ideal point is fixed as \({{\mathbf{Z}}^ * }=(1,1)\) (i.e., µf1 = 1, µf2 = 1) and the theoretical optimization of profit and diversity is achieved simultaneously. The closest solution to the fuzzy ideal point is calculated with the following Eq. (29):$${D^ * }=\arg \hbox{min} \sqrt {{{({\mu _{{f_1}}}({\mathbf{X}}) - 1)}^2}+{{({\mu _{{f_2}}}({\mathbf{X}}) - 1)}^2}}$$(29)According to the determined objective function and constraints, the NSGA-II algorithm is used to solve the mathematical model of planting strategy, which can obtain the Pareto optimal frontier that satisfies the requirements of minimizing the cost and maximizing the profit of decentralized management at the same time. Its corresponding pseudo-code table is shown in Table 1 below.Table 1 Table of rules for experts.Full size tableTable 2 Pseudocode for NSGA-II Solver.Full size tableResultsData preprocessingA comprehensive visual analysis of the structure of arable land shows the proportion and distribution of different types of arable land, revealing the current status of the utilization of arable land resources in the countryside. This analysis helps to understand the distribution of cropland resources and lays the foundation for subsequent optimization strategies. Next, the yields of various types of crops and their comparative mu yields under different arable land conditions were calculated, revealing the production potential of the crops. At the same time, the average mu profit of each type of crop was ranked to provide strong data support for optimizing the use of cropland and formulating the best planting plan. The results of analyzing these data will provide an important basis for subsequent decision-making, thus effectively enhancing the efficiency and economic benefits of the use of arable land resources.Fig. 2Visualization of rural farmland structure, crop planting status, and average per-acre profits.Full size imageAccording to Fig. 2, the total area of open cultivated land in the village is 1,201 acres, distributed in 34 plots, covering four main types of cultivated land: flat dry land, terraced land, hillside land, and irrigated land. Specifically, flat dryland accounted for 30% of the total cropland area, 365 acres, distributed in six plots, with individual plot sizes ranging from 35 to 80 acres; terraces were the main type of cropland, accounting for 52% of the total, with a total area of 619 acres, distributed in 14 plots, with sizes ranging from 20 acres to 86 acres; hillslope and irrigated watered land each accounted for 9% of the total, with hillside area of 108 acres, divided into six plots, with sizes ranging from 13 acres to 27 acres; watered land covers 109 acres and is distributed into 8 plots, with individual plot sizes ranging from 6 acres to 22 acres. The open cultivated land is mainly suitable for growing one season of food crops, while the watered land has the potential to grow rice or two seasons of vegetables.In terms of greenhouses, there are 16 ordinary greenhouses and 4 smart greenhouses in the village, each covering an area of 0.6 acres. The total area of ordinary greenhouses is 9.6 acres and the total area of smart greenhouses is 2.4 acres. Ordinary greenhouses are suitable for planting one season of vegetables and one season of edible fungus, with a certain insulation effect; intelligent greenhouses utilize solar energy technology to automatically regulate the temperature to ensure the normal growth of crops in the winter, and two seasons of vegetables can be planted each year. The introduction of the greenhouse not only improves the land utilization rate, but also provides strong support for modern agriculture in the countryside.Through Fig. 1, the structure of existing cultivated land in the countryside is carefully analyzed. The inner pie chart shows the overall distribution of various types of arable land, including flat dry land, terraced land, hillside land, watered land, ordinary greenhouses and smart greenhouses. The outer pie chart further refines the specific composition of these cultivated lands, e.g., there are 16 ordinary greenhouses and 4 smart greenhouses. This two-layer visualization makes the diversity and distribution characteristics of rural croplands more intuitive, deepens the understanding of the structure of rural croplands, and provides data support for future agricultural planning and crop cultivation strategies.The pie chart on the left side shows the distribution of open cropland in the countryside, covering four types: flat and dry land, terraced land, hillside land, and irrigated land, and the proportion of each type of open cropland is visualized. The pie chart on the right side focuses on the distribution structure of cultivated land in greenhouses, showing in detail the proportion of ordinary greenhouses and intelligent greenhouses, which makes the current situation of cultivated land in the countryside clearer.In summary, the structure of cultivated land and greenhouses in this countryside is reasonable, with a diverse distribution of land use, where open cultivated land is mainly used for grain crop cultivation, while watered land has the potential to grow rice or two-season vegetables. The use of greenhouses, especially smart greenhouses, further increases the flexibility and yield of agricultural cultivation and ensures winter crop growth through solar technology. This model of combining arable land and facilities lays the foundation for the development of modern agriculture in the countryside and significantly improves the efficiency of land use and promotes the development of sustainable agriculture.By plotting bar charts ranking the total production of each type of crop and comparing the acre yield of major crops under different arable land conditions in 2023, this section delves into the current situation of rural crop cultivation. The charts show the yield distribution of each type of crop and reveal the impact of different arable land conditions on the yield of major crops, which provides important data support for optimizing the rural agricultural structure and improving planting efficiency.Fig. 3Total yield ranking and per-mu yield comparison of major crops under different farmland conditions.Full size imageIn Fig. 3, bar charts display the per-mu yield, planting cost, and sales price of different crops. For example, “garlic,” “onion,” and “potato” show very high per-mu yields, exceeding 10,000 jin, while most other crops have relatively lower yields. Both “garlic” and “onion” also have high planting costs, reaching more than 5,000 yuan/mu. Crops like “corn” and “tomato” have relatively low planting costs. The sales prices for “garlic” and “onion” are relatively high, while some other crops like “wheat” have lower prices.According to Fig. 2, in 2023, food crops dominated the total yield, especially wheat, corn, and millet, which yielded far more than other crops. Among them, wheat took the largest share in the comprehensive category, highlighting its important role in the rural economy and ensuring food security. Additionally, vegetable crops closely followed in terms of yield, primarily including varieties such as cabbage and eggplant, reflecting stable market demand, especially with the accelerating urbanization process. Vegetable crops have become an essential part of daily consumption. Their high yield and market demand have driven the continued expansion of their planting areas, making them a new driving force for rural economic development.Although the total yield of edible fungi crops is relatively low, their market value is high. The chart displays the market share of edible fungi such as single-stalk mushroom, white beech mushroom, elm yellow mushroom, and shiitake mushroom, indicating that these high-value crops are gaining increasing favor in the market. This is especially true against the backdrop of the growing awareness of healthy eating. Despite their lower yield, edible fungi’s high-profit potential makes them an important choice for farmers to adjust their planting structure and increase income in the second season.Overall, the total yield of agricultural crops in 2023 demonstrates a diversified development pattern, with food crops, vegetables, and edible fungi all contributing to growth. Food crops dominated in terms of planting area and yield, while vegetable and edible fungi crops showed considerable market potential and economic benefits. These data not only reflect the production situation for the year but can also serve as an expected basis for crop sales forecasts from 2024 to 2030, providing important reference for future crop planting strategies and market planning.This section also presents a comparison of the per-mu yield of major food crops under three different terrain conditions: flat arable land, terraces, and sloped land. By analyzing the terrain conditions for different crops, the impact of terrain differences on crop yields can be effectively assessed, thus providing valuable insights for rational crop planting planning.According to Fig. 3, the per-mu yield of food crops on flat arable land is generally higher, especially for crops like pumpkins and red crops, which show a significant yield advantage. In contrast, the yields on terraces and sloped land are slightly lower. Particularly on terraces, crops like buckwheat show more suitable planting conditions, with yields close to those on flat arable land. The overall yield on sloped land is lower, but drought-resistant crops such as beans can still maintain good yields. Overall, flat arable land remains the preferred terrain for planting food crops, but according to the characteristics of different crops, terraces and sloped land also have certain planting potential.Fig. 4Open-field farmland structure and greenhouse farmland structure.Full size imageAlthough some crops, such as garlic and onions, have higher per-mu yields, their planting costs are also higher. Consequently, these crops also have higher sales prices. Therefore, when making planting decisions, it is necessary to weigh the relationship between planting costs and yield.Each box plot displays the distribution of minimum profit, maximum profit, sales volume, sales price, planting cost, and planting area for different crops. The distribution of minimum and maximum profits shows significant variability, with the maximum profit distribution noticeably higher than the minimum profit, and several outliers with very high values. The distribution of sales prices is relatively concentrated, with the prices of most crops falling within a smaller range. Planting costs and areas exhibit considerable fluctuations, with some crops having very high planting costs, while the planting costs of most crops are concentrated in lower ranges.Fuzzy-Expert-NSGA-II was used to solve the optimal planting strategy optimization model. The operation was carried out through Python, and this paper selected three groups of solutions closest to the fuzzy ideal point from the Pareto optimal frontier, and tested five groups of weights in the preexperimental stage according to the requirements of the assessment of the economic effectiveness of staple food production areas in the Food Security Security Law, and screened out the most representative combinations of these three groups through the ANOVA analysis (F-value = 8.37, p = 0.002). Ensuring that the poor design of each group of weights was verified by paired t-test (p