The Practice of a Method of Self-Study Students Counting in Classrooms Based on Head Detection in Colleges and Universities

Abstract

In order to solve the problem that it is difficult for students to find self-study classrooms because of the limited classroom resources, combined with the current situation of informatization in colleges and universities, a feasible method of students counting in classrooms based on head detection is proposed. This method first collects the scene images in the classroom at regular intervals based on the existing examination monitoring system, and then uses the offline trained AdaBoost cascade detector to detect the head candidate region in the images. Then, the trained CNN-SVM model is used to further identify the head, and finally the identification results are processed and the number of students in the classrooms is counted. The test and practice show that the query system for the idle situation of self-study classrooms constructed by coordinating the classroom seat capacity, classroom scheduling data and the students counting in the classroom based on the above method can easily query the current crowded degree of the students in the classrooms, which plays a good guiding role for students to find self-study classrooms. The method has strong reference and promotion significance for solving similar problems in other universities.

Share and Cite:

Liu, M. and Yu, L. (2022) The Practice of a Method of Self-Study Students Counting in Classrooms Based on Head Detection in Colleges and Universities. Journal of Computer and Communications, 10, 51-62. doi: 10.4236/jcc.2022.104005.

1. Introduction

Many colleges and universities have such problems that there are not sufficient dedicated self-study classrooms for students due to the shortage of classrooms. Usually, Students study by themselves in the spare classrooms that are not occupied by courses, meetings or activities. In this case, students hope to be able to query whether a classroom is now occupied in real time through an information system, if not occupied, and then can query the current crowded degree of classrooms, so as to decide which classroom to study in. At present, many colleges and universities in China have developed the classroom inquiry system which summarizes the course scheduling information and classroom borrowing information, students can query whether the classroom is occupied through PC and mobile terminals. However, according to the author’s investigation, few colleges and universities have actually solved the problem that students hope to query the crowded degree of the classrooms. The classroom resource of China University of Geosciences (Beijing) is very tight, and students constantly put forward the need to query the current crowded degree of self-study classrooms. It is urgent to solve this problem.

The key to solving the problem of presenting the crowded degree of self-study classroom is to solve the problem of students counting in the classroom. With the number of students in the classroom, the crowded degree of the classroom can be calculated easily according to the number of the seats in the classroom. As for the students counting in classrooms, there are mainly the following methods.

1) Students counting based on pressure sensing device

Install a pressure sensing device on the classroom seat, judge whether there is a person in the seat by sensing whether there is pressure through the pressure sensor, and then transmit the signal to the single chip microcomputer for information processing. Finally, the statistical result is transmitted to the application server, and then the personal computers or the mobile terminals obtain the number of students in the classroom by accessing the application server [1] [2]. The method needs to install pressure sensing devices on the seats of all classrooms, the investment cost is relatively high, and the management and maintenance cost of classroom seats will increase accordingly.

2) Students counting based on RFID Technology

Each student carries an RFID (Radio Frequency Identification) card with a unique code. The classroom is equipped with an RFID reader covering the whole area. Within a certain distance range, the reader can detect the identification card signal and transmit the detected basic information of the identification card to the application server. The application server matches the detected information with the information of students in the database server, then the number of students in the classroom can be calculated [3] [4]. This method needs to equip all students with RFID cards and purchase supporting card readers. The investment cost is high, and students may lose or forget to carry RFID cards, which will lead to inaccurate statistics of the number of students in the classroom.

3) Students counting based on infrared photoelectric sensor

An infrared photoelectric sensing device integrating transmitting and receiving is installed at the door of the classroom to detect the object by blocking or reflecting the infrared beam by the detected object. When there are people in and out of the classroom, the light emitted by the transmitter is blocked and returns to the receiver, and then the optical signal is converted into an electrical signal inside the receiver. After processing the electrical signal, the low-level signal is output. On the contrary, when there are no people in and out, the high-level signal is output. The level signal is transmitted to the single chip microcomputer, which processes the signal and counts, and the counting results are transmitted to the application server in the background [5]. This method requires the purchase of infrared photoelectric sensing devices and supporting single chip microcomputers for each classroom, and additional continuous operation and maintenance management costs need to be invested during operation.

4) Students counting based on classroom wireless Access Point

With the continuous improvement of information technology in colleges and universities, wireless network has gradually become an indispensable part of College Students’ study and life. At present, the teaching area and living area of domestic university campuses have basically covered the campus wireless network, and almost every classroom is equipped with wireless Access Point (AP). After students enter the classroom, their wireless terminals such as mobile phones, pads, laptops, etc. will automatically access the campus wireless network through wireless AP. By counting the number of wireless terminals connected to the wireless AP in the classroom, we can roughly know the number of people in the classroom. The advantage of this method is that it uses the existing wireless network equipment and does not need to buy additional new equipment, so it does not have large investment cost. However, after the actual test it is found that there is a large error between the number of students calculated by this method and the actual number of students in the classroom. The main reasons for the error are as follows: first, a student may bring multiple wireless terminals at the same time; second, the wireless AP connected to the mobile terminals carried by the students after entering the classroom may be the wireless AP in the next classroom. This method is more suitable for large areas such as restaurants and squares in the campus to calculate the distribution of population density or the distribution of crowd aggregation points [6] [7].

5) Students counting based on image recognition

In recent years, the image-based population statistics method has been deeply studied and widely used [8] [9]. Due to the need for standardized examination room, most classrooms in China University of Geosciences (Beijing) have installed examination monitoring system. We can make use of the existing examination video monitoring system at ordinary times. We can capture the video pictures of the classroom regularly, and study the character recognition algorithm in the state of students’ self-study, so as to count the number of students in the classroom when the pictures are captured.

Based on the above five methods, the students counting based on image recognition is more in line with the actual situation of China University of Geosciences (Beijing), which will not increase too much cost investment and the statistical results will not have too much error. Therefore, we have conducted in-depth research and practice on this method.

2. Student Counting Based on Head Detection

The key of image-based population statistics is to describe the human features and determine the standard of human feature recognition. According to the different detection objects, the commonly used population statistics methods include: the method based on head detection [10] [11] [12], the method based on head and shoulder detection [13] [14], the method based on face detection [15] [16], the method based on head and face detection [17], the method based on body contour detection [18] [19], the method based on skin color detection [20]. In this paper, the scene of the statistics of the number of students is the self-study students in the classroom. In the self-study scene, most of the students are in the low head state, and the face is not easy to be detected, while the head is easy to be detected in the bare state. Considering that the classroom population statistics in this article does not need to be too accurate, as long as it can guide students to find the self-study classroom with free seats, we choose the method based on head detection and put it into practice.

2.1. Algorithm Introduction

AdaBoost algorithm can upgrade the weak classifier slightly better than random guess to a strong classifier with high classification accuracy, which provides new ideas and new methods for the design of learning algorithm [21]. The key idea is to train multiple weak classifiers for the same training set, and finally integrate these weak classifiers to form the final strong classifier. AdaBoost algorithm mainly changes the distribution of data samples and modifies the weights of samples in time according to whether the classification results of each sample in the sample set are correct in each training process. The new data set with modified weights is trained again to obtain a new weak classifier. Finally, through some strategy, such as voting weighting, the obtained weak classifiers are integrated to generate the final decision classifier [22]. At present, there are a large number of face detection algorithms, among which AdaBoost algorithm is a more practical algorithm [15] [23].

CNN (Convolutional Neural Networks) is a kind of feedforward neural network with convolution calculation and depth structure. It is a famous deep learning architecture. CNN has been widely used in target detection in recent years. The main idea of target detection based on CNN is to judge whether the sampling window is a potential object by rapid measurement, and then transfer the potential objects to more complex detectors to determine whether they are background or specific objects [24]. R-CNN (Region based CNN) is a famous case that successfully applies deep learning to target detection. It realizes target detection based on CNN, linear regression, SVM (Support Vector Machine) and other algorithms [24] [25] [26].

2.2. Technical Route

2.2.1. General Idea

Figure 1 shows the scene of students’ self-study in the classroom. As can be seen from Figure 1, the perspective of images taken by cameras in different classrooms is quite different, and the head with a far perspective is low-resolution. At the same time, due to the differences in image perspectives, the sizes of human heads are different, which brings difficulties to human head detection. Especially when the students are far away from the camera, the head detection becomes more difficult.

Based on the above, the AdaBoost and CNN algorithms are comprehensively used for students counting in classrooms. Firstly, the cascade AdaBoost head detection algorithm is used to detect head regions or similar head regions. Then the CNN classifier is used to exclude false targets similar to head regions and improve the accuracy. Finally, the number of students in the classroom is determined by the number of detected heads. This method makes the system have strong robustness in bad scenes such as low image resolution, serious crowd occlusion and large viewing angle difference.

2.2.2. Implementation Method

The students counting based on head detection is shown in Figure 2, which mainly includes two parts: offline training and online detection. Offline training is divided into two stages, the first offline training stage and the second offline training stage. The first offline training stage is to train the AdaBoost cascade detector. In this stage, a large number of images from students’ self-study scene in classrooms are collected, and then the positive samples (effective head images) and negative samples (background and other non-head images) are manually marked in these images to form the samples always pass as much as possible. The second off-line training stage is to train the CNN-SVM classifier. Firstly, the cascade head detector generated by the first offline training is used to detect the original training data set, and the detection results are extracted from the image. The detection results are artificially divided into head images and non-head images, which construct a new data set. This paper defines the new data set as Sample Dataset 2. Based on the Sample Dataset 2, a CNN-SVM classification model for distinguishing human head and non-human head is trained by extracting the features of the CNN full connection layer of the sample.

Figure 1. Example of classroom scenes for students’ self-study.

Figure 2. The method of students counting in classrooms based on head detection.

2.2.3. About Sample Datasets

Sample data sets are collected from the actual classroom video surveillance system. In order to train the AdaBoost cascade detector, 30 classrooms distributed in three teaching buildings were randomly selected to capture images in different self-study periods, and the original training image was formed. According to certain specifications and standards, 12,350 positive samples of head images were manually annotated in the original training image. 15,800 negative samples of non-head images from empty classrooms and the Internet were collected. Some positive samples and negative samples are shown in Figure 3(a) and Figure 3(b) respectively. These positive and negative samples are constructed into Sample Dataset 1 for training the Adaboost cascade detector.

After training the AdaBoost cascade detector, the original training images are detected by the trained AdaBoost cascade detector. Then the correct results of head detection are selected as positive samples, and the incorrect results are selected as negative samples. A new sample dataset 2 is constructed by these positive and negative samples to train the CNN-SVM classifier. The sample dataset 2 contains 4892 positive samples and 3205 negative samples. Some positive and negative samples are shown in Figure 3(c) and Figure 3(d).

3. Case Analysis

The examination video surveillance system currently operated by China University

Figure 3. Partial samples.

of Geosciences (Beijing) covers 104 classrooms and uses infrared high-definition hemispheric cameras. Using the existing classroom video surveillance system and based on the above technical methods, the information system of students counting in classrooms is developed. According to the number of students and the number of seats in the classroom, the current crowded degree of the classroom is calculated. Students can query the crowded degree of each classroom through personal computers and mobile terminals, which is convenient for them to quickly find the classroom in which they can be self-study.

3.1. System Operating Environment

The hardware and software configuration of the servers running the system is shown in Table 1.

3.2. Time Strategy of Image Acquisition

After testing, for 104 classrooms, it takes about 3 minutes and 20 seconds for the students counting system to collect images and analyze and calculate the number of students in each classroom. The strategy of data acquisition and update is set

Table 1. Software and hardware configuration of classroom students counting system.

as follows: the classroom students counting system collects the classroom monitoring image every 4 minutes for analysis and calculation, and pushes the students number to the intermediate database of the classroom status query system based on Web. The classroom status query system takes data from the intermediate database every 1 minute and calculate the occupancy of classroom seats, and then displays it on the web page. Therefore, the classroom seat occupancy inquired by students is updated every 5 minutes at most, which basically meets the needs of students.

3.3. Trial Operation Result

Randomly select some classrooms to count the number of students in the classroom manually and automatically at the same time in the morning and afternoon respectively to verify the accuracy of the classroom students counting system. The trial operation data are shown in Table 2. The data show that the error of the classroom students counting system based on image head detection is basically within 10%, which can meet the needs of querying the crowded degree of classrooms.

3.4. Actual Operation Effect

The classroom status query system based on head detection of China University of Geosciences (Beijing) has been officially running for more than four months and is running well. It can give good guidance for students to find self-study classrooms. Figure 4 is the web page of the classroom status query system on mobile terminals. The gray icon ■ indicates that the classroom has classes or is borrowed during this period and cannot be used for self-study; the blue icon ■ indicates that the classroom is not occupied during this period, and self-study is allowed in it; the green icon ■ means that the classroom is not occupied during this period, and self-study is allowed, and the number of students accounts for less than 50% of the number of seats in the classroom, so which is relatively loose; the orange icon ■ indicates that the classroom is allowed to self-study during this period, and the number of students accounts for 50% - 80% of the number of seats in the classroom, so which is relatively crowded; the red icon ■ means that the classroom is allowed to self-study during this period, and the number of students accounts for more than 80% of the number of seats in the classroom, so which is very crowded.

Figure 4. The web page of the classroom status query system on mobile terminals.

Table 2. Comparison between manual counting and system automatic counting.

4. Summary

In general, the classroom status query system based on head detection method for students counting in this paper has low investment cost and follow-up system operation and maintenance management is more convenient, which has been well practiced in China University of Geosciences (Beijing). At present, formal universities in China have built the examination video monitoring system, which can be reused. During the examination, the video monitoring system is enabled and the examination situation of each classroom can be mastered in real time through the video monitoring screen; during the non-examination period, the video monitoring system is also enabled. By regularly collecting the monitoring images and using the head detection method to calculate the number of students in classrooms, the classroom status query system is realized to provide more accurate information service for students. Therefore, the practice of China University of Geosciences (Beijing) has strong popularization significance in colleges and universities.

Acknowledgements

The author thanks the information network center of China University of Geosciences (Beijing) for providing a good working environment and all colleagues who provide help.

Conflicts of Interest

The authors declare no conflicts of interest regarding the publication of this paper.

References

[1] Bao, L.L. (2021) Student Attendance Seat and Its System in Multimedia Classroom. CN Patent No. CN201820492904.4.
[2] Shao, G.C., Cui, J.T. and Xu, L. (2015) A Real-Time Query System for Empty Seats In University Self-study Classrooms. CN Patent No. CN201510176115.0.
[3] Chen, X.L. (2017) The Design and Implementation of the Intelligent Classroom Management System Based on the RFID. M.D. Thesis, Jiangsu University, Zhenjiang.
[4] Chen, J.M., Zhang, B.S. and Peng, F.C. (2020) Design of Intelligent Attendance Checking System Based on RFID and Single Chip Microcomputer. Electronic Test, 19, 14-17.
[5] Qin, L.J. and Liu, H. (2021) A Low-Cost Monitoring System for Indoor Number of People. Internet of Things Technologies, 8, 12-14.
[6] An, Y., Li, J.H. and Wang, H.J. (2021) Regional Population Statistics and Contact Tracking Method Based on Wireless Log under the Background of epidemic Prevention and Control. The Chinese Journal of ICT in Education, 1, 75-79.
[7] Ding, S.Y., Guo, B. and Xin, T. (2019) WiCount: A Crowd Counting Method Based on WiFi Channel State Information. Computer Science, 11, 297-303.
[8] Fan, X.X. (2018) A Survey of Image-Based Person Counting Methods. Wireless Internet Technology, 12, 98-101.
[9] Meng, J.F., Wang, J.J. and Qin, Y.Y. (2015) Classroom Population Statistics System Based on Image Recognition. CN Patent No. CN201510246804.4.
[10] Peng, Y. (2019) Research on Head Detection Algorithm for Indoor Scene. M.D. Thesis, Harbin Institute of Technology, Harbin.
[11] Gao, C.Q., Li, P., Zhang, Y.J., Liu, J. and Wang, L. (2016) People Counting Based on Head Detection Combining Adaboost and CNN in Crowded Surveillance Environment. Neurocomputing, 208, 108-116.
https://doi.org/10.1016/j.neucom.2016.01.097
[12] Ma, T.J., Ji, Q.G. and Li, N. (2018) Scene Invariant Crowd Counting Using Multiscales Head Detection in Video Surveillance. IET Image Processing, 12, 2258-2263.
https://doi.org/10.1049/iet-ipr.2018.5368
[13] Zhou, X. (2017) Pedestrian Head and Shoulders Detection Method Based on Improved Vi Be and Machine Learning. M.D. Thesis, East China Jiaotong University, Nanchang.
[14] Luo, J., Wang, J.Q., Xu, H.Z. and Lu, H.Q. (2015) A Real-Time People Counting Approach in Indoor Environment. 2015 International Conference on Multimedia Modeling, Sydney, 5-7 January 2015, 214-223.
https://doi.org/10.1007/978-3-319-14445-0_19
[15] Lan, S.K. (2021) Face Detection Based on AdaBoost. Computer and Information Technology, 2, 16-19.
[16] Thilagavathi, B., Suthendran, K. and Srujanraju, K. (2021) Evaluating the AdaBoost Algorithm for Biometric-Based Face Recognition. In: Reddy, K.A., Devi, B.R., George, B. and Raju, K.S., Eds., Data Engineering and Communication Technology, Springer, Singapore, Vol. 63, 669-678.
https://doi.org/10.1007/978-981-16-0081-4_67
[17] Ha, T.-O., Tran, H.-N., Nguyen, H.-Q., Tran, T.-H., Nguyen, P.-D., Doan, H.-G., et al. (2021) Improvement of People Counting by Pairing Head and Face Detections from Still Images. 2021 International Conference on Multimedia Analysis and Pattern Recognition (MAPR), Hanoi, 15-16 October 2021, 1-6.
https://doi.org/10.1109/MAPR53640.2021.9585270
[18] Yang, L. (2021) A Classroom Population Statistics Algorithm Based on Human Contour. Acta Metrologica Sinica, 42, 178-183.
[19] Zhang, Y., Kuang, Y. and Wang, M. (2020) Human Contour Detection Algorithm Based on OpenCV. Computer Technology and Development, 30, 81-85.
[20] Zhang, K., Wang, Y.D., Li, W.Y., Li, C.L. and Lei, Z.C. (2021) Research progress of adaptive dynamic skin color detection technology. Chinese Journal of Liquid Crystals and Displays, 36, 293-304.
https://doi.org/10.37188/CJLCD.2020-0196
[21] Cao, Y., Miao, Q.G., Liu, J.C. and Gao, L. (2013) Advance and Prospects of AdaBoost Algorithm. Acta Automatica Sinica, 39, 745-758.
https://doi.org/10.1016/S1874-1029(13)60052-X
[22] Xu, J. and Zhang, H.T. (2014) Design and Application of Adaboost Algorithm Classifier. Journal of Sichuan University of Science & Engineering (Natural Science Edition), 27, 28-31.
[23] Feng, X.J., Ma, M.D. and Wang, D.Y. (2019) Face Detection System Based on Improved Adaboost Algorithm. Computer Technology and Development, 3, 89-92.
[24] Gu, J.X., Wang, Z., Kuen, J., Ma, L., Shahroudy, A., Shuai, B., et al. (2018) Recent Advances in Convolutional Neural Networks. Pattern Recognition, 77, 354-377.
https://doi.org/10.1016/j.patcog.2017.10.013
[25] Ji, X.S. and Wu, F. (2018) Head Detection Using Hybrid Convolution Neural Networks. Chinese High Technology Letters, 4, 313-319.
[26] Jiménez-Bravo, D.M., Mutombo, P.M., Braem, B. and Marquez-Barja, J.M. (2020) Applying Faster R-CNN in Extremely Low-Resolution Thermal Images for People Detection. 2020 IEEE/ACM 24th International Symposium on Distributed Simulation and Real Time Applications (DS-RT), Prague, 14-16 September 2020, 1-4.
https://doi.org/10.1109/DS-RT50469.2020.9213609

Copyright © 2024 by authors and Scientific Research Publishing Inc.

Creative Commons License

This work and the related PDF file are licensed under a Creative Commons Attribution 4.0 International License.