Jihong Zhu

Benjamin Navarro

Robin Passama

Philippe Fraisse

André Crosnier

Andrea Cherubini

Robotic manipulation planning for shaping deformable linear objects with environmental contacts

Keywords: Dexterous Manipulation, Contact Modeling, Manipulation Planning

published or not. The documents may come

I. INTRODUCTION

Humans are able to manipulate objects with high dexterity. For decades, we have been trying to give robots similar capabilities. Robotic manipulation has been studied intensively with the focus on rigid objects. However, humans encounter all kinds of deformable objects and manipulate them on a regular basis. Therefore, to fully embed robots with humanlike manipulation skills, we should pay considerable attention to deformable objects manipulation. The fields of application include areas like surgical operation, agriculture, food making, household services and industrial automation.

One of the biggest challenges in deformable objects manipulation is the infinite degree of freedoms in the object deformation versus finite inputs from robot manipulators/hands. Often, when dealing with deformable objects, humans not only apply both hands, but also use contacts in the environment to regulate the object shape. For instance, when folding a towel, we place it on a flat surface to constrain its deformation due to gravity.

Deformable objects with linear shapes such as cables, wires, etc., are often referred to as deformable linear objects (DLOs) in the literature. Yet, for simplicity, we will denote them as cables in this paper. In cable harness, cables need to follow a designated path defined by a set of contacts (see Fig. 1). Our objective is to establish a robotic manipulation framework that automates the cable routing process. We simplify this problem by considering circular contacts on the board. The robot plans its motion according to the contacts placement, detects the occurrence of a contact, modifies its manipulation behaviour accordingly and finally achieves a desired configuration of the cable.

A. Related work

We outline works that have been done in robotic cable manipulation in three sub-categories: cable modelling, manipulation planning and shape control.

The model of a cable can be either geometrical or topological. The geometrical model usually requires optimizing the system total energy. Wakamatsu et al. developed a cable model considering bend, twist and extensional deformation [START_REF] Wakamatsu | Modeling of linear objects considering bend, twist, and extensional deformations[END_REF]. Later, this model was explored for grasping and manipulation planning in [START_REF] Wakamatsu | Static modeling of linear object deformation based on differential geometry[END_REF]. Yoshida et al. simulated the deformation of an elastic band using the finite element method [START_REF] Yoshida | Simulation-based optimal motion planning for deformable object[END_REF]. Topological models are another option. One of the first models was developed in [START_REF] Hopcroft | A case study of flexible object manipulation[END_REF], to solve the knotting problem. The topological model is often based on knot theory [START_REF] Murasugi | Knot theory and its applications[END_REF], and the problem to solve is usually tying [START_REF] Wang | Knot-tying with visual and force feedback for vr laparoscopic training[END_REF] or untying knots [START_REF] Wakamatsu | Knotting/unknotting manipulation of deformable linear objects[END_REF].

In manipulation planning, contact with the environment is often considered as undesired -and thus to be avoided. A collision free path planner was developed in [START_REF] Lamiraux | Planning paths for elastic objects under manipulation constraints[END_REF] using a randomized algorithm. A planner in [START_REF] Moll | Path planning for deformable linear objects[END_REF] computed a path in the shape space from one minimal energy curve to another while satisfying environmental constraints. Bretl and McCarthy showed that the shape space of an elastic rod is a six-dimensional smooth manifold [START_REF] Bretl | Quasi-static manipulation of a kirchhoff elastic rod based on a geometric analysis of equilibrium configurations[END_REF]. Later, the authors of [START_REF] Borum | The free configuration space of a kirchhoff elastic rod is path-connected[END_REF] took a step forward and proved the path-connectedness of this space.

In shape control, we distinguish model-based and modelfree methods. Nakagaki et al. used a deformation model for insertion tasks [START_REF] Nakagaki | Study of deformation and insertion tasks of a flexible wire[END_REF]. Navarro-Alarcon et al. developed a modelfree Fourier-based shape servoing strategy [START_REF] Navarro-Alarcon | Fourier-based shape servoing: A new feedback method to actively deform soft objects into desired 2-D image contours[END_REF]. We extended that work to the shape servoing of cables in [START_REF] Zhu | Dualarm robotic manipulation of flexible cables[END_REF].

Few papers have investigated cable manipulation with contacts in the environment. In a pioneer work [START_REF] Henrich | Manipulating deformable linear objects-contact states and point contacts[END_REF], the authors presented the specification of contact states for linear objects with polyhedral obstacles, and identified unstable/stable contact states. Acker and Henrich further proposed visual features for the detection of contact state transitions in cable manipulation [START_REF] Acker | Manipulating deformable linear objects: characteristic features for vision-based detection of contact state transitions[END_REF]. In a more recent research [START_REF] Roussel | Robot Manipulation: What has been achieved and what remains to be done?[END_REF], the authors planned cable manipulation strategies with a simulator in both free and contact space. Some works in deformable object manipulation exploited contact for manipulation: plastic material shaping [START_REF] Cherubini | Towards vision-based manipulation of plastic materials[END_REF] and towel folding [START_REF] Maitin-Shepard | Cloth grasp point detection based on multiple-view geometric cues with application to robotic towel folding[END_REF] where some or all manipulation tasks were done with contact compensating the gravity. Yet, these papers do not study the specific use of contact.

B. Our contribution

To the best of authors' knowledge, contact-based cable routing relying on robotic manipulation is still an open research problem. Yet, it is widely present in the industry (e.g., in cable harness). We address this practical problem by a mathematical analysis on the contact mobility. We propose an index to quantify the mobility. This index motivates our choice of motion primitives. A motion planning framework using the primitives is designed for the robot to shape a cable by contacts. The performance of the framework is analyzed using the proposed contact mobility index.

C. Paper organization and notation

The paper is organized as follow. Sec. II states the contactbased cable manipulation problem and presents an overview of the framework. Sec. III defines the angular contact mobility index. Then we analyze two cable motions and their effect on the index. Sec. IV proposes motion primitives for the robot. Sec. V presents the planner which uses the motion primitives for planning robot motions. Sec. VII explains the setup and shows experiment results 1 . In the last section, we conclude and propose some future research directions.

We employ the following mathematical notation throughout the paper. Vectors are denoted with small bold letters, e.g. v, w. Matrices are with capital bold letters e.g. A, B. The vector difference is denoted by -→, e.g. -→ vw = wv. The Euclidean norm of a vector is given by || • ||, e.g. ||v||, || -→ vw||.

II. PROBLEM STATEMENT AND FRAMEWORK OVERVIEW A. Problem statement

The overall problem is depicted in Fig. 2. We consider contacts as small circles on the 2D plane. For a cable with sufficient length, given a starting end of the cable, with a list of ordered small 2 circular contacts placed on the plane, the cable should be manipulated such that it follows the path defined by the contacts' position and sequence. The order of the contacts 1 The video of the experiments can be found at: https://youtu.be/7CdNQ4R wT0 2 The radius of the contact is much smaller than the length of the cable.

is known a priori by the robot. The cable must be shaped by each contact sequentially and in the end reach the target position.

Initial cable configuration

Fig. 2. A contact-based manipulation example to illustrate the problem. The order of the contacts is given by the number besides each contact. This information is provided a priori to the robot.

The cable should touch all contacts in the given order, without creating any loop. We do not consider friction in this work, and neglect the cable's deformation along the tangential direction.

B. Framework overview

We utilize a dual arm robot for the cable manipulation task. The robot is equipped with two end-effectors M and F. We place F at a fixed pose to hold the starting end of the cable. M holds the other end of the cable and is free to move on the 2D manipulation plane. An in-hand camera is mounted on M to provide visual feedback.

The framework consists of a planner and a vision-based contact detector. The planner plans the motion for M given contacts and a target location. The detector identifies the occurrence of a contact.

III. ANGULAR CONTACT MOBILITY INDEX

One way of analyzing the contact is by its mobility index, which measures the free motion of the object in contact [START_REF] Rimon | Mobility of bodies in contact. II. how forces are generated by curvature effects[END_REF]. In this section, we introduce a novel contact mobility index based on the angular range of motion. We term it Angular Contact Mobility Index (ACMI). The robot manipulates the cable on a plane. The cable is soft and can adapt to the curvature of the contact object. In Fig. 3 we show an example. We construct a local Cartesian coordinate frame Oxy at the center of the object. We consider the motion of the cable relative to the contact. The direction of motion is a unit vector v(φ) = [cos φ sin φ] T with φ (0 ≤ φ < 2π) the angle between the vector and x axis. For any point ρ on the contact curve, the direction of the contact force is denoted n(ρ). Definition 1. Angular Contact Mobility Index (ACMI): the angle (in radians) that represents the range of directions the object can move to break free from the contact.

In Fig. 4, we consider -in four cases -the directions of motion of the contact object (red circle) with regards to the cable. The direction v is parameterized by φ. We derive the ACMI for these cases and finally provide a general expression of the ACMI.

When there is no contact (Fig. 4a), the break free (from contact) directions are given by the following set:

R = φ ∈ [0 , 2π) . (1)
Since the object can move in all directions, the ACMI equals 2π.

For a single contact point ρ (Fig. 4b), the set of break free directions is defined by:

R(ρ) = φ ∈ [0 , 2π) : n(ρ) • v(φ) > 0 .
(

) 2
This defines an open set of directions with only positive components in the direction of n. The angular range in the R(ρ) is π. The ACMI equals π.

For the curved contact in Fig. 4c, the set of break free directions is expressed by:

R = ρ2 ρ=ρ1 R(ρ). (3)
Noting ψ the contact curve angular range, if ψ ∈ (0, π], then the ACMI is π -ψ. Instead, if ψ ∈ (π, 2π] (see Fig. 4d), the ACMI equals 0. No matter which direction the object moves, it cannot break free from the contact. To sum up, we provide a quantitative definition of the ACMI:

(a) No contact Point contact (c) 0 < ψ ≤ π (d) π < ψ ≤ 2π
ACMI =        2π, No contact, π, Point contact, max(0, π -ψ) Curved contact. (4)
Using the ACMI, we quantify the free motion range due to the contact. The higher the index, the larger the range of motion sufficient to break free from contact (i.e., it is easier to lose contact).

Below we analyze two motions of the cable and their effects. The first motion is termed rotation. Starting from an initial contact point (ρ 2 ) scenario depicted in Fig. 5, the ACMI is π. Consider the left segment of the cable fixed, and perform an anti-clockwise rotation with center at the contact for the right segment: we expect the contact point to become a curve. Then the length of the curve grows due to this movement, so the ACMI decreases. The reverse motion will make the contact curve shrink, and the ACMI increase. The second motion is termed sliding. In case of contact point (Fig. 6a), sliding corresponds to:

Contact initial final

R(ρ) = φ ∈ [0 , 2π) : n(ρ) • v(φ) = 0 . ( 5
)
For a curved contact with two end points (Fig. 6b), we denote two edges of the curve as ρ 1 and ρ 2 with n 1 and n 2 being the directions of the associated contact force. Sliding corresponds to the direction within:

R 1 R 2 , (6)
with

R 1 = φ ∈ [0 , 2π) : n 1 • v(φ) = 0 , R 2 = φ ∈ [0 , 2π) : n 2 • v(φ) = 0 .
In both figures we show an example of contact after sliding in a specific direction. The sliding motion maintains the contact curve (point) and the ACMI stays unchanged.

Sliding direction

After sliding Before sliding (a) Point contact case

Before sliding

After sliding (b) Curved contact case Fig. 6. The effect of sliding on the ACMI.

In the next sections, we will relate robotic cable manipulation with these two motions. Using the ACMI, we show in Sec. VII-C that with the proposed framework, the robot constructs and utilizes contacts for shaping the cable to reach a desired configuration.

IV. MOTION PRIMITIVES

In Fig. 7, we define the manipulation plane coordinate frame Fxy with origin at the position of the fixed end-effector F, and we attach a local coordinate frame Mxy to the end-effector M. The pose of M in Fxy is then q

M = [x M y M θ M ] T ∈ R 3
, with θ M the counterclockwise orientation of Mxy with regard to Fxy.

The fixed end-effector F is designed such that it can either hold or release one end of the cable. The moving end-effector M always holds the other end of the cable. When F is holding, the length of the cable between the two end effectors is fixed. Then M rotates the cable (Fig. 7a) with a fixed point on the cable as the rotation center. When F releases, it allows M to pull the cable so that the length of the cable between the two end-effectors increases (Fig. 7b).

We define two motion primitives for the dual arm robot to accomplish the task:

• rotate: F hold + M rotate.

• pull: F release + M pull.

V. PLANNER

In this section, we introduce planners for the robot motion. For each contact, the robot executes the pull motion primitive to reach an initial pose for making contact and then the rotate motion primitive to construct and use the contact. Since the cable length is much larger than the contact radius, the radius is assumed neglectable in the section.

The flow chart describing the overall motion generated by the planner for n ordered contacts is shown in Fig. 8.

A. Initial pose planner

The initial pose planner plans a discrete target pose q M around each contact. We denoted the planned pose as q * = [p * T θ * ] T , with p * = [x p * y p * ] T as position and θ * as orientation.

Let us consider a general case in Fig. 9. We set the fixed point on the cable at f = [x f y f ] T , the current contact at c = [x c y c ] T , the next contact at r = [x r y r ] T . The fixed point is either at origin of Fxy or the previous contact location which regulates the cable. We use pull to reach each target planned pose. After having reached the planned pose we rotate with the center at f to construct a contact, so the cable length is fixed. Thus, we have our first condition on p * :

p * ∈ R 2 || --→ f p * || > || -→ f c|| . (7)
Otherwise, the cable cannot reach the contact by rotation. We separate the plane into two half planes, by a line connecting the fixed point f and the contact c. We denote the half plane with the next contact as P and the other one as P . To reach the next contact, we need:

p * ∈ P . (8)
We envision M to be near the contact, because if it is far, more effort is needed to bring the cable in contact. To this end, we impose a third condition:

p * ∈ R 2 || --→ cp * || = d , (9)
where || -→ cr|| > d > 0. In practical implementations, d should be set considering the end-effector size (if too small, the endeffector may collide with the contact), and the camera field of view (large d may jeopardize contact visibility).

By combining ( 7) -( 9), we obtain a feasible set for p * :

p * ∈ R 2 P ∩ || --→ f p * || > || -→ f c|| ∩ || --→ cp * || = d , (10)
which is illustrated in Fig. 9 (purple arc).

The local coordinate frame Mxy should have its positive x direction towards f (the center of rotation). Thus, the target orientation θ * can be calculated as θ * = arctan(y ∆ /x ∆ ), with ∆ = fp * .

Extending the method to multi-contact cases is straightforward. For each contact, the fixed point f is at the previous contact (or at the origin of Fxy for the first contact). For the last contact, the next contact r is at the target position. We calculate the planned pose for each contact in the given order. Figure 10 shows a planning example.

Once the planned pose is reached, we go to the pre-contact phase.

B. Real-time local planner

In the pre-contact phase, the local planner generates motions to reach the contact. This planner is termed real-time because it continuously receives contact detection information from a vision-based contact detector. When a contact occurs, the robot moves to the post-contact phase and the planner changes its behaviour.

1) Pre-contact phase: In this phase, we rotate the cable to construct a contact. F will hold the cable so that the cable length is fixed. We denote a set of planned rotational positions as:

P = p 1 p 2 • • • , (11)
where

p i = [x i p y i p ] T ∈ R 2
is the i th planned position on the manipulation plane. The rotational direction can be either clockwise or anti-clockwise. In Fig. 11, with initial position of M at p * , we define the two vectors l 1 = p * -f ∈ R 2 and l 2 = cf ∈ R 2 . We construct a matrix L = [l 1 , l 2 ] ∈ R 2×2 . The direction is calculated by s = sgn(det |L|) with positive clockwise and negative anti-clockwise. The radius for the rotation is r = ||p * -f ||. We set the rotational step to be δθ. For each p i we set orientation θ i = θ * + iδθs. The position vector p i = [x i p y i p ] T is then

p i = f + r cos θ i -sin θ i ∈ R 2 . ( 12
)
The full pose vector for M is [p i T θ i ] T . A planning example is shown on Fig. 11. M continues to rotate until contact occurs.

2) Contact detection: Since the contact is not on the robot but on the cable, contact forces cannot be directly measured on the robot. In addition, the contact force can be very small, which makes it hard to detect. Therefore, we use vision for the detection. We present the contact detector in Sec. VI.

3) Post-contact phase: Once a contact is made, the robot uses the contact to shape the cable, until a good configuration is obtained for reaching the next planned initial pose (or to reach the target). When a contact occurs, the robot has to adapt its manipulation behaviour. Let us denote the position of M at the time of contact by p . In the post-contact phase, contact c = [x c y c ] T becomes the new fixed point, thus the new center for rotation is c, and the new rotation radius is r = ||p -c||. We re-plan the robot motion with the new center c and radius r in the same manner as in the pre-contact phase, and keep the rotational direction. The example overall motion is shown in Fig. 11. As discussed in Sec. III, this post-contact rotation enlarges the contact curve, so the ACMI decreases. This way, the robot utilizes the contact for shaping the cable, and the contact is strengthened by the motion.

From the initial planner we get the position of the next planned pose t. End effector M continues to rotate until it lies on the line connecting c and t. Then, the robot pulls the cable towards t. As depicted in Fig. 12, since we consider the radius of the circular contact neglectable (r l), then:

-→ ce = -→ cρ + -→ ρe ≈ -→ ρe. ( 13
)
The direction of the pull is the same as the sliding one, which we analyzed in Sec. III. Since the ACMI stays unchanged during the pull, the cable maintains contact.

VI. CONTACT DETECTOR

We detect the contact by extracting three features on the inhand camera image, respectively: the locations of two ends of the cable segment and the contact. The detector is active only when a contact is in the image. To ease extraction, we use a white manipulation plane, a black cable and blue contacts. OpenCV [START_REF] Bradski | The OpenCV Library[END_REF] is used for image processing. Below is the procedure to extract these features:

• The blue contact is found via HSV (Hue, Saturation, Value) thresholding. • The image is binarized using uniform thresholding. Then, the Canny edge detector outputs the contour(s) of the cable in the image. • Since the relative translation between the cable end held by M and the camera is fixed, that cable end is selected as the bottom point on the contour in a small Region Of Interest (ROI). (Fig. 13b orange ROI). The other end of the cable is selected as the upmost point on the contour within the green ROI at the top of the image.

The feature extraction results are shown in Fig. 13b with the end held by M orange, the other end green, and the contact red. 13b) and --→ e g e r (Blue dashed arrow in Fig. 13b) is smaller than a threshold (set to 0.1 rad in the robotic experiments).

VII. ROBOT EXPERIMENTS

A. Hardware setup

We use our BAZAR robot [START_REF] Cherubini | A collaborative robot for the factory of the future: Bazar[END_REF] which is equipped with two lightweight KUKA LWR IV. Planning is carried out in the task space, then projected in the joint space via inverse kinematics. To avoid kinematic singularities, we use adaptive damped least squares [START_REF] Chiaverini | Achieving userdefined accuracy with damped least-squares inverse kinematics[END_REF]. For a starting pose p s and final desired pose p f . We specified the starting/final velocity and acceleration to be 0, and the maximum (operational space) velocity (0.2 m • s -1 ) and acceleration (0.1 m • s -2 ). The trajectory generation is based on second order polynomials. The generation is done by reflexxes motion generation library [START_REF] Kröger | Opening the door to new sensor-based robot applications the reflexxes motion libraries[END_REF].

A table serves as the manipulation plane. We use cylinder screws as contacts and a board with holes for easy insertion of contacts. A white wall paper covers the board, with only the contacts standing out. The size of the manipulation plane is 0.5 m × 0.9 m.

Figure 14a shows the end-effector M. A cable can be firmly attached at the bottom of it. An Intel Realsense D435 camera is mounted, with height from the bottom adjustable (3-27cm). We only use the camera RGB images. The image resolution is 1920 × 1080. F is a 3D printed structure with 4 springs. When pressed on the table, it holds the cable; when lifted, it lets the cable slide (Fig. 14b).

Figure 15 shows the coordinate frames. An ArUco marker [START_REF] Garrido-Jurado | Generation of fiducial marker dictionaries using mixed integer linear programming[END_REF] is placed just below F to serve as the origin of the manipulation plane. The manipulation plane is parallel to XY plane in the robot frame.

The transformation from any position

[X Y Z] T ∈ RXY Z to [x y] T ∈ Fxy is [x y] T = [X Y ] T -[X F Y F ] T , where [X F Y F ] T is the XY position of F in the robot frame.

B. Contact localization

The location of contacts in the robot frame is obtained by commanding an initial upward motion of M to capture an image of the manipulation plane with the ArUco marker. Using this image, with simple HSV thresholding, we find the blue contact locations on the image plane. The projection equation from 3D to 2D is then:

[u v 1] T = DCT C R [X Y Z 1] T , (14)
where D ∈ R 3×3 , C ∈ R 3×4 are respectively distortion and camera matrices, and T C R ∈ R 4×4 is the transformation from the robot to the camera frame. Both the depth Z and T C R can be obtained via ArUco. Given image coordinates u and v, the projection equation ( 14) consists of two functions with two unknowns. Thus, we solve the robot frame coordinate X and Y from u and v. The contacts are conventionally ordered with increasing X axis coordinate.

C. Results

To validate our framework, we did 8 experiments with different contact configurations. Figure 16 shows the manipulation time for each experiment scenario 3 . The majority of time is dedicated to the rotation, during which the contact detector is active. We use a rotation step of 0.02 rad. The rotation step is chosen based on our image processing rate (on average 60 milliseconds per image) for an accurate contact detection. A late detection will put the cable in high tension. With faster image processing, we could reduce the execution time in the rotation phase by taking larger rotation steps. This could be achieved -for instance -by using smaller size images.

Figure 20 presents graphically all the multi-contact scenarios with nominal cable configurations. In the figure, the contact and initial/target XY (Z is constant) locations are given by vectors (in meters) expressed in the robot frame RXY Z. The initial pose of M is [-0.05 0.65 π] T . To reach the target, we set the target orientation for M as π. Figure 17 shows the final configuration for these scenarios. The robot achieves all these configurations by contact regulation. Figure 21 shows a step by step manipulation process for scenario 8. We can analyze the effect of robot motion on the ACMI for individual contact and then for the overall experiment. For an experiment with n contacts, the initial overall ACMI is 2πn. We expect the ACMI to decrease as the cable is regulated by each contact. The initial overall ACMI for scenario 8 is 3 × 2π = 6π. Given the motion in Fig. 18a, we can calculate the ACMI for the i th contact as shown on Fig. 18b:

ACMI i = 2π -π -α i -β i . (15)
The -π in ( 15) comes from the first contact detected by the vision-based detector. A point contact is then constructed.

The α i > 0 is the rotation angle subsequent to the contact detection. The β i ∈ [-π, π] is the rotation angle after pull until the next contact is detected; β i is positive if the rotation after the pull has the same direction as before the pull, and negative otherwise. For the last contact β n = 0 rad. For the example on Fig. 18b, from the motion and contact locations we are able to calculate α 1 = 0.76 rad and β 1 = -0.0862 rad (β is negative as the direction is different from the rotation direction before the pull). The ACMI for the contact is: 2π -π -0.76 + 0.086 = 2.46 rad. ACMIs for the rest of contacts can be calculated in the same manner.

One simple measure to analyse overall contact mobility is by summing up the ACMI of each contact for a given scenario. The total ACMI for a n contacts setup after robotic manipulation can be calculated by ( 16):

T = n i=1 ACMI i . (16)
For a given topology of contact locations (order known), the start and target end-effector positions, one could calculate the nominal total ACMI by the cable configuration. Consider the example in Fig. 18, based on the nominal cable configuration (obtained by connecting the start, contacts in order and the target sequentially), the nominal ACMI for the first contact is ψ 1 which is the angle between the k 1 and k 2 (see Fig. 18). Similarly, using [START_REF] Acker | Manipulating deformable linear objects: characteristic features for vision-based detection of contact state transitions[END_REF] we can calculate total nominal ACMI for a given the topology. Figure 19 presents a bar graph of comparison between the nominal and actual ACMI in each scenario. The difference between the nominal ACMI and ACMI calculated from the robot motion is very small. This confirms that with our framework the robot is able to construct contact and to use it for shaping the cable to reach the desired configuration.

In these experiments, we were constrained by the operational space of the robot, and by the simple mechanical structure designed to hold the cable. To extend the framework for more contacts one needs to consider: 1. re-grasping of the cable, 2. using a mobile base to enlarge the robot operational space.

VIII. CONCLUSION AND FUTURE WORK

In this paper, we address contact-based robotic manipulation of cables. Two motion primitives are selected based on a contact analysis. Then, we propose a novel planning strategy with a vision-based contact detector. Experiments are carried out to validate the approach.

The paper is one of the pioneer works which considers environmental contacts in deformable object manipulation. We believe contacts play a vital role in deformable objects manipulation. Currently, since we use a fixed base, the number of contacts is limited, as is the robot operational space. With a mobile base, one could enhance the robot operational range. In addition, since the rationale behind a human using a specific contact for shaping is probably closely related to science, some inspiration can be drawn from [START_REF] Tee | Towards emergence of tool use in robots: Automatic tool recognition and use without prior tool learning[END_REF] for studying how robots should use different In a nutshell, contact for deformable objects manipulation is a rich area with a lot of new research opportunities. We hope this work can be a starting point for future research.

Fig. 1 .

 1 Fig. 1. Cable harness board with contacts.

Fig. 3 .

 3 Fig.3. Example of a circular object in contact with a cable. The green vector is a candidate direction of relative object/cable motion. Many others directions are possible.

Fig. 4 .

 4 Fig. 4. The ACMI in four contact cases, (a): no contact; (b): point contact; (c): curved contact with 0 < ψ ≤ π; (d): curved contact with π < ψ ≤ 2π.

Fig. 5 .

 5 Fig. 5. The effect of rotation on the ACMI.

Fig. 7 .

 7 Fig. 7. Motion primitives: (a). End-effector F holds while end-effector M rotates the cable, (b). End-effector F releases while end-effector M pulls the cable.

Fig. 8 .

 8 Fig. 8. Flow chart depicting the steps to reach the final target by contact-based manipulation with n contacts.

Fig. 9 .

 9 Fig. 9. Position planning for a single contact.

Fig. 10 .

 10 Fig. 10. Multiple contacts planning example. The order of the contacts is presented by the numbering besides each contact, and known by the robot, which can then compute the initial pose.

FixedFig. 11 .Fig. 12 .

 1112 Fig. 11. Full rotational motion planning.

Fig. 13 .

 13 Fig. 13. Extraction of the cable ends and the contact: (a). Original image, (b). Image after processing with locations of three features and ROIs

Fig. 14 .Fig. 15 .

 1415 Fig. 14. Designs of the two end-effectors.

Fig. 16 .Fig. 17 .

 1617 Fig. 16. Total manipulation time for each scenario. Single contact cases: 1,2. Two contacts cases: 3-5. Three contacts cases: 6-8.

Fig. 18 .

 18 Fig. 18. (a): Planned motion for scenario 8; (b): Example calculation of the ACMI of contact 1 after the robot motion.

Fig. 19 .

 19 Fig. 19. The nominal ACMI and the ACMI after the manipulation.

Fig. 20 .

 20 Fig. 20. Manipulation experiments with more than one contact. Contacts are denoted with black dots, and the nominal cable configuration is drawn with solid (2 contacts) and dashed (3 contacts) lines

Fig. 21 .

 21 Fig. 21. Manipulation process for scenario 8.

  Manuscript received: Jun, 7, 2019; Revised Aug, 22, 2019; Accepted Sept, 12, 2019. This paper was recommended for publication by Editor Jingshan Li upon evaluation of the Associate Editor and Reviewers' comments. This work was supported by European Union Horizon 2020 research and innovation programme as part of the project VERSATILE under grant agreement No 731330. All authors are with the Laboratory for Computer Science, Microelectronics and Robotics LIRMM -Université de Montpellier CNRS, 161 Rue Ada, 34090 Montpellier, France. firstname.lastname@lirmm.fr

Digital Object Identifier (DOI): see top of this page.

We developed a website indicating all the control and vision parameters used in our experiments: https://jihong-zhu.github.io/robotics/2019/08/17/ Experiment-contact-based-manipulation.html.


Vincent Itier
email: vincent.itier@lirmm.frwilliam.puech@lirmm.fr

William Puech

How to recompress a JPEG crypto-compressed image?

This paper presents a new method, of recompressing a JPEG crypto-compressed image. In this project, we propose a cryptocompression method which allows recompression without any information about the encryption key. The recompression can be executed on the JPEG bitstream directly by removing the last bit of the code representation of a non null DCT coefficient and adapting its Huffman code part. To be able to apply this approach, the quantization table is slightly modified to make up the modifications. This method is efficient to recompress a JPEG cryptocompressed image in terms of ratio compression. Moreover, since the encryption is fully reversible, the decryption of the recompressed image produces an image that has a similar visual quality compared to the original compressed image.

Introduction

Today, there is an enormous amount of images exchanged via the Internet and this number increases every day. For acquisition, exchange, transmission and storage, compressed images are often used. The most popular image compression standard is JPEG [START_REF]T.81, Information Technology-Digital Compression and Coding of Continuous-Tone Still Images Requirements and Guidelines[END_REF]. The JPEG File Interchange Format [START_REF] Hamilton | JPEG file interchange format[END_REF] (JFIF) is often used for encapsulate image compressed using JPEG compression. Moreover, the JPEG compression has been more standardised by the Independent JPEG Group [START_REF] Wallace | The JPEG still picture compression standard[END_REF] (IJG). This method of lossy compression is popular both in normal use and in research. Moreover, for security purpose, it is common to encrypt data during their transit and their storage. Let consider two users Alice and Bob. Alice wants to send a raw image to Bob through a network that she does not trust. Alice can send a encrypted image in order to mask the visual information but bandwidths can be limited. Thus, sending a raw image has a huge cost. A realistic scenario is to consider a compression before sending an image. In order to send a crypto-compressed image, there exists two main scenarios. The first case consists to encrypt the image and to compress it, as done in [START_REF] Schonberg | On compression of encrypted images[END_REF][START_REF] Lazzeretti | Lossless compression of encrypted greylevel and color images[END_REF][START_REF] Zhang | An improved image compression scheme with an adaptive parameters set in encrypted domain[END_REF]. In this case the compression is limited due to the removing of redundancy by the encryption. Moreover, the compression has often a specific format. The second case consists to compress the image in a common format and to encrypt it. In order to reinforce the protection and the confidentiality of JPEG compressed images, several JPEG crypto-compression techniques have been proposed. These techniques aim to offer a format compliant visual masking. In order to partially hide details of an image, such as face or text, without losing the image meaning, selective or partial encryption methods have been pro-posed [START_REF] Rodrigues | Selective encryption of human skin in JPEG images[END_REF][START_REF] Unterweger | Length-preserving bit-streambased JPEG encryption[END_REF][START_REF] Puech | Advanced Color Image Processing and Analysis, chapter Protection of Colour Images by Selective Encryption[END_REF][START_REF] Korshunov | Scrambling-based tool for secure protection of JPEG images[END_REF]. In the case where confidentiallity is needed, full encryptions methods [START_REF] Li | A leak and its remedy in JPEG image encryption[END_REF][START_REF] Niu | JPEG encryption with file size preservation[END_REF][START_REF] Minemura | JPEG image scrambling without expansion in bitstream size[END_REF][START_REF] Ong | Beyond formatcompliant encryption for JPEG image[END_REF] allow to efficiently hide the content. We analyzed which encryption method to use in order to have interesting visual masking and a good compression rate. Most of JPEG encryption methods encrypt the AC coefficients of DCT transformation and do not cipher the DC coefficients or with a specific method, as they are encoded differently and contain important visible information [START_REF] Van Droogenbroeck | Techniques for a selective encryption of uncompressed and compressed images[END_REF]. The less sensitive AC coefficients can be encrypted using AES xor encryption scheme [START_REF] Rodrigues | Selective encryption of human skin in JPEG images[END_REF][START_REF] Pinto | Protection of JPEG compressed e-comics by selective encryption[END_REF] or by scrambling technique [START_REF] Li | A leak and its remedy in JPEG image encryption[END_REF][START_REF] Korshunov | Scrambling-based tool for secure protection of JPEG images[END_REF]. However, the network capacity can be more limited at some nodes, that can involves problems during image transmission. In this context, it is common to apply a JPEG recompression onto clear image in order to reduce image size. This recompression may produce block artifacts and has been studied by Bauschke et al. [START_REF] Bauschke | Recompression of JPEG images by requantization[END_REF]. The main problem is to recompress a crypto-compressed image without being exposed to privacy leaks. The best solution is to avoid the decryption and to work in the encrypted domain. Working in encrypted domain is a main challenge concerning privacy and security in many applications such as indexing, retrieving and data hiding. It requires to find an encrypted domain which allows to perform a recompression. Recently, many applications in encrypted domain have been proposed such as features extraction proposed by Hsu et al. [START_REF] Hsu | Image feature extraction in encrypted domain with privacy-preserving SIFT[END_REF] and watermarking proposed by Qian et al. [START_REF] Qian | Reversible data hiding in encrypted JPEG bitstream[END_REF].

In this paper, we propose a new method for JPEG recompression in the encrypted domain which preserve the image content. We define a JPEG crypto-compression method which allows the recompression directly in the bitstream. This method is based on xor operation on the appended bits in entropy encoding with a pseudo-random bits sequence as done by Rodrigues et al. [START_REF] Rodrigues | Selective encryption of human skin in JPEG images[END_REF]. The main idea is to divide non null DCT coefficients by removing one bit of the encrypted value and adapting quantization tables. Our approach allows us to localize which bits of the pseudo-random bits sequence are lost after the recompression. Thus, the decryption is fully reversible after the recompression process. The rest of the paper is organized as follow. First, we present the JPEG standard and we discuss previous work in crypto-compression. Then, we describe the proposed JPEG crypto-compression method, and the recompression method. The experimental results are presented and analyzed. Finally, we provide a conclusion of this study.

Related Work

In this Section, we first describe JPEG compression and more precisely JPEG quantization and JPEG entropy coding. Then, we present previous JPEG encryption methods and we explain their limits in terms of confidentiality, security and bitstream size.

JPEG compression

According to JPEG standard, a RGB image represented by three components red, green, blue, is first converted into luminance/chrominance space (YUV). Fig. 1 illustrates the main stages of JPEG compression for the luminance component. For the rest of this study, we consider only the luminance component. First, an image I is decomposed into non-overlapped 8 × 8 pixel blocks. Each block is transformed into DCT coefficients. A quantization matrix is defined depending on the desired compression. Then the quantization matrix is used to quantify DCT coefficients. Then each block defines a Minimum Code Unit (MCU) which is compressed using entropy encoding. Finally, the JPEG compressed image I QF consists of a header followed by the MCUs codes.

JPEG quantization

The DCT transformation is not involved in the compression. At the contrary, it produces 64 non correlated floating coefficients for each 8 × 8 pixel block. The compression is mostly performed by the entropy encoding. Nevertheless, the quantization aims to code DCT coefficients onto small integers and to produce zero coefficients which are efficiently encoded. The quantization step is the cause of losses in JPEG compression, the other stages are reversible. In the most commun case of JFIF format, quantization matrices can be transmitted in JPEG header since, generally, each encoder has its own specification. Generally, quantization tables quantify less low frequency coefficients which are more significant for the visual human system. However, in the standard recommanded by the IJG, the quantization strenght is given by a quality factor QF ∈ [START_REF] Bauschke | Recompression of JPEG images by requantization[END_REF]100]. This quality factor is used to compute the quantization table T QF . The IJG specifies a standard quantization table T 50 for a quality factor QF of 50%. From this table, each quantization table with a quality factor QF ∈ [1, 100] can be calculated. First, the corresponding the scaling factor SF is given as:

SF = 5000/QF, if QF < 50 200 -QF, otherwise. (1)
Then, the new quantization table T QF is computed for all index pair (u, v), u, v ∈ {0, 7}:

q QF (u,v) = q 50 (u,v) • SF + 50 100 . (2)
Furthermore, in order to fulfill the IJG recommendation and for full JPEG baseline compatibility, the quantization matrix values are constrained to the range [START_REF] Bauschke | Recompression of JPEG images by requantization[END_REF]255] :

q QF (u,v) =        1 if q QF (u,v) < 1 255 if q QF (u,v) > 255, 1u, v ∈ {0, 7}. q QF (u,v) otherwise. (3)
This may have an effect for quality factors below 25, and it prevents very low quality files from being generated [START_REF] Wallace | The JPEG still picture compression standard[END_REF]. Finally, block quantization is defined as the integer division of each coefficient c (u,v) by its corresponding quantifier q QF (u,v) :

c (u,v) = c (u,v) q QF (u,v) , u, v ∈ {0, 7}. (4)
The integer division produces a loss of precision which impacts the dequantization step. It is the inverse function that returns the input for the IDCT:

ĉ(u,v) = c (u,v) × q QF (u,v) , u, v ∈ {0, 7}. (5)
The quantization table is saved in the JFIF header and the quantified DCT blocks are compressed using entropy encoding.

JPEG entropy coding

The quantization produces small integers and zeros AC coefficients. As DC coefficients contain a lot of image energy and are very predictable, they are coded using a one dimensional predictor. AC coefficients are encoded following a zig zag order. The zig zag order is used to classify frequencies from the lowest to the higher. In zig zag order blocks often end with zeros since high frequencies are more quantified. Thus, after the last non-zero coefficient, an End Of Block (EOB) symbol is added to the MCU. The entropy encoder is illustrated in Fig. 2 which presents the main steps. The quantized DCT coefficients are coded by a pair (HEAD, AMPLITUDE) of binary vector. The variable HEAD contains run-length coding for zero values and run-size values, the Huffman code of non-zeros coefficients. Meanwhile the HEAD of DC coefficients is only made up by its size. The amplitude part corresponds to the amplitude of non-zero AC coefficients, or in the case of DC is the difference between two neighbouring DC coefficients. The i th pixel block is then represented by a MCU as:

B i = [(H i 0 , A i 0 ), . . . , (H i j , A i j ), . . . , (H i k , A i k )], (6)
where, 0 ≤ k ≤ 64 is the number of element in the MCU. The sequence of MCUs is placed after the header in JFIF bitstream.

JPEG encryption

Several JPEG encryption techniques have been proposed because they are format compliant, they do not increase much the size, they hide content or partially hide content and they are secure. In order to preserve privacy and security, images should be encrypted during transmission or storage. Recently number of approaches have been proposed in order to encrypt JPEG compressed images. The encryption should be format compliant to preserve JPEG structure and be viewable. The main challenge is to not increase the file size, which is against compression rules. Authors have proposed size preserving JPEG encryption, which aims to keep the same size [START_REF] Unterweger | Length-preserving bit-streambased JPEG encryption[END_REF][START_REF] Minemura | JPEG image scrambling without expansion in bitstream size[END_REF][START_REF] Puech | Advanced Color Image Processing and Analysis, chapter Protection of Colour Images by Selective Encryption[END_REF] or limit the size expansion [START_REF] Niu | JPEG encryption with file size preservation[END_REF][START_REF] Ong | Beyond formatcompliant encryption for JPEG image[END_REF]. First partial encryption methods using sign encryption have been shown unsecure by Said [START_REF] Said | Measuring the strength of partial encryption schemes[END_REF]. Rodrigues et al. [START_REF] Rodrigues | Selective encryption of human skin in JPEG images[END_REF] propose a partial encryption which is applied selectively on regions of interest of the image such as faces. This method which relies on XOR operation with the AES algorithm, performs the compression and the encryption in the same process. Partial encryption is sufficient to keep hiding sensitive information such as text or faces. Moreover, it has the advantage to not change the size of the encrypted file. It can be used in the case of selective encryption as done in [START_REF] Pinto | Protection of JPEG compressed e-comics by selective encryption[END_REF][START_REF] Puech | Advanced Color Image Processing and Analysis, chapter Protection of Colour Images by Selective Encryption[END_REF]. A reversible watermarking method in encrypted domain is proposed in [START_REF] Qian | Reversible data hiding in encrypted JPEG bitstream[END_REF]. This method relies on XOR operation but for more visual masking author encrypt also quantization table. Blocks and coefficients scrambling is used in [START_REF] Niu | JPEG encryption with file size preservation[END_REF][START_REF] Unterweger | Length-preserving bit-streambased JPEG encryption[END_REF][START_REF] Minemura | JPEG image scrambling without expansion in bitstream size[END_REF][START_REF] Ong | Beyond formatcompliant encryption for JPEG image[END_REF]. Simple scrambling methods tend to increase the size if there is no verification of the run-length for example. In addition, simple scrambling methods can be attacked [START_REF] Li | A leak and its remedy in JPEG image encryption[END_REF]. Using the non-zero-counting attack, authors extracts binary image from an encrypted one. They also propose a secure method based on full inter-block shuffle (FIBS). In [START_REF] Unterweger | Length-preserving bit-streambased JPEG encryption[END_REF], authors propose a partial encryption which preserves the size. Moreover, their method is claimed secure against attacks.

Recompression of crypto-compressed JPEG image

In this section, we develop our proposed method to recompress a crypto-compressed JPEG image. Assume Alice uses crypto-compression in order to protect her image against malicious user, and she allows format compliant recompression. It does not require specific viewer and it can allow partial visualization in case of selective encryption. Alice does not need to know the state of the bandwidth, she can crypto-compress her image in order to let the network provider recompress her image without the encryption key. The proposed scenario is presented in Fig. 3. First, the image is JPEG crypto-compressed using a quality factor QF ∈ [START_REF] Bauschke | Recompression of JPEG images by requantization[END_REF]100]. Through the network the image is recompressed to a lower quality factor QF < QF. The advantage of our method is that the decryption process before recompression is not necessary and then it is possible to recompress it without knowing the secret key. Moreover, this method does not need to decompress JPEG image and the recompression processing is done into the JPEG bitstream. The main idea of the recompression is for each coefficient code, to remove its last amplitude bit which corresponds to a division by two in base-10. In order to make a correct decoding, the quantization table has to be multiply by two. This method is compatible with the presented encryption because we can locate the removing part and shift the ciphering sequence.

First, we present the JPEG bitstream encryption while preserving its format and its size. Then, we explain the recompression steps of crypto-compressed image. Finally, we analyze the behavior of the quality factor during the recompression.

Preserving size JPEG crypto-compression

Starting from a raw image, we propose to crypto-compress the image into a JPEG format compliant bitstream. Since our method is designed to compress data, we use an encryption technique which does not increase the size of the bitstream compared to a simple JPEG compression. In this project, we propose to use the method presented by [START_REF] Puech | Advanced Color Image Processing and Analysis, chapter Protection of Colour Images by Selective Encryption[END_REF]. After defining the appropriate luminance quantization table, the method follows the JPEG compression steps. We propose to encrypt the amplitude part of the non-zero AC coefficients i.e. the concatenation of the amplitude of each coefficient of each block

[A i 0 , . . . , A i k , . . . , A n 0 , . . . , A n k ],
where n is the number of blocks. The amplitude sequence is denoted A = [a 0 , . . . , a l ] where l is the number of amplitude bits. A standard stream cipher function is used to generate a pseudorandom sequence E = [e 0 , . . . , e l ] from a secret key. This sequence is XORed with the incoming plaintext, in order to produce the ciphered sequence A = [ a 0 , . . . , a l ]:

a i = a i ⊕ e i , i ∈ [0, l], (7)
where ⊕ denoted the XOR operator. The encrypted sequence is substituted to the amplitudes of the original bitstream. A coefficient c (u,v) is coded by the pair (H i k , A i k ), where i is the block number and k = u × 8 + v. This coefficient is encrypted using Eq. ( 7), to its new code (H i k , A i k ) with the same number of bits. The encrypted bitstream can be decoded by a standard viewer but the content is partially masked, as presented in Fig. 4.b. There exists other preserving size encryption which are not suitable for recompression. Nevertheless, applying a full inter-block shuffle (FIBS) [START_REF] Li | A leak and its remedy in JPEG image encryption[END_REF], in addition, allows to hide the content and add security. Although it increases the size of encrypted image, the additional cost remains low.

JPEG Recompression

The recompression is applied on the encrypted JPEG bitstream, which is the list of MCUs. They contains clear DC quantified coefficient and the encrypted AC quantified coefficients, noted c (u,v) , u, v ∈ [0, 7] encoded by the pair

(H i k , A i k ) for DC coef- ficient and (H i k , A i k )
, where i is the MCU number and k = u×8+v. The binary representation of A i k is noted [a 0 , . . . , a l ] where l + 1 is its binary size. First, each coefficient is divided by two:

c (u,v) = c (u,v) 2 , (8)
which corresponds to removing the last bit a l of the binary representation of A i k . If it amplitude is set to zero, it is coded in the run-lenght code of another coefficient, else the new value A i k contains the bits [a 0 , . . . , a l-1 ]. Then, its corresponding head part H i k is adapted in function of the new amplitude size and in function of the number of preceding zeros if it changes. The head part is the Huffman code of the concatenation of the binary representation of the run-length and size values for AC coefficients, only size for DC coefficients. Removing the last bit implies reducing the binary size by one for all coefficients. Finally, c (u,v) is encoded by

( H i k , A i k ).
The adapted quantization table T is given as:

q (u,v) = q QF (u,v) × 2. ( 9
)
The main advantage of this method is that it localizes the removed bits and the decryption is still possible. Then, the head part of an encoded coefficient has to be updated. The size part is decremented by one since we remove one bit. Moreover, if there is no more zeros before the coefficient, the runlength does not change. This method is compatible with the used encryption method because we can locate the removed part and shift the ciphering sequence. There is an exception for coefficients whose size is 1 bit. These coefficients become 0 after recompression and are included in entropy coding. Thus, in order to solve this problem, we propose to not encrypt these kinds of coefficients during the first crypto-compression. The quality impact is very low since the encryption of these coefficient does not change the value in 50% of cases in average. We are limited to one recompression in this case. Nevertheless, if coefficients of size lower than the number of recompression are not encrypted, the decryption is possible. Applying more recompression is possible at the expense of the encryption quality. We assume that a single recompression is sufficient in many cases. Moreover, the recompression can be applied on JPEG scrambled encryption method such as full interblock shuffle (FIBS) [START_REF] Li | A leak and its remedy in JPEG image encryption[END_REF]. Indeed, shuffling AC coefficients has no impact on their amplitude code, but it can change the entropy coding. In the experimental results, we propose then to analyze encryption effect on the compression rate. An example of the recompression in encrypted domain is illustrated in Fig. 5.

-435 160 . . . c) Entropic coding Fig. 5.a presents the DC and low frequency coefficient of a MUC. Suppose that an AC coefficient c (0,1) = 160 quantified by q QF (0,1) = 3, thus its new value is c (0,1) = 53. Then, suppose that c (0,1) = 53 is preceded by none 0 in zigzag order. Then, its run-length/size code is: 0/6. A standard Huffman table gives the code: 1111000, thus the binary code for this coefficient is: 1111000110101. The coefficient is coded on 13 bits. The recompression is done by dividing by 2 the value, i.e. by removing the last bit. Thus, the run-length/size code is: 0/5, assuming there is still no 0 before. And finally, we get 10 bits: 1101011010, coding the coefficient c (0,1) = 26. The quantization table is multiplied by two, so the dequantized value ĉ(0,1) = 26 × (3 × 2) = 156.

A JPEG recompressed encrypted image is still viewable and the decryption can be perform with the key if we know there was a recompression. Indeed, we add in the JPEG comment part, 8 bits coding 0 or 1 that correspond respectively to no recompression and recompression. This recompression can be applied on any kind of JPEG encoded image encrypted with a compatible method such as the presented JPEG crypto-compression.

Quality factor analysis

In this section, we analyze how to evaluate objectively the compression quality of the produced recompressed cryptocompressed image. Indeed, after recompression, the image quality cannot be calculated without deciphering. The quality factor proposed by the IJG provides a good index of the compression quality. The final JPEG format file size is studied in Section Results. The recompression method produces quantization tables which are not standard. Furthermore, generally, there is no information in the JFIF header that contains the quantization factor. The problem is then to estimate the quality factor from a quantization table, this is illustrated in Fig. 6, where an original quantization table T 80 , presented in Fig. 6.a, is multiplied by two to compensate the recompression. The image was compressed with a quality factor QF = 80 which is not know but can be retrieved. Nevertheless, the quality factor corresponding of the new quantization table T presented in Fig. 6.b, is not straightforward. Thus Chandra and Ellis [START_REF] Chandra | JPEG Compression Metric as a Quality Aware Image Transcoding[END_REF] proposed a predictor to measure the IJG equivalent of the JPEG quality factor for a JPEG image. Nevertheless, their predictor is not analyzed and there are no proof of correctness. We propose to estimate the quality factor of the new quantization tables from the definition of IJG for recompressed image. In order to evaluate the quantization factor of the produced tables, we invert Eq. ( 2). Thus, the mean inverse function is computed with the two possible equations:

f 1 (T ) = 1 n 7 ∑ u=0 7 ∑ v=0 100 - 50 • p QF (u,v) -25 q 50 (u,v) (10)
f 2 (T ) = 1 n 7 ∑ u=0 7 ∑ v=0 5000 • q 50 (u,v) 100 • p QF (u,v) -50 (11)
Finally the quality factor is given by:

f (T ) = f 2 (T ), if f 2 (T ) ≤ 50 f 1 (T ), otherwise. (12)
The quality factor estimation is denoted QF = f (T ) and T = T QF . The inversion works perfectly, if the Eq. ( 3) is not considered. The range value limitation implies that values smaller than 1 and greater than 255 are lost. Extreme cases are then defined for by two quantization tables T QF -and T QF + , where:

• p QF - (u,v) = 1, ∀u, v ∈ [0, 7] , • p QF + (u,v) = 255, ∀u, v ∈ [0, 7].
Thus, the range of the proposed quality factor estimation is [ f (T QF -), f (T QF + )] = [START_REF] Pinto | Protection of JPEG compressed e-comics by selective encryption[END_REF]99]. The quality factor estimation function is plotted in Fig. 7 notice the divergence of the function for quality factors below than 20 and for the value 100. To evaluate this divergence, we propose to evaluate the quality factor QF of standard quantization table T QF , then we generate the standard quantization table T QF with the evaluated quality factor. If the quality factor is correctly estimated then the L2-distance between T QF and T QF is null. Results of L2-distance divergence are presented in Fig. 8 while the estimated QF diverges the distance between standard quantization table and the estimated quantization table increases. This study is done to evaluate the compression quality after the recompression, so we evaluate the L2-distance between the recompressed standard quantization table for which we evaluate a quality factor QF and the estimated quantization table given by QF . Results are presented in Fig. 9. From this figure, we note that the divergence starts for an estimated quality factor around 34 to the limit at 11. We also notice a range where the function has a sawtooth shape, which is due to integer rounding errors. Nevertheless, we can well estimate the recompressed image quality for an estimated QF greater than 34. The estimated correspondance This analysis allows us to guess the recompression quality even before the crypto-compression of the image and to choose wisely an appropriate quality factor. Moreover, this analysis is used to assess the image recompression quality for experimental results.

Experimental results

In this study we evaluate the image quality with the PSNR (Peak Signal-to-Noise Ratio) between the compressed images and their original corresponding raw images. We also evaluate the compression rate presented in bpp (bit per pixel). Fig. 11.a presents the result of the JPEG crypto-compression, of the raw image Barbara (256 KB) with a quality factor QF of 75%. The compression rate is about 0.18 bpp and the PSNR is 17.9 dB. Note that the decryption of this image produces a good quality image with a PSNR of 36.3 dB. In Fig. 11.b the image of Fig. 11.a, is recompressed with our proposed method to an approximate quality factor of 50%, achieving a compression rate of 0.10 bpp. The PSNR of the recomressed crypto-image is almost the same around 17.9 dB. Finally, the recompressed crypto-image can be decrypted with the good key as shown in Fig. 11.c. The image is correctly decrypted with a PSNR of 31.9 dB. Our experimental results have been applied on 117 standard gray-scale images from different databases 1 . Each image is crypto-compressed, then recompressed and finally decrypted. Table . 1 presents in the first row the quality factors used for crytpo-compression. The corresponding approximate quality factors calculated after recompression are presented in the second row. designed to work in encrypted domain but it should be efficient in terms of compression rate and PSNR. Thus, Fig. 13 presents the comparison between the standard JPEG compression and the decryption of the recompressed JPEG crypto-compression in terms of PSNR and compression ratio. The estimated quality factor calculated after recompression is used as standard quality factor (i.e. quantization table is generated from standard table) for standard JPEG compression. It can be seen that the curve of the decryp- These images have a similar PSNR but the recompressed image looks more noisy because of block artifacts which is visually disturbing. This kind of artifacts are more frequent for certain quality factors as explained by [START_REF] Bauschke | Recompression of JPEG images by requantization[END_REF].

The main objective of recompression of crypto-compressed image is to reduce the size while preserving the security of the encrypted visual information. An example is presented in Fig. 15, first the image is crypto-compressed from the raw image with QF = 75, the file size is 32.6 KB. Then, the image is recompressed with an estimated QF = 50, it has a size of 18.5 KB, which is a gain of 43% in size. The crypto-compression qual- the recompression gain in size is always superior of a quarter of the crypto-compressed image size. Moreover, for more standard applications, such as a crypto-compression with QF = 75, the recompression rises to 42% of file size.

Conclusion

In this paper we propose an efficient method to recompress JPEG crypto compressed images. The preservation of the size of the JPEG crypto-compression allows us to keep the size comparable to a simple JPEG compression. The recompression method efficiently reduces the JPEG crypto-compressed image size. Moreover, the compression rate is very close to the standard JPEG one. In this paper, we focused on the luminance channel and thus we presented results on gray scale image. The method can be ap-plied on color image on its luminance component and extended to chrominance channels. In future work, we will consider different scenarios such as selective, partial or even full encryption. Furthermore, we are investigating the best quality factor for cryptocompression in order to produce few artifacts and thus, have the best image quality after compression while maintaining an efficient size gain.

Figure 2 :Figure 3 :

 23 Figure 2: Entropy encoder.

Fig. 4 .

 4 Figure 4: a) Raw image: 256 KB, b) crypto-compressed JPEG image with quality factor set to 75: 35 KB, PSNR: 20.31 dB.

Figure 5 :

 5 Figure 5: a) DCT Coefficients, b) Quantization table, c) Entropic coding

Figure 6 :

 6 Figure 6: a) T 80 , b) T for a recompression.

Figure 7 :

 7 Figure 7: Quality factor estimation from quantization table.

Figure 9 :

 9 Figure 9: L2-distance between standard quantizationtable and the estimated quantization table after recompression.

  a) JPEG crypto-compressed image with QF = 75 (46 KB), b) The recompressed image with QF = 50 (26 KB), c) Decryption of the recompressed crypto-compressed image (26 KB).

Fig. 12 presentsFigure 12 :

 1212 Fig.12presents the compression rate as a function of the PSNR. It presents the average of values acquired on the 117 images of the base for each quality factor and their corresponding approximate quality factor after recompression. This method is

Figure 13 :

 13 Figure 13: Average compression rate for 117 images as a function of the average PSNR, in black classical JPEG compression, in orange the decryption of the recompressed JPEG cryptocompressed images.tion recompressed images, is very closed to the JPEG standard compression. It shows that the modified quantization table fit almost fit the JPEG compression with standard quantization table. However, the proposed recompression is similar to standard JPEG recompression which produces block artifacts[START_REF] Bauschke | Recompression of JPEG images by requantization[END_REF], as illustrated in Fig.14. Fig.14.a presents these artifacts on the decryption

Figure 16 :

 16 Figure 16: Average gain in file size in percentage for 117 for the quality factor sample.

  , for standard quantization table. We can

	0	20 Standard quantization table calculated from quality factor 40 60 80	100

  for all standard quantization table with QF ∈ [1, 100]. It is observed that L2-distance between standard quantization table and the estimated quantization table.

		900
		800
		700
		600
	L2 distance	300 400 500
		200
		100
		0	0	20	40 Quantization table 60	80	100
	Figure 8:

  table and the estimated quantization table after recompression. between a standard table quality factor and the new quality factor value after recompression is presented in Fig. 10. Figure 10: L2-distance between standard quantization table and the estimated quantization table after recompression.

		100
	Estimated quality factor (%)	20 40 60 80
		0	0	20 Recompressed quantization table calculated from quality factor 40 60 80 100

Table 1 :

 1 Sample of quality factors used in our experiments and their corresponding approximate quality factors after recompression.

	QF =	100% 95% 90% 75% 50% 25% 15%
	QF	97%	90% 80% 50% 25% 14% 12%

http://decsai.ugr.es/cvg/index2.php

Author Biography

Vincent ITIER received the M.S degree in Computer Science from the University of Montpellier, France, in 2012


Eskandar Kouicem

Clément Raïevsky

Michel Occello

Artificial Emotions for Distributed Cyber-physical Systems Resilience

Keywords: Artificial Emotions, Multi-agent systems, Cyber-physical systems, Resilience, Distributed Artificial intelligence, Distributed Systems, Human and Social Sciences

The concept of system resilience is important and popular in different domains like psychology, psychiatry, sociology, and more recently in cognitive science, biological disciplines, ecology and computer science. The main objective of this paper is to present a research avenue exploring the applicability of knowledge from those domains to solve resilience problems in cyber-physical systems. Emotions have been identified as an important process to cope with unexpected events and is therefore crucial for resilience. Our work is thus aimed at utilizing emotion-like processes in cyber-physical systems to improve their resilience, at individual and collective levels. Furthermore, one of our main assumptions is that the multi-agent paradigm is particularly well suited to embed such emotion-like processes in this type of systems.

Introduction

Emotion has a major influence on the ability of humans to adapt to unknown or unusual situations as individuals and as groups. It is therefore, a natural source of inspiration when tackling the problem of distributed complex systems resilience that we consider as the ability of such systems to identify and cope with unexpected situations. As emotions positively have a physiological component, the main application domain of this PhD project1 will include cyber-physical systems, that is to say systems that are at least partially in direct interaction with the physical world. Resilience concerns the ability to recognize, adapt, and handle unanticipated perturbations that call into question the model of competence, and demand a shift of processes, strategies and coordination [START_REF] Woods | Essential characteristics of resilience[END_REF]. In our work, we aim at including knowledge from psychology and sociology about resilience and emotion in cyber-physical systems utilizing the multi-agent paradigm. This paradigm brings to the existing approaches of resilience a social metaphor for complex systems. In addition, we aim at embedding cognitive science and psychology knowledge about resilience and cognitive functions of emotion in the individual systems decision-making mechanisms and in the self-organizing processes of agents groups.

In this paper, we start by presenting a synthesis in the field of resilience in human and social science and present the applicability of these concepts to cyber-physical systems. After that, we will present the multi-agent paradigm our solution will be based on. We will then present artificial emotions and expose the way we plan to use inspiration from human emotion to solve resilience problems. Finally, we conclude this paper by the description of the state of this project.

Resilience

Resilience is studied by researchers in a variety of disciplines including psychology, psychiatry, sociology, and more recently cognitive science, biological disciplines, ecology and computer science. Resilience has different definitions in different communities. In ecology, resilience is the ability of an ecosystem or species to recover its normal behaviour after experiencing traumas. In psychology, "resilience is the ability of a person or a group to develop well, to continue to project into the future, despite destabilizing events, difficult living conditions and sometimes severe traumas" [START_REF] Ruault | Résilience des systèmes sociotechniques application à l'ingénierie système[END_REF]. At the level of the individual, traumas destroy the psyche, at the level of the group, traumas destroy the existing bonds between the members of the group [START_REF] Ruault | Résilience des systèmes sociotechniques application à l'ingénierie système[END_REF]. In computer science, resilience is the persistence of supplying services and the availability of features [START_REF] Trivedi | Resilience in computer systems and networks[END_REF].

Resilience in Human and Social Sciences

In human and social sciences and especially psychology, there are two types of resilience, individual and collective. Individual resilience is the process of, capacity for or outcome of successful adaptation despite challenging or threatening circumstances [START_REF] Masten | Resilience and development: Contributions from the study of children who overcome adversity[END_REF]. Collective resilience is the ability of communities to withstand external shocks to their social infrastructure [START_REF] Adger | Social and ecological resilience: are they related?[END_REF]. Psychological resilience is characterized by the ability to bounce back from negative emotional experiences and by adapting flexibly to the changing demands of stressful experiences, also, the positive emotionality emerges as an important element of psychological resilience [START_REF] Tugade | Resilient individuals use positive emotions to bounce back from negative emotional experiences[END_REF][START_REF] Lazarus | From psychological stress to the emotions: A history of changing outlooks[END_REF].

The work of Norris et al. [START_REF] Norris | Community resilience as a metaphor, theory, set of capacities, and strategy for disaster readiness[END_REF] (see Fig. 1) gives us insight on the applicability of resilience in an artificial system by introducing the robustness, redundancy, and rapidity notions. It explicitly states that resilience depends on its resources to react well and amortize stress. According to Norris et al. [START_REF] Norris | Community resilience as a metaphor, theory, set of capacities, and strategy for disaster readiness[END_REF] the keys concepts relating resources and resilience are:

-Resources : Objects, conditions, characteristics, and energies that people value. -Robustness: resource strength, in combination with a low probability of resource deterioration. -Redundancy: the extent to which elements are substitutable in the event of disruption or degradation.

-Rapidity : how quickly the resource can be accessed and used (mobilized).

Fig. 1. The model of stress resistance and resilience over time [START_REF] Norris | Community resilience as a metaphor, theory, set of capacities, and strategy for disaster readiness[END_REF].

On the one hand, vulnerability occurs when resources are not sufficiently robust, redundant, or rapid to create resistance or resilience, resulting in persistent dysfunction. The more severe, enduring, and surprising the stressor, the stronger the resources must be to create resistance or resilience. On the other hand, resilience occurs when resources are sufficiently robust, redundant, or rapid to buffer or counteract the effects of the stressor allowing the organization to adapt its functioning to the altered environment. For human individuals and communities, this adaptation manifests in wellness [START_REF] Norris | Community resilience as a metaphor, theory, set of capacities, and strategy for disaster readiness[END_REF].

Resilience in Cyber-Physical Systems

The 5C architecture presented by Lee et al. [START_REF] Lee | A cyber-physical systems architecture for industry 4.0-based manufacturing systems[END_REF] clearly defines how to build a CPS from the initial data acquisition to the creation of final value through analysis. The detailed architecture of the 5C is described in Fig. 2. As we can see, the configuration level is the one that allows machines to self-configure and self-adapt. According to the definition of resilience we adopted, our contribution to CPSs resilience lies in this configuration level.

Usually, a CPS consists of two main functional components: (i) advanced connectivity that provides real-time data acquisition of the physical world and cyberspace feedback and (ii) intelligent management of data, data analytics and computing capabilities that build cyberspace. However, this requirement is very Fig. 2. 5C architecture for the implementation of a cyber-physical system [START_REF] Lee | A cyber-physical systems architecture for industry 4.0-based manufacturing systems[END_REF]. abstract and not specific enough for the implementation in general. The total integration of the 5 levels within a CPS is currently rarely achieved, and it is not always justified according to the type of application [START_REF] Lee | A cyber-physical systems architecture for industry 4.0-based manufacturing systems[END_REF].

Linkov and Kott [START_REF] Linkov | Fundamental concepts of cyber resilience: Introduction and overview[END_REF] define cyber-resilience as the ability of a system to recover or regenerate its performance after a malfunction (or attack) has degraded it (see Fig. 3). In this graph, we can see the four stages of the event management cycle that a system needs to maintain to be resilient according to the National Academy of Sciences (NAS) [START_REF]Disaster resilience: A national imperative[END_REF][START_REF] Linkov | Resilience metrics for cyber systems[END_REF] which are:

1. Plan/Prepare: lay the foundation to keep services available and assets functioning during a disruptive event (malfunction or attack). 2. Absorb: maintain most critical asset function and service availability while repelling or isolating the disruption. 3. Recover: restore all asset function and service availability to their pre-event functionality. 4. Adapt: using knowledge from the event, alter protocol, configuration of the system, learning process, or other aspects to become more resilient.

Traditional resilience approaches problems

In general, resilience approaches can be divided into two broad categories: qualitative and quantitative.

Fig. 3. Notional resilience profile, plotting a systems critical functionality over time [START_REF] Linkov | Fundamental concepts of cyber resilience: Introduction and overview[END_REF].

-The qualitative category, which includes methods that evaluate the resilience of a system without a numeric descriptor, contains two sub-categories:

• Conceptual frameworks that offer best practices.

• Semi-quantitative indices that provide expert assessments of different qualitative aspects of resilience.

-Quantitative methods include two sub-categories:

• General resilience approaches that provide domain-independent measures for quantifying resilience across applications. • Structural modelling approaches that model representations specific to the components of the resilience components.

Linkov and Kott [START_REF] Linkov | Fundamental concepts of cyber resilience: Introduction and overview[END_REF] classify existing work dealing with resilience into two other main categories: metric-based and model-based approaches. Metric-based approaches use measurements of the individual properties of system components or functions to assess overall system performance. Model-based approaches use system configuration modelling and scenario analysis to determine the overall performance of the system (see Fig. 4). Agent based approach and multi-agent systems are considered as model-based approaches to address resilience.

We find that the main approaches addressing the issue of resilience are centralized or based on redundancy [START_REF] Hosseini | A review of definitions and measures of system resilience[END_REF]. This project aims to provide the subsystems constituting a CPS with a form of decision-making autonomy, allowing the CPS to detect abnormal situations and then adapt its behaviour to these situations. To do so, our approach utilize the multi-agent paradigm.

Multi-agent systems and resilience

In this section, we are going to present multi-agent systems, self-organization and the advantages of using a multi-agent approach for cyber-physical systems resilience.

Multi-agent system (MAS)

An agent is a real (physical) or virtual entity, located in an environment, able to perceive and act upon it, which can communicate with other agents, an agent is responsive, proactive, social, autonomous and can also have the ability to learn [START_REF] Ferber | Multi-agent systems: an introduction to distributed artificial intelligence[END_REF][START_REF] Weiss | Multiagent systems: a modern approach to distributed artificial intelligence[END_REF]. According to Demazeau, a multi-agent system is a system composed of: a set of agents, an environment, a set of relationships and interactions between agents and a set of organizations of agents [START_REF] Demazeau | From interactions to collective behaviour in agent-based systems[END_REF].

According to Ferber [START_REF] Ferber | Multi-agent systems: an introduction to distributed artificial intelligence[END_REF] MAS main characteristics are:

-Each agent has its own role.

-No global control.

-The data and the decisions are decentralized.

-The operations are asynchronous.

The notion of organization plays a fundamental role within MASs and can be defined as:

a mean of logically organizing agents, a default communication network, and an agent, role, or competence search media.

In addition, its reification provides an entry point into the system for visualizing and improving agent interactions through its dynamic evolution. Organization is needed to structure the interactions that occur between different system entities (agents) [START_REF] Mathieu | Rio: Roles, interactions and organizations[END_REF]. MASs can be provided with a self-organization process making them able to adapt to changes in the environment. Self-organization is an endogenous, bottom-up, process concerning systems in which only information is manipulated by agents which may be unaware of the state of the organization in its entirety [START_REF] Marzo Serugendo | Self-organisation and emergence in multi-agent systems: An overview[END_REF][START_REF] Jamont | A self-organization process for communication management in embedded multiagent system[END_REF]. Self-organization is achieved by modifying the organization; either by directly changing the configuration of the system (topology, neighborhoods, and influences) or through the system's environment by using local interactions and influences, avoiding using predefined models.

Multi-agent approach for resilience

Multi-agent systems offer us a decentralized solution to solve the "single point of failure" problem which is intrinsic in centralized solutions. Moreover, with a multi-agent approach we can avoid the redundancy/replication of a lot of software and hardware components of the cyber-physical system [START_REF] Ferber | Multi-agent systems: an introduction to distributed artificial intelligence[END_REF]. Multi-agent system can maintain its functioning in case communication loss, decrease of data volumes to be transmitted and scaling using the autonomy of its agents. In addition, adopting the multi-agent paradigm and self-organization is breaking with traditional approaches of resilience by the fact that it makes a use of a social metaphor for complex systems. Adding to that, this paradigm allows us to use cognitive science and psychology to reproduce the cognitive functions of emotions, both in the decision-making mechanism of the individual and in the process of the self-organization of the group.

Artificial emotions and CPSs

In this section, we are going to present artificial emotions, emotions theories (computational models) and the use of artificial emotions in our project.

Artificial emotions

According to Frijda [START_REF] Frijda | The emotions[END_REF], emotional phenomena are: non-operationalized behaviours, non-instrumental behavioural traits, physiological changes, and evaluative experiences, related to the subject, all caused by external or mental events, and primarily by the meaning of such events. In computer science, artificial emotions are a set of pre-programmed or non-scheduled processes running within a machine, facilitating decision-making and enabling the system to adapt to the environment. This artificial emotion is the fruit of the program's input-output as well as its own internal activity, and is often the object of a collaboration with a cognitive structure, by means of which the system deals with the problems introduced by its environment. In addition, it is part of a programming logic more or less explicit, but still in the field of computable [START_REF] Mahboub | Modélisation des processus émotionnel dans la prise de décision[END_REF]. In the literature, a panoply of emotion models and computational models are offered but for an artificial system, certain constraints are always present (performance, reliability, durability, integration...) for this reason the choice of an emotion model and a computational model requires a deep analysis to have the best choice for a cyber-physical system (see Fig. 5). Fig. 5. A history of computational models of emotion [START_REF] Marsella | Computational models of emotion[END_REF].

Appraisal theory is one of the main psychological perspectives on emotion and arguably the most fruitful source for the design of symbolic AI systems. In this theory, emotion is argued to arise from patterns of individual judgment concerning the relationship between events and an individuals beliefs, desires and intentions, sometimes referred to as the person-environment relationship [START_REF] Lazarus | Emotion and adaptation[END_REF]. These judgments, formalized through reference to devices such as situational meaning structures or appraisal variables [START_REF] Frijda | Emotion, cognitive structure, and action tendency[END_REF], characterize aspects of the personal significance of events. Patterns of appraisal are associated with specific physiological and behavioral reactions. Computational appraisal models have been applied to a variety of uses including contributions to psychology and AI. For example, several authors have argued that appraisal processes would be required by any intelligent agent that must operate in real-time, ill-structured, multi-agent environments (e.g., Staller and Petta [START_REF] Staller | Introducing emotions into the computational study of social norms: A first evaluation[END_REF]).

Dimensional theories of emotion argue that emotion and other affective phenomena should be conceptualized, not as discrete entities but as points in a continuous (typically two or three) dimensional space [START_REF] Mehrabian | An approach to environmental psychology[END_REF]. It is not surprising that these theories relegate the term emotion to a cognitive label attributed, retrospectively, to some perceived body state. Computational dimensional models are most often used for animated character behavior generation, perhaps because it translates emotion into a small number of continuous dimensions that can be readily mapped to continuous features of behavior such as the spatial extent of a gesture. For example, PAD model of Mehrabian and Russell [START_REF] Mehrabian | An approach to environmental psychology[END_REF] where these dimensions correspond to pleasure (a measure of valence), arousal (indicating the level of affective activation) and dominance (a measure of power or control).

Anatomic theories stem from an attempt to reconstruct the neural links and processes that underlie organisms emotional reactions [START_REF] Ledoux | The emotional brain: The mysterious underpinnings of emotional life[END_REF]. Unlike appraisal theories, such models tend to emphasize sub-symbolic processes. Unlike dimensional theories, anatomic approaches tend to view emotions as different, discrete neural circuits and emphasize processes or systems associated with these circuits. Computational models inspired by the anatomic tradition often focus on low-level perceptual-motor tasks and encode a two-process view of emotion that support for a fast, automatic, undifferentiated emotional response and a slower, more differentiated response that relies on higher-level reasoning processes (e.g., Armony et al. [START_REF] Armony | Computational modeling of emotion: Explorations through the anatomy and physiology of fear conditioning[END_REF]).

Rational approaches typically reside in the field of artificial intelligence and view emotion as window through which one can gain insight into adaptive behavior. Within this rational approaches, cognition is conceived as a collection of symbolic processes that serve specific cognitive functions and are subject to certain architectural constraints on how they interoperate. Emotion, within this view, is simply another, although often overlooked, set of processes and constraints that have adaptive value. Models of this sort are most naturally directed towards the goal of improving theories of machine intelligence [START_REF] Marsella | Computational models of emotion[END_REF].

Artificial emotions for CPSs

Emotions have inspired many studies on human-machine interaction and especially on the detection and expression of natural emotions [START_REF] Calvo | The Oxford handbook of affective computing[END_REF]. Other work on artificial emotions aim to reproduce in artificial systems the stereotyped behaviors that are associated to make virtual agent behaviors more realistic [START_REF] Saunier | Mixed agent/social dynamics for emotion computation[END_REF][START_REF] Adam | Simulation of the emotion dynamics in a group of agents in an evacuation situation[END_REF].

It should be noted that our work is clearly distinct from these themes because it does not deal with the interaction with humans or simulation of natural emotions but to reproduce their functions [START_REF] Raïevsky | Emotion generation based on a mismatch theory of emotions for situated agents[END_REF]. In existing approaches of artificial emotions, emotions are elicited by an analysis of symbolic events related to the system's goals or include a lot of knowledge from the system's designer about situations the system might encounter. These initial assumptions of existing work limits intrinsically the resilience of the resulting systems. Furthermore, these characteristics are hardly applicable to CPSs since 1) they are embedded in the physical world and can't trigger emotions from symbolic data about the situation and 2) the distributed and open nature of CPSs make it impossible for their designers to foresee all possible situations.

Our aim is to design processes that replicate some functions of emotions while avoiding to depend upon such assumptions. Therefore, the functions of emotion we chose to replicate in artificial systems to improve their resilience are: detecting abnormal situations and updating social organizations in response to these abnormal situations. These functions are directly related to the "Absorb" and "Adapt" phases of the resilience profile depicted in Fig. 3.

In this project, we adopted an experimental approach made of different hypotheses, and currently we are working on an emotional agent model for testing their validity.

From the state of the art of artificial emotions, resilience and multi-agent systems, we are designing an individual, decentralized mechanism for detecting abnormal situations using a process inspired by the triggering of an emotional episode. The mechanism will be used in the "Absorb" phase of the resilience profile and integrated in our agent model. Another mechanism will be designed, a process of adapting the individual behaviour of subsystems to improve the resilience of the CPS (the "Adapt" phase of the resilience profile). Using the multi-agent paradigm, we design a collective process for detecting abnormal situations using the information built by the individual detection mechanism. This collective process is initiated by the behaviour adopted when an abnormal situation is detected individually. The adaptation of individual behaviour impacts on the social organization of the group of agents carrying out the control of the CPS, which will trigger a self-organization in order to collectively adapt to the abnormal situation.

The mechanisms proposed in this project are generic, not specific to the tasks of the system. For validating our hypotheses, we have chosen a case of application, a building's thermal regulation system (CP S trb ), consisting of a set of heaters, air conditioners, thermal sensors, thermostats, light sensors, fans and automatic rolling shutters. The resilience in this system is that CP S trb continues to ensure the temperatures chosen by users in case of problems. Before defining the resilience for our CP S trb , we have described the main features, sensors, actuators of this system as well as the potential problems it may encounter. In this context, we are interested in problems like: connectivity breakdown, a node failure, increasing workload issue and adding or removing a node to/from CP S trb . This cyber-physical system is agentified using DIAMOND method [START_REF] Jamont | Designing embedded collective systems: The diamond multiagent method[END_REF]. In this method, there are four phases to move from global characterization to the specification of local behaviours:

-Situation phase : define the general context of the multi-agent system, i.e.

the environment, the agents with their main capacities and their contexts. -Individual phase : define agents from an internal point of view (independent of social relationships). -Social phase : describe the interaction and organization from an external point of view. -Integration phase : to integrate social influences into agents behaviours.

The proposed processes and multi-agent system will be simulated using MASH2 [14], a hybrid hardware software simulation platform, in order to quantify experimentally the resilience improvements they bring.

Fig. 4 .

 4 Fig. 4. Metric-based and model-based approaches for resilience assessment [20].

This project is funded by the Trust research chair of the Grenoble-INP Foundation and the Auvergne-Rhône-Alpes region.

MASH (MultiAgent Software/Hardware simulator)