Farming optimization De Villiers, A. Roux, M. M. Sejeso, A. D. - - PowerPoint PPT Presentation

farming optimization
SMART_READER_LITE
LIVE PREVIEW

Farming optimization De Villiers, A. Roux, M. M. Sejeso, A. D. - - PowerPoint PPT Presentation

Farming optimization J. Boshoff, F. Farming optimization De Villiers, A. Roux, M. M. Sejeso, A. D. The price of success and the route to success Maphiri, M. O. Olusanya, E. M. Thulare, T. Mu- tavhatsindi, S. J. Boshoff F. De Villiers


slide-1
SLIDE 1

Farming

  • ptimization
  • J. Boshoff, F.

De Villiers, A. Roux, M. M. Sejeso, A. D. Maphiri, M.

  • O. Olusanya,
  • E. M. Thulare,
  • T. Mu-

tavhatsindi, S.

  • T. Sepuru, B.

Seota, C. Nhangumbe

Farming optimization

The price of success and the route to success

  • J. Boshoff
  • F. De Villiers
  • A. Roux
  • M. M. Sejeso

A.

  • D. Maphiri
  • M. O. Olusanya
  • E. M. Thulare

T. Mutavhatsindi

  • S. T. Sepuru
  • B. Seota
  • C. Nhangumbe

Industrial Representative: Dr Norman Hoeltz Supervisor: Prof. Montaz Ali

1 / 33

slide-2
SLIDE 2

Farming

  • ptimization
  • J. Boshoff, F.

De Villiers, A. Roux, M. M. Sejeso, A. D. Maphiri, M.

  • O. Olusanya,
  • E. M. Thulare,
  • T. Mu-

tavhatsindi, S.

  • T. Sepuru, B.

Seota, C. Nhangumbe

Introduction

Objective Provide smallholder and urban farmers with integrated solution combining the following aspects: Predictive pricing model “Uber” for smallholder and urban agriculture

Figure: Aparate

2 / 33

slide-3
SLIDE 3

Farming

  • ptimization
  • J. Boshoff, F.

De Villiers, A. Roux, M. M. Sejeso, A. D. Maphiri, M.

  • O. Olusanya,
  • E. M. Thulare,
  • T. Mu-

tavhatsindi, S.

  • T. Sepuru, B.

Seota, C. Nhangumbe

Predictive pricing model

Helping farmers to decide: What to grow in the first instance (single produce, mix of produce) When to grow the produce When to harvest and sell their produce

3 / 33

slide-4
SLIDE 4

Farming

  • ptimization
  • J. Boshoff, F.

De Villiers, A. Roux, M. M. Sejeso, A. D. Maphiri, M.

  • O. Olusanya,
  • E. M. Thulare,
  • T. Mu-

tavhatsindi, S.

  • T. Sepuru, B.

Seota, C. Nhangumbe

Pricing data

The following data is given: Historical monthly market prices for each produce over the last years Historical daily market prices for each produce over the last 90 days Growing guides to determine the time from planting to harvest Fruit and vegetable price trends Example of Monthly Market Information Report Vegetables

4 / 33

slide-5
SLIDE 5

Farming

  • ptimization
  • J. Boshoff, F.

De Villiers, A. Roux, M. M. Sejeso, A. D. Maphiri, M.

  • O. Olusanya,
  • E. M. Thulare,
  • T. Mu-

tavhatsindi, S.

  • T. Sepuru, B.

Seota, C. Nhangumbe

Time series plots

Figure: Four different time plots

5 / 33

slide-6
SLIDE 6

Farming

  • ptimization
  • J. Boshoff, F.

De Villiers, A. Roux, M. M. Sejeso, A. D. Maphiri, M.

  • O. Olusanya,
  • E. M. Thulare,
  • T. Mu-

tavhatsindi, S.

  • T. Sepuru, B.

Seota, C. Nhangumbe

Seasonal plots

Figure: Seasonal plots

6 / 33

slide-7
SLIDE 7

Farming

  • ptimization
  • J. Boshoff, F.

De Villiers, A. Roux, M. M. Sejeso, A. D. Maphiri, M.

  • O. Olusanya,
  • E. M. Thulare,
  • T. Mu-

tavhatsindi, S.

  • T. Sepuru, B.

Seota, C. Nhangumbe

ARIMA models

ARIMA models are struggling to model our commodity monthly average prices due to small data set.

7 / 33

slide-8
SLIDE 8

Farming

  • ptimization
  • J. Boshoff, F.

De Villiers, A. Roux, M. M. Sejeso, A. D. Maphiri, M.

  • O. Olusanya,
  • E. M. Thulare,
  • T. Mu-

tavhatsindi, S.

  • T. Sepuru, B.

Seota, C. Nhangumbe

Forecasts

Figure: forecast plots

8 / 33

slide-9
SLIDE 9

Farming

  • ptimization
  • J. Boshoff, F.

De Villiers, A. Roux, M. M. Sejeso, A. D. Maphiri, M.

  • O. Olusanya,
  • E. M. Thulare,
  • T. Mu-

tavhatsindi, S.

  • T. Sepuru, B.

Seota, C. Nhangumbe

Machine learning algorithms

LSTM networks - type of Recurrent Neural Network specially designed to prevent the neural network output for a given input from either decaying or exploding as it cycles through the feedback loops. SVR - uses a kernel function to transform a given data into a higher dimensional feature space to make it possible to perform the linear separation FFNN - an artificial neural network wherein connections between the nodes do not form a cycle. As such, it is different from recurrent neural networks. The FFNN was the first and simplest type of artificial neural network devised.

9 / 33

slide-10
SLIDE 10

Farming

  • ptimization
  • J. Boshoff, F.

De Villiers, A. Roux, M. M. Sejeso, A. D. Maphiri, M.

  • O. Olusanya,
  • E. M. Thulare,
  • T. Mu-

tavhatsindi, S.

  • T. Sepuru, B.

Seota, C. Nhangumbe

Results for cabbages

Table: Evaluation of the models for cabbages.

Algorithm Training RMSE Testing RMSE LSTM 641.384 237.826 SVR 664.997 237.989 FFNN 1199.857 859.124 ARIMA(2,0,1)(2,1,0)12 883.199 LSTM model is the best forecasting model for cabbage monthly average price.

10 / 33

slide-11
SLIDE 11

Farming

  • ptimization
  • J. Boshoff, F.

De Villiers, A. Roux, M. M. Sejeso, A. D. Maphiri, M.

  • O. Olusanya,
  • E. M. Thulare,
  • T. Mu-

tavhatsindi, S.

  • T. Sepuru, B.

Seota, C. Nhangumbe

Results for carrots

Table: Evaluation of the models for carrots.

Algorithm Training RMSE Testing RMSE LSTM 782.992 754.345 SVR 779.796 755.541 FFNN 1500.923 1507.450 ARIMA(1,1,1)(1,1,0)12 944.169 LSTM model is the best forecasting model for carrots monthly average price.

11 / 33

slide-12
SLIDE 12

Farming

  • ptimization
  • J. Boshoff, F.

De Villiers, A. Roux, M. M. Sejeso, A. D. Maphiri, M.

  • O. Olusanya,
  • E. M. Thulare,
  • T. Mu-

tavhatsindi, S.

  • T. Sepuru, B.

Seota, C. Nhangumbe

Results for potatoes

Table: Evaluation of the models for potatoes.

Algorithm Training RMSE Testing RMSE LSTM 455.844 239.743 SVR 456.753 260.213 FFNN 1337.049 1133.372 ARIMA(0,0,1)(2,1,0)12 336.984 LSTM model is the best forecasting model for potatoes monthly average price.

12 / 33

slide-13
SLIDE 13

Farming

  • ptimization
  • J. Boshoff, F.

De Villiers, A. Roux, M. M. Sejeso, A. D. Maphiri, M.

  • O. Olusanya,
  • E. M. Thulare,
  • T. Mu-

tavhatsindi, S.

  • T. Sepuru, B.

Seota, C. Nhangumbe

Results for strawberries

Table: Evaluation of the models for strawberries.

Algorithm Training RMSE Testing RMSE LSTM 16928.991 34146.637 SVR 15764.179 30574.898 FFNN 33110.796 51201.785 ARIMA(2,0,1)(1,0,0)12 16251.967 SVR model is the best forecasting model for strawberries monthly average prices.

13 / 33

slide-14
SLIDE 14

Farming

  • ptimization
  • J. Boshoff, F.

De Villiers, A. Roux, M. M. Sejeso, A. D. Maphiri, M.

  • O. Olusanya,
  • E. M. Thulare,
  • T. Mu-

tavhatsindi, S.

  • T. Sepuru, B.

Seota, C. Nhangumbe

Conclusion and future work

LSTM has better forecasting capability for monthly average price. Include more predictor variables in forecasting monthly average price such as temperature. Hyper parameter tuning Ensemble Methods.

14 / 33

slide-15
SLIDE 15

Farming

  • ptimization
  • J. Boshoff, F.

De Villiers, A. Roux, M. M. Sejeso, A. D. Maphiri, M.

  • O. Olusanya,
  • E. M. Thulare,
  • T. Mu-

tavhatsindi, S.

  • T. Sepuru, B.

Seota, C. Nhangumbe

Route planning

Figure: Farm locations

15 / 33

slide-16
SLIDE 16

Farming

  • ptimization
  • J. Boshoff, F.

De Villiers, A. Roux, M. M. Sejeso, A. D. Maphiri, M.

  • O. Olusanya,
  • E. M. Thulare,
  • T. Mu-

tavhatsindi, S.

  • T. Sepuru, B.

Seota, C. Nhangumbe

The route to success

Objective Develop route planning and optimization model including all farms and depots given Increase economic viability for the transportation company regarding utilization of trucks, drivers and petrol

16 / 33

slide-17
SLIDE 17

Farming

  • ptimization
  • J. Boshoff, F.

De Villiers, A. Roux, M. M. Sejeso, A. D. Maphiri, M.

  • O. Olusanya,
  • E. M. Thulare,
  • T. Mu-

tavhatsindi, S.

  • T. Sepuru, B.

Seota, C. Nhangumbe

Model constraints

Max route length per day: 400km Max time on the road: 8hrs / 480 mins Vehicles must return to the depot in the evening Routes and travel time calculated based on average traffic time according to Google Maps API data

17 / 33

slide-18
SLIDE 18

Farming

  • ptimization
  • J. Boshoff, F.

De Villiers, A. Roux, M. M. Sejeso, A. D. Maphiri, M.

  • O. Olusanya,
  • E. M. Thulare,
  • T. Mu-

tavhatsindi, S.

  • T. Sepuru, B.

Seota, C. Nhangumbe

Model constraints

Carrying capacities and vehicle types:

Standard trucks (Vehicle 1: 1 ton, Vehicle 2: 2 ton) Refrigerated truck (Vehicle 3: 0,5 ton)

Vehicle type must match the produce transportation requirements Include ramp-up/ramp-down time per farm visited: 15 minutes Include time taken to load cargo: 0.05 minutes per kg

18 / 33

slide-19
SLIDE 19

Farming

  • ptimization
  • J. Boshoff, F.

De Villiers, A. Roux, M. M. Sejeso, A. D. Maphiri, M.

  • O. Olusanya,
  • E. M. Thulare,
  • T. Mu-

tavhatsindi, S.

  • T. Sepuru, B.

Seota, C. Nhangumbe

Model constraints

Relax requirement to visit every node exactly once:

allows us to find partial feasible routes when trucks are

  • versubscribed (in terms of distance, time or capacity);

dropping a node from the routes carry a large penalty -

  • ptimizer encouraged to include as many nodes as possible;

penalties may be adjusted per node to prioritize nodes with certain characteristics.

19 / 33

slide-20
SLIDE 20

Farming

  • ptimization
  • J. Boshoff, F.

De Villiers, A. Roux, M. M. Sejeso, A. D. Maphiri, M.

  • O. Olusanya,
  • E. M. Thulare,
  • T. Mu-

tavhatsindi, S.

  • T. Sepuru, B.

Seota, C. Nhangumbe

Mathematical Model

Model the problem as a graph G = (F, E), with vertex set F = {0, 1, . . . , n} with 0 := depot, and E is the set of edges. cij - the distance of traversing the edge (i, j) ∈ E. dim - demand of produce m associated with farm i ∈ F − {0} Qmk - capacity of produce m on vehicle k. We use the following notations for variables: xijk =

  • 1

if vehicle k travels directly from i to j

  • therwise

yimk =

  • 1

if vehicle k pick produce m form farm i

  • therwise

20 / 33

slide-21
SLIDE 21

Farming

  • ptimization
  • J. Boshoff, F.

De Villiers, A. Roux, M. M. Sejeso, A. D. Maphiri, M.

  • O. Olusanya,
  • E. M. Thulare,
  • T. Mu-

tavhatsindi, S.

  • T. Sepuru, B.

Seota, C. Nhangumbe

Mathematical Model

Objective: minimize the total distance travelled by the vehicles min

v

  • k=1

n

  • j=0

n

  • i=0

cijxijk subject to

n

  • j=0

x0jk ≤ 1 ∀k;

n

  • i=0

xi0k ≤ 1 ∀k (1)

n

  • i=0

v

  • k=1

xijk ≥ 1 ∀j (2)

n

  • i=0

xijk =

n

  • i=0

xjik ∀j; ∀k (3)

  • i∈S
  • j∈S

xijk ≤ |S| − 1 ∀k; S ⊆ F − {0} (4)

21 / 33

slide-22
SLIDE 22

Farming

  • ptimization
  • J. Boshoff, F.

De Villiers, A. Roux, M. M. Sejeso, A. D. Maphiri, M.

  • O. Olusanya,
  • E. M. Thulare,
  • T. Mu-

tavhatsindi, S.

  • T. Sepuru, B.

Seota, C. Nhangumbe

Mathematical Model

The following constraints concerns this problem Each produce m, ordered for collection by farm i must be collected by one vehicle

v

  • k=1

yimk = 1 ∀i; ∀m (5) Vehicle k can only collect produce m form farm i if the vehicle visit the farm yimk ≤

n

  • j=0

xijk ∀i; ∀m; ∀k (6)

22 / 33

slide-23
SLIDE 23

Farming

  • ptimization
  • J. Boshoff, F.

De Villiers, A. Roux, M. M. Sejeso, A. D. Maphiri, M.

  • O. Olusanya,
  • E. M. Thulare,
  • T. Mu-

tavhatsindi, S.

  • T. Sepuru, B.

Seota, C. Nhangumbe

Mathematical model

More constraints concerning this problem The capacity of the vehicles must be satisfied

n

  • i=0

dimyimk ≤ Qmk ∀m; ∀k (7) Restriction on the maximum allowed distance for each vehicle

n

  • i=0

n

  • j=0

cijxijk ≤ Cmax ∀k (8)

23 / 33

slide-24
SLIDE 24

Farming

  • ptimization
  • J. Boshoff, F.

De Villiers, A. Roux, M. M. Sejeso, A. D. Maphiri, M.

  • O. Olusanya,
  • E. M. Thulare,
  • T. Mu-

tavhatsindi, S.

  • T. Sepuru, B.

Seota, C. Nhangumbe

Mathematical Model

Modification of the current model Allowed to skip some farms, but put penalty for the skipped farms. The objective function changes to

v

  • k=1

n

  • j=0

 

n

  • j=0

cijxijk +

p

  • m=0

Pidim(1 − yimk)   (9) and constraint (2) is relaxed to

n

  • i=0

v

  • k=1

xijk ≥ 0 ∀j (10)

24 / 33

slide-25
SLIDE 25

Farming

  • ptimization
  • J. Boshoff, F.

De Villiers, A. Roux, M. M. Sejeso, A. D. Maphiri, M.

  • O. Olusanya,
  • E. M. Thulare,
  • T. Mu-

tavhatsindi, S.

  • T. Sepuru, B.

Seota, C. Nhangumbe

Swaps and cluster

Recap:

Figure: Dry produce Figure: Cold produce

25 / 33

slide-26
SLIDE 26

Farming

  • ptimization
  • J. Boshoff, F.

De Villiers, A. Roux, M. M. Sejeso, A. D. Maphiri, M.

  • O. Olusanya,
  • E. M. Thulare,
  • T. Mu-

tavhatsindi, S.

  • T. Sepuru, B.

Seota, C. Nhangumbe

K-opt swaps

Take x[0] to x[i] in that order Take x[i + 1] to x[k] and reverse the order take x[k + 1] to x[len(x)] in that order

26 / 33

slide-27
SLIDE 27

Farming

  • ptimization
  • J. Boshoff, F.

De Villiers, A. Roux, M. M. Sejeso, A. D. Maphiri, M.

  • O. Olusanya,
  • E. M. Thulare,
  • T. Mu-

tavhatsindi, S.

  • T. Sepuru, B.

Seota, C. Nhangumbe

K-mean cluster

Input: K (Number of clusters)

  • ld centres ← k random points

∆ centres ← M > tol while ∆ centres > tol for i = 1, 2, . . . , n Assign cluster membership new centres ← mean of cluster members ∆ centres ← |initial centre − new centre |

  • ld centres ← new centres

Output new centres

27 / 33

slide-28
SLIDE 28

Farming

  • ptimization
  • J. Boshoff, F.

De Villiers, A. Roux, M. M. Sejeso, A. D. Maphiri, M.

  • O. Olusanya,
  • E. M. Thulare,
  • T. Mu-

tavhatsindi, S.

  • T. Sepuru, B.

Seota, C. Nhangumbe

Clustering

Figure: Clustering results

28 / 33

slide-29
SLIDE 29

Farming

  • ptimization
  • J. Boshoff, F.

De Villiers, A. Roux, M. M. Sejeso, A. D. Maphiri, M.

  • O. Olusanya,
  • E. M. Thulare,
  • T. Mu-

tavhatsindi, S.

  • T. Sepuru, B.

Seota, C. Nhangumbe

Combined

Figure: Model results

29 / 33

slide-30
SLIDE 30

Farming

  • ptimization
  • J. Boshoff, F.

De Villiers, A. Roux, M. M. Sejeso, A. D. Maphiri, M.

  • O. Olusanya,
  • E. M. Thulare,
  • T. Mu-

tavhatsindi, S.

  • T. Sepuru, B.

Seota, C. Nhangumbe

Moving

Figure: Improvement moving

30 / 33

slide-31
SLIDE 31

Farming

  • ptimization
  • J. Boshoff, F.

De Villiers, A. Roux, M. M. Sejeso, A. D. Maphiri, M.

  • O. Olusanya,
  • E. M. Thulare,
  • T. Mu-

tavhatsindi, S.

  • T. Sepuru, B.

Seota, C. Nhangumbe

Model Results

Figure: Feasible route with two dropped nodes - maximum time on road reached

31 / 33

slide-32
SLIDE 32

Farming

  • ptimization
  • J. Boshoff, F.

De Villiers, A. Roux, M. M. Sejeso, A. D. Maphiri, M.

  • O. Olusanya,
  • E. M. Thulare,
  • T. Mu-

tavhatsindi, S.

  • T. Sepuru, B.

Seota, C. Nhangumbe

Further work

Route optimization: Pick-up points may be added or removed while truck is en route Time windows when farm staff are available Cost factors like running cost and fuel economy of trucks Trucks at capacity may return to depot and go out again Consider the volume trucks can take and not only the mass Decision support for fleet composition / simulations with different fleet sizes Robust solution methods that hedge against adverse traffic conditions and unexpected vehicle breakdowns

32 / 33

slide-33
SLIDE 33

Farming

  • ptimization
  • J. Boshoff, F.

De Villiers, A. Roux, M. M. Sejeso, A. D. Maphiri, M.

  • O. Olusanya,
  • E. M. Thulare,
  • T. Mu-

tavhatsindi, S.

  • T. Sepuru, B.

Seota, C. Nhangumbe

Thank You

Figure: Stir-fry delivered :)

33 / 33