Pierre Larrenie
email: pierre.larrenie@thalesgroup.com

Cédric Buron
email: cedric.buron@isen-ouest.yncrea.fr

Frédéric Barbaresco
email: frederic.barbaresco@thalesgroup.com

L R Cédric

Buron

Collaborative Multi-Radars Tracking by Distributed Auctions

Keywords: Collaborative combat, Distributed Auctions, Multi-Radar Tracker

In this paper, we present an algorithm which lies in the domain of task allocation for a set of static autonomous radars with rotating antennas. It allows a set of radars to allocate in a fully decentralized way a set of active tracking tasks according to their location, considering that a target can be tracked by several radars, in order to improve accuracy with which the target is tracked. The allocation algorithm proceeds through a collaborative and fully decentralized auction protocol, using a collaborative auction protocol (Consensus Based Bundle Auction algorithm). Our algorithm is based on a double use of our allocation protocol among the radars. The latter begin by allocating targets, then launch a second round of allocation if they have resources left, in order to improve accuracy on targets already tracked. Our algorithm is also able to adapt to dynamism, i.e. to take into account the fact that the targets are moving and that the radar(s) most suitable for Tracking them changes as the mission progresses. To do this, the algorithm is restarted on a regular basis, to ensure that a bid made by a radar can decrease when the target moves away from it. Since our algorithm is based on collaborative auctions, it does not plan the following rounds, assuming that the targets are not predictable enough for this. Our algorithm is however based on radars capable of anticipating the positions of short-term targets, thanks to a Kalman filter. The algorithm will be illustrated based on a multi-radar tracking scenario where the

Presentation of the problem of collaborative multi-radar tracking

It is considered that each radar has a 2-dimensional frame in a polar coordinate system centered on itself. It is estimated that the influence of elevation is negligible, so it is not useful to use a 3-dimensional landmark.

Each target therefore has a position in the radar reference frame determined by its distance, denoted , and its azimuth (polar angle), denoted θ1 . The precision of the measurement made by the radar is noted: σ r in distance and σ θ in azimuth. The resulting measurement uncertainty is represented as an ellipse. The measure itself corresponds to a2 centered 2-dimensional Gaussian random variable of covariance K = R(θ) σ r 0 0 σ θ , where represents the R (θ) angle θ rotation matrix. During active tracking, the aim is therefore to anticipate the next measurement to be performed on the target given the past of the target and its current position thanks to the use of a Kalman filter. As for the measurement, there is also a prediction uncertainty. This is summarized in fig. 1 with the measurement uncertainty in orange and the prediction uncertainty associated with the tracking of the target by the radar in pur-ple.

The signal received by the radar is assumed to be subject to Gaussian white noise. The signal to noise ratio (S/N)3 is assumed to be constant. The value was set at 13, which corresponds to a common value in practice. The S/N will influence the standard deviation of the measurement. The S/N will in fact correspond to the quality of the output desired by the user. For a given S/N it is possible to choose the parameters such as the wavelength to be transmitted or the transmission power, etc.

We first start by formalizing the problem we are dealing with. We are interested in the multi-radar target allocation problem. We first describe the radar model. We then formalize the single-radar allocation problem, i.e. the problem where each target is tracked by at most one radar, and finally the complete multi-radar allocation problem, where each target can be tracked by up to two radars.

First problem: mono-sensor allocation

It may be noted that the model described below corresponds exactly to a variant of a backpack problem. This problem can be formalized as follows:

(P 1) :

                             max i,j c ij • x ij s.t.: i x ij ≤ 1,∀j ∈ J (C1) j γ ij • x ij ≤ L t i ,∀i ∈ I (L)
x ij ∈ {0, 1} ,∀ (i, j) ∈ I × J Sets :

• I : Set of cardinality radars|I| = N u • J : Set of cardinality tasks|J | = N t
Note that we are placed here, in the framework I ≪ J .

The variables :

• c ij : Corresponds to the utility that the radar i provides to the system if it handles the task j. c ij is of the following form, with V (E ij ) the surface of the ellipse E ij described by the Kalman filter matrix P ij of the radar i for the target j:

c ij = f (V (E ij ))
Note that the function f is therefore decreasing according to V (E ij ).

• x ij : Boolean variable, x ij equals 1 if the radar i performs the task j , 0 otherwise.

• γ ij : Cost of the task j for the radar i.

• L ti : Radar budget i.

Constraints :

• Constraint (C1) implies that a task can only be performed by a single radar.

• The constraint (L) models the load of the radar which must not exceed its budget. The γ ij are therefore similar to costs.

Let be a total of |I| + |J | constraints.

3 Second problem: multi-sensor allocation

(P 2) :                                                    max i,j,k c ikj • w ikj s.t.: w ikj = x M ij ∧ x O kj , ∀ (i, k) ∈ I 2 , ∀j ∈ J (A ikj ) i w ij ≤ 1, ∀j∈ J (C2) j γ ij • (x M ij + x O kj -w iij ) ≤ L t i , ∀i ∈ I(L) x M ij , x O kj ∈ {0, 1} 2 , ∀ (i, j) ∈ I × J w ikj ∈ {0, 1} , ∀ (i, k) ∈ I 2 , ∀j∈ J
The variables : • c ikj : Corresponds to the utility that the radar i and the radar k provide to the system if the radar i handles the task j as a main radar and k as an optional radar. c ikj is of the following form, with V (E ij ) (respectively V (E kj )) the surface of the ellipse E ij ( resp . E kj ) described by the matrix P ij (resp. P kj ) of the Kalman filter of the radar i (resp. k) for the target j and V (E ij ∩E kj ) the intersection volume of these two ellipses, as represented on fig. 2:

c ikj = f (V (E ij )) + αg(V (E ij ∩ E kj )) 𝑅 𝜃 𝑅′ 𝐶′ 𝐶
f (V (E ij )) >> αg(V (E ij ∩ E kj )) αg (V (E ij ∩ E kj )) > ε min , ε min ∈ R + * , si E ij ∩ E kj ̸ = ∅
where:

• x M ij : Boolean variable, x M ij equals 1 if the radar i performs the task j as the main radar, 0 otherwise.

• x Oij : Boolean variable, x Oij equals 1 if the radar i performs the task j as an optional radar, 0 otherwise.

• w ikj : Boolean variable, w ikj equals 1 if the radar i performs the task j as main radar and the radar k performs the task j as optional radar, 0 otherwise.

Constraints:

• (A ikj ):Constraints making it possible to interface between the objective function and the other constraints according to the category of the task for the radar. The operator ∧ corresponds to the logical AND operator. The constraint summarized here is equivalent to the two constraints below:

x M ij + x Oij -2w ikj ≤ 1 x M ij + x Oij -2w ikj ≥ 0
It may be interesting to note that if w iij = 1 then, it is considered that the task is only performed by a single main radar.

• (C2) : This constraint corresponds to the constraint (C1) of the first model. It lists all possible combinations of 2 sensors that track a target j. There is at most only one combination of sensors that can be chosen.

• (L) : Just like the constraint (L) of , this constraint models the load of the radar. If the radar is tracking the target as main or optional radar, the term between parentheses equals 1, otherwise it equals 0 and the load for the task is therefore not considered.

Let be a total of

|I| 2 • |J | + |J | + |I| constraints.
Note that the present formulation is difficult to generalize to a coupling of n sensors, because it requires adding n -1 additional indices which would increase the number of constraints and Boolean variables far too much. Moreover, this would make the problem insoluble4 for a classical solver. However, it is estimated that in our case, two sensors are more than enough to have a significant precision on the target.

Adaptation of distributed auctions algorithms for multi-radar tracking

The approach that we present in this article is based on the use of two successive CBBA algorithms: the first to make an allocation as the main radar, the second as an optional radar. In this section, we proceed in two steps. We first present the CBBA algorithm and the adaptations we have made to it so that it can consider the specificities of radars. We then present the general process, which includes the CBBA algorithm, allows to consider the interactions between radars and the dynamism of the mission.

Adaptation of CBBA to radars

The CBBA (Consensus Based Bundle Auction) algorithm [START_REF] Choi | Consensus-based decentralized auctions for robust task allocation[END_REF] is based on the communication between the different radars. The messages that the radars send to each other can be represented as a set of vectors. The set of vectors that a radar sends to another one corresponds to its current knowledge of the system. Using these messages, and therefore the knowledge of the other speed cameras, each speed camera can update its knowledge and transmit it in turn. The transmitted data includes:

• Y , the vector that contains the known winning bid utility for each target. For a radar i , Y = (y ij ) j≤|T |

• Z, the vector that contains the identity of the radar that won the auction for each target. For a radar i , Z = (z ij ) j≤|T | . Thus, by making the link with Y , if we have Z j = i * , then we know that it is the radar i * which made a winning bid of an amount Y j

• S, which corresponds to a "timestamp" vector, it makes it possible to manage conflicts by making it possible to keep the track of the contacts between radars. For a radar i, S i = (s ik ) k≤|A| .

Each component therefore corresponds to the date of the last message received from each radar. It therefore makes it possible to determine which of 2 radars was the last to be in contact with another one and therefore to select the most up-to-date information. This vector is updated when an agent receives a message. The values of the agent's neighbors are updated with the current time, while the values of other agents are updated with the most recent time of the agent's neighbors:

s ik = reception time if k ∈ i. max l∈i. s lk
In our case, for the allocation as main radar, another vector will also be sent. This is the vector E = (e ij ) j≤|T | that groups the ellipses leading to the winning bids for each target. This notably makes it possible to calculate intersections with the latter.

The algorithm is divided into 2 main phases:

• A selection phase: the radar calculates the utility for each of the targets it can process 5 . It then selects targets for which it has utility greater than the winning bid, until it cannot add any more due to overload, until there are no more targets it can deal, or that the proposed bids are too low.

An update phase: the radar will open the messages it has received containing the knowledge of other radars and update its own according to rules defined in the form of a

z ij = n): y ij ← y kj , z ij ← z kj ,e ij ← e kj ,
• reset:

y ij ← 0 , z ij ← , e ij ←
In the static case, when all the radars have the same beliefs, we say that the consensus is established. That is to say that a distributed allocation conflict-free could be found; this therefore constitutes the end of the algorithm.

The CBBA algorithm has a 50% performance guarantee, i.e., in the worst case, the global solution obtained is greater than half of the optimal solution. Certain assumptions are necessary to ensure this convergence, the main one being the Diminishing Marginal Gain (DMG) constraint. We note b i all the tasks allocated to the radar i. The DMG constraint is as follows:

c ij = c ij (b i ) ≥ c ij (b i ⊕ b) ∀b (DMG)
The constraint (DMG) reflects the fact that the utility for the same target must be decreasing in the number of tasks.

In our case, we also want to balance the loads of the radars, i.e., to make sure that a single radar will not take the maximum of tasks while leaving the others unoccupied. To respect this constraint, we added a bias:

c CBBA ij = c ij |b i |

General loop, interaction and dynamism

The algorithm operates in a closed loop, where the algorithm is executed at each time step; in particular, the agent makes an allocation as the main radar, then it makes the allocation as an optional radar if it has remaining budget. Each allocation is made through a CBBA algorithm, and therefore includes the two phases of the algorithm (auction and consensus) explained above. It therefore receives and sends information on its allocation as main and optional radar at each time step. The dynamism aspect, which completes the global loop of the algorithm, is explained below.

The interactive aspect can be understood in the following way: on the one hand, a radar does not take into consideration the targets which it follows as main radar in the list of targets which it can take as secondary radar (that wouldn't matter). On the other hand, the ellipses sent by the radars are taken into account by the other radars (whether they are ellipses sent directly by the neighbors of the radar or transmitted with the winning bids step by step). It is these ellipses which make it possible to perform the utility calculation for the allocation as a secondary radar, and which therefore make it possible to calculate the utility function of the radar for the target. Another aspect of coupling is how the budget is managed. Indeed, when the agent arrives at the stage of allocation as main radar, it considers its budget as all of its remaining budget plus the budget allocated as optional radar. If ever a new allocation as main radar is possible, it deallocates the tasks as optional radar with the lowest utility, and performs a reset as described in the previous section.

To take account of the dynamic aspect of our problem, we only considered that the consensus was never reached. Thus, all auctions concerning a target are not considered closed unless the target in question has not been seen throughout the system for a certain period of time. This delay must take into account the fact that all the radars of the system are not in direct communication. After this delay, the radar deletes the knowledge (which has become useless) that it had on the target and transmits the information. In the case where the target can be perceived again by the system, the latter behaves in the same way as for the appearance of a new target, namely that it creates the knowledge associated with it. After each allocation step (as main radar and optional radar), the latter performs the tasks to which it has allocated itself.

So the general loop (repeated forever) is as follows.

1. The radar makes the selection step as the main radar. To do this, it calculates the uncertainty ellipses for each target, and its utility function; it also applies the Kalman filters of all the targets it is already tracking.

2. If it has remaining radar time budget, the radar proceeds to the selection step as an optional radar on all the targets that are not already tracked as the main radar (with its remaining budget).

3. The radar proceeds to the consensus stage as the primary radar. The vectors Y, Z, E and S as main radars are updated; vectors are sent to neighbors.

4. The radar then proceeds to the consensus stage as an optional radar. Vectors Y, Z and S as optional radars are updated; vectors are sent to neighbors.

5. The radar tracks the targets it has selected, possibly by applying its Kalman filter.

Note that since the radar initiates the tracks at each execution of the two phases of CBBA, which means that the algorithm does not have time to converge. In practice, this can result in conflicts. This is the case for a target on the edge between two radars, and which is increasingly threatening. In this case, each radar making its decision on a previous value of the utility of the others, and its own current value, it will consider that its bid wins the bet. Similarly, a less and less threatening radar (i.e., whose usefulness decreases) will potentially be followed by no one, each radar considering that the other has a better bid than itself. Differentiation from conventional methods

The method we propose calls into question several classic points in target allocation. If there is indeed a method of target allocation by auction, our approach proposes a different method, where the role of the auctioneer is in fact distributed on the radars. The latter therefore hold two roles at once: that of bidder first, and then that of auctioneer. This feature is represented by the two phases of the algorithm: the auction phase and the consensus phase.

Another particularity of our approach is that it allows to allocate a target to several radars, thus making it possible to take advantage of the intersection of the ellipses of uncertainties generated by the different radars, which is not possible in the methods offered in the state of the art. Finally, we propose a classic auction, and not a combinatorial auction. While traditional auctions are generally less efficient than the combinatorial auctions described in the state of the art, they are also much faster, which allows our approach to achieve a relatively rapid allocation, particularly in a context where targets are move quickly.

Algorithm illustration

Our approach makes it possible to solve the task allocation problem in an advantageous way: in the case where the radars remain in contact, even if the communication graph evolves during the mission, this remains possible provided that the graph of connection of the radars remains connected by arc. The total decentralization of the algorithm makes it possible to relax the constraint on the communication graph, which does not require having a radar in direct communication with all the radars, the information propagating in the communication graph. In order to make the allocation in a reasonable time, the calculations of allocation on the targets are done in an additive manner at the level of each radar, which makes it possible to reduce the combination thereof. Finally, by carrying out two sequential auction runs, our algorithm also takes into account the possible overlapping of uncertainty ellipses, and thus makes it possible to generate an allocation favoring more precise tracking of targets when possible, while prioritizing the tracking of as many targets as possible (depending on radar capability).

The main means of realization is the deployment of the CBBA algorithm on radars. To proceed with this deployment, each radar is provided with a part of the implementation of the utility function, which allows it to determine the utility associated with a target, as well as a decision function which allows it: 1. To bid on the targets it has detected during its standby phase, considering its own load limits, 2. To receive messages sent by other radars, 3. To calculate the winner for each target according to Table 1,

Return the updated table.

Radars must also be able to differentiate between first-round allocation messages -one that tracks as many targets as possible -and one that improves accuracy by generating an intersection of uncertainty ellipses. Each radar i proceeds by trying to maximize j x ij •c ij for the main allocation (resp. j,k w ikj •c ikj for the optional allocation), that is to say the sum of the utilities corresponding to the targets that it tracks, while taking into account the information received from the other radars, in particular the bids made by the latter.

An example of the way the algorithm works for allocation of the main radar is represented on fig. 4. The implementation must also include an additional target disambiguation mechanism, making it possible to identify the targets present at several radars, and in particular a plot merging algorithm, making it possible to match the targets of the different radars. This induces the sending of additional information enabling this operation to be carried out, such as the estimated speed and position of the targets.

Results

The implementation of our model has been performed on the MESA framework [START_REF] Kazil | Utilizing python for agent-based mod-eling: the mesa framework[END_REF], along with the Kalman filter package [START_REF] Laaraiedh | Implementation of kalman filter with python language[END_REF], on the same simulator as the one used in [START_REF] Nour | Multi-radar tracking optimization for collaborative combat[END_REF]. The fig. 4 shows the simulator: the radars are represented as blue points while the targets are represented as red triangles. Main radars following a target are represented as green lines, optional ones as purple lines. The uncertainty ellipses are in yellow.

In order to evaluate our work, we compare it to an optimal allocation, performed with the Coin-OR Branch and Cut tool (CBC). Results are represented on fig. 5. The blue (or green) curves correspond to the decentralized (or centralized) approach. The average value of each of the simulations and the different scenarios for a certain "composition" of Targets and Radars are presented. Each of the "compositions" of Targets and Radars is represented on the x-axis as a tuple (Targets, Radars). This allows us to compare the performance of the centralized and decentralized approaches with equivalent configuration. The colors of the bars correspond to the decentralized (D) or centralized (C) values, with optional tracking represented in light colors when relevant. The standard error (in black) is available for each of the bars of the different graphs.

Regarding the utility, as shown in the previous figure, the centralized approach obtains results superior to the decentralized approach. However, it can be seen that here too, for the decentralized approach, we obtain a utility clearly higher than the theoretical 50% of the CBBA algorithm compared to the centralized approach.

Regarding the coverage, we notice that for a constant configuration we obtain equivalent coverage in "main" tracking. The coverage being weaker for the coverage for the "optional" tracking.

Regarding the average load, we observe that for the configurations studied, there is almost no difference between the centralized and decentralized approaches. While we would have liked the decentralized approach should have a much lower load than the centralized approach.

As we can see overall, there are only very small differences between the centralized and decentralized approaches. This can be interpreted as a strength for the decentralized approach, because the radar configuration could then be adaptive (one could suppose that the radars are not fixed but can move) but also resilient, i.e., the global system could continue to function normally if a connection is cut, which is not the case with a centralized approach since there is only one connection with the control center. Since the load is also more evenly distributed, it can be assumed that the centralized approach can cope with a "surprise" attack without a total re-planning, which is not the case for the centralized approach. It should be noted that no experiment has been done with a higher number of radars since the constraint of the cost of purchasing a set of radars can be very limiting. Several works have focused on the use of decentralized approaches for task allocation for sensor, since the seminal work of Lesser et at. [START_REF] Lesser | Distributed sensor networks: A multiagent perspective[END_REF]. Since then, many approaches have been used. Recently, for real time use cases, auction methods have gained much interest in the multi-agent community [START_REF] Gini | Multi-robot allocation of tasks with temporal and ordering constraints[END_REF][START_REF] Michael Krainin | An application of automated negotiation to distributed task allocation[END_REF] for their capacity to perform good allocation in an affordable time. Many methods have been using auctions since then to allocate tasks in real-time, including to robots, sensors and radars (see for instance [START_REF] Deliang | A distributed sensor management algorithm based on auction[END_REF]).

One of the most successful recent algorithms is CBBA [START_REF] Choi | Consensus-based decentralized auctions for robust task allocation[END_REF]. This algorithm allows to perform the allocation in a fully decentralized way, the agents acting both as auctioneers and bidders. This algorithm has since been used several times for sensors [START_REF] Jia | Consensus-based auction algorithm for distributed sensor management in space object tracking[END_REF][START_REF] Sameera | Robust distributed planning strategies for autonomous multi-agent teams[END_REF]. However, none of them has been taking into account the specificities of radars, i.e., their collaboration through the intersection of their uncertainty ellipses. Similarly, the challenge of high dynamicity has been barely studied.

Conclusion

In this paper, we presented a novel approach for allocating target to a team of radars in a totally decentralized way. This approach is based on a fully decentralized auction algorithm, CBBA. We showed that, when taking into account the intersection of uncertainty ellipses, the results of this algorithm is comparable to the centralized optimal allocation. Future works include the design of a more generic approach, that could handle an arbitrary number of radars following the same target. We also would like to make our approach more dynamic, for instance by including replanning approaches that have been recently proposed to improve CBBA [START_REF] Buckman | Partial replanning for[END_REF] and evaluate this approach in the highly dynamic setting imposed by our use-case.

Figure 1 :

 1 Figure 1: Illustration of uncertainty ellipses during active pursuit

Figure 2 :

 2 Figure 2: Reconciliation of uncertainty ellipses for two radars following the same target

  (a) initial allocation (b) sending messages (c) Update (consensus) (d) Bidding & sending messages (e) Second consensus stage, consensus reached

Figure 3 :

 3 Figure 3: Master Allocation Method Workflow for Two Targets and Three Radars

Figure 4 :

 4 Figure 4: Simulation of the algorithm with 3 radars, the area where they are able to pick up targets in active pursuit, and 10 targets. The main track is in green, the secondary track in purple.

  Mean Load of the radars

Figure 5 :

 5 Figure 5: Evolution of tracking metrics over scenarios generated randomly

Table 1 :

 1 table (taken from the article on the CBBA), represented on table 1. If y kj > y ij ands km > s im → update k ifs km > s im → update otherwise → reset m ifs km > s im → update n / ∈ {i, k, m} if s km > s im ands kn > s in → update if s km > s im andy kj > y ij → update if s kn > s in ands im > s km → reset none ifs km > s im → update none CBBA Update Table The actions shown in the table are as follows:

	The	transmitter	The recipient (radar	Action taken by i
	(radar k) thinks the	i) thinks the winner
	winner is:		is:
	k		i	If y kj > y ij → update
			k	update
			m / ∈ {i, k}	If y kj > y ij ands km > s im → update
			none	update
	i		i	leave unchanged
			k	Reset
			m / ∈ {i, k}	if s km > s im reset
			none	leave unchanged
	m / ∈ {i, k}	i
			i	leave unchanged
			k	update
			m / ∈ {i, k}	ifs km > s im → update
			none	leave unchanged

• leave unchanged: Y i and Z i all three remain unchanged

• update (for z kj = m and

A zero angle corresponding to "North"

Corresponding to the Cartesian coordinates of the target in a global coordinate system determined by a control center

The S/N (Signal to Noise Ratio) corresponds to the ratio between the noise power of the useful signal and the power of ambient noise.

Insoluble in a reasonable time. Indeed, the presence of n Boolean variables requires performing an enumeration, ie 2 n of possibilities.

i.e., are located within its range of perception and move sufficiently quickly along the radial axis of the radar

decentralized dynamic task allocation.

In AIAA Scitech 2019 Forum, page 0915, 2019.


Lucas Mohimont
email: lucas.mohimont@univ-reims.fr

Franc ¸ois Alin

Nathalie Gaveau

Angelo Luiz

Steffenel

Lite CNN Models for Real-Time Post-Harvest Grape Disease Detection

Keywords: . classification, segmentation, deep learning, fruit grading, grape disease

Post-harvest fruit grading is a necessary step to avoid disease related loss in quality. In this paper, a hierarchical method is proposed to (1) remove the background and (2) detect images that contains grape diseases(botrytis, oidium, acid rot). Satisfying segmentation performances were obtained by the proposed Lite Unet model with 92.9% IoU score and an average speed of 0.16s/image. A pretrained MobileNet-V2 model obtained 94% F1 score on disease classification. An optimized CNN reached a score of 89% with less than 10 times less parameters. The implementation of both segmentation and classification models on low-powered device would allow for real-time disease detection at the press.

Introduction

The impact of diseases is one of the main problems in agriculture. Diseases are directly responsible for yield and quality loss in many cultivars. The Food and Agriculture Organization of the United Nation estimates that plant diseases and invasive insects are responsible for 20% to 40% worldwide yield loss [START_REF] Secretariat | Scientific review of the impact of climate change on plant pests[END_REF]. Disease detection is therefore an important problem in the field of Smart Agriculture. Recent advances in computer vision allow for in-field symptoms detection of plant disease. The development of new models is made easier with deep convolutional neural networks that can directly process images. Automatic plant disease detection in field conditions is difficult because there are many challenging factors such as background, natural lighting, symptoms variations, plant phenological stage, etc. Post-harvest detection is therefore still applied during a grading process. Fruits and vegetables grading also includes the detection of others defects such as bruises or lack of maturity.

In this paper, our research is focused on post-harvest grape grading before the pressing stage. Winemakers use preventive pesticide spraying to limit disease proliferation. However, infected grapes can still be harvested if needed. For this reason, a grading process is applied before the pressing to sort the grapes into quality categories. This is necessary to limit the quality loss induced by infected grapes in the press. Our goal is the automation of this process with computer vision. Our approach is based on deep learning with semantic segmentation models for automatic grape disease detection. Our two main contributions are the development of an optimized UNet model for automatic grape detection in the existing industrial context and the development of an optimized CNN for disease classification.

The paper is organized as follow: related works are presented in Section 2, the image acquisition protocol, the datasets and the proposed methods are presented in Section 3; then the segmentation and classification results are presented in Section 4, before presenting our conclusions and future works.

Related Works

Automated vine disease detection is a dynamic sub-field of AI research in agriculture because it would allow for large scale detection of diseases on the field or after harvest. This work is mainly performed by human operators, whose detection of grape diseases are often biased [START_REF] Hill | Comparison of methods for the quantification of botrytis bunch rot in white wine grapes[END_REF]. In comparison, computer vision over-performs humans in a single grape leaf disease classification task [START_REF] Cruz | Detection of grapevine yellows symptoms in Vitis vinifera L. with artificial intelligence[END_REF], all while ensuring an unbiased evaluation.

Plant disease detection from RGB images is a difficult task. Many difficulties have been described in details in the work of Barbedo [4]. Building a representative dataset is a complex task because there are many sources of variations (phenological stages, disease severity, weather and lighting conditions, etc.). This also leads to heavily unbalanced classes because the symptoms represent a small part of the images.

A first application is grape disease detection from images of individual leaves. This is a popular example because it is easy to develop. The processing pipeline is always the same: (1) images of diseased grape leaves are collected, (2) background removal can be easily done with thresholding segmentation, (3) symptoms regions candidates are detected and then a classifier is applied on every region after feature extraction. Different diseases and methods are proposed in many research works but the environment and task is almost always the same.

Most notably, deep learning with pre-trained GoogleNet model reached 99.35% accuracy on the PlantVillage dataset that contains 14 crop species and 26 diseases. This includes grape leaves affected by Leaf Blight, Black Rot or Esca disease [START_REF] Mohanty | Using Deep Learning for Image-Based Plant Disease Detection[END_REF]. Deep learning have been recently applied to symptoms quantification with an object detection model based on Faster R-CNN and it reached 81% mean Average-Precision [START_REF] Xie | A Deep-Learning-Based Real-Time Detector for Grape Leaf Diseases Using Improved Convolutional Neural Networks[END_REF].

Practical in-field disease detection is a more difficult task for multiple reasons. The images contain more complex scenes, whole vines instead of a single leaf for example, with natural background and lighting. Multiple deep learning-based models have been proposed recently. Popular object detection architectures, Faster R-CNN [START_REF] Ren | Faster R-CNN: Towards Real-Time Object Detection with Region Proposal Networks[END_REF], R-FCN [START_REF] Dai | Object Detection via Region-Based Fully Convolutional Networks[END_REF] and SSD [START_REF] Liu | SSD: Single Shot Multi-Box Detector[END_REF], were successfully applied on tomato symptoms detection on greenhouse images. A single model reached 83% mean Average Precision on leaf and gray mold, canker, plague, miner, low temperature symptoms, mildew, whitefly pest and nutritional excess [START_REF] Fuentes | A Robust Deep-Learning-Based Detector for Real-Time Tomato Plant Diseases and Pests Recognition[END_REF]. This type of model can be optimized for in-field real time prediction, which would allow for efficient large scale processing.

Data augmentation is systematically used to train deep learning models because they need huge quantity of labeled data. This requires a lot of human time for labeling and computing power for model training. A more classical, feature extraction based, approach does not have this limitation. Such approach was recently applied to in-field downy mildew detection by using color and texture(with the Local Structure Tensor) features with Gaussian mixture modeling and seed-growth correction [START_REF] Abdelghafour | In Field Detection of Downy Mildew Symptoms with Proximal Colour Imaging[END_REF]. A recall rate of 76% with 83% precision rate were obtained on pixel-wise mildew classification from infield images taken with a flash. These performances are calculated on the labeled pixels and does not entirely represent the performances on mildew spot detection. The labeled dataset was published as a benchmark [START_REF] Abdelghafour | An annotated image dataset of downy mildew symptoms on Merlot grape variety[END_REF].

Ideally, winemakers want to avoid putting diseased grapes in the pressing batches. In practice, diseased grapes incidence may be too high and could represent a big proportion of the yield. Therefore, post-harvest disease quantification is necessary for grapes grading: healthy grapes and diseased grapes are separated to keep a good wine quality. There are few published research work about post-harvest grape grading from images. The authors of Vazquez-Fernandez proposed a segmentation algorithm based on Gabor filters and pixel classification from raw pixels neighborhoods for grape batch segmentation (ripen grapes, green grapes, rotten grapes, leaves, etc) [START_REF] Vazquez-Fernandez | A computer vision system for visual grape grading in wine cellars[END_REF]. A classification success rate of 94% was obtained with multi-layer perceptron at the pixel level. The proposed method used artificial lighting with a simple industrial background to avoid confusion. It does not take the low probability of diseased grapes into account during the prediction, this can result in many false positives. Another published work proposed an automatic stem and leaves detection method from hyper-spectral images [START_REF] Portalés | An image-based system to preliminary assess the quality of grape harvest batches on arrival at the winery[END_REF].

Our two contributions are: (1) grape detection at the press without interfering in the current grading process and (2) the detection of grape crates that contain grapes infected by botrytis, oidium and acid rot. This method would ideally be applied directly in the pressing site without specific calibration and without costly changes in the process.

Materials and Methods

The presented work has been carried on three image collection campaigns from 2019 to 2021. This section presents the developed acquisition protocol used in 2019, 2020 and 2021, the collected datasets, the proposed methods and the evaluation metrics.

Image acquisition

An image acquisition protocol was defined in summer 2019 to collect images for supervised learning. This protocol was designed to be applied directly on the existing industrial setting without too much interference. Data collection was performed in Vranken-Pommery Monopole's wine presses during the weighting stage. The existing industrial process is the following: (1) pallet's containing one to four levels of four grape crates are delivered on the press site; (2) each pallet is moved to the weighting site to collect relevant information (weight, variety, parcels); (3) a quality grade is attributed to the whole pallet after a quick visual inspection by an employee (potential alcoholic content is also estimated during this stage); (4) the pallet is then moved to the docks before pressing.

The quality grade depends on multiple factors like the presence of diseases (oïdium, botrytis, mildew), leaves, soil, etc. It is assumed that the visible area on the upper level of the pallet is representative of the whole pallet. The visual inspection is subjective to the human employee who can be biased by fatigue, visual impairment, etc. Automating this inspection is the goal of the project. GoPro Hero Black 7 cameras, with 4000x3000 resolution, were attached over the weighting sites to obtain images of the visible area of the pallets. The camera's WiFi connection is used with a computer to associate the images to the properties of the pallets (quality grade, variety, weight, alcoholic content). The installation was performed by our team and the data collection was performed by Vranken-Pommery's employees.

Data collection campaigns were carried on in two wine press in 2019 and 2020 in Tours-sur-Marne and Merrey-sur-Arce in France. A third site in Saudoy was added to the campaign in 2021. The industrial process was not changed. The two first sites are in semi-open area and can be affected by the sun light and multiple pallets can be visible in the images. Artificial lighting was only used during the 2021 campaign in Tours-sur-Marne. The resulting datasets were cleaned, few images were removed (redundant takes or dark images taken near sun fall). Each visible crate of the weighted pallet is labeled for binary segmentation with LabelMe polygonal mask [START_REF] Wada | Image Polygonal Annotation with Python[END_REF]. Most images contain 4 crates. Therefore, the segmentation allow us to process each crate separately to detect the disease. Each crates were extracted from the images and they were split into two classes: class 0 for the healthy crates(beside sunburn damages) and class 1 for the crates that contain infected grapes (botrytis, oidium, acid rot).

Methods

Segmentation for grape detection

Classical image processing techniques can be used for background removal. In this context, thresholding in the HSV space mixed with Gabor-filter-based segmentation, as proposed by [START_REF] Vazquez-Fernandez | A computer vision system for visual grape grading in wine cellars[END_REF], was developed and tested on the 2019 dataset. This resulted in about 50% rate of accurate segmentation. This was due to variable lighting, variable grape size in pixels and variable color. Development time was therefore shifted to image labeling and deep learning for image segmentation without subjective choices of features and decision rules. Model training and inference were performed on a Nvidia DGX-1 server with a single Tesla V100 GPU for acceleration.

The proposed segmentation model is a lite Unet model. The Unet [START_REF] Ronneberger | U-Net: Convolutional Networks for Biomedical Image Segmentation[END_REF] model is a popular encoder-decoder neural network designed for semantic segmentation. The encoder is used for feature extraction and the decoder is used for dense pixel prediction. Pre-trained Unet models are available, most of them contains too many parameters. In our case, the Unet model was optimized to allow for real time segmentation. A simplified representation of the proposed model is shown in Figure 1 The encoder is defined as a succession of four pooling blocks. Each block contains two convolutional layers, with a skip connection [START_REF] He | Deep Residual Learning for Image Recognition[END_REF], and a 2x2 pooling layer. Batch normalization was applied before Relu activation for the first layer and without activation for the second layer. The encoder is followed by a similar central block without the pooling layer. Then, the decoder contains one up-sampling block for each block of the encoder. It is similar to the down-sampling block with reversed order (up-sampling-convolutionconvolution). There is a skip connection between each pair of down/up-sampling blocks, outputs of both block are concatenated. The segmentation mask is produced by a convolutional layer with a single filter with sigmoid activation.

The size of the model can be changed by increasing/decreasing the number of filters for each layer. In our case, the model should be as small as possible to allow for real-time prediction during the deployment stage. The number of filters is kept small, between 8 and 64, to limit the model size to 173k parameters. Furthermore, the model is directly applied on the whole images. The image size was reduced from 4000x3000 to 800x600 pixels to fit into memory.

The training was performed on images from 2019, 2020 and 2021. Data-sets were split into training/validation sets for each year, each location and for each color. In total, 1643 images were used for training (970 of red grapes and 673 of white grapes) and 714 were used for validation (421 red grapes, 293 white grapes). Jaccard index and Intersection over Union were used respectively as loss function and segmentation metric. Adam optimizer with a learning rate of 0.0001 and batch size of 16 was used for the training. Early stopping with a patience of 30 epochs was used as regularization.

Classification

The next step is disease detection at the crate level after background removal. The images from the three campaign(2019,2020 and 2021) enabled us to create a large dataset with 3300 images of crates in the "Healthy" class and 1600 in the "Disease" class (about 32.6%). Three models were compared after 5-fold cross-validation on 256x256 images. Images were pre-processed with Contrast Limited Adaptive Histogram Equalization(CLAHE) to enhance the contrast [START_REF] Pizer | Adaptive histogram equalization and its variations[END_REF].

The first model is the MobileNet-V2 [START_REF] Sandler | MobileNetV2: Inverted Residuals and Linear Bottlenecks[END_REF] classification model pre-trained on the ImageNet dataset. MobileNet models were designed specifically for mobile applications. They serve as backbone for classification, segmentation and object detection architectures. MobileNet-V2 uses depth-wise separable convolutions to reduce the number of parameters. The pre-trained MobileNet-V2 was automatically downloaded by the Keras Applications API. The last layer of the model was replaced by a dense layer with 2 neurons and softmax activation. Fine-tuning was performed with the Adam optimizer with early stopping and with automatic decrease of the learning rate after few epochs of stagnation. Batches of 32 images for a maximum of 200 epochs were used. Training was performed directly on the unbalanced dataset.

The second model is a custom CNN designed to have a small number of parameters. This CNN uses five down-sampling blocks and two dense layers. Each down-sampling block contains two convolutional layers followed by batch-normalization. The first layer is also followed by a Relu activation. Skip connection and Relu activation is then applied by adding the input and the output of the second layer. Finally, max-pooling is applied to reduce the spatial size of the feature maps. The five blocks uses respectively 8, 16, 32, 64 and 64 filters for each convolutional layers. The block structure is shown in Figure 2. A fully connected layer with 128 neurons was then applied with 50% drop-out probability, the output layer is a dense layer with 2 neurons and softmax activation. The same training configuration was used to train this model. However, full oversampling of the minority class was used to balance the dataset. This model contains only 164k parameters compared to over 2M for MobileNet-V2.

The third model is a baseline classifier based on the classic approach of feature extraction. Six features were computed from the Grey-Level Co-Occurrence(GLCM): dissimilarity, contrast, homogeneity, Angular Second-Moment(ASM), energy and correlation [START_REF] Hall-Beyer | GLCM Texture: A Tutorial v. 3.0[END_REF][START_REF] Haralick | Textural Features for Image Classification[END_REF]. They were computed for each RGB channels. Color features, average value and standard-deviation, were also used. The resulting 24 features were used to trained a SVM classifier with radial-basis function kernel.

Evaluation was performed with the classification metrics: Recall, Precision, F1, area under the ROC curve and area under the Precision-Recall curve.

Results

Segmentation model

The proposed model reached 92.9% IoU on red grapes and 92.6% on white grapes. A segmentation result is shown in Figure 3. Similar performances were observed in every year and every pressing sites. The detailed results for the 2021 model are shown in Table 2. The model was able to detect the grapes in the weighting zone only. In the 2021 validation set, 88 of the 275 images contain visible grapes outside of the weighting zone. However, false positives occurred in only 3 of the 88 images. Multiple errors can be seen in Figure 4: (1) grapes in the background, (2) confusion with the ground and (3) the segmented crates are not completely separated. These kind of errors can be easily removed with morphological operations. Finally, the inference speed of the model was measured

Classification model

Results for the Classification model are shown Table 3. The pre-trained MobileNetV2 reached a F1 score of 92%, compared to 89% for the customized lite CNN. MobileNet-V2 fine-tuning was also tested in 2020 and it was unable to converge. We can also note This gap was even bigger for the GLCM+SVM model with 89% training F1 and 76% validation F1. This is mostly due to the precision rate of 75%. In this case, deep learning was able to surpass the classical method with a difference of +10% in recall, precision and F1 scores. This does not mean that a classical method could not reach the same level of accuracy. But it would imply extensive development for feature extraction, features and models selection. The choice might depend on the hardware available to the researchers. Deep learning for images needs at least one powerful, expensive, GPGPU. Classical methods can be executed without GPGPU (they still need careful optimization) but might need more development time. Classical methods are also easier to interpret because every steps are defined by the developer. In the case of deep learning, neural networks have the reputation to act like black boxes. The weights of a neural network can not be directly interpreted, unlike logistic regression for example. Visualization tools have been proposed for this purpose. Algorithm like t-SNE and Umap [START_REF] Mcinnes | UMAP: Uniform Manifold Approximation and Projection for Dimension Reduction[END_REF] are used to project neural networks activations(or feature maps) into 2-D or 3-D data that can be visualized. The Umap algorithm was applied to our case. We compared the pre-trained MobileNet before and after fine-tuning to show the evolution of the discriminative capacity induced by the training process. The algorithm was applied with 100 neighbors with a minimal correlation distance of 0.9. We can see in Figure 5 that the two classes are not completely separated when using the pre-trained ImageNet features. The separation is more distinct after fine-tuning.

Conclusion and Future Works

The proposed lite models for segmentation and classification reached respectively 0.92% IoU and 0.89% F1 scores with less than 200k parameters. In particular, the lite CNN classification model has 10 times less parameters compared to a pre-trained MobileNet-V2 model with 0.94% F1 score. A compromise between accuracy and inference speed is necessary for a practical implementation of the existing models for real-time usage. A previous segmentation model was already optimized for embedded execution in STM32 boards and Jetson Nano [START_REF] Roesler | Deploying Deep Neural Networks on Edge Devices for Grape Segmentation[END_REF]. Better segmentation speed is expected with the current model. Future works also includes the development of segmentation models for disease detection and quantification. Implementation and evaluation of these models are expected for the next campaign in late summer 2022.

Figure 1 .

 1 Figure 1. Architecture of the proposed lite UNet model.

Figure 2 .

 2 Figure 2. Down-sampling block used in the proposed CNN.

Figure 3 .

 3 Figure 3. Example of UNet inference: left) Original image from Tours-sur-Marne 2021; center) Labeled mask; right) Predicted mask (93.5% IoU)

Figure 4 .

 4 Figure 4. Example of faulty segmentation: left) Original image from Tours-sur-Marne 2021; center) Labeled mask; right) Predicted mask with multiple errors on the 275 validation images from 2021. The average segmentation time was 0.16s per image. The reduced size of the images and the model, with only 137k parameters, will make optimization on low-powered devices easier.

Figure 5 .

 5 Figure 5. Umap applied to the MobileNetV2 models. Points in yellow are positives samples(disease) and points in purple are negatives samples(healthy): left) Pre-trained MobileNetV2 before fine-tuning; center) Mo-bileNetV2 after fine-tuning; right) MobileNetV2 after fine-tuning, validation set only.

Table 1 .

 1 Training and validation performances of the models.

	Model	% Training IoU	% Validation IoU
	UNet-2021 Red Grapes	93.6	92.9
	UNet-2022 White Grapes 93.4	92.6

Table 2 .

 2 Intersection over Union for each subgroup of the final dataset.

	Split	Training Red White Red Validation White
	Merrey 2019	93.2		92.4
	Tour 2019	91.2	91.5	89	90.2
	Merrey 2020	93.3	93	93	90.5
	Tour 2020	94	93.4	93.7	92.6
	Merrey 2021	91.7	92.3	89.6	93
	Tour 2021	93.8	93.8	93.3	93.6
	Saudoy 2021	93.5	93.4	93	92.5

Table 3 .

 3 Classification performances of the three models. Recall AUC with 0.95 for the MobileNetV2 model and 0.94 for the lite CNN. This is important because the lite CNN has only 164k parameters compared to 2.2M parameters for MobileNetV2. The lite CNN could be easily implemented on a low-power device with a smaller classification threshold to allow for real-time prediction directly in the pressing site. We also note that the gap between training and validation scores is bigger for the lite CNN compared to the MobileNet model. This is probably due to duplication oversampling. Training with data augmentation could be necessary to reduce over-fitting.

	Models	Split	Recall Precision	F1	AUC ROC AUC PR
	MobileNetV2	Training Validation 0.94 0.99	0.9 0.9	0.94 0.92	0.99 0.97	0.98 0.95
	Lite CNN	Training Validation 0.93 0.99	0.94 0.86	0.97 0.89	0.99 0.97	0.99 0.94
	GLCM+SVM	Training Validation 0.82 0.91	0.87 0.75	0.89 0.76	0.94 0.92	0.92 0.83
	that both model obtained similar Precision-

Acknowledgements

This work has been performed in the project AI4DI: Artificial Intelligence for Digitizing Industry, under grant agreement No 826060. The project is co-funded by grants from Germany, Austria, Finland, France, Norway, Latvia, Belgium, Italy, Switzerland, and the Czech Republic and -Electronic Component Systems for European Leadership Joint Undertaking (ECSEL JU).

We want to thank Vranken-Pommery Monopole, our partner in the AI4DI project, for allowing image collection in their sites. We also thank the ROMEO Computing Center 2 of Université de Reims Champagne-Ardenne, whose Nvidia DGX-1 server allowed us to accelerate the training steps and compare several model approaches.


Lilian Hollard

Angelica Durigon

Luiz Angelo Steffenel

Machine Learning Forecast of Soybean Yields on South Brazil

Keywords: Machine Learning, Regression, Random Forest, Soybean, Yield forecast

This article investigates the problem of agricultural yield prediction, including that of soybeans. Soya is a very nutritious legume and one of the species producing the most protein per hectare. It is used in particular as a source of protein in animal feed and as an oilseed. However, agricultural systems are dependent on climatic variability, and farmers must deal with this factor to optimize their activities. This article describes a method for predicting soybean yields based on machine learning. The comparative study shows that one can obtain forecasts with less than 2% margin of error using the Random Forest algorithm. In addition, the results obtained in this study can be extended to many other crops such as maize or rice.

Introduction

In the field of artificial intelligence for agriculture, several applications of Data Mining and Machine Learning can be used to help farmers, bringing information about crop estimations and weather conditions. Indeed, [START_REF] Singh | Classification and Clustering in Yield Prediction based on Soil Properties[END_REF] have implemented the K-Means algorithm to predict pollution in the atmosphere, while the K Nearest Neighbor method is applied [START_REF] Amonkar | A k-nearest neighbor space-time simulator with applications to largescale wind and solar power modeling[END_REF] to simulate daily precipitation as well as other meteorological variables. Crop prediction is also a popular subject [START_REF] Chemchem | Combining SMOTE Sampling and Machine Learning for Forecasting Wheat Yields in France[END_REF], and several machine learning algorithms have been studied to support crop yield prediction research [START_REF] Van Klompenburg | Crop yield prediction using machine learning: A systematic literature review[END_REF].

This work is oriented toward the prediction of agricultural yields, focusing on soybean. Soybean is a very nutritious legume that counts among the species producing the most protein per hectare. Therefore, it is used today as a source of protein for animal feeding, which drives massive exports from producing countries to meet an increasing demand worldwide.

With the world population increasing from one billion at the beginning of the 20th century to more than seven billion today, food needs have not stopped rising. A considerable increase in world production is thus necessary in the context of climate change. Agricultural systems are thus dependent on climate variability, and farmers must deal with this factor to make their activities as profitable as possible. In order to forecast the production of a given year, we rely on historical data and machine learning models to identify patterns and tendencies according to relevant features. Our algorithms and machine learning methods are all based on a combination of historical yield records and weather data. We will then focus on soybean as a model for our research, using relevant data from two producing regions in the South of Brazil.

This paper is organized as follows. Section 2 presents some definitions and introduces the datasets used in this work. Section 3 describes the data preparation steps, while Section 4 presents the machine learning models retained for this work. In Section 5, we present the first results for the case of soybean in the county of Santa Maria, while Section 6 demonstrates the generalization of the model to other crops and areas, proving the interest of the approach. Finally, Section 7 presents our conclusions on this preliminary work and discusses the future works.

Definitions and Datasets

Soybean is a species of legume widely grown for its edible bean. Plant sowing takes place from late spring to early summer, and soybeans must have warm soil to germinate and grow. Indeed, to reach maturity, soybeans must accumulate 1400°C in the ground; from this point, farmers usually add a week to get the harvest date. Soil temperature is, therefore, the main feature for the forecast, but other data such as pluviometry and temperature ranges can help to obtain a precise forecast [START_REF] Van Klompenburg | Crop yield prediction using machine learning: A systematic literature review[END_REF].

Helping producers estimate their harvest becomes a key advantage in today's agriculture: from harvest and storage planning to the price of products and commodities, all the logistic and economic chain depends on these values.

Our prediction analysis of soybean yield depends on two datasets. The first one includes crop statistics from 1974 to 2019 for the county of Santa Maria, RS, Brazil (53.7°S, 29.8°W, 150m from the sea level), providing information such as the average yield in kg/ha and the cultivated surface. An excerpt of this dataset is presented in Figure 1. This dataset provides, therefore, a base of explained variables.

The second dataset concerns meteorological and solar-related parameters from NASA's POWER project 2 , which provides a list of explanatory variables. We speak of explanatory variables when the variable explains the explained variable. In other words, our weather data must explain soybean production. Daily values covering the entire period from sow to harvest are used in the model, accounting for climatic variations and weather conditions over the years. Figure 2 shows an example of the dataset, whose variables are the following: Please note that weather information can be improved with on-site sensors. Indeed, several initiatives such as [START_REF] Coppola | Innovative Vineyards Environmental Monitoring System Using Deep Edge AI[END_REF] aim at deploying sensors to characterize better both weather and soil conditions, which can lead at term to more precise models.

• LAT -Latitude • LON -Longitude • YEAR -Year (format YYYY) • DOY -

Data Preparation

Before applying different machine learning algorithms, we had to prepare the dataset. The first decision was on the covered period. While the production dataset covers crops since 1974, the POWER dataset only has data since 1984. For this reason, training and test subsets were selected only in the period from 1984 to 2018. Similarly, the validation subset comprises harvest and climate data from the 2019 season.

Data Correlation

Hence, we applied a correlation matrix to assess the dependence between several variables at the same time, as seen in Figure 3. The result then contains a correlation coefficient calculated by different methods of correlation tests: Pearson, Kendall, and Spearman correlation. This method makes it possible to establish a link between several random variables, which contradicts their independence. The interest in our case is to select Thanks to this research, we observed that the year variable has a significant weight on the decision-making of our algorithms. Indeed, agricultural production has evolved since the 1980s due to the evolution of agricultural techniques and genetic improvement of the plants. However, as this impact is not directly related to the year itself, we propose using an inflation rate coefficient as presented in Equation 1.

In f lation rate = current year production previous year production

The results being more interesting on the three algorithms with this coefficient, we decided to keep it. In addition, this coefficient follows a logic over time, which allows us to determine a coefficient for an unknown year using the average of the 5 or 10 previous years.

Scaling

Some algorithms are also sensitive to the variations in the scale of values between each characteristic. Indeed, several linear regression algorithms regularize the linear regression by imposing a penalty on the size of the coefficients. Thus, the coefficients are narrowed towards zero and each other. If the independent variables do not have the same scale, the shrinkage does not behave well. On the contrary, algorithms based on decision trees are less sensitive to data scaling and do not require scaling.

Using scikit-learn [START_REF] Pedregosa | Scikit-learn: Machine Learning in Python[END_REF], we opted for the scaling technique called the Standard Scaler. This technique recalculates each feature so that the data is centered around 0 and scaled to obtain a variance of 1.

Metrics

Finally, to determine the robustness of the models, we compare their R 2 and RMSE scores. In statistics, Pearson's coefficient of determination denoted denoted R 2 is a measure of the quality of the prediction of linear regression. This coefficient, between 0 and 1, increases with the adequacy of the regression to the model: The other relevant indicator is the RMSE. This index provides information with respect to the dispersion or variability of the quality of the prediction. However, RMSE values are often difficult to interpret since we may not be able to tell if a variance value is low or high. This indicator can vary a lot, depending on the context:

• If the
• An RMSE of 10 is relatively low if the average of the observations is 500.

• On the contrary, a model will have a high variance if it leads to an RMSE of 10 while the average of the observations is 15.

Indeed, in the first case, the variance of the model corresponds to only 5% of the average of the observations, whereas the variance reaches more than 65% in the second case.

Machine Learning Models

This section compares different machine learning algorithms, looking for an accurate forecast model. Indeed, this is a regression problem as we must determine the soybean production in kg/ha as precisely as possible.

In order to determine the different algorithms to use in our work, we observed the characteristics of the dataset. Indeed, most machine learning algorithms used in crop yield estimation [START_REF] Sun | County-level soybean yield prediction using deep CNN-LSTM model[END_REF][START_REF] Terliksiz | Use of deep neural networks for crop yield prediction: A case study of soybean yield in lauderdale county, alabama, usa[END_REF][START_REF] Van Klompenburg | Crop yield prediction using machine learning: A systematic literature review[END_REF] require large amounts of data to perform well but, in our case, we require algorithms that support less than 100,000 data entries. Two groups of algorithms stand out: linear regression and random forest regression. For the same reason, we decided against more complex algorithms such as Neural Networks.

Linear Regression

Linear Regression is a family of statistic methods that aim to create a linear model with coefficients w = (w 1 , . . . , w n ) by minimizing the residual sum of squares between the observed targets in the dataset and the targets predicted by the linear approximation. Linear regression methods require a minimum of entries, making them good candidates here.

Among the Linear Regression methods, we selected Elastic Net and Ridge Regressor. The first one can react with little data input among the entire dataset, while the second one is known as having good performances with a complete dataset [START_REF] Buitinck | API design for machine learning software: experiences from the scikit-learn project[END_REF]. These two regularized regression methods will distort the space of solutions to prevent the appearance of too high values. This involves modifying the cost function of the linear regression problem by supplementing it with a penalty term [START_REF] Geron | Hands-on machine learning with Scikit-Learn and TensorFlow : concepts, tools, and techniques to build intelligent systems[END_REF].

Random Forests

The Random Forests is an algorithm proposed by Leo Breiman in 2001 [START_REF] Breiman | Random Forests[END_REF]. This algorithm is based on a collective decision over an ensemble of decision trees. Random Forests are quick to train and produce results that are generalizable and intuitive to understand.

As stated above, the operation of the Random Forest trains a set of independent decision trees. Each tree has a fragmented vision of the problem (features and/or data entries) and, in the end, all these independent decision trees are grouped.

Indeed, for each independent tree, the training algorithm will look among all the possible decisions and choose the one that seems the best to serve as the root (first decision). The algorithm then adds branches to the tree using the Gini score. The Gini score is a value between 0 and 1, indicating how likely the tree is to make a decision error. Each time it is necessary to add a branch, this score will be calculated to assess the relevance of the decision that the algorithm wishes to add. Finally, the decision that allows the tree to guess or calculate the result most correctly is selected and grafted to the tree.

While there is no guarantee that a single tree is optimal, Random Forests explores different alternatives by varying the subsets of features and data entries for each tree and makes its decisions by voting on all the decision trees that compose it. As a result of this ensemble approach, a more robust model arises.

Fitting Harvest Production

During the training phase, we seek to improve scores through Hyperparameter Optimization research. This step involves choosing a set of optimal hyperparameters for a learning algorithm. Indeed, machine learning algorithms propose parameters whose value is used to control the learning process, called hyperparameters. As a result, Table 1 presents the results obtained with the models identified in Section 4.

When applied to 2019 data, these models deliver yield forecasts that are compatible with the R 2 and RMSE from Table 1. Indeed, the predictions listed in Table 2 show a clear advantage for the Random Forest model, which was able to forecast the average soybean production in 2019 with a 20kg error/ha (0.6% error margin).

Generalization to other Crops and Locations

To conclude our study, we expanded the scenarios to assess the robustness of the Random Forest model. Hence, we looked for other crops in Santa Maria as well as crops in the county of Campos Novos (27°24'06"S,51°13'30"W, 946m elevation), located 450km away from Santa Maria. This choice was driven by the climatic differences between these towns and the variable impact of weather conditions on different crops. Table 3 summarizes these tests. It demonstrates that the choice of meteorological features and a Random Forest model allow for a robust forecast with limited error margins. Indeed, we obtain less than 2% error, a value that can still be improved with further optimizations and more data.

Conclusion and Future Works

This paper presents a preliminary study on how machine learning techniques can help cereal growers to forecast their future crops. In this first work, we concentrated on identifying which features contribute most to the accuracy of the models and how different machine learning models perform.

The results suggest a clear advantage of Random Forests models over more traditional linear regression models, the latter being more sensitive to data scaling and variations in the dataset.

In addition, we applied the Random Forest model to other crops and locations, obtaining excellent results when predicting the average productivity in kg/ha. In all the studied scenarios, we obtained less than 2% of error margins, proving the interest of the approach.

The present model is being integrated into a web bulletin board application that provides updated estimations as the season advances, in accordance with new weather information. We believe, however, that fine-grain models can be obtained by combining a county-level model with farmers' own data, including their historical production, soil details, weather data from IoT sensors deployed on the fields [START_REF] Coppola | Innovative Vineyards Environmental Monitoring System Using Deep Edge AI[END_REF] as well as some other crop specificities (plant variety, sowing date, organic agriculture...).

Figure 1 .

 1 Figure 1. Crop Statistics for Santa Maria, RS, Brazil

Figure 2 .

 2 Figure 2. POWER dataset for Santa Maria, RS, Brazil

  Day of the year (1 to 365) • PRECTOT -Total precipitation (mm) • WS2M -Wind speed at 2 Meters (m/s) • T2MDEW -Dew temperature at 2 Meters (Celsius) • RH2M Relative Humidity at 2 Meters (%) • T2M MAX -Maximum temperature of the day at 2 Meters (Celsius) • T2M MIN -Minimum temperature of the day at 2 Meters (Celsius) • T2M ) Temperature at 2 Meters (Celsius) • ALLSKY TOA SW DWN -Top-of-atmosphere Insolation (MJ/m 2 /day) • ALLSKY SFC SW DWN -All-Sky Insolation Incident on a Horizontal Surface (MJ/m 2 /day) • TS Soil temperature (Celsius)

Figure 3 .

 3 Figure 3. Correlation Matrix on POWER variables

  R 2 is close to zero, then the regression line sticks to almost none of the points.• If the R 2 of a model is 0.50, then the points can explain half of the variation observed in the calculated model. • If the R 2 is 1, then the regression determines 100% of the distribution points.

Table 1 .

 1 Test scores for different ML Models

	Model	R 2	% RMSE
	ElasticNet	0.62	450
	Ridge	0.62	400
	Random Forest 0.9	300

Table 2 .

 2 Soybean yield forecast for 2019 in Santa Maria

	Model	Prediction	Real production performance
	ElasticNet	2104kg/ha	3300 kg/ha
	Ridge	2234 kg/ha 3300 kg/ha
	Random Forest 3280 kg/ha 3300 kg/ha

Table 3 .

 3 Random Forest yield forecast for different crops

	Location	Crop	Real production Error margin
	Santa Maria	Soybean	3300 kg/ha	20 kg/ha (0.6%)
		Rice	7060 kg/ha	39.77 kg/ha (0.56%)
	Campos Novos Soybean	4080 kg/ha	66.6 kg/ha (1.63%)
		Maize	11400 kg/ha	200 kg/ha (1.75%)

Corresponding Author. E-mail: angelo.steffenel@univ-reims.fr

https://power.larc.nasa.gov/data-access-viewer/


The initial version of this paper was given the 02/12/2021 at Specfic 2021, Karlstad University, Sweden in the "Perspectives on Fantasy" panel chaired by Stefan Ekman. See also "Queering Fantasy Temporality" by Anna Bark Persson (Södertörn University).

Taking the Red and Black Pill: Anarchy as a Cure to Modern Ails By Dean-Liathine McDonald When Johnny Rotten contorted himself around a spittle-covered microphone to vociferously scream the chorus of the infamous song Anarchy in the U.K., i little did he know just how far his influence would stretch. It is safe to say he probably didn't imagine a wave of punk elves shaving off their long, Lothlorien-inspired locks to instead sport stiff multi-coloured mohawks. Yet, the movement that he had such a hand in rendering popular would influence and spread throughout anglophone culture and beyond bringing rebellion, revolt, repudiation and more or less vague notions of revolution to many a domain-not least of which, the arts. An interesting chain of events would bring Punk to 1980s adolescence, and magic to their fictional cities represented in the, then, burgeoning genre of early Urban Fantasy (UF). Fundamental to both Punk and UF are the ideas espoused by a particularly nebulous ideology, that of Anarchy. In order to best present these ideas to you, I'll first touch on some background information. I'll start by explaining what I mean by early UF, then speaking about the Anglophone world at the time it rose to popularity. Then, I'll present the punk ideals of UF, before finally looking at Anarchy, the politics at the movement's centre, and how UF writers filtered these ideas down to find a more balanced synthesis between both culture and counter-culture, or to put it another way: the cure at the core. Some of you may be wondering what UF is. A perfectly valid question considering that not only is the genre defined by its genre-hybridity and fluid nature, as McLennon (2014) points out, ii as well as its constant subversion of norms and tropes (see Langford's addendum), but also for the longest time, studies on UF were hampered by appellative confusion. Early on, for example, Brian [START_REF] Attebery | Strategies of Fantasy[END_REF] in his Strategies of Fantasy would justly refer to the genre as "indigenous fantasy", iii Farah Mendlesohn would later use "non-horror intrusion fantasy" or "modern intrusion fantasy", iv others still would use terms such as "supernatural detective fiction", "template dark fantasy" (Kaveney 2011), v "paranormal romance", and the list goes on. As does time, and with it the popularity of the genre grew.

Steadily gaining in both scope and readership, fans would adopt the term 'urban fantasy' followed, after 2010, by a number of scholars. The term, however, would be used as a taxonomically-diffuse marketing device that subsumed and added to Clute's (1997) original definition. vi Once centred on city and edifice, UF now existed on the speculative borders between genres as in this image (see fig. 1). Prompting Langford to add the following addendum to Clute's definition in the online version of The Encyclopedia of Fantasy: "2. The above is a rare instance in which this encyclopedia's terminology has been superseded by common usage. As a publishing category which has risen to enormous popularity in the twenty-first century, Urban Fantasy has come to denote the subgenre of stories set in an alternate version of our modern world where humans (often with special Talents) and supernatural beings -most typically Vampires, Werewolves, assorted other Shapeshifters, and very humanlike Elves or Fairies -interact via adventure, melodrama, intrigue and Sex. A closely related, indeed overlapping, publishing classification is Paranormal Romance. [DRL]" For those of you who would like to delve further into the subject, allow me to suggest Leigh [START_REF] Mclennon | Defining Urban Fantasy and Paranormal Romance: Crossing Boundaries of Genre, Media, Self and Other in New Supernatural Worlds[END_REF] genre history and spectrum definition of UF and Paranormal Romance and, of course, Stefan Ekman's (2016) indispensable aggregate study: 'Urban Fantasy: a Literature of the Unseen'. vii For the purposes of this paper, let us say that UF more or less involves an urban setting, typically in a version of our own world, though there are secondary-world UF such as Miéville's (2000) Perdido Street Station, viii with one main addition: magic exists.

In the 1980s, the city was anything but magical. The political pendulum had swung back to the right under Thatcher and Reagan. The previous decades of what [START_REF] Jones | The Limits of Liberty: American History 1607-1992[END_REF] describes as the latrociny of the left had led to a rise in right-wing groups. He describes this shift as a reaction to cultural changes and laws surrounding sexual conduct, the status of women and family, religious belief, and the treatment of criminals. ix As voters turned to the right, however, the economic regimes of Thatcherism and Reagonomics rubbed many the wrong way and, more specifically, fuelled an already rebellious group, adolescents, to even louder heights. The ubiquitous fear of the Cold War and nuclear attack, coupled with high levels of unemployment and a rampant sense of boredom seeded the idea that there was no future for these displaced youth (see Worley 2017). And so, rebellion ensued.

Punk, a baby born of both nations, aesthetically American and politically British, was its medium. It was largely a misunderstood movement, from without and from within., due to media representations of gut rebellion and violence mixed with the multiplicity of meaning coming from members of the movement itself, both politically and in relation to its cultural position. In fact, Punk was a three-fold movement, equal parts youth trend, gut rebellion, and a voice of opposition (O'Hara 1999, 41), leading Dines (2016, 9) to describe it as a subculture built primarily upon "subversion and political malcontent". x Nevertheless, whatever form Punk took, it is best known for its music.

Exploding onto the world stage in the mid-seventies, by the 1980s Punk was everywhere. At the beginning of that decade, the youth centres and music clubs that facilitated the Punk scene were synonymous with the city. It comes as no surprise then, that the early UF writers would bring magic through music to the metropole. Charles de Lint had been involved in the Canadian music scene since he ran away from home at 15 and even held a number of jobs at record stores when he first started writing [START_REF] Windling | La Insumision Voluntaria: El Anarquismo Individualista Espanol Durante La Dictadura y La Segunda Republica (1923-1938)[END_REF]), xi Emma Bull had been involved in three groups, including Cats Laughing (even winning mentions in various early UF stories), and she is known to perform at conventions to this day. Terri Windling brought these writers together in her 1986 shared-world anthology Borderland and Bordertown. In her blog, she writes (2014): xii "These writers were asserting that one needn't travel to imaginary lands, the medieval past, or even to the countryside to find a magical (dare I say "spiritual'?) connection to place: it was available to all…yes, even at the heart of the beast: the big, noisy, crowded, diverse, dangerous, exciting modern city. (And remember that these writers began working in the '80s, when urban decline rendered many cities far less appealing than they are today.)" This push for a connection, a place within the city, meant taking into consideration both the good and the bad within both the mainstream and its subcultures, searching for an ideal between them. One such alternative was Anarchy.

Anarchy seems to reign beneath the surface of both Punk and early UF. But, what is it? The idea itself is hard to pin down. Looking in the Collins dictionary, Anarchy is defined as: xiii n. 1 general lawlessness and disorder, esp when thought to result from an absence or failure of government.

2. the absence or lack of government.

3. the absence of any guiding or uniting principle; disorder; chaos. 4.the theory or practice of political anarchism [C16: from Medieval Latin anarchia, from Greek anarkhia, from anarkhos without a ruler, from AN-+ arkh-leader, from arkhein to rule] This host of heterogeneity demonstrates the scope of potential interpretations and risk of possible confusion. A description of political anarchy is notably absent here, the definition is insufficiently summarised as a doctrine advocating the abolition of government. Even here, Anarchy as a political system remains liquid in form around a nucleus of decentralisation. Understandable, considering that the central tenet of Anarchy is a system limiting both hierarchy and the concentration of power. The individual interpretation made possible by this idea would help birth a host of systems from anarcho-syndicalism, to anarcho-punk, and even anarquismo sin adjetivos (anarchism-without-adjectives) to name but a few. xiv Of course, not all of these models are present in the aforementioned texts. Specifically, three forms of Anarchy are visible in early UF: The ancient Anarchies of acephalous groups are represented in Charles de Lint's (1984) Moonheart, xv where the Quin'on'a people demonstrate equality in group decision-making by forming drum circles that provide the group's homologous harmony; the rebellious anarchic uprisings associated with the late 19 th century mix with a dose of 20 th century Punk in Emma Bull's (1987) War for the Oaks when protagonist, Eddi McCandry, tears open a space in the current binary, fay system through a magical battle for the soul of the city, and a call to arms that literally transforms the citydwellers into a sonic sword to win the day, a metaphoric rendering of the spontaneous revolution of the masses acting upon a collective, instinctual desire for freedom; xvi finally, Anarchy runs free in many forms, including the Anarcho-syndicalist farming, reminiscent of civil-war era Spain, and Anarchy as societal breakdown, in Terri Windling's shared-world anthologies Borderland Bordertown (1986), and Life on the Border (1991), etc. xvii Nevertheless, representation is not advocacy. Indeed, the above texts appear ambivalent towards political Anarchy, either showing it as ill-adapted to modern society (de Lint), arguably insufficient as an instigator of change (Bull), or dangerous and dystopic (Windling). There is a sense of critique against the cultural mainstream that has ousted the artist, but also of the resulting counter-culture. At their heart, these texts leave the reader with the impression that society as a whole is not functioning as it should be, all while highlighting the benefits of community. In the anarchist staple Mutual Aid (1902), Kropotkin posited that human society is constructed not on socialist Darwinism, xviii but on reciprocity-an idea espoused by both Guérin (1970) andTaylor (1982). xix Although Taylor goes one step further, his thesis effectively demonstrating that the ideal of reciprocity at the heart of Anarchy can only function in small communities, as only these can avoid the problem of free riders or those who partake sans contribution to a public good. Of course, these small communities and the modern city seem antinomic, the anarchic structure a pipe-dream. In order to bring them together symbolically, the early UF writers brought magic and the mythical creatures of the past into their metropoleis.

Here, the setting may be modern, yet these UF writers romanticised the medieval. Of course, this is arguably the case within the Fantasy genre in general. Maund (1997), for example, describes 'History in Fantasy' thusly:

"Fantasy as a genre is almost inextricably bound up with history and ideas of history, reflected and reworked more or less thoroughly according to the needs, ambitions and intentions of individual authors. Its roots can be found… in the backward-looking romanticism of the preraphealites; and in academic Classical and medieval scholarship… predominantly associated with medieval history… Many fantasy authors borrow historical events and ideologies, and transform them to provide the basis of a new world… quasi-medieval (often highly inaccurate)… never free from romanticism and idealism…"

The mythic creatures in early UF may have adapted in some way to the modern setting, but their very presence evokes the medieval. Elves (or their less-Eurocentric homologues the Manitou), the Fay folk (Seelie or Unseelie), and magic-wielding bards allude to, perhaps even personify, the past. What's more, as Bull's Faerie Nobleman and supernatural guitarist, Willy, attests, even those who manage to fit in to modern society do not fully adapt. Although not entirely adherent to the archaic organisation of his original group, he injects the modern-day setting with an element of the old-world artistry that charms the protagonist. With this in mind, the use of mythic creatures that allow for a romanticised borrowing of anachronistic, anarchic ideologies becomes natural when placed in the city setting.

The medieval city was anarchic-and artistic. At least, it was according to Kropotkin (1902). Despite Anarchy failing to maintain a viable system of government in recent times, he claims that the ideals fought for and briefly exemplified by both civil-war era Spain and 19 th century Ukraine, had already flourished in the walled and independent medieval city (108). Just as the Elves and Faerie-Folk of Fantasy are often associated with masterful endeavours in art and craftwork, so too was the medieval city. Relying on self-jurisdiction, no two cities were identical, each a "result of struggle between various forces which adjusted and re-adjusted themselves in conformity with their relative energies, the chances of their conflicts, and the support they found in their surroundings" (105). On top of this, the creative forces of both function and aesthetics came together in these guilds, as each object was made not only to serve the community but also to demonstrate the artisan's skill. Those tight-knit guild workers worked within, what Kropotkin describes as, a "conception of brotherhood and unity fostered by the city," it was this that engendered such feats of skill in art, architecture (116), and other crafts. These communes of master craftsmen exemplify Taylor's (1982) anarchic structure of small communities, which he believes is the only functioning form of Anarchy, made possibly because members share the group identity, caring for each other and the community as friends, or what he calls "secular family communes" (164).

Anarchy, Anarcho-Punk, and UF, share a common goal. Whether it be the anarchosyndicalists of the past, the noisy, pogoing, mohawk-sporting Punks of Britain and America searching for meaning in a world that seemed to have forgotten them, or the mythic beings of a medieval long, long ago: building a better society that fulfils the needs of its members was key. While Punk's relationship to Anarchy may have been, at times, ambivalent, the desire to be useful, to transform the build-up of boredom and tension into positive action and creative endeavour can be seen throughout the era. Early UF drew their readers through a magic mirror into a fictional world that was a reflection of our own. They pulled inspiration from this extremely politicized period of recent history and Punk's reaction to it, stripping the latter of its negative elements by highlighting the dangers of violence and nihilism, and filtered it down to its core message: the magic of family and community and authentic creativity. In these stories, the reader finds the nostalgia for the past that is so common in the fantasy genre mixed with the now ineluctable urban environment of the city. Yet, this resulting alchemy is not to be despaired. Instead, Bull, de Lint, and Windling use it to highlight, what the latter (2014) refers to as the "metaphorical search for wonder and natural (rather than supernatural) magic in city settings;" the sense of connection with the land and those with whom it is shared that can be found when one looks for it, even in the city. xx In other words, UF stories sought to convince those that felt displaced that a sense of place was possible, that it is normal to feel lost in the city crowd because humans flourish through community and the mutual aid that Kropotkin (1902) believes was key to our evolution (161). xxi The magical creatures that erupt from the middle-ages into modernity, bring with them the veneration of artisan creation that animated the medieval city and the love of nature that animates them in turn. Their mere presence denounces the destructive nature of unbridled capitalism and consumer culture and calls for a return to a past form of society. The writers of early UF forced the reader to look simultaneously at the past and contemporary society, creating a magical amalgamation of the positive elements found in both, an enchanting representation of something that never was, as if this nebulous genre was dipping into the roots of our collective past seeking ancient cures for modern ails.

Figure 1 :

 1 Figure 1 : Urban Fantasy on the border

  Lint, Charles de. Moonheart. Orb 1994. New York: Ace, 1984. xvi Bull, Emma. War for the Oaks. Orb 2001. New York: Ace, 1987. xvii Windling, Terri, ed. Life on the Border. New York: Tor, 1991. Windling, Terri, and Mark Alan Arnold, eds. Borderland. New York: Signet, 1986. ---, eds. Bordertown. New York: Tor, 1986. xviii Kropotkin, Peter. Mutual Aid: A Factor in Evolution. New York: McClure, Philips and Company, 1902. xix Guérin, Daniel. Anarchism: From Theory to Practice. Translated by Mary Klopper. New York: Monthly Review Press, 1970. Taylor, Michael. Community, Anarchy & Liberty. Cambridge: Cambridge University Press, 1982. xx Op. Cit.

xv xxi Op. Cit.