Double-platform university classroom self-study query method based on YOLOV5s
By using the YOLOV5s model to detect the number of people in college classrooms and processing data in MySQL database, it provides dual-platform equipment to query the number of people in the self-study classroom, solving the problem that students find it difficult to quickly find the self-study space, and improving the classroom resource utilization and detection accuracy.
Patent Information
- Application Number
- CN202411598216.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-11-11
- Publication Date
- 2025-02-28
AI Technical Summary
The existing technology is difficult to effectively manage university classroom resources, making it difficult for students to quickly find suitable self-study spaces, affecting their learning enthusiasm and efficiency.
The dual-platform self-study query method for college classrooms based on YOLOV5s is used to perform real-time number of people detection by using the YOLOV5s model on the server side, and the data is processed using MySQL database and passed to devices on Android or Windows platforms, providing quick query of the number of people in the self-study classroom.
Based on the existing classroom monitoring, it quickly checks the number of people in the self-study classroom, and improves the classroom resource utilization rate. The lightweight YOLOV5s algorithm has high detection accuracy and low resource occupation. It can call multiple cameras without affecting the use of other cameras.
Smart Images

Figure CN119537436A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of computer vision technology, and in particular to a dual-platform university classroom self-study query method based on YOLOV5s. Background Art
[0002] College classrooms are important places for students to study, but with the expansion of colleges and universities and the change of teaching modes, classroom resources are becoming increasingly scarce relative to the number of students. As students' demand for learning and self-improvement continues to increase, students want to study but cannot find a "suitable free study room". In the digital age, the rapid development of Internet technology and artificial intelligence technology, the portability and popularity of mobile devices, have made various APPs an indispensable tool in people's lives, especially young people. How to use the existing monitoring resources in the classroom, use modern Internet technology and artificial intelligence technology to effectively manage classroom resources, improve the utilization rate of classroom resources, and facilitate students to quickly find a satisfactory study space on campus, thereby improving students' learning enthusiasm and learning efficiency, has become an important issue.
[0003] YOLO has attracted widespread attention due to its high efficiency and accuracy. The core idea of YOLO is to transform the target detection problem into a regression problem, and directly predict the bounding box and category probability on the entire image through a single neural network model. Compared with traditional region-based methods (such as the R-CNN series), YOLO has significantly improved in speed because it does not need to run multiple classifiers or region proposal generators on the image. Therefore, the use of the YOLO target detection algorithm for real-time human detection technology is not only faster than traditional image target detection algorithms, but also significantly improved in accuracy. However, the YOLO target detection algorithm uses a single thread to call the real-time camera, which has become a challenging problem for how to call multiple cameras simultaneously in the self-study system of college classrooms. Summary of the invention
[0004] The technical problem to be solved by the present invention is to overcome the shortcomings in the prior art and provide a dual-platform college classroom self-study query method based on YOLOV5s. On the basis of existing classroom monitoring, data processing is performed in the server / backend based on YOLOV5s and MySQL database, and the data is transmitted to the display of a device installed with an Android or Windows platform, so that students can quickly query / find a self-study classroom.
[0005] The present invention is achieved through the following technical solutions:
[0006] A dual-platform college classroom self-study query method based on YOLOV5s, comprising the following steps:
[0007] S1. Select the lightweight framework YOLOV5s and improve the framework of YOLOV5s;
[0008] S2. Use the public data set to train the model improved by the YOLOV5s framework to form a real-time people detection model;
[0009] S3. Collect real-time images of the classroom through multiple cameras, and access the real-time number detection model, and use a single-threaded method to call multiple cameras to identify and count the number of people in the classroom;
[0010] S4. Use Android platform and Windows platform to build the system front end respectively to form a display interface to display the classroom population recognition and statistics results.
[0011] According to the above technical solution, preferably, step S1 includes: integrating the CA attention mechanism module into the neck network layer of the YOLOV5s model; adding one upsampling in the neck network layer, and after the third upsampling, fusing it with the second layer of the backbone network to obtain a newly added prediction layer.
[0012] According to the above technical solution, preferably, step S2 includes: obtaining images in a public data set, segmenting and annotating the people in the images to form a training data set; performing data enhancement on the training data set; inputting the data enhanced training data set into the improved YOLOV5s model for training to form a real-time number detection model.
[0013] Among them, in step S2, the training data set is data enhanced, and the images in the training data set are resized, flipped left and right, multi-scale transformed, and normalized; at the same time, when training the model improved by the YOLOV5s framework, an adaptive gradient descent optimizer is used, and the learning rate NMS=0.45, the confidence threshold 0.25, the number of training rounds 100 epochs and the number of batches are set, GIoU is used as the loss function, and the original weight YOLOV5s.pt is used for lightweight weight training to obtain the trained real-time number of people detection model, and a mathematical calculation method is added to sum the number of all heads.
[0014] According to the above technical solution, preferably, in step S3, fluidization technology is adopted to call real-time video with video stream for target detection; the category probability output by the model is used to traverse the detected targets to determine the category of each detected target, and the number of people is counted according to its category information; the number of each camera is set, and the recognition statistics are outputted respectively according to the number of each camera and the number of people identified.
[0015] According to the above technical solution, preferably, in step S3, a single-threaded method of calling multiple cameras is adopted, and a multi-threaded parallel algorithm is used according to the database order principle, that is, an optimized load balancing strategy; in the optimized load balancing strategy,
[0016] Initial objective function:
[0017] Objective function = w1 × response time + w2 × resource utilization
[0018] The objective function after optimization is:
[0019] Objective function = w1 × average response time + w2 × resource utilization difference
[0020] Resource Utilization:
[0021]
[0022] Total CPU running time = CPU effective working time + CPU idle waiting time
[0023] Among them, response time refers to the time it takes for the system to complete all camera tasks, resource utilization refers to the utilization of system resources, including CPU utilization and memory utilization; w1 and w2 are weights used to adjust the relative importance of response time and resource utilization in the objective function; average response time is the average time it takes for the system to process a request, and resource utilization difference refers to the standard deviation of each resource utilization.
[0024] The beneficial effects of the present invention are:
[0025] On the basis of existing classroom monitoring, the present invention uses YOLOV5s in the server / backend and adopts MySQL database for data processing, and transmits the data to the display of the device installed with Android or Windows platform, so that students can quickly query / find the number of people in the self-study classroom; the improved YOLOV 5s algorithm of the present invention is lighter than traditional detection in terms of light weight and detection accuracy, has less redundant information and high accuracy, and can call multiple cameras at the same time, and the damage of one camera will not affect the use of other cameras. BRIEF DESCRIPTION OF THE DRAWINGS
[0026] Figure 1 It is a physical topology diagram in the present invention.
[0027] Figure 2 It is an overall flow chart of the design of a dual-platform college classroom self-study system based on YOLOV5s provided by the present invention.
[0028] Figure 3 It is the overall data flow diagram in the present invention.
[0029] Figure 4 It is the demand analysis framework diagram in the present invention.
[0030] Figure 5 It is a structural diagram of the YOLOV5s model in the present invention.
[0031] Figure 6 It is a database table structure diagram in the present invention.
[0032] Figure 7 It is a schematic diagram of the data communication interaction in the present invention.
[0033] Figure 8 It is a flow chart of data communication interaction. DETAILED DESCRIPTION
[0034] In order to enable those skilled in the art to better understand the technical solution of the present invention, the present invention is further described in detail below in conjunction with the accompanying drawings and the best embodiment. Based on the embodiments in the invention, all other embodiments obtained by ordinary technicians in the field without making creative work are within the scope of protection of the invention.
[0035] The present invention discloses a dual-platform college classroom self-study query method based on YOLOV5s, comprising the following steps:
[0036] S1. The target detection model is trained using the Pytorch framework. The target detection model uses the lightweight framework YOLOV5s selected in the YOLO algorithm and improves the YOLOV5s framework.
[0037] Specifically, the coordinate attention mechanism (CA) is integrated into the neck network layer of the YOLOV5s model to improve the feature extraction ability of the model, and the CA attention mechanism module is added to common.py to be integrated into the Neck network layer; at the same time, the detection head P3 is added, a prediction layer is added to the original network of YOLOV5s, and one upsampling is added to the Neck network. After the third upsampling, it is fused with the second layer of the backbone network to obtain a newly added 160×160 prediction layer for detecting small targets. After the improvement, the entire model adopts a prediction layer of 4 prediction scales, which makes full use of the high resolution of the underlying features and the high semantic information of the deep features, and does not significantly increase the network complexity, so as to achieve the purpose of lightweight without affecting the real-time detection performance.
[0038] S2. Use public data sets to train the model improved by the YOLOV5s framework to form a real-time people detection model.
[0039] Specifically, images in public data sets (coco data sets, head data sets) are obtained, and the people in the images are segmented and labeled to form a training data set; data enhancement is performed on the training data set; the training data set after data enhancement is input into the YOLOV5s model after the framework improvement for training to form a real-time person detection model.
[0040] The images in the training data set are resized, flipped left and right, multi-scaled, and normalized to expand the training set. Specifically, the images are unified into a size of 640×640 pixels, then flipped left and right with a flip probability of 0.5; then scaled by 0.5, 0.75, 1.0, 1.25, 1.5, 1.75, and 2.0 times, and finally normalized to obtain the image training set after data enhancement.
[0041] In addition, the image training set after data enhancement is input into the improved YOLOV5s model for training. The adaptive gradient descent optimizer is used to set the learning rate (NMS = 0.45, confidence threshold = 0.25), the number of training rounds (100 epochs) and the number of batches. GIou is used as the loss function, and the original weight YOLOV5s.pt is used for lightweight weight training to obtain the trained real-time crowd detection model. The mathematical calculation method is added to sum up the number of heads. First, two boxes are calculated (prediction box B pred and the real frame B gt )’s IoU:
[0042]
[0043] Then calculate the GIoU value:
[0044]
[0045] Finally, the loss function of GIoU is defined as:
[0046] L GIoU =1-GIoU
[0047] Using GIoU as the loss function for training takes into account the overlapping area of the predicted box and the true box, as well as their inclusion relationship. This allows the model to focus more on accurately locating the target during training rather than just maximizing the overlapping area. When the predicted box completely contains the true box, the traditional IoU (Intersection over Union) loss function will not be able to provide effective gradients to adjust the size and position of the predicted box. The GIoU loss function can guide the model to more accurately locate the box by considering the inclusion relationship. In the traditional IoU loss function, when the predicted box and the true box do not overlap at all, the gradient is zero, resulting in the gradient vanishing problem during training. By using the GIoU loss function, effective gradients can still be provided in this case, allowing the model to continue to optimize, and the calculation is simple without increasing the complexity of the calculation.
[0048] S3. Collect real-time images of the classroom through multiple cameras, and connect them to the real-time number detection model, and use a single-threaded method to call multiple cameras to identify and count the number of people in the classroom.
[0049] Fluidization technology is used to call real-time video for target detection through video stream, which can more effectively reduce memory usage. At the same time, real-time detection frame-by-frame images are not saved, nor is the data generated by YOLOV5s target detection. A lower frame rate of 30fps is used to improve processing efficiency, and the window size is set to 1280×800 pixels. In terms of counting the number of people, the category probability output by the model is used to traverse the detected targets to determine which category each detected target belongs to, and the number of people is counted based on its category information. The number of each camera is set to i, and the output information corresponds to the number of each camera and the number of people identified.
[0050] In order to provide a smoother effect when enlarging the image, change the size of the detection result display window to make it more suitable for viewing, adjust the display pixel size, use the cv2.INTER_CUBIC parameter, specify the use of cubic interpolation to scale the image, use the four nearest neighboring pixels around the interpolation point, construct a cubic polynomial function to fit the gray value changes of these pixels, and then determine the gray value of the new pixel based on the value of the new position on this polynomial function. The formula is as follows:
[0051] P(x)=a0+a1x+a2x 2 +a3x 3
[0052] Assume that the coordinates of the point to be interpolated are (x, y), and the coordinates of the four nearest neighboring pixels are (i, j), (i+1, j), (i, j+1), (i+1, j+1), and the corresponding grayscale values are f(i, j), f(i+1, j), f(i, j+1), and f(i+1, j+1). First, calculate the interpolation in the horizontal direction. For the interpolation in the x direction, use a cubic polynomial function for interpolation. Assuming the function is P(x), we have the formula (1). Based on the two known points (i, f(i, j)) and (i+1, f(i+1, j)) and their values on P(x), list the following set of equations:
[0053] P(i)=f(i,j)=a0+a1i+a2i 2 +a3i 3
[0054] P(i+1)=f(i+1,j)=a0+a1(i+1)+a2(i+1) 2 +a3(i+1) 3
[0055] Solving this set of equations can obtain the coefficients a0, a1, a2, and a3, and then substitute the horizontal coordinate x of the point to be interpolated into P(x) to obtain the interpolation result P(x) in the horizontal direction. Then calculate the interpolation in the vertical direction. Based on the result of the horizontal interpolation, perform a cubic interpolation in the vertical direction, also using the cubic polynomial function Q(y), where y is the vertical coordinate of the point to be interpolated. The formula is the same as the horizontal coordinate and is shown below:
[0056] Q(y)=b0+b1y+b2y 2 +b3y 3
[0057] According to the two known points (j, P(x)) and (j+1, P(x+1)) and their values on Q(y), a new set of equations can be listed to solve the coefficients b0, b1, b2, and b3. Finally, the ordinate y of the point to be interpolated is substituted into Q(y) to obtain the final interpolation result Q(y), which is the grayscale value of the point to be interpolated. In this way, each new position in the image can be interpolated to achieve image scaling. The cubic interpolation method can reduce the jagged and blurring phenomena during image scaling to a certain extent and improve the image quality.
[0058] In order to avoid waste of resources and bottlenecks, the target detection tasks of different cameras are evenly distributed throughout the system. The original single-threaded camera call algorithm in YOLOV5s is changed. It still follows the database order principle and uses a multi-threaded parallel algorithm, that is, optimizes the load balancing strategy. According to the number of cameras, the complexity of the video stream and the processing power of the system, tasks are reasonably allocated to each process. Ensure that each process has an appropriate workload to avoid overloading some processes while other processes are idle. This is achieved by dynamically adjusting the task allocation of the process to achieve the effect of load balancing. The algorithm optimizes the load balancing strategy so that the target detection tasks of different cameras are evenly distributed throughout the system, avoiding waste of resources and bottlenecks. The formula is as follows:
[0059] Initial objective function:
[0060] Objective function = w1 × response time + w2 × resource utilization
[0061] The objective function after optimization is:
[0062] Objective function = w1 × average response time + w2 × resource utilization difference
[0063] Resource Utilization:
[0064]
[0065] Total CPU running time = CPU effective working time + CPU idle waiting time
[0066] Among them, response time refers to the time it takes for the system to complete all camera tasks, and resource utilization refers to the utilization of system resources, which can be CPU utilization, memory utilization, etc. w1 and w2 are weights used to adjust the relative importance of response time and resource utilization in the objective function. Average response time is the average time it takes for the system to process a request, and this time should be as short as possible. Resource utilization difference refers to the standard deviation of the utilization of each resource (such as CPU, memory, etc.). The smaller this value is, the more balanced the resource utilization in the system is. If you focus on balanced resource utilization, increase w2. Make the system achieve the established performance and efficiency goals while maintaining efficient and balanced resource utilization.
[0067] S4. Use Android platform and Windows platform to build the system front end respectively to form a display interface to display the classroom population recognition and statistics results.
[0068] In the front-end display system based on the Android platform, components are used to improve development efficiency, reduce application size, support dynamic updates, speed up application startup, and facilitate code maintenance; the native XUI framework and components are mainly used for parsing and display. In addition to components, the front-end processes the content according to the sub-package module based on the Android platform. Among them, the bridge connecting the front and back ends uses the okhttp framework, the data uses the okhttp library to execute http requests and handle responses through callbacks, the HTTP protocol is used, the incoming objects are converted into JSON format strings using the GSON library, a request is created, a POST request is constructed and the JSON data is used as the request body, a connection is established with the back end to call the information in the database, and the JSON framework is used for data transmission services. In the Android development process, an API interface is left to interact with the back end for data, and the request is passed to the back end to call data from the database. In the sub-package module, the Activity module, Adapter module, AdapterView module, Domain module, Fragment module, and Tools module are used; different modules contain various application interface scenarios and data required by the front-end platform.
[0069] When designing the front-end display system based on the Windows platform, in order to facilitate users' familiarity with the front-end interface, an interface consistent with the Android platform interface is adopted. HBuildX is used to reconstruct the Android platform interface and apply it to the Windows platform, and this method is used to reconstruct the dual platforms. It mainly includes uniapp and springboot frameworks, which are implemented in the form of tags. The interface part is encapsulated through custom component tags to improve code reusability; page layout tags are used to achieve flexible arrangement of elements; CSS preprocessor tags are used to optimize styles and define unified variables; responsive design tags are used to adapt to different device screen sizes; routing configuration tags are used to adjust page routing and customize navigation bar and tab bar tags to improve interface logic and user navigation convenience.
[0070] In the back-end development of the control platform with Spring Boot as the framework, Servlet is used to receive / respond to customer requests and access the back-end MySQL database through JDBC (Java Data Base Connectivity). The application is usually divided into different layers to improve the maintainability and scalability of the code, namely config layer, controller layer, dao layer, domain layer, and service layer.
[0071] The config layer (configuration layer) is mainly used to store Spring Boot related configuration classes, which include database connection, application parameters, security configuration, etc. The controller layer (control layer) is the business control layer, which mainly receives requests and forwards them to the corresponding service layer for processing, and returns the processing results to the client. It is a bridge for communication between the outside world and the business layer. When the mobile terminal and the front end call the interface to access related services, they will go through the controller. For the development of the controller layer, use @RestController or @Controller annotations to identify; use the dao layer (data access object layer) to interact with the database and persist the data. First, create an interface in the dao layer, then define the implementation class of the interface in the configuration file, call the dao interface in the module, and process the data business; use the domain layer (entity layer) to contain business entities as data carriers to transfer business data, transmit and encapsulate data between modules; use the service layer (service layer) to design the logic application of the business module, design the interface in the service layer, and create the implementation class. After configuring the association of its implementation in the configuration file, call the interface in the service layer to process the business logic application, and finally encapsulate the service layer.
[0072] like Figure 1 As shown, the physical topology structure diagram of the overall system architecture design of the present invention includes the user end (front end), wireless network, server end (back end) and campus classroom data, wherein the user end is divided into Windows platform and Android platform (mobile phone, Android system, Hongmeng system, etc.), and the server end includes the back-end IDEA and the database part; the campus data is inserted into the database according to the specific situation, and all data, including videos, requests, etc., are executed on the server end and then transmitted to the front-end user end for display after processing.
[0073] like Figure 2 As shown, the technology involved in the present invention includes three modules, namely, a front-end receiving and displaying module, a back-end data analysis and management module, and a real-time target detection module; these three modules respectively include an Android platform, an HBuilX reconstruction platform, a SpringBoot back-end, a YOLOV5s algorithm part, and a MySQL database.
[0074] like Figure 3As shown, users use this software through mobile devices, generate corresponding http requests, and transmit them to the IIS server through the Internet. The server runs an application responsible for processing requests. The classic MVC architecture is adopted to separate the control layer from the model layer. After the control layer obtains the request, it is assembled into a corresponding model and passed to the model layer. The model layer is responsible for querying relevant data and returning the results, and finally passing them to the user through the server interface for display. Most of the data processing in the whole process is completed on the server side, which reduces the burden on the user's device, so that most resources can be used to process the responsiveness and fluency of the software and improve the user experience. The modules have clear division of labor and are interdependent, and they work together to complete the data request task.
[0075] like Figure 4 As shown in the figure, according to the on-campus survey, the overall structure diagram of the design system includes the required application requests. The system is mainly divided into two user roles: administrator and client user. The system is a dual-platform system. Administrators can manage it on the computer through the web or on the mobile phone. For administrators, they have higher permissions and can manage user accounts, including adding new users, deleting users, and modifying user information. They also have the authority to modify other applications in the App, such as comment information, announcement information, and classroom information; users and administrators can manage functions one by one, including registration and login, homepage query information and jump, study room main page view, personal center view, and other applications.
[0076] like Figure 5 As shown in the figure, the target detection model is constructed by improving YOLOV5s, and then the public head dataset (head dataset) and coco dataset are used to train the above target detection to obtain the trained head detection weight.
[0077] like Figure 6 As shown, design the corresponding database list according to the demand analysis framework, establish the table with corresponding functions, and define the data table, field, and index in the database according to the entity relationship. Construct a relational tree database (RDBMS) composite structure list, organize data in a table form (two-dimensional table), and associate data through foreign keys. It has a strict composite structure, contains multiple data structures in one table at the same time, supports SQL query language, has strong transaction processing capabilities, and ensures data consistency and integrity. According to the demand analysis, establish a one-to-one corresponding data table, design the specific table content of the database according to the framework content, and build the corresponding relational database table according to different needs.
[0078] like Figure 7The figure shows a flowchart of the data communication interaction implementation, in which initialization is first required, and a MiniLoadingDialog dialog box is created and displayed to display the loading status during the request process. Secondly, a request is created, and OkHttpClient and Request.Builder are used to build a GET request. You can choose whether to add a token as a request header. Third, an asynchronous request is made, and the call.enqueue method is used to put the request into asynchronous execution without blocking the main thread. Fourth, the response is processed. In the onResponse callback, the loading dialog box is closed, and the callback interface HttpCallback is used to pass the server response data. Finally, error handling is performed. In the onFailure callback, the loading dialog box is closed and a "connection timed out" prompt is prompted;
[0079] The POST request is first initialized in the same way as the GET request. Then the data is serialized and the incoming object is converted into a string in JSON format using the GSON library. Third, the request is created, a POST request is constructed, content-type is set to application / json, and JSON data is used as the request body. The data uses the okhttp library to execute the http request and handle the response through callbacks.
[0080] like Figure 8 The figure shows the layers required by the backend and the specific frameworks in the layers for the specific communication and interaction between the front-end and back-end and the database. The controller layer interacts with the database by calling the API interface corresponding to its management. This service interface is usually implemented as a service class, which uses MyBatis-Plus or the database for interaction. In this controller, multiple API interfaces are defined, such as login, adding administrators, etc., which all involve database operations. By using the QueryWrapper class in the MyBatis-Plus framework, various conditions are added, such as equal to, not equal to, greater than, less than, etc., as well as functions such as sorting and selecting specific columns.
[0081] At the same time, those skilled in the art can recognize that the embodiments of the above invention need to be operated with the help of relevant software platforms. The platform is mainly based on computers and mobile devices. The software platform can be Pytorch and Eclipse, Android, IDEA, etc. Those skilled in the art can choose according to their own expertise. The data storage medium can be various databases, such as MySQL, Oracle Database, Redis, etc.
[0082] The above is only a preferred embodiment of the present invention. It should be pointed out that for ordinary technicians in this technical field, several improvements and modifications can be made without departing from the principle of the present invention. These improvements and modifications should also be regarded as the scope of protection of the present invention.
Claims
1. A dual-platform college classroom self-study query method based on YOLOV5s, characterized in that: The steps include: S1. Select the lightweight framework YOLOV5s and improve the framework of YOLOV5s; S2. Use the public data set to train the model improved by the YOLOV5s framework to form a real-time people detection model; S3. Collect real-time images of the classroom through multiple cameras, and access the real-time number detection model, and use a single-threaded method to call multiple cameras to identify and count the number of people in the classroom; S4. Use Android platform and Windows platform to build the system front end respectively to form a display interface to display the classroom population recognition and statistics results.
2. According to the dual-platform university classroom self-study query method based on YOLOV5s in claim 1, it is characterized in that: Step S1 includes: Integrate the CA attention mechanism module in the neck network layer of the YOLOV5s model; One upsampling is added to the neck network layer. After the third upsampling, it is fused with the second layer of the backbone network to obtain the newly added prediction layer.
3. According to the dual-platform university classroom self-study query method based on YOLOV5s in claim 2, it is characterized in that: Step S2 includes: Obtain images from a public data set, segment and annotate the people in the images, and form a training data set; Performing data enhancement on the training data set; The training data set after data enhancement is input into the improved YOLOV5s model for training to form a real-time people detection model.
4. According to the dual-platform university classroom self-study query method based on YOLOV5s in claim 3, it is characterized in that: In step S2, data enhancement is performed on the training data set, and the images in the training data set are resized, flipped left and right, multi-scale transformed, and normalized.
5. According to the dual-platform university classroom self-study query method based on YOLOV5s in claim 3, it is characterized in that: In step S2, when training the model improved by the YOLOV5s framework, Use the adaptive gradient descent optimizer, set the learning rate NMS = 0.45, the confidence threshold 0.25, the number of training rounds 100 epochs and the number of batches, use GIoU as the loss function, and use the original weight YOLOV5s.pt lightweight weight training to obtain the trained real-time crowd detection model, and add mathematical calculation methods to sum up the number of all heads.
6. According to the dual-platform university classroom self-study query method based on YOLOV5s in claim 1, it is characterized in that: In step S3, fluidization technology is used to call real-time video for target detection using video stream; Through the category probability output by the model, the detected targets are traversed to determine the category of each detected target, and the number of people is counted based on its category information; Set the number of each camera, and output the recognition statistics according to the number of each camera and the number of people recognized.
7. According to the dual-platform university classroom self-study query method based on YOLOV5s in claim 1, it is characterized in that: In step S3, a single-threaded method of calling multiple cameras is adopted, and a multi-threaded parallel algorithm is used according to the database order principle, that is, an optimized load balancing strategy.
8. According to the YOLOV5s-based dual-platform college classroom self-study query method of claim 7, it is characterized in that: In step S3, in the optimized load balancing strategy, Initial objective function: Objective function = w1 × response time + w2 × resource utilization The objective function after optimization is: Objective function = w1 × average response time + w2 × resource utilization difference Resource Utilization: Total CPU running time = CPU effective working time + CPU idle waiting time Among them, response time refers to the time it takes for the system to complete all camera tasks, resource utilization refers to the utilization of system resources, including CPU utilization and memory utilization; w1 and w2 are weights used to adjust the relative importance of response time and resource utilization in the objective function; average response time is the average time it takes for the system to process a request, and resource utilization difference refers to the standard deviation of each resource utilization.