{'fraction_non_alphanumeric': 0.030364614465032875, 'fraction_numerical': 0.01123729826658697, 'mean_word_length': 4.374558303886926, 'pattern_counts': {'":': 0, '<': 0, '<?xml version=': 0, '>': 0, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 3, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
Location Recognition in RFID Bookshelves

We consider RFID bookshelves, which detect the location of books using RFID. An RFID bookshelf has the antennas of RFID readers in the boards, and detects the location of an RFID tag attached to a book. However, the accuracy is not good with the experience of the existing system, and sometimes reads the tag of the next or even further area. In this paper, we propose a method to improve the location detection using naive Bayes classifer, and show the experimental result. We obtained 78.6% of F-measure for total 12658 instances, and show the advantage against the straightforward approach of calculating the center of gravity of the read readers. More importantly, we show the performance is less dependent of a change of layouts and a difference of books by leave-1-layout/book-out cross validation. This is favorable for the feasibility in library operation.


Introduction
RFID (Radio Frequency IDentification) is a technology to identify objects and people using small RF devices called RFID tags. RFID is begining to be attached to the books as in Fig. 1 in libraries, and widely used as media of multiple applications, such as automatic check in/out machines, anti-theft gates, inventory management, and automatic book stacks [3].
An RFID bookshelf is a bookshelf with RFID readers embedded. It can detect which area of the bookshelf each book is by using multiple antennas, each of which corresponds to a separated area of the bookshelf.
However, there are cases where some antennas read the area of not in charge, such as a next part, or even further. This can be problematic since the bookshelf only knows that the book exists, but not where. Off course, antennas can be tuned in the stages of development and installation, but there are limitations in physical level adaptation, since they need extra effort which is not feasible in the real situation.
In this paper, we solve the problem of accurate location detection in bookshelves with the system level approach, including pattern classification. At first, we model the problem as a classification problem, and fit it to naive Bayes classifier. Next, we show the experimental result using an RFID Manuscript  bookshelf located in the real library. For the logs obtained, we applied the naive Bayes classifier to improve the location detection. We obtained 78.6% of F-measure for total 12658 instances, and show the advantage against the straightforward approach of calculating the center of gravity of the read readers. More importantly, we show the performance is less dependent of a change of layouts and a difference of books by leave-1-layout/book-out cross validation. This is favorable for the feasibility in library operation.
In the following sections, we introduce RFID bookshelves and their challenges in Sect. 2 and define a problem and show two kinds of solutions: center of gravity and naive Bayes in Sect. 3. Moreover, experimental evaluation is described including the method, result, and discussions in Sect. 4. Finally, we conclude in Sect. 5. Figure 2 is the picture of an RFID bookshelf of 210 cm height and 90 cm width. It has an RFID antenna for each block, and reads all RFID tags within a few minutes. In this section, we firstly describe considerable applications of RFID bookshelves, which can be combined with other RFID applications. Then, we address technical challenges for location detection in RFID bookshelves.

Application
RFID bookshelf can introduce significant advantages to libraries or other types of facilities such as bookstores. It provides data of fine-grained use cases to be used for data mining and/or marketing. It can be also valuable to characterize a set of books from a use pattern, to predict a use patterns Copyright c 2011 The Institute of Electronics, Information and Communication Engineers and to help the users with similar patterns, or the library itself can utilize the patterns for the book selection. Especially, the data will be valuable if the use cases are collected together with the logs of other RFID applications, which leads to lineage data of specific books in the hall.
Furthermore, some of the bookshelves, as shown in Fig. 2 has the ability of telling the user in front of the bookshelves by blinking LED each of which corresponds to the area of detection. Using this, the library can tell the place of a book a user looks for, by attaching LED etc to them and blinking it. Moreover, by connecting to the network, a service of informing to a user's cellular phone by e-mail is possible when the book currently read inside a hall by another has returned to the bookshelf.
Since RFID is being introduced to libraries, RFID bookshelf can be considered as a reasonable extention to existing RFID library systems, in the sense that no extra payment for RFID tags is needed. There are still many libraries which operate with barcode library systems, but unfortunately, they cannot be affordable to achieve this kind of location detection in bookshelves. RFID bookshelves can be a killer application of library RFID.

Challenge
However, during the operation of an RFID bookshelf, we found there are cases where some antennas reads the area of not in charge, such as a next part, or even further. This can be problematic as well as the case where a book is not identified by any readers, since the bookshelf only knows that the book exists, but not where.
Ofcourse, antennas can be tuned in the stages of development and installation. But the case we experienced is after the tuning has been done, and it proofs there are limitation in physical level adaptation, for some reasons such as they need more cost to achieve complete accuracy.
Therefore, in the rest of the paper, we solve the problem of accurate location detection in bookshelves with the system level approach, including pattern classification.

Location Detection in Bookshelves
In this section, we formally define book location detection problem at first. Next, we present a straightforward idea of calcurating the center of gravities, which is shown here as one compared with our proposed method. Then, we show our proposed method to use naive Bayes classifier.

Problem Definition
In real situations, multiple books are being in the bookshelf, but here we formalize the problem for detecting location of a single book. This is because those for multiple books are a trivial extention of detecting single book. We also consider the granularity of detection is each area of antennas, from the constraint of RFID bookshelf.
Let the bookshelf have N areas to detect, each of which are equipped with an antenna. Then, we denote x i = 1 as if an area i detects a book, and x i = 0 otherwise. That is, we can denote an instance of detections as (x 1 , x 2 , · · · , x N ) when a book is located at the area y ∈ {1, · · · , N}.
Here, problem of book location detection is defined as follows:

Definition (Book location detection problem)
N} be a set of RFID readings, and Y = {1, 2, · · · , N} be a set of book locations. For given instances That is, it is a classification problem of learning unknown vectors in the form of (x 1 , x 2 , · · · , x N , y) from a training set consists of instances in the same form.

Center of Gravity (COG) Method
This is to use the geometories of each areas, where the center of gravity (COG) are calculated from the areas where the books are identified, and to answer the nearest location as the location of the book. This method is one of the straightforward ways of calculating location, and actually it does not use the learning data.

Naive Bayes Classifier
In recent years, naive Bayes classifer is often adopted as a powerful method to solve classification problems [1], [2]. Here, we describe how to solve book location detection problem with naive Bayes classifier.
The location detection problem is represented as p(y|x 1 , x 2 , · · · , x N ) for each location y ∈ Y. This value is, To obtain the maximized posteriori, we can have y which maximizes the value as follows: p(x i |y).

Experiment
We did an experiment to examine the performance of the method. Firstly, we collected data for learning and testing. We placed 67 books to the bookshelf composed of 14 blocks, where 10 of them have RFID antennas behind. The books we have chosen are magazines, since they are one of the most required types to be captured the usage in the library, since they are usually prohibited to be checked out, and are not well known how they are used. Table 1 is the layout of each block in the bookshelf. The numbers correspond to the locations of books read by RFID readers. The blocks with 'None' have no readers because of an implementational reason.
We tried two ways of placing books: one is placing books next to another book as usual bookshelf, and the other is displaying a few books with facing the cover, which is often done to display magazines. The ways of each block are shown in Table 1. How the books were located is shown as a histgram of books times read trials by each block in Fig. 3. Here, the histgram were decided with a librarian in order to reflect the real situation of usage. According to it, the highest blocks (No.9 and 10) had few books since it is a high position to take a look at. Additionally, No.5, 6, 7, and 8 also had fewer books since their type is 'display'.
Thus, we oriented to the real usage situations of bookshelves in libraries.

Steps
Upon the books located as above, we changed the layout for 10 times, and tried RFID reading for 10 times for each layout. In a single layout, the books were not moved. It takes a few minutes to read all the blocks, and it becomes the longer if the more books a block has.
After the reading of 10 layouts times 10 repeats, we analyzed the performance of location detection in the following steps: 1. Apply COG method to the result, and obtain the score, which is composed of precisions (the rate of correctly classified instances to a location) and recalls (that of correctly classified instances from an actual location) and F-measure (harmonic mean of precision and recall) for each blocks, and also the mean of them. 2. Generate naive Bayes model by learning, and obtain the score by 10-fold cross validation, which get the score for 10% of the data for the learned model by the rest of data, and repeat it for 10 times for other 10 independent 10%. 10-fold cross validation is effective to remove overfitting. 3. Compare the scores of 1 and 2. Here, the COG method is not good when the gravity vector comes to in-between blocks. In that case, the method must randomly (or uniformly) decide one of adjacent blocks. To avoid this effect for some extent, we compare 1 and 2 by only the difference of the vertical positions of blocks (combine horizontal 2 blocks). 4. Investigate the effect of layout difference by 2 ways.
First, leave-1-layout-out cross validation, which is the same way as 10-fold cross validation, except that the data are devided by single type of layout and the rests. In each fold, single type of layout are applied for a model learned from the rest data. Second, obtain the score of layout-specific learning, which divides the same layout data into learning set and applying set, and their scores are averaged for all layouts. This is done to see the performance of models specialized for each layout.

Investigate the effect of book difference by 2 ways:
leave-1-book-out cross validation and Book-specific learning, which are done in the similar way as leave-1-layout cross validation and layout-specific learning. 6. Investigate the recognition error, including the case where no reader reads an RFID.

Result
After the readings, we obtained 12658 instances and 1862 failures from the total 14520 readings. We performed classification learning upon the instances above. Table 2 is the confusion matrix of instances for each classified or original location by the COG method. Table 3 is the scores of it for each blocks and weighted means. As mentioned in Sect. 4.2, blocks are packed by horisontal pairs. From the table, the F-measure mean is 86.4%. Table 5 is the confusion matrix of naive Bayes method. Table 6 is the scores of it for each blocks and weighted means.     To compare with COG method, we pack the result of blocks of the same hight, and show in Table 4. From the table, the F-measure mean of the packed score is 88.9%. Comparing this to COG score, naive Bayes method is only 2.5% better. However, the naive Bayes method has an ability of recognizing a block from another of the same height. If we force to divide the packed score in Table 2, the scores will decrease to about the half. Table 7 is the scores of layout-specific learning for each blocks and weighted means. Table 8 is the scores of leave-1-layout-out cross validation for each blocks and weighted means. Table 9 is the scores of book-specific learning for each blocks and weighted means. Table 10 is the scores of leave-1-book-out cross validation for each blocks and weighted means.

Effect of Book Layouts and Books
The summary of Table 6-9 is shown in Table 11. From Table 11, although all the F-measure are worse than 10fold cross validation, they are at most 7.9% worse in bookspecific-learning.
For the effect of layout, recall decreases for layoutspecific learning, while precision is better. As a result, the Fmeasure becomes 71.2%. That of leave-1-layout-out cross validation is 75.1%, which is a bit worse than 10-fold cross validation.
As for the effect of books, book-specific learning is 72.9% for the precision, but the recall is 69.7%. As a result, the F-measure is 70.7%. That of leave-1-out cross validation is 71.7%.

Read Errors
Finally, we show the distribution of read errors, where no reader read a tag. Figure 4 is the histgram of read errors by blocks. Since block 1 to block 4 has many books, it is natural that they have many errors. On the otherhand, block 6 and 8 has relatively lot errors compared to the histgram of Fig. 3. Figure 5 is the histgram of errors by book IDs.

COG v.s. Naive Bayes Method
Comparing Table 3 and Table 4, the scores are not explicitly different. However, naive Bayes method has an advantage in the sense that it can recognize more accurate locations as shown with reasonable score in Table 6, while COG method has a shortcoming that it becomes undecidable when the location of gravity becomes the border of multiple blocks.

Effect of Book Layouts and Books
The score of naive Bayes method keeps relatively higher score even for both leave-1-layout/book cross validation. It implies that the learned model is still applicable to a new unknown layout or book. This result provides great advantage in the real application, since library staff do not have to re-train naive Bayes model when a new book is introduced, or the layout is changed by a librarian or by a user.
On the other hand, the models by both layout/bookspecific learning have worse scores. This can be considered because the specialization to a layout or a book can not contribute to recognition performance, and even has somewhat bad effect.

Related Work
As for detecting locations with RF, there are a lot of work for indoor location system of an RF device [4]- [10]. There is also a work to use bayesian filtering for location detection [11]. However, most of these approaches measure the received signal strength (RSS), or using a special protocol for location detection to detect the location even within the range of a single antenna. These might be helpful to improve RFID bookshelf, but they need extra functionality which is not applicable to existing systems. Our first research goal is to qualify the effect of reading from multiple antennas, and different from that of indoor location systems.
Another approach to detect the book in the bookshelf is image processing. [12] does the detection of book boundaries located on a bookshelf. This approach helps to detect the location of books if each book can be identified, but this is still a complementary way, since image processing has a disadvantage that visual obstacles or dark light keeps the book from detection.
Over all, there are few work on challenging for accurate location detection in RFID bookshelves.

Conclusion
In this paper, we proposed a method to improve the location detection using naive Bayes classier, and show the experimental result. The result showed the reasonable performance with the method, and, more importantly, the performance was shown to be less dependent of layouts and books, which is favorable for library operation. One of the future work is tackle with real time detection, since currently the detection result comes only after reading through all antennas.