Fully Automatic Pet Sheet Disposal System Using Image Processing

In recent years, more and more people have been keeping pets. Many zoonotic diseases now exist, and it is possible to become infected with zoonotic diseases from pets. One of the routes of infection is through excrement. Therefore, we have developed a device that automatically folds pet sheets. This system consists of two parts: a camera part that detects excrement and a part that processes the excrement. When the system recognizes that the pet has defecated through image processing, it automatically folds the pet sheet along the creases and opens the lid of the trash can for disposal. When the pet gets on the device to defecate, the system saves the image taken just before as a background, and when the pet gets off the device after defecating, the system recognizes the excrement and folds the left and right sides of the pet sheet, then the top and bottom. Then, the pet sheet is lifted to the front of the trash can and the lid of the trash can is opened using a DC motor. Finally, the pet sheet is thrown into the trash can, and the operation is completed by returning the arm and the trash can lid to their initial positions. The success rate of the experiment was 100% for the recognition of excrement and 100% for the disposal of excrement.


Introduction
In 2020, WHO declared a pandemic due to COVID-19, and the number of infected people and deaths is increasing daily [1] . So far, human beings have fought various zoonotic diseases such as SARS, MARS, and Ebola; there are more than 200 infectious diseases known to WHO alone, and new ones are expected to occur in the future [2,3,4] . According to the "National Survey of Dog and Cat Ownership" conducted by the Pet Food Association of Japan, as of October 2020, there were approximately 8.489 million dogs and 9.64 million cats in captivity, indicating that many animals coexist in our society [5] . Under these circumstances, preventive measures are very important to prevent the spread of zoonotic diseases [6] . The two main routes of transmission are direct transmission and indirect transmission. Direct transmission refers to infection from animal bites, scratches, feces and droplets. We focused on the method of transmission by wind-borne inhalation of pathogens contained in feces. The Ministry of Health, Labor and Welfare recommends that excrement be disposed of promptly to prevent infection [7] . However, it is not practical to dispose of feces every time you defecate. Therefore, a product called "Brilliant Pad" is sold [8,9] . This is a product in which the pet excretes on a roll of sheets, and the sheets are rolled up at regular intervals. This means that the product can be disposed of without touching the excrement, thus reducing the risk of zoonotic infections. However, there are some disadvantages. The first is that it can only be rewound once every 8 hours at the shortest, and the waste cannot be disposed of immediately after excretion. The second disadvantage is that the waste remains in the device until one roll is used up. One roll of these pet sheets is equivalent to 27 sheets of regular size pet sheets, and it takes one to two weeks to finish using one roll. The third point is that if the pet does not defecate in a certain place in the sheet, there is a possibility that it will be missed.
Therefore, we developed a device that automatically folds and disposes of pet sheets at the push of a button [9] . This system folds the pet sheets one by one and disposes of them in the trash, so they can be disposed of at any time. Furthermore, the pet can defecate anywhere in the sheets. Conventional systems do not have a lid on the trash can, assuming that the owner will collect the pet sheets immediately after the operation is finished. However, since it is impossible for owners to always check on their pets at Proceedings of the 8th IIAE International Conference on Intelligent Systems and Image Processing 2021 DOI: 10.12792/icisip2021.010 home, pathogens generated from dried excrement may become airborne.
To solve this problem, we developed a system that attaches a lid to a trash can, processes images using a camera, and disposes of pet sheets when excrement is detected.
This system first uses a camera to perform image processing to recognize that a pet has gotten on the device, that the pet is there, and that excrement has been left behind. Next, it folds the pet sheet on both sides, top and bottom. Then, it opens the lid of the trash can using the DC motor, carries the pet sheet to the trash can, and throws away the pet sheet. Finally, all parts are returned to their initial positions to complete the operation. This system consists of three parts: the folding part, the disposal part by the trash can, and the camera part. Compared to the previous system, this system is improved by 66.7% because of the improvement of two parts, the disposal part and the camera part.

Fully Automatic Pet Sheet Disposal System
The configuration of the device created in this study is shown in Figure 1. The device consists of a two-stage disposal system with an image processing unit at the top. The first stage of the disposal system consists of seven servo motors to fold the pet sheets, as shown in Fig. 1(a). The second stage of the disposal system consists of a power supply, Arduino, DC motor, and motor driver, and the DC motor opens and closes the trash can as shown in Figure 1(b). Figure 1(c) shows a side view of the entire system. The numbers in Figure 1(a) and 1(c) represent the servo motors. The user places the pet sheet on top of the system as shown in Figure 2.

Camera Section
When the distance sensor recognizes that the pet has entered the device, the image before the pet entered the device is saved as the background as shown in Figure 2(a). In the same way, when the distance sensor recognizes that the pet has gotten off the device, it starts image processing using the camera. First, the image after the pet gets off the device is stored as shown in Figure 2(b). To keep only the part of the image to be processed, a perspective projection is performed as shown in Figure 2(c). Next, grayscale the image for binarization, as shown in Figure 2 difference between the previously stored background and the grayscaled image is taken as shown in Figure 2(e). The detected difference is binarized as shown in Figure 2(f). To eliminate the noise, the image is expanded twice as shown in Figure 2(g) and reduced four times as shown in Figure 2(h). To return the image to its original size, it is expanded twice as in Figure 2(i). Assign a number to each lump in the remaining differences. Finally, it deletes a small area as shown in Figure 2(j), recognizes the remaining items as excrement, automatically starts folding the pet sheet, and disposes of the pet sheet in the trash.

Disposal Section
Pet sheets are folded according to the procedure shown in Figure 3. First, set up the pet sheet as shown in Figure 3 (2) to 90 degrees again. To make it easier to fold, tilt (3) by 20 degrees, as shown in Figure 3(d). The folding of the central part is done as follows. Fold the pet sheet by tilting (4) about 145 degrees as shown in Figure 3(e). The front view of the sheet is shown in Figure  3(f). As the pet sheet absorbs urine and expands, do not put back (4), but fold (5) by 150 degrees as shown in Figure 3(g). The front view of the sheet is shown in Figure 3(h). After holding down the pet sheet with (5), lower the arm of (3) and put (4) back as shown in Figure 3(i). To discard the pet sheet, move the pet sheet to the plate (6) in Figure 3(i). To prevent the pet sheet from shifting, carry the pet sheet to plate (6) by sandwiching it between plates (5) and (7) as shown in Figure  3(j). Since the pet sheet is repulsive, stop once at the angle where the plate of (7) becomes vertical, as shown in Figure  3(k). Tilt (6) outward as shown in Figure 3(l) to prevent the pet sheet from falling. After finishing tilting (6), return (7) to its initial position. Move on to the operation of throwing away the pet sheet. As shown in Figure 3 Figure 3(o). Return the angle of (7) to its initial position as shown in Figure 3(p), and dispose of the pet sheets in the trash can. After returning (3) to its initial position as shown in Fig. 3(q), return all servo motors to their initial positions. Finally, as shown in Fig. 2(r), wind the DC motor in the opposite direction from Fig. 2(n) to close the lid of the trash can and finish the operation.

Prototype
In this section, we describe the prototype that realized the system described in Chapter 2. The overall view of the system we produced is shown in Fig. 4. Figure 4(a) shows the top view of the first stage of the disposal system and the camera section, Figure 4(b) shows the top view of the second stage of the disposal system, and Figure 3(c) shows the side view. The size of the disposal system is approximately 580W x 405D x 370H (mm). The system is powered by the servo motors (1) to (7) in Fig. 3(a) and the DC motor located at A in Fig. 3(b). The image processing unit consists of the camera located at B in Fig. 3(a). The image processing unit consists of the camera located at B in Fig. 3(a). The DC motor is Tamiya's AO-8037 geared motor 540K300. The motor driver was Pololu's dual VNH2SP30 motor driver MD03A. The camera used was iBUFFALO's BSW20KM11. VL53L0X from ST micro was used as the distance sensor to recognize the pet's entry into the device.
SHARP's GP2Y0E03 was used as a sensor to confirm that the waste bin was opened. A camera was placed on the lid of the trash can to show the entire disposal system. Details of the servo motor are shown below. (1) The servo motors were arranged as shown in Fig. 5(a). The range of motion of the servo motor is from 0 to 140 degrees so that the aluminum plate moves toward the center. (2) is a reversed version of (1) as shown in Fig. 5(b). (3) The servo motor is placed as shown in Figure 5(c). The arm is about 300mm long and has a servo motor at the end to put pet sheets into the dustbin. The movable range of the servo motor was set to 0 to 90 degrees. Since this servo motor is subjected to a heavy load, we used a servo motor with high torque. The servo motor was placed as shown in Fig. 4 (d). The movable range of the servomotor was set from 0 to 145 degrees so that the aluminum plate would move toward (7). For (5), the servo motor was placed as shown in Figure 5 (e). In (5), the movable range of the servomotor is set from 0 to 150 degrees so that the arm moves toward (7). For (6), the servo motor was installed as shown in Fig. 5(e). For (6), the movable range of the servo motor was set from 0 to 155 degrees so that it moves as shown in Figure 3(l). For (7), the servo motor was placed as shown in Fig. 5(f). The details of the DC motor are shown below. As shown in Fig. 6(a), a wire is passed through the pedal of the trash can, and the wire is wound by the DC motor to open and close the trash can, so it was placed in front of the trash can.
Since the response range of the sensor is 4-50 cm, we placed the sensor so that the hinge reacts to the sensor when the trash can opens, as shown in Fig. 7.
First, we place a pet sheet. The pet sheet is wetted with yellow water instead of urine. When the distance sensor ecognizes that the pet has entered the device, it stores the image before the pet entered the device as a background. When the distance sensor recognizes that the pet has gotten off the device as well, it starts image processing using the camera. When a difference of less than a threshold value is observed between the image after the pet gets off the device and the background, the system recognizes it as excrement, automatically starts folding the pet sheet, and disposes of the pet sheet in the trash. In image processing, the threshold for each operation is as follows: for perspective projection, the

Experiment
The practicality of this system was confirmed by experiments.

Image Processing
We confirmed whether the system can recognize excrement appropriately by image processing.
(a) Urine We tested whether urine could be recognized by image processing. A healthy dog urinates 24~41ml per 1kg of body weight per day, and an adult dog urinates 3~4 times per day [10,11] . Since this prototype is designed for small dogs, assuming that a small dog weighs 5kg, the amount of urination per time

4.5cm
18cm would be about 40ml. In order to take into account the change in urine volume, we changed the volume to 20 ml, 30 ml, 40 ml, 50 ml, and 60 ml as shown in Fig. 8. The placement was separated by the folds of the pet sheet as shown in Figure 9.
(b) Feces We tested whether feces could be recognized by image processing. The direction of the feces was changed as shown in Fig. 10 to see if it could be recognized no matter which direction it was facing. In addition, the layout of the feces was divided into 5 x 5 as shown in Fig. 11, taking into account that the feces may ride on the folds of the pet sheet. A total of 36 images were processed, and 100% of the images were recognized.
Urine was processed a total of 36 times. An example is shown in Figure 12. 100 images of feces were processed and 100% of them were recognized. An example is shown in Figure 13.

Overall Operation
We tested whether the system can continuously perform a series of operations from the point where the pet enters the system to the point where the pet sheet is disposed of. All the tests were successful.

Discussion
In this study, we developed a fully automatic pet sheet   automatic folding system. The system was able to automatically perform image processing using a camera, recognize excrement, and perform all operations from folding to disposal of pet sheets. This allows the user to dispose of the pet sheets without touching them. In addition, since excrement can be disposed of even when the owner is not present, the risk of infection by zoonotic diseases can be greatly reduced.
In the future, we aim to add a function to automatically place the pet sheets, and a function to take and save photos of the excrement with the installed camera and attach them to e-mails so that the condition of the excrement can be checked.