Paper biological risk detection through deep learning and fuzzy system

Given the recent events worldwide due to viral diseases that affect human health, automatic monitoring systems are one of the strong points of research that has gained strength, where the detection of biohazardous waste of a sanitary nature is highlighted related to viral diseases stands out. It is essential in this field to generate developments aimed at saving lives, where robotic systems can operate as assistants in various fields. In this work an artificial intelligence algorithm based on two stages is presented, one is the recognition of paper debris using a ResNet-50, chosen for its object localization capacity, and the other is a fuzzy inference system for the generation of alarm states due to biological risk by such debris, where fuzzy logic helps to establish a model for a non-predictive system as the one exposed. A biohazard detection algorithm for paper waste is described, oriented to operate on an assistive robot in a residential environment. The training parameters of the network, which achieve 100% accuracy with confidence levels between 82% for very small waste and 100% in direct view, are presented. Timing cycles are established for validation of the exposure time of the waste, where through the fuzzy system, risk alarms are generated, which allows establishing a system with an average reliability of 98%.


INTRODUCTION
Technological tools are nowadays a means for the automatic detection of biohazards [1], [2] as well as for the analysis of waste such as plastic paper or metal that may involve the same type of risk [3]. Identifying, locating, and detecting biohazards is of utmost importance to safeguard human lives [4]. Among these identification methods, those based on deep learning stand out, for example, employed in [5] to detect plastic waste in rivers and in [6] to develop an intelligent waste management system, both based on deep learning through convolutional networks (CNN) [7], which extends to the detection of biological risks [8].
Deep learning garbage detection has shown a high level of efficiency for this task as shown in [9]- [11]. One of the CNN-based algorithms that stands out for object detection and localization in an image are region-based networks [12], which have been widely used in various fields [13]- [17]. Specifically, no work was found in the state of the art that employs networks of this type to identify paper residues as biological waste, which are common in stages of influenza or influenza virus disease, of very high propagation in humans. In this paper we present the training of a region-based network, type faster regionbased CNN (R-CNN), to identify and locate paper waste in residential environments. Similar applications used for wear location and wear mechanism identification through faster R-CNN [18], shows the relevance of this network in this type of tasks.
Fuzzy systems have been used as a decision-making strategy in multiple fields [19]- [22], for example, decision-making in cleaning robots regarding the shape, size, and distribution of garbage [23], [24], with high effectiveness. Fuzzy controllers are another important application on developments like robotic navigation systems [25], or specific task like improve the contact force in systems of pantograph-catenary to deliver power to a train [26]. This work used fuzzy logic to design a model for a non-predictive system to allow establishes a risk level for accumulation or temporal duration of the paper waste in situ, employing to the task of identification and localization convolutional networks based on regions. This allows contributing to the state of the art an algorithm to identify biological risks by paper waste focused on a residential environment, based on the waste originated by home care diseases such as influenza [27], where the risks from this type of biological waste have increased due to the covid pandemic, not being previously treated.
The article is structured in four sections. The present introduction that refers to the state of the art, the second section that exposes the methods and materials in two subsections, the training of the network and the fuzzy system. The third section presents the results and their analysis. Finally, the fourth section presents the conclusions reached.

METHOD
The detection of paper waste implies being able to visually identify and locate them in space and has temporal implications, since the longer the time increases the probability of bacterial reproduction. To perform the automatic detection of biohazard from paper waste, a deep learning network based on region proposal network (RPN) like the faster R-CNN but using a ResNet-50 architecture [28], is trained by transfer learning. This allows the identification and localization of paper residues within the scene. The algorithm is oriented to work later an assistive robot, which will traverse a residential environment, i.e., areas such as a bathroom, living room, bedroom, and kitchen. The application scheme is oriented to develop an algorithm based on the flowchart illustrated in Figure 1. It was determined that the robot will generate inspection tours through the determined areas every 6 hours, which will be called an inspection cycle, each time it detects the risk of paper waste, the COUNT variable will be increased, which corresponds to an array of 4 elements, where each one associates each of the inspection areas. To generate the biohazard alarm, a fuzzy inference algorithm is used based on the area where the waste is located employing ResNet-50 and the time spent in this area based on the number of cycles in which it was found. In the following, both parts of the algorithm, the training of the network and the fuzzy inference system, are presented.

Detection of paper waste
For training, a database of 200 images of paper waste in the four environments (50 for each one) is used. Data augmentation process is applied using reflection operations on the vertical axis and translation, obtaining 600 images in total. The 80% of augmented database are used for training and the remaining 20% for validation. A sample of the initial database used is shown in Figure 2. The training of the network was performed at a learning rate of 0001, for 15 30, 30 and 50 epochs with 250, 1,140 and 7,210 iterations, respectively. Each training achieves 100% accuracy, with times ranging from 50 min to 3 hours on a 2.80 GHz Intel Core i7 computer with NVIDIA Gforce GTX 1050 8GB GPU. Figure 3 illustrates the accuracy versus recall plots obtained for each case, where for the 50 epochs (image on the right) a better balance between accuracy and recall is evidenced, where an accuracy value of 0.9 is preserved up to a recall of 0.45, much better than in the two previous cases.  Figure 4 shows the result of the learning of the network for the detection of paper debris. Figure 4 on the left shows a case of paper detection on non-uniform surfaces for a carpet, which does not significantly alter the confidence level of the detection, which is 0.9. The central part of Figure 4 shows the recognition in an environment with a variety of objects, some even similar to waste, however, the detection is effectively given with a high level of confidence. In the case of the detection of multiple debris, as shown in Figure 4 on the right, an adequate detection is observed where the level of confidence begins to decrease to low values, in this case, the lowest value recorded was 82%.

Biohazard alarm
Given the nonlinearity of the system, because it is not possible to predict when a paper will be found or in what place, a fuzzy inference model is used for this type of situation, where the mathematical model of the system is not viable [29], [30]. Thus, there are two inputs, one associated with the time measured in cycles and the other associated with the size of the paper detection area, where the output is determined by the level of risk involved in paper waste and the time it is kept in the residential environment. Figure 5 illustrates the fuzzy scheme implemented. The membership's functions were determined iteratively as shown in Figure 6. In general, a gradual change was required where both the beginning and the end present, a delay of reaction for the beginning, and saturation for the end of the universe of discourse, which limited the actions of alarmed state. For the time input, as seen in Figure 6(a), three membership functions are established, each with linguistic labels of low, medium and high, to denote the temporal perception of the paper residue at the site. For this case, the universe of discourse is established in 10 cycles, where after the 8 th cycle (48 hours or 2 days) a high risk predominates. This scheme is determined given that at the residential level it is common to perform cleaning actions, which involve waste collection, at least once a day.
The area input, in Figure 6(b), is determined by the bounding box of the paper detection by the ResNet, the larger it is, the more paper volume, which is, in turn, proportional to the risk involved. Given that the size of the input images to the network is 224×224 pixels, we have that, for the position that the camera will have on the robot to recognize the area, two-thirds of the scene without occlusion is required, which corresponds to an area of 75 pixels on each side to be gradually occluded by debris. Three membership functions are established for this input, each with linguistic labels of small, medium and big, to denote the size of the area covered by paper debris. The universe of discourse is set to 80 pixels, since this value is close to one-third of the dimensions of the scene, as already mentioned.
Sometimes more than one paper is found in the scene, as shown in Figure 7. In such cases each of the areas is summed up. If the papers are very close together, it is possible that the network will detect them as one and in this case the area will automatically involve both of them.
The output of the fuzzy system corresponds to the associated biological risk and is determined in a universe of discourse from 0 to 100%, as shown in Figure 8 The rule base is presented in Table 1, which is constructed in a general way when the paper biohazard is detected, where symmetry is generated in the system response where the three output states are associated proportionally to each input combination. In essence, the system remains below high alarm until 6 cycles, i.e., one and a half days. As mentioned, referring to the fact that at the residential level there are usually daily cleaning days, resulting in the collection of waste in at least four periods a day if a risky situation arises, for example, due to illness. Similarly, Figure 9 shows the graph of the behavior of the fuzzy system, showing the predominance of the medium state, since the idea is to prevent the accumulation of paper waste. The system is nonlinear as observed, given the behavior established in the input and output membership functions. Where more than 8 cycles should generate a high alarm state regardless of whether or not there is an accumulation of paper waste. Figure 10 illustrates the final scheme used in the evaluation of the biological risk model developed. The input corresponds to the video capture of the camera associated with the robot. This enters the classifier by ResNet, whose output is taken by the fuzzy inference system. According to the defuzzification associated with Figure 9, will activate each alarm indication light. It is necessary that in the variable of the bounding box the value of the area or sum of areas of each paper recognition is delivered.

RESULTS AND DISCUSSION
Through simulations of the algorithm in the environment shown in Figure 10, using videos of the different zones at 30 fps, the performance was evaluated, and the results shown in Table 2 were obtained. 100 wastes paper samples were used in different positions and groupings, which were kept in the same positions during the different cycles that the inspection lasts divided in 10, i.e., 24 hours were represented by 2.4 hours and so on. To facilitate the evaluation times of the algorithm up to 48 hours, the video was repeated every cycle, i.e., every 36 minutes in the simulation. For the "low" alarm case, there were 99 true positives (TP) and one false positive that was due to erroneous recognition of paper where it did not exist. For the "medium" alarm, there were 97 true positives (TP) and two false positives that were due to erroneous recognition of paper where it did not exist. During the medium stay, which lasted 3 cycles, only two of the false positives occurred once out of the three times that the algorithm inspected the same area in this alarm state, the other two times were not detected. For the third false positive, a reflection of light from a light bulb on a laminate floor was mistaken for paper waste, so the error continued. For the "high" alarm case, there were 98 true positives (TP) and two false positives that were due to erroneous recognition of paper where it did not exist, plus the previous light reflection. It is also relevant to mention that initially triangular membership functions had been established for the input 'area', as shown on the left of Figure 11, so that high-risk alarm levels were not achieved, which was solved by using the trapezoidal membership functions illustrated on the right. The lower part of each fuzzy set shows the activations derived from the rule base and the defuzzification value, where the center of gravity varies significantly for the same input values (thick red line in the last box). Figure 11. Graphical response of the fuzzy system The results of Table 2 were validated through a virtual environment where the robot moves in the cycles mentioned by the residential environment. Figure 12 illustrates on the right the simulated environment and on the left the camera's view of the robot navigating in the test environment. The effectiveness of the proposed method is validated in the correct identification of the paper residue by the network and the generation of alerts recorded by the diffuse system used.

CONCLUSION
The training of the network was iterative, where the best combination of features of the network was exposed, which for detection by regions exhibits a better accuracy versus recall ratio. This allows us to conclude that, by obtaining a high accuracy initially, the classification will be very exclusive, which is necessary to avoid false positives, which decreases with the increase of the recall allows finding paper debris in different positions and shapes, surely not trained. Given the fast convergence of the fuzzy inference system and the low computational cost involved, it was concluded that it is beneficial for paper waste detection to use the fuzzy logic algorithm to reduce the decision time, mainly at the time of being embedded for the robotic control. The integration of deep learning techniques and fuzzy systems in a paper waste biohazard detection application leads to the conclusion that the automation of this type of hazard is feasible without the direct intervention of human control and/or supervision.