Sustainable supply chain management using Bi-GRU network optimized by hybrid maritime search and rescue algorithm Authors: Zhenjie Li Published: 2025 ABSTRACT AbstractThe agricultural and food supply chain faces various challenges that include waste reduction, traceability, and profit optimization, with one being dynamic disturbances such as the weather events and transportation delays. As traditional methods have constraints in addressing these challenges due to a lack of adaptability and scalability, this study proposes a hybrid framework to resolve the problem. The study combines the Bidirectional Gated Recurrent Unit (Bi-GRU) networks and a Hybrid version of Maritime Search and Rescue (HMSR) for sustainable supply chain management. The production and storage prediction problem is handled using IoT sensors and market trends-based time series data by the Bi-GRU model, and the HMSR algorithm is used to optimize the decisions based on constraints, which can include production capacity, storage constraints, and market demand. Applied to the Global Food and Agriculture Statistics dataset on Kaggle and synthetic disruption scenarios, our framework reaches 92.4% accuracy in making storage decisions, reduces waste by 34.2% and maximizes profit margins at 28.7%, outperforming GRU, LSTM, GA, PSO, and HGSODL-ASCM baselines. These discoveries highlight that hybrid AI-driven artificial intelligence approaches can revolutionize agricultural structures and food supply chains, providing adaptable and scalable solutions for institutions in their pursuit of profitability and sustainability.Supplementary InformationThe online version contains supplementary material available at 10.1038/s41598-025-25366-w.Keywords: Blockchain technology, IoT, AI-Driven predictive analytics, Agricultural supply chains, Sustainable agriculture, Bi-GRU, Hybrid version of maritime search and rescue optimizerSubject terms: Engineering, Mathematics and computing Introduction Humans need proper and valuable nutrition to survive and continue living. The agricultural industry is responsible for providing these vital substances in the first step, which includes growing various plants, vegetables, greens, and oilseeds1. Providing and making available agricultural products, given the vastness of the Earth and the increasing population, requires a precise, agile, and minimally risky supply chain2. For this reason, logistics and supply chain are considered very important in the agricultural industry3. Agricultural and food supply chains (SCs) are an important part of the global food security4. However, it faces sustainability and profitability challenges. The main issues in this direction are: High Waste Rates: Around 30% of perishable goods (like fruits and vegetables) are wasted because of inappropriate storage, ineffective logistics, and poor demand forecasting5. High Waste Rates: Around 30% of perishable goods (like fruits and vegetables) are wasted because of inappropriate storage, ineffective logistics, and poor demand forecasting5. Traceability, trade, and transparency: Fragmented stakeholder coordination and manual record-keeping create opaque supply chains that make it difficult to comply with safety regulations or consumer demand for transparency6. Traceability, trade, and transparency: Fragmented stakeholder coordination and manual record-keeping create opaque supply chains that make it difficult to comply with safety regulations or consumer demand for transparency6. Profit volatility: Chaotic market prices, varying demand, and operational hiccups (like energy costs associated with cold storage) compress profit margins for farmers and distributors7. Profit volatility: Chaotic market prices, varying demand, and operational hiccups (like energy costs associated with cold storage) compress profit margins for farmers and distributors7. In addition, these challenges are worsened due to the dynamic nature of SC environments, where disruptions (e.g., weather events or transportation delays) necessitate real-time adaptive decision-making. These challenges can be addressed by emerging transformative technologies8. Pioneered by blockchain technology, it facilitates immutable, decentralized record-keeping that maintains the integrity of the information blockchain provides, such as the journey of produce from farm to retailer, with transparency and traceability that offers anti-fraud capability and improved compliance with safety standards9. On the other hand, smart contracts provide automated agreements, e.g., payment on delivery, that reduce administrative delays10. The IoT (Internet of Things) sensors enable real-time monitoring of environmental changes, such as humidity and temperature, in storage facilities and transport vehicles, and help to mitigate spoilage by issuing alerts and corrective actions. However, past research has addressed blockchain for traceability, IoT for monitoring, and AI for forecasting, and three key gaps remain: Lack of Unified Frameworks: Many existing studies concentrate on specific technologies (e.g., blockchain or GRU models) and do not build them into unified frameworks. Static Decision-Making: Conventional AI models (e.g., LSTMs) and optimization algorithms (e.g., genetic algorithms) do not sufficiently adapt to real-time disruptions in SC contexts. Limited Scalability: Existing hybrid approaches are often limited to single stakeholders and cannot be scaled to cooperative, multi-stakeholder settings where conflicting objectives (e.g., farmer profits and retailer costs) complicate coordination. Static Decision-Making: Traditional AI methods (e.g., LSTMs) and optimization methods (e.g., genetic algorithms) do not respond to real-time SC environmental perturbations. Limited Scalability: Existing hybrid approaches demonstrate limited scalability in multi-stakeholder scenarios where different objectives are misaligned (for example, farmer profits vs. retailer costs), making coordination difficult. In this research, AI is considered, and Bi-GRU networks (bidirectional gate recurrent units) are used to capture both temporal dependencies in time-series data, like previous yields and price variations, to forecast recommended production and storage strategies. Furthermore, a modified metaheuristic algorithm, the HMSR (Hybrid Maritime Search and Rescue optimizer) algorithm, emulate adaptive searching patterns to address complex optimization challenges, including profit maximization within time-varying constraints. Figure 1 illustrates stakeholders (farmers, distributors, retailers) are connected through a blockchain network. Schematic of a blockchain-enabled agricultural supply chain with IoT sensors. For example, IoT sensors are deployed in farms and warehouses to monitor the temperature and the inventories, which can be fed to the blockchain. This can then be processed into the Bi-GRU/HMSR model to take optimized actions (ex. modify storage or schedule a method of shipment). The concern of this research relates to issues surrounding agriculture and food supply chains with significant waste, especially for perishables, which can be up to 30%. Poor traceability, profitability that varies with each supply chain cycle, risks from dynamic disruption including weather disruption and delays in transportation, which benefits the eradication of sustainability and prudent economics. Traditional supply chain management methods are still using a form of static models or independent technologies such as blockchain or basic AI technologies which are not flexible, scalable, or in real-time decision making, which are the core to be able to address this complex interconnected issues. Previous work investigated individual technologies (e.g., LSTM networks for time series forecasting or the use of metaheuristic algorithms such as GA and PSO for optimization), but little attempts were made at integrating predictive modeling with adaptive constraint-aware optimization. Many studies analyze individual components of the supply chain, usually together with deep learning paradigms that are disconnected from dynamic decision framework for addressing real-time disruptions and multiple stakeholders constraints. These strategies can operate less than optimal under dynamic uncertainty, perishability conditions, and demand variability. This research introduces a hybrid framework that operates collaboratively by employing Bi-Directional Gated Recurrent Unit (Bi-GRU) for a context-rich temporal forecasting and Hybrid Maritime Search and Rescue (HMSR)-based real-time constraint optimization, which ultimately allows for accurate forecasting of production and storage requirements, but more importantly, allows for the ability to fine-tune decisions based on changing operating and environmental conditions and addresses vital gaps in scalability, adaptability, and responsiveness in sustainable agricultural supply chains. Related works The paradigm shift brought by recent developments in AI and optimization algorithms has transformed traditional SCM practices towards proactive risk mitigation, dynamic decision-making , and sustainable resource allocation. Han and Zhang11 established a method for supply chain risk management based on learning and neural networks. Furthermore, they assessed the risk indicator system on the basis of the current state of supply chain management. Also, the research was conducted using MATLAB, and the model’s validity was assessed using examples. Subsequently, training of data, the value of risk analysis was generated, along with suggestions for dealing with the risk. The investigation indicated that the model was useful and had a practical impact. Jianying et al.12 used a neural network for assessing the fresh grape supply chain’s risk. Initially, the supply chain’s potential factors of risk were recognized, and a risk assessment index system was offered. After that, risk assessment methods due to the optimized BP and single BP or PSO-BP and GABP neural networks were developed. Finally, the methods were tested, trained, and assessed through data from a survey of the supply chain. The outcomes revealed that the fresh grape supply chain’s risk was low. However, the risk of links was inconsistent. Actually, the greatest risk was the risk amid the chain’s links or R0, and the highest risk dimensions were social, cooperation, and economic risk. The majority of dangerous events occurred in the 2nd quadrant (high damage and low probability risks). The model’s testing and training outcomes revealed that the method outperformed the single BP neural network’s risk assessment within the sustainable supply chain of grapes, while the PSO-BP method was more suited, with fewer assessment mistakes and a higher R2. Also, the findings identified the risk elements, which contributed most to the grape sustainable supply chain’s general risk. The current study theoretically enriched supply chain risk assessment of the method and made practical recommendations for stable operation, avoidance of risk, and sustainability development in the supply chain of fresh grapes. Merneedi and Palisetty13 examined the elements, which were employed for arranging the GSCM system within leather manufacturing. First, survey queries were produced and spread to industry authorities. Indeed, 3 leather industries responded to each survey question correctly. All of the questions were necessary. The acquired data were then evaluated through a DBN, or deep belief network in order to determine the influence of major drivers in applying the GSCM system in factories. The suggested system’s performance was evaluated using a variety of existing methodologies like f-measure, accuracy, precision, and so forth. The current framework’s application had suggestions for improving organizational effectiveness through reducing waste, saving expenses, and creating a green culture amid employees. The study helped to build policies and gain a better understanding of the way to adopt green innovation strategies. Xu et al.14 conducted a Hunger Games Search Optimization based on a Deep Learning Model for HGSODL-ASCM or management of food supply chain and Sustainable agricultural. The HGSODL-ASCM approach’s main focus was on enhancing decision-making procedures for food commodities and agricultural production for maximizing profits. The offered HGSODL-ASCM approach used a Bi-LSTM or bidirectional long short-term memory method for calculating the quantity of needed storage and productivity in order to enhance income. The current work applied the HGSO algorithm to improve the Bi-LSTM categorization procedure’s enactment. Actually, the HGSODL-ASCM approach could establish SCM policies by interacting with intricate and adaptable settings. The simulations were carried out to guarantee that the HGSODL-ASCM approach performed well. The outcomes showed the better enactment of the HGSODL-ASCM technique compared to other approaches. Yuan and Wang15 addressed the inventory management and resource distribution difficulties within systems of supply chain through developing a supply chain optimization method due to the ISCO-DQ or Deep Q-Networks that prioritized eco-effectiveness. First, the project created a supply chain method, which included supplier-customer connections that were led by means of green computing concepts to reduce environmental effects. The model implemented Markov Decision Processes in order to create a structure for maintainable supplier inventory management, with a focus on waste decrease and resource implementation. Actually, the method prioritized energy-efficient inventory management processes while achieving intelligent resource allocation using Deep Q-Networks’ function approximation abilities. The ISCO-DQ inventory managing method, in turn, converged to − 181,300 and − 41,400 after 300 and 100 cycles with normal client request distributions. Compared to common single-period random and fixed-order amount inventory managing approaches, the ISCO-DQ method decreased overall prices by mans of an average of 6.7% and 16.6% through decreasing carbon emissions from excess inventory and overproduction. Additionally, the ISCO-DQ method significantly alleviated costs from ambiguity in requests by responding quickly to volatility, as well as enhancing inventory approaches by assisting in circular economy. It also emphasized how the ISCO-DQ inventory management method effectively addresses the rigidity and inefficiencies inherent in traditional supply chain management, ultimately promoting organizational sustainability and environmental stewardship. The application of these models to dynamic, real-world settings, such as agriculture and food systems, where perishability, demand variability, and multi-stakeholder coordination can complicate decision-making, remains challenging. Materials and methods This paper introduces a new hybrid method involving a hybrid Bidirectional Gated Recurrent Unit and Hybrid Maritime Search and Rescue (HMSR) metaheuristic algorithm as an effective framework for agricultural and food supply chain management (SCM). It seeks to exploit the nature of these environments to make the best possible decisions with respect to production and storage while maximizing profit in an environmentally sustainable and resilient fashion. The Bi-GRU model leverages learning of temporal dependencies from time-series data, such as logs from sensors, market trends and temporal conditions, to offer predictive input on optimal productivity and storage levels. The HMSR act as a metaheuristic optimization method that refines these predictions by optimally arranging the learning and predictions from the Bi-GRU to include temporal constraints and assessments of actual experiences. The previous section highlighted both components, clarified their interplay, and justified those design approaches. Bi-GRU model: predicting productivity and storage needs In this study, the Bidirectional Gated Recurrent Unit (Bi-GRU) serves as the predictive engine that accurately predicts production amounts and storage needs within agricultural and food supply chains from temporal dependencies within multi-source time-series data. By integrating sequences in both the forward and reverse context, the Bi-GRU can derive a more complete historical context, including historical yields and weather, historical changes in market prices, and capture a forward context such as demand forecast and anticipated disruptions which can enhance adaptive decision-making. The Bi-GRU merges information from IoT sensors and market trends alongside operational logs that we have pre-processed and input into the model to create dynamic decision-making predictions for production () and storage (). The outputs from the model are processed inputs, and are not stand-alone decision variables, as they serve as the input into the Hybrid Marine Search and Rescue (HMSR) optimization algorithm which revised the model outputs against real-world constraints such as capacity limits, demand uncertainties, and environmental conditions. Thus, the Bi-GRU serves as the backbone in providing context-based, highly accurate forecasts, enabling proactive, data-driven, and resilient supply chain management of the hybrid framework to maximize profit, cut back on waste, and realign in real-time against dynamic disruptions. In the following, different parts of the Bi-GRU model for productivity and storage prediction have been explained in detail. Bidirectional processing for capturing Temporal dependencies Bi-GRU is a type of RNN that uses bidirectional processing to capture both the past and future context of the sequences. Conventional unidirectional RNNs can only process sequences in one direction (e.g., left to right), which means they cannot consider future dependencies. Bi-GRUs, on the other hand, read sequences in both forward and backward directions; they therefore capture richer representations of temporal patterns. The Bi-GRU network structure is given in Fig. 2. The Bi-GRU network structure. The hidden state at time-step t is calculated as follows mathematically: where, is the input data from step 1 to , ​ indicates the input data from the time step to , ​ and ​ are GRU layers reading the data forward and backward, respectively. To get the final output, it concatenates forward and backward hidden states: This bi-directional architecture is especially beneficial for SCM tasks, which can require decisions based on history (e.g., previous yields, market prices) and future (e.g., expected demand, weather forecasts) information. For example, projecting storage needs should not only take into account past stock levels but also anticipated deficiencies or surpluses of stock in future. Input data and feature engineering Data of series from several sources is entered into the Bi-GRU model to account for place-monitoring environmental state (e.g., temperature, humidity, and soil moisture level) via Internet of Things (IoT) sensors and trade data, which consists of past and future prices, interest demand, and competitors’ actions, and operational data, including production capacity, transport schedule, and stock limits. Therefore, these inputs are pre-processed during their passage to the model itself. For example, by imputing missing values via interpolation methods16, normalizing features17 to avoid models becoming biased towards any variable that has a larger scale than others, and dividing time-series into fixed-size windows (look-back steps) for the model to learn through time. Figure 3 shows the process. The Bi-GRU model for productivity and storage prediction. Parameters of the Bi-GRU model The Bi-GRU model has dependencies to different hyperparameters, each of which provides an important effect on the trade-off between accuracy, complexity, and computational efficiency. The look-back steps (L) determine how many time steps back you want to include when you make predictions- a larger look-back will yield more context, but also be more expensive to train. For example, L = 30 would make sense when predicting monthly yield, whereas L = 7 would be sufficient for weekly storage adjustments. Neurons in a layer increase representation power but can also lead to overfitting if too high, with common maximum values of 64, 128, or 256 neurons per layer. Dropout rate (D) avoids overfitting by randomly dropping neurons during training, with common values in the range [0.2, 0.5]. Output: profit and storage decisions The Bi-GRU model gives two outputs, one for predicted production levels () for when to harvest the crops based on historical data and environmental conditions, and storage requirements (), to find out the storage space needed to minimize spoilage and maximize revenue. These predictions are inputs used by the HMSR algorithm to dynamically make optimal decisions. As its name implies, the Bi-GRU model combines innovations in recurrent neural networks (RNNs) known as GRUs, with a bidirectional learning process that enables the predictive model to leverage both past and future data when determining outcomes or making predictions. When the model predicts excess produce (P_t > Demand_t), the HMSR algorithm determines how the excess inventory would be distributed across the storage facilities with the lowest cost. The primary benefit of using Bi-GRU over other models is the intelligent and efficient combination of bidirectionality and computational power, the flexibility of adaptive decision-making during interruptions, and the ability to easily couple with an optimization algorithm like GA and PSO in running simulations. For agricultural supply chains, an optimal set of key features-waste management, profitability, and sustainability enables decision making to be precise, situationally aware, and resilient in decision making. Empirical evidence demonstrated that none of the other models in the comparison set (GRU, LSTM, GA, PSO, HGSODL-ASCM) displayed a comprehensive performance based on accuracy, profitability, and operational efficiency. It follows that the Bi-GRU/HMSR combination will be a disrupter in the management of sustainable supply chains in the future. The preprocessing pipeline was comprehensive in developing the time series data used in the Bi-GRU/HMSR framework to assure that accurate predictions and robust predictions could be made from high-quality performance inputs. As earlier described in Sect. Input data and feature engineering, the preprocessing included missing data imputation, where interpolation methods were used to infer missing data values from surrounding data points so as not to obliterate temporal continuity. There was also normalization of features so that all input features would have to scale to the range [0, 1], as this would prevent the model from becoming biased toward variables of greater magnitudes and would hasten convergence during training. In addition, the data were further segmented into fixed-size time windows (based on look-back steps) for the Bi-GRU model to learn sequentially. Such preprocessing was performed on those heterogeneous data sources, like IoT sensor readings (e.g., temperature, humidity), market trends (e.g., prices, demand forecasts), and operational logs (e.g., production capacity, transport schedules), so that the model would learn effectively from heterogeneous real-world agricultural supply chains. Hybrid maritime search and rescue algorithm Inspiration One of the main objectives of MSRA is duty based on rescue and marine search. The search and rescue organization carries out these missions when an accident occurs. This is done by dispatching the first helicopter, the second helicopter, and other equipment. The main idea of the proposed algorithm is explained based on this helicopter behavior. In this process, the starting point is randomly selected within the range and is represented by a red triangle in the image. This behavior is defined as follows: Here defines starting position, is in the rang of (0, 1) randomly, and and are the upper and lower borders, respectively. From the beginning position, perform a linear scan of the surface of the sea in the designated / direction. This behavior can be explained using formula (2): In this case indicates the state of the helicopter at the time from ; represents the situation of renewal; then, the line spacing between scanning’s each scanning line is shown by , is the search stage, stands for the search direction. These parameters can be achieved as follows: The scanning order, designated by in this case, is . It has scanned positively in the starting part . Use to resume scanning as soon as the upper border is obtained. If scanning is going in a positive way, it becomes even; if it is going in a negative direction, it becomes odd; and so on. The term “stp” refers to the number of visits created by scanning in a positive or negative direction. It can be expressed as an integer such as 50, 100, 1000, etc. that are anticipated throughout a specific time period determine the overall scanning lines quantity, which can be represented as an integer, specifically 5, 6, 7, …. In naval search and rescue, the distance between prearranged scanning lines must be as small as feasible after dealing with poor perceptibility and complex water conditions, which increase the number of scanning lines. and manage the sensitivity and error of MSRA. With the increase of these two values, the sensitivity increases, which in turn leads to an increase in the calculation time. The aircraft typically scans the area in the y-direction after completing the scan in the x-direction. This behavior is calculated by the next formula. In this case, and provide equal assumptions as their equivalents during the horizontal scanning direction. This study does not reiterate this. The condition equivalent to the optimal fitness shown in the previous horizontal scanning direction is denoted by . The scenario vector consistent with the minimum amount was computed for the min problem. The scenario vector consistent with the maximum amount was identified for the max issue. By finishing rough scanning, the search region was reduced in size in order to focus on the most suspect location. The scanning process was comparable to the previously described rough scanning approach, except for the smaller search area. The following equations describe this behavior. Here, [, ] is a recently described narrowing border that is assigned to , after which the previously mentioned horizontal and vertical scanning is repetitive, with being the arrangement repetition’s number. The equation makes it evident that the MSRA’s convergence speed is determined by , and that this speed has an impact on the computation erroneousness. The convergence constraints could be appropriately changed to reduce the speed of convergence and increase the computation accuracy for complex computing purposes. At first, some key parameters are chosen for the MSRA approach. Then, Eq. (3) was expressed as a computer program; Subsequently, a loop body was composed. The MSRA Loop defines the number of loops. To resolve Eq. (4), a computer program has been produced. To estimate and determine the ideal quantity, the coordinate points that were scanned in the horizontal direction are then replaced by the test function. The primary quantity of the y-direction scan is then assigned to , which corresponds to the y-direction with the best fitness. The next stage is to write a computer program for Eq. (11). To calculate and achieve the ideal quantity, the coordinate points that are scanned in the vertical direction are added to the test function. Next, Eqs is written. (9) through (11) are computer programs. Additionally, evaluate whether or not the loop calculation is completed. Ultimately, the ideal quantity and associated xy coordinates are found. Algorithm I in APPENDIX I shows the pseudocode of the MSRA. Hybrid maritime search and rescue algorithm This study’s Hybrid Maritime Search and Rescue (HMSR) algorithm will serve as a metaheuristic optimization engine, dynamically optimizing production and storage decisions while refining and enhancing the predictive outputs of the Bi-GRU model against real-world constraints such as production capacities, market demand variability, and environmental disruptions. HMSR was inspired by search and rescue operations on water and combines the global exploration capabilities of the MSRA (Maritime Search and Rescue Algorithm) with the local exploitation strength of Particle Swarm Optimization (PSO) to avoid local optima and accelerate convergence toward global optima. It fine-tunes critical hyperparameters of the Bi-GRU model (look-back steps, number of neurons, and dropout rate) for the dual purpose of balancing accuracy and computational efficiency while also reallocating resources in response to synthetic disruptions like transportation delays or weather impacts. The integrated adaptive optimization mechanisms of the HMSR enable the hybrid framework to maximize profit margins (28.7%); minimize wastage (34.2%); and maintain resilience in dynamic and multi-stakeholder agricultural supply chain environments. To eliminate these limitations, the MSRO method is merged with the PSO (Particle Swarm Optimization) algorithm. Despite the promising outcomes of the MSRO optimizer, it does have its limitations, which include a proneness to sticking in local optima and a slower speed of convergence. These limitations become more important when the problem set is high dimensional. This combination provides various benefits as compared to adopting each approach alone. Actually, by expanding the search space investigation, this combination helps MSRO avoid becoming trapped in less-than-ideal solutions. PSO establishes a balance between exploration and exploitation in the solution space to accelerate the convergence of MSRO. PSO raises the population diversity in MSRO by adding new particles to the solution space. Like what is done in the PSO algorithm, we merge the PSO mechanism into the position updating process to improve the MSRO method. The equation is as below: , Here, the constant factor influences the scaling of the MSRO and PSO algorithm dimensions. in order to boost the MSRO method’s cost-effectiveness, the value of is set to 0.6. in addition, the velocity )is determined in the following manner: The vectors and represent the current position of the individual and the solutions’ best-known position, in turn. The constants is the weight assigned to the global and describes local best solutions, and the variables and show the prior of particle and present velocities. PSO plays a crucial role in improving both convergence and global search capabilities of the HMSR optimizer and in hastening its convergence. The major advantage of MSRA is that it can organize very systematic scanning and then exploit those through deterministic grid-based search patterns, but it suffers from slow convergence and an inclination to get stuck in the local optima even when that very mode is applied in high-dimensional, noisy environments such as agricultural supply chains. PSO introduced in the position update mechanism of HMSR (defined in Eqs. 12 and 13 of the manuscript) helps alleviate these effects. PSO even goes a step further by introducing stochastic swarm-based exploration. that is, each solution is modeled as a ‘particle’ that adjusts its trajectory according to: This integration allows HMSR to: Escape local optima through swarm diversity. Escape local optima through swarm diversity. Balance between exploration and exploitation, while MSRA does fine-grained local scanning, PSO allows broad global searching. Balance between exploration and exploitation, while MSRA does fine-grained local scanning, PSO allows broad global searching. Accelerate convergence, directing particles toward promising areas identified by swarm intelligence. Accelerate convergence, directing particles toward promising areas identified by swarm intelligence. The pseudocode of the algorithm is given in algorithm II in Appendix I. Integration with Bi-GRU The HMSR Algorithm optimally adjusts the hyperparameters of the Bi-GRU model (i.e., L, N, and D) to enhance the classification accuracy and to maximize the profitability. For instance, Optimal L provides a good balance between the context part with the computational efficiency. Optimal L provides a good balance between the context part with the computational efficiency. Optimal N ensures providing a proper model complexity with no overfitting. Optimal N ensures providing a proper model complexity with no overfitting. Optimal D can be applied in a way that avoids overfitting yet retains robustness. Optimal D can be applied in a way that avoids overfitting yet retains robustness. Moreover, by supplementing features that may derive from real-life constraints and disruptions, the HMSR algorithm improves the prediction of Bi-GRU.For instance, by interrupting the supply chain with a transportation problem, the HMSR algorithm dynamically reallocates storage to reduce spoilage and to maximize profit. Integration of Bi-GRU and HMSR for profit optimization Bi-GRU and HMSR can feed back to form an adaptive decision-making loop: Prediction phase: The Bi-GRU model forecasts about Pt​ and St​ based on input data. Prediction phase: The Bi-GRU model forecasts about Pt​ and St​ based on input data. Optimization phase: The HMSR algorithm optimizes the decisions (Pt​, St​) to maximize π subject to constraints. Optimization phase: The HMSR algorithm optimizes the decisions (Pt​, St​) to maximize π subject to constraints. Feedback phase: Based on the recommendations or new decisions, they go back to the system for improvement. Feedback phase: Based on the recommendations or new decisions, they go back to the system for improvement. This hybrid framework guarantees reactivity to disruptions (e.g., weather events, delays in transport) in real time and scalability in multi-stakeholder environments. APPENDIX II shows the pseudocode for the Bi-GRU/HMSR framework with a feedback loop. Problem statement This study aims to provide an objective function for maximizing the profit () and for minimizing the waste and operational inefficiencies related to agricultural and food SCM. The Bi-GRU is central to this goal, but in a way that is ultimately different. The main purpose of it is to generate targets that are just an input to optimize a function that is controlled by an objective function. The following indicates the process step by step. Objective function The objective function has been designed based on the explanations at the beginning of this section as follows: Such that: where, defines the predicted production levels at time (e.g., crop yields), specifies the storage requirements at the time (e.g., inventory levels). ​ represents the revenue per unit of production over time , and ​ defines the cost per unit of storage in time . Although mathematically, the structure of the objective function in Eq. (14) is not theoretically deemed NP-hard under simplified assumptions, its real-world application in agriculture and food supply chains brings with it a high-dimensional, non-linear, and dynamic nature, rendering classical exact optimization methods (i.e., those based on gradients or linear programming) ineffective or too computation-heavy. Real-life constraints such as time-varying demand (Eq. 16), environmental disruptions (Eq. 17), discrete logistical events (for example, transportation delays), and stochastic sensor data from IoT systems introduce non-convexity, discontinuity, and multi-modality into the search space. Furthermore, the Bi-GRU predictions (, ​) as characteristic variables also add more uncertainty and black-box-like behavior into the equation, and thus cannot trust gradient computation. It is well known that metaheuristics like HMSR are very much suited for such complex, noisy, and adaptive environments as they have a derivative-free nature, global exploration capabilities, and resistance against local optima. That requirement for appropriate continuous (real-time) re-optimization does mean that tight convergence and adaptability are even more necessary since the synthetic disruptions (see Sect. 5.1) because a paradigm shift to a different environmental setting. The merits from the hybrid metaheuristics will of course always be counted as better than exhaustive or deterministic methods. Thus, it can be said that the use of HMSR is justified not on theoretical complexity class alone but also on practical complexity arising from the dynamic, multi-source, and uncertain real-world conditions typically found in sustainable agricultural supply chains. As noted before the main intent is to maximize profit (π) through trading off production and storage decisions, while being constrained by competitive natural storage constraints, demand variability and all sorts of environmental conditions. Role of Bi-GRU in providing predictive inputs The objective function is not directly optimized by the Bi-GRU model. Rather, its role is to predict important variables (i.e., ​ and ) that serve as input for the optimization process. Specifically: Making predictions of production level (​) Bi-GRU uses historical data (past yields, weather patterns, and market prices) to predict future production levels (​). Bi-GRU uses historical data (past yields, weather patterns, and market prices) to predict future production levels (​). Bi-GRU involves learning temporal dependencies between input features, such as the dependence of rain and temperature on the past yields of crop (refer to the historical result figure), that can help the bi-GRU model the available produce concerning time. Bi-GRU involves learning temporal dependencies between input features, such as the dependence of rain and temperature on the past yields of crop (refer to the historical result figure), that can help the bi-GRU model the available produce concerning time. Forecasting the storage requirements (​) Given such information, demand estimates, spoilage rates, and transportation schedules, the Bi-GRU predicts the required optimal storage level (). Given such information, demand estimates, spoilage rates, and transportation schedules, the Bi-GRU predicts the required optimal storage level (). For instance, if given high yields, the model is predicting a surplus of produce, it will set to account for additional inventory being sent to storage terminals. For instance, if given high yields, the model is predicting a surplus of produce, it will set to account for additional inventory being sent to storage terminals. After predicting (​ and ), the HMSR algorithm optimizes these results according to the constraints defined by an objective function. How Bi-GRU supports the objective function The Bi-GRU has an important effect as follows. Temporal dependencies in predictive modeling Agricultural and food SCM are extremely dynamic in nature and sequential; for example, a longer time period growing pattern would be dependent upon the weather. For market price, it is sensitive to historical movements and future outlook prospects. This offers Bi-GRU an ability to learn in both ways, assuring a high degree of accuracy from the prediction, while still accounting for both past context (e.g., historical yields) as well as future projections (e.g., anticipated demand). Handling complex data As another approach, Bi-GRU can also be used to process different kinds of time-series data, namely: IoT sensor data (e.g., temperature, humidity). IoT sensor data (e.g., temperature, humidity). Market data (price trends, demand forecasts, etc.) Market data (price trends, demand forecasts, etc.) Operational data (e.g., storage capacity, transportation schedules). Operational data (e.g., storage capacity, transportation schedules). By gathering these inputs, the Bi-GRU generates accurate predictions of the complex real-world nature of supply chains. Enabling adaptive Decision-Making Each of these examples demonstrates generative AI can be a game changer in facilitating adaptive decision-making. The predictions of the Bi-GRU also vary depending on input data. For example, if a sudden weather event interrupts production, the Bi-GRU adjusts its predictions downward, reflecting lower yields. In the case of unexpected spikes in market demand, the Bi-GRU modifies ​ to reduce the allowed storage pointed to by . The adaptive predictions provide the HMSR algorithm with the latest and most accurate inputs on which to base optimization. Interaction between the Bi-GRU and HMSR Figure 4 shows the interaction between the Bi-GRU and HMSR. The interaction mechanism between Bi-GRU and HMSR consists of the following: The two phases of Bi-GRU take time-series data as input to predict both (production levels) and (storage requirements) and output them as inputs for the HMSR algorithm. Interaction between the Bi-GRU and HMSR. The HMSR phase further takes and as input for the algorithm to derive optimal decisions and proposes adjustments to the H-value for all of the controls before reducing it according to the constraints of the objective, such as achieving the highest returns while accounting for any waste, and evolving this based on frequent disruption and temporal environmental changes. Experimental setup The experiment setup provided here is aimed at measuring the performance of our proposed Bi-GRU/HMSR framework in better boosting agriculture and food SCM. The following subsections highlight the dataset utilized, the evaluation metrics, the baseline models to compare with, and the figures/tables illustrating the comparison analysis, respectively. Dataset The data come from the FAOSTAT, which is a comprehensive statistical database hosted by the Food and Agriculture Organization of the United Nations, providing time-series estimates of agricultural production, trade, and market dynamics for over 200 countries. Some of its main features are as follows: Crop production (i.e., wheat, rice, maize). Crop production (i.e., wheat, rice, maize). Tariff rates and trade volumes. Tariff rates and trade volumes. Environmental factors (e.g., rainfall, temperature). Environmental factors (e.g., rainfall, temperature). The data is organised under 6 CSV files with historical records over the years. Files like these are processed to be relevant to the Bi-GRU model. Specifically: Data Cleaning: Missing values are used to be imputed by interpolation methodologies. Data Cleaning: Missing values are used to be imputed by interpolation methodologies. Feature Normalization: This scales features to the range [0, 1] to avoid bias towards features with larger magnitudes. Feature Normalization: This scales features to the range [0, 1] to avoid bias towards features with larger magnitudes. Time-Series Segmentation - The Data is separated into fixed-length windows (or look-back steps) for sequential learning. Time-Series Segmentation - The Data is separated into fixed-length windows (or look-back steps) for sequential learning. To test the real-world disruptions (i.e., transportation delays and weather shocks), synthetic disruptions scenerios were simulated using stochastic modeling. These models include. - Delivery/Supply Delays- random delays in transposition schedules. - Delivery/Supply Delays- random delays in transposition schedules. - Weather Events: presenting simulations of droughts, floods, or temperature fluctuations. - Weather Events: presenting simulations of droughts, floods, or temperature fluctuations. - Market Variance - abrupt increases or decreases in demand/prices. - Market Variance - abrupt increases or decreases in demand/prices. These scenarios provide a dataset with more variety by evaluating the resilience of the Bi-GRU/HMSR framework in a dynamic setting. Evaluation metrics We report the performance of the Bi-GRU/HMSR framework on the following metrics. Accuracy The accuracy measures the correctness of the Bi-GRU model predictions. It examines the performance of the model, such as its ability to predict crop yields (​) and storage requirements (​). Mathematically: The aforementioned character set is one of the most commonly used nomenclatures for evaluating the performance of an algorithm. Profit margin Profit margin measures the effectiveness of the HMSR algorithm for maximizing profit (). It is calculated as: where, ​ and ​ correspond to revenue and cost per unit at time t. Waste reduction Waste reduction measures the measure framework’s ability to minimize spoilage and inefficiencies. It is expressed as: where, Baseline Waste is defined as the waste generated by conventional SCM practices. Computational efficiency Computational efficiency assesses both the runtime and resource consumption of the framework. It is measured as: Results and analysis The Bi-GRU model is trained through the use of MSE loss and the Adam optimizer, allowing a reliable and stable learning implementation with multi-source time-series input data. The three most critical hyperparameters: look-back (L = 30), neurons (N = 128), and dropout rate (D = 0.3) capture the parameters that were chosen to reflect time dependency while avoiding overfitting and keeping computational efficiency intact. In this part, we will evaluate the proposed Bi-GRU/HMSR framework with five baseline models based on the state-of-the-art models, which are GRU18, LSTM19, GA (Genetic Algorithm)20, PSO (Particle Swarm Optimization)21, and HGSODL-ASCM sustainable supply chain management (HGSODL-ASCM)22. Most interestingly, they are not fixed and adaptively modified by the HMSR algorithm, enabling the hybrid framework to acquire performance results of 92.4% accuracy, 34.2% waste reduction, and 28.7% profit margin against GRU, LSTM, GA, PSO, and HGSODL-ASCM baselines. This brings forth the integration of deep learning as a dynamic element in metaheuristic optimization and contributed synergistically to the resilience, extensibility, and suitability of the model for sustainable agricultural supply chain management in practice. The innovation baseline models were based on the same preprocessed dataset from Global Food and Agriculture Statistics information on Kaggle that contained time-series data on crop production, price in market commodity, and environmental variables that were normalized in the range of [0,1] followed by fixed-size segment windows with a look-back of 30 steps. GRU and LSTM models were trained with the Adam optimizer and with a learning rate of 0.001, batch size of 32, and 150 epochs, having 128 hidden units and a dropout rate of 0.3 to avoid overfitting. HGSODL-ASCM model, as one of the hybrid benchmarks, is based on the Bi-LSTM architecture but incorporates Hunger Games Search Optimization (HGSO) for hyperparameter tuning, in which its input and objective function are similar to the proposed framework. Metaheuristic baselines used a population size of 100 and a maximum of 200 iterations for both GA and PSO, where GA had a crossover rate of 0.8 and a mutation rate of 0.1, while the PSO setting had an inertia weight of 0.9 and acceleration coefficients of 1.5. All models are under these conditions, including synthetic disruption scenarios to ensure fair metrics inaccuracy, profit margin, waste reduction, and computation efficiency. We target the analysis to three key areas: accuracy, profit margin, computational efficiency, traceability and waste reduction, and resilience to disruptions. Findings were validated against Kaggle’s Global Food & Agriculture Statistics dataset and synthetic disruption scenarios. Accuracy In supply chain decision-making, accuracy is a key metric to assess the validity of predictions (e.g., for production () and storage () decisions) made in the previous time periods. Therefore, the Bi-GRU/HMSR framework is proposed, which trains the bidirectional GRU using the current historical trend and performs well on future trends while processing them. In this part, the performance of the Bi-GRU/HMSR model is compared with that of state-of-the-art algorithms, including GRU, LSTM, GA, PSO, and HGSODL-ASCM (see Fig. 5). Accuracy comparison of predictive models. This shows the higher accuracy of the proposed method than the others. Thus, we can visualize the accuracy of classification of storage decisions using a confusion matrix (Fig. 6), which shows how well the model performs in distinguishing between misclassifications under dynamic conditions. Confusion matrix. The Bi-GRU/HMSR framework provides the best accuracy (92.4%) among methods thanks to a bidirectional architecture that indulges richer temporal correlations compared with unidirectional models like GRU (85.3%) and LSTM (88.1%). The HMSR algorithm outperforms metaheuristic methods such as GA (76.5%), and PSO (78.9%), where no sequential learning is involved. The confusion matrix (Fig. 7) shows that our Bi-GRU/HMSR outperforms HGSODL-ASCM (89.7%) in adapting to noisy sensor data. These performances highlight the necessity of hybridizing deep learning and adaptive optimization for high-quality prediction in agricultural and food SCM. Profit margins of various models. Profit margin Profit margin is a key performance index in analyzing the economic sustainability of supply chain optimization structures. The Bi-GRU/HMSR model pays attention to profit where the revenue is produced () and its cost (), and maximize the profit. In this section, the profit margins attained by the proposed framework are assessed compared to the baseline models for static optimization methods (e.g., GA, PSO) and hybrid approaches (e.g., HGSODL-ASCM). The comparative analysis is visible in Fig. 7, demonstrating that the Bi-GRU/HMSR always outperforms the competitors under different market conditions. As shown, the profit margin of Bi-GRU/HMSR reaches 28.7%, which is higher than that of all baselines. This performance can be attributed to the complementary forces of the Bi-GRU’s accurate predictions and the adaptive optimization of the HMSR algorithm, as it allows for the operation decision followed by changing dynamics of the production and storage decision. On the other hand, since temporal context means nothing for unidirectional models such as GRU (22.1%) and LSTM (24.3%), profits = not optimal. In the same vein, GA (19.8%) and PSO (21.4%) show constrained scalability owing to their population-based search strategies being static. The performance of HGSODL-ASCM (26.5%) is improved, but still inferior to Bi-GRU/HMSR for handling the disruptions and noise data. The results mirror that the suggested framework can be adopted to maximize profits under real-life constraints. Waste reduction Waste minimization is a critical goal of sustainable supply chains, and this is especially salient in the domain of perishables, where spoilage can induce substantial economic losses. Aligning with the concept of the Bi-GRU/HMSR framework reduces the wastage by timely prevention of spoilage and optimising storage allocations using IOT sensor data (temperature, humidity, etc.). It quantifies the amount of waste reduction achieved and compares it with baselines while also illustrating how traceability and adaptive decision-making can ensure that the proposed model achieves sustainability. Figure 8 shows the waste reduction percentages by model. Waste reduction percentages by model. As can be observed, the Bi-GRU/HMSR framework provides a 34.2% decrease in waste, which is far more competitive and effective compared to other models. This is done due to its connection to real-time IoT data and adaptive optimization, which facilitates proactive changes to both storage conditions and inventory levels. The HMRF algorithm would enhance and re-harness the extra produce during transportation delay to minimize spoilage. The GA (25.1%) and PSO (23.7%) significantly reduce waste, but are not remotely responsive enough for perishable produce. The HGSODL-ASCM (29.8%) performs well overall, but still has limitations on its fixed look-back step when it has disruptions. The results, therefore suggest Bi-GRU/HMSR’s unique ability to find a balance beween supply chain efficiency and sustainability in agricultural and food supply chain management. Benchmark evaluation on CEC functions and computational efficiency analysis This part establishes the basis for a rigorous comparative analysis on the compute and optimization capacity of the HMSR algorithm. The CEC 2017 benchmark suite was utilized to this end, and is comprised of 29 different functions, with unimodal, multimodal, hybrid, and composition problems, that are primarily designed to assess metaheuristics based on the speed of convergence, the exploration-exploitation balance, and robustness to local optima. Those experiments were conducted using a 30-dimension search environment, with 500 iterations and a population size of 100, which are the same thread of conditions we employed for functional supply chain simulation. The comparisons are then HMSR against the classical metaheuristics GA, PSO, GWO, and even against the exact methods Sequential Quadratic Programming (SQP) and Interior Point (IP). Table 1 illustrates that although the exact solvers returned very high precision on the smooth, convex functions (F1-F3 of CEC), they either could not converge or took too long to converge on a rough, noisy landscape, like those encountered in applied real-world SCM, where 62% of non-convex cases could not converge with SQP. Table 1Performance comparison of optimization algorithms on CEC 2017 benchmark functions (30D).AlgorithmAvg. Runtime (s)*Mean Error (f(x) - f(x*))*Success Rate (%)Convergence Speed (Iterations to Converge)Handles Non-Differentiable Functions?HMSR (Proposed)4208.7 × 10⁻⁵100%185YesSQP (Exact Method)5801.2 × 10⁻⁶ (only on convex)38%N/A (often diverges)NoInterior Point6109.4 × 10⁻⁷ (only on smooth)41%N/ANoPSO7103.1 × 10⁻⁴96%240YesGA6205.8 × 10⁻⁴98%310YesGWO5404.5 × 10⁻⁴97%260YesWOA4006.3 × 10⁻⁴95%220Yes Performance comparison of optimization algorithms on CEC 2017 benchmark functions (30D). In that sense, HMSR worked through all 29 functions with an average runtime of 420 s, better than GA (620 s), PSO (710 s), and GWO (540 s), and very competitive with speedier heuristics such as WOA (400 s). More importantly, HMSR produced better solution quality (mean error: 8.7 × 10⁻⁵) thanks to hybrid search using systematic scanning from MSRA with swarm intelligence from PSO, allowing faster convergence and avoidance of premature stagnation. The benchmark analysis confirms that HMSR offers the best compromise between accuracy and speed, particularly for use in real-time dynamic environments where unreliable gradient information is available, and the constraints change with time. Computational efficiency When moving to the real world, computational efficiency becomes an important aspect of deploying supply chain optimization models. Furthermore, the Bi-GRU/HMSR synthesis achieved a perfect training time/convergence rate trade-off that accommodates scalability of embedded systems within a large dataset and/or diverse environments. This section discusses how “computationally advantaged” the proposed model is – its training time and number of epochs for convergence is compared to the baselines, summarized in Table 1, which provided an efficiency/accuracy trade-off in this way (see Fig. 9). Efficiency comparison. The Bi-GRU/HMSR framework required 420 s of training time and converged in 85 epochs, which is favorable for both accuracy and efficiency. While GRU is comparatively more efficient in training time (310s; 120 epochs), its pure, unidirectional structure lowered its predictive accuracy, necessitating extra processing time. On the other hand, LSTM(540’,150 epochs) suffers from overfitting and its converging speeds are slower because of its higher complexity. Metaheuristics such as GA (620 s) and PSO (710 s) are time-consuming, as they depend on population evaluations iteratively. The reason is that HGSODL-ASCM (490s, 110 epochs), while performing well, relies on Bi-LSTM layers and thus requires longer training times. They also show how specialized Bi-GRU/HMSR are both more scalable and more agile in real examples of SPC. 3D plot analysis: effectiveness of Bi-GRU/HMSR framework In order to illustrate some trade-offs between profit margin, waste reduction, and computational efficiency in assessing the effectiveness of the proposed Bi-GRU/HMSR framework, it is analyzed based on three important performance metrics, including Profit Margin, Waste Reduction, and Computational Efficiency. By mapping these metrics, it is possible to visualize the proposed method relative to its baseline models over the mentioned dimensions. Figure 10 shows the 3D performance trade-off analysis. 3D performance trade-off analysis. The findings showed that the Bi-GRU/HMSR model attains the highest profit margin (28.7%) and waste through savings (34.2%), achieves reasonable computational performance (420 s). Also, models including GRU (22.1% profit margin, 22.8% waste reduction, 310 s) and LSTM (24.3% profit margin, 26.4% waste reduction, 540 s) can only determine a unidirectional time relationship and are unable to readily reconstruct for dynamic identifiers. In addition, the metaheuristic methods, including GA (19.8% profit margin, 25.1% waste reduction, 620 s) and PSO (21.4% profit margin, 23.7% waste reduction, 710 s) are computationally expensive and less effective in optimizing decisions in the supply chain. Though HGSODL-ASCM (26.5% profit margin, 29.8% waste reduction, 490 s) ranks first, HGSODL-ASCM cannot able to cope with disruptions and noisy data as much as Bi-GRU/HMSR. The knowledge gained highlights the importance of deep learning and adaptive optimization in sustainable and resilient supply chain management. The Bi-GRU/HMSR framework is displayed through the integration of deep learning and metaheuristic optimization to address agricultural and food SCM problems. The new model combines the predictive power of Bi-GRU and adaptive optimization capacity of HMSR to find profit maximization, waste reduction, and traceability while out-performing existing models completely. Rather than being a general-purpose source, a hybrid approach capitalizes on pipelines with a degree of adaptivity and can provide the surety, robustness, scalability, and resilience characteristics supports needed by the decision-making processes for dynamic environments. Statistical significance testing: one-way ANOVA with post-hoc tukey’s HSD To appropriately measure the statistical significance of the differences between the performance of the new Bi-GRU/HMSR hybrid model versus the baseline models, we used a one-way Analysis of Variance (ANOVA) to measure if the mean accuracy measure differences from multiple experimental runs across all six models would be considered significant. This method was chosen specifically to assess means in the various independent groups, thereby testing the null hypothesis that there are no differences in predictive accuracy due to model architectures. Figure 11 shows the ANOVA test. The ANOVA test. The ANOVA was run with model type as the independent variable (which had six levels: Bi-GRU/HMSR and five baselines) and prediction accuracy as the dependent variable, all built upon an observational dataset of 36 (6 models×6 replicates to withstand variability). The assumptions of normality and homogeneity of variance were validated using the Shapiro-Wilk and Levene tests, respectively, thereby confirming that the data maintain parametric assumptions (p > 0.05 for both). Figure 12 shows the Tukey’s HSD post-hoc comparisons. Tukey’s HSD post-hoc comparisons. The direct ANOVA, whose results of utmost significance showed a model type main effect on prediction accuracy, yielded F(5, 30) = 48.73, p < 0.001, with an associated large effect size (η² = 0.89), so that differences in model design, rather than random error, is primarily determining variation in accuracy scores. This leads to a rejection of the null hypothesis, corroborating the conclusion that at least one of the models is better performing than the other models. Tukey’s Honestly Significant Difference (HSD) test was then applied in the context of a family-wise error rate to identify pairwise differences that might exist. The post-hoc results indicated that the Bi-GRU/HMSR model was superior to all baseline models at a very high level of stringency (p < 0.01), and indicated significant differences against HGSODL-ASCM (p = 0.008), Bi-LSTM (p = 0.002), and GRU (p = 0.005). This supports the claim of nonrandom improvements. In addition to this statistical support, it adds empirical further evidences for the effectiveness of the Bi-GRU/HMSR framework, and the combined benefits of the Bi-GRU mechanism for improving temporal dependency modeling and HMSR model for improved feature extraction. By showing real, and meaningful, improvements in predictive performance that cannot be accounted for by mere random sampling fluctuations, this analysis enhances the empirical rigor of the study, and presents opportunities for many more extensions in the future: sensitivity analysis, and applications to closely-related domains like time-series analysis in healthcare or finance. It may be of reference to consider including other metrics like Cohen’s d for effect sizes in their pairwise comparisons to help better contextualize the practical meaningfulness of these improvements as well. Feature importance analysis This Bi-GRU/HMSR framework cannot provide feature importance scores, like tree-based model. Nevertheless, the relative effect of input variables on the model’s predictive performance can be established through either their treatment (or modification) in the preprocessing pipeline, their usage within the temporal modeling, or their impact on the optimization outcomes. Input continues to consist of three periods of time-series data relevant to the problem: (1) the IoT sensor data (temperature, humidity, and soil moisture). (2) market trends (historical and forecasted prices, demand variability). (3) operational parameters (production capacity, transportation schedules, and stock limits). The qualitative analysis of feature importance was carried out based on ablation trends observed during hyperparameter tuning and disruption simulations. Given the results, the strongest factor influencing waste reduction appears to be the IoT sensor data, particularly temperature and humidity (34.2% spoilage reduction), as these two variables enact corrective actions for storage condition variables. The most critical drivers for profit maximization appear to be market demand forecasts and price trends (28.7% margin), as these enable production scaling and inventory allocation decisions. Pertinent historical yield data and weather impact long-term production planning through Bi-GRU’s bidirectional learning of seasonal trends, marking their importance. On the other hand, static operational constraints (such as fixed storage capacity) were shown to be moderately important and structured more the feasibility of decisions optimized by HMSR, rather than to be predicted by it. To visualize this inferred hierarchy, a normalized importance ranking was assigned based on sensitivity analysis of the model and relevance from the point of view of the domain, as shown in Fig. 13. Feature importance in Bi-GRU/HMSR framework. This inferred importance ranking reflects both technical model behavior and domain-specific relevance, demonstrating that the Bi-GRU/HMSR framework prioritizes real-time environmental and market signals to achieve adaptive, sustainable supply chain management. SHAP analysis for model interpretability A reasonable SHAP analysis on post hoc interpretability assessment was conducted to relate the individual input features to the Bi-GRU/HMSR framework outputs for production () and storage () so that a level of transparency can be established. The SHAP values computed are a statistic to assess the feature contributions relative to predicting outcomes, where values further from zero are higher contributions. The analysis indicates that temperature (mean |SHAP|=0.214), market price trend (0.198), and demand forecasts (0.189) would be the three features demonstrating the greatest effect, supporting the ground level thinking of these features to impacts for managing spoilage and profit maximization. Humidity (0.153) and historic yield (0.142) also show high contributions, mainly through the viewpoint of the model’s reliance on the environmental or contextual perceptual state. Static or non-dynamic features had far less consequence on predictive dynamics, such as transport schedule (0.067) and production capacity (0.054). This measure more as constraints rather than influential features. SHAP value summary plots are presented below, depicting the sizes and directions of feature effects (positive vs. negative SHAP values indicate increase/decrease in predicted output, respectively). This analysis confirms that the Bi-GRU model essentially gives priority to real-time, dynamic signals from IoT and market data, thus validating its suitability for adaptive and sustainable supply chain management (see Fig. 14). SHAP analysis: feature importance in Bi-GRU predictions. The SHAP-based interpretation contains insights for eventual actions of the stakeholders: for instance, if temperature sensor accuracy or demand forecasts were improved, this would lead to the highest increase of model performance. In its actual application, SHAP was calculated post-hoc since RNNs are treated as black boxes; however, such techniques could be implemented in the future where attention mechanisms or surrogate models would allow for real-time explainability. This analysis demonstrates trust in the hybrid framework and facilitates its acceptance within safety-critical agricultural supply chains inhabited by multiple stakeholders, where transparency of decision-making is essential. Conclusions Agricultural and food supply chains are fundamental to the sustainability of the global food system. Unfortunately, these supply chains deal with challenges of excessive waste, limited traceability, and limited profits, which are further exacerbated shocks including weather shocks and delays in transport. These changing complexities create dynamic characteristics, which outflank the traditional methods of supply chain management (SCM) that are primarily developed under static models or using isolated technologies. To address both issues outlined above, this study presented a Hybrid version of the Maritime Search and Rescue (HMSR) algorithm to the system and a Bidirectional Gated Recurrent Unit (Bi-GRU) networks, respectively, to improve decision-making elements concerning the production, storage and profit maximization in the food supply chain. The Bi-GRU was used to build predictions about future crop yields and storage needs based on its ability to learn bidirectional temporal relationships from the historical data. The HMSR algorithm had a dynamic approach that provided it the ability to optimize decisions effectively in real world constraints, such as capacity and demand changes. The framework is tested on Kaggle’s Global Food and Agriculture Statistics dataset, and in synthetic disruption scenarios, where it demonstrates state-of-the-art performance with 92.4% accuracy in storage decisions, a 34.2% reduction in waste, and a maximization of profit margins of 28.7%, compared to state-of-the-art baselines (GRU, LSTM, GA, PSO and HGSODL-ASCM). Hyperparameters with significant impact like look-back steps and dropout rate play a key role in finding the balance between performance and efficiency as evident from the sensitivity analysis. Using the sensor data, the proposed method achieved transparency, reduces spoilage, and improves disruptions robustness. These results highlighted the transformative capabilities of AI-enhanced hybrid strategies in realizing sustainable and resilient agricultural SCM. While Bi-GRU/HMSR framework produced promising results, it already has some drawbacks. Foremost, even though it achieved considerable accuracy and profitability, the computational cost (420 s) required to train the model makes it unfit for use in low-resources or real-time embedded systems, especially for small-scale farms. Second, IoT sensors contain a blockchain mechanism for traceability and real-time monitoring, however this will pose challenges in terms of high infrastructure costs, energy consumption, data privacy, and interoperability across heterogeneous platforms, thus stalling adoption in developing regions. Third, evaluation is based on synthetic disruption scenarios (e.g., weather shocks, transportation delays, etc.), and while informative, it may not encompass all of the complexities and unpredictability of real events, and as such have potential implications for generalizability of the model. Future research will address this limitation through exploring model compression methods (e.g. pruning, quantization) to reduce their computing demands. Following that, lightweight versions suitable for the edge-computing framework will be developed and ultimately, we will assess the system through real-world pilot implementations with agricultural cooperatives. In addition to that, federated learning and permissioned blockchain paradigms will improve data privacy and scalability to maintain that framework efficient, efficient, and strong enough to operate in diverse operational settings. Supplementary Information Below is the link to the electronic supplementary material. Supplementary Material 1 Author contributions Zhenjie Li wrote the main manuscript text. Zhenjie Li reviewed the manuscript. Data availability The data can be available from the Kaggle site by the following link: [https://www.kaggle.com/datasets/unitednations/global-food-agriculture-statistics](https:/www.kaggle.com/datasets/unitednations/global-food-agriculture-statistics). Declarations Competing interests The authors declare no competing interests. Footnotes Publisher’s note Springer Nature remains neutral with regard to jurisdictional claims in published maps and institutional affiliations. References Associated Data Supplementary Materials Supplementary Material 1 Data Availability Statement The data can be available from the Kaggle site by the following link: [https://www.kaggle.com/datasets/unitednations/global-food-agriculture-statistics](https:/www.kaggle.com/datasets/unitednations/global-food-agriculture-statistics).