A high school classroom class attendance rate detection method, system, device and medium

By using the YOLO neural network model and multi-frame target tracking technology, the accuracy and real-time performance issues of classroom head-up rate detection in traditional methods have been solved, enabling real-time monitoring and intelligent assistance of classroom teaching quality and improving teaching effectiveness.

CN122116472APending Publication Date: 2026-05-29ZHENGFANG SOFTWARE CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
ZHENGFANG SOFTWARE CO LTD
Filing Date
2026-02-14
Publication Date
2026-05-29

AI Technical Summary

Technical Problem

Traditional methods are insufficient for real-time and objective detection of students' head-up rate in university classrooms. Existing technologies suffer from problems such as low efficiency, high subjectivity, high cost, high intrusion, and poor accuracy.

Method used

By employing a pre-trained YOLO neural network model combined with multi-frame target tracking technology, the system identifies students' head postures through video stream processing, calculates the periodic head-up rate, and provides teaching rhythm adjustment suggestions to teachers.

Benefits of technology

It enables accurate identification of students' head posture in complex classroom environments, dynamically quantifies classroom status, improves teaching interaction efficiency, and enhances classroom teaching quality.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122116472A_ABST
    Figure CN122116472A_ABST
Patent Text Reader

Abstract

The application relates to a high school classroom attendance rate detection method, system, device and medium, belonging to the technical field of education informatization, comprising: receiving teaching scene setting data of the current course; after the current course starts, collecting an original video stream in the classroom, preprocessing each frame of the original image to obtain a standard image frame; inputting the standard image frame into a pre-trained YOLO neural network model to output a corresponding detection result list; determining a stable tracking target list of the current frame according to the detection result list of the current frame and a tracking target list of the last frame; calculating a period attendance rate of the classroom in a statistical period according to the tracking target list of all frames in the statistical period; calculating the mean value of the period attendance rate sequence of N statistical periods, and when the mean value is less than a set threshold, controlling the teacher end to pop up a teaching rhythm adjustment notification according to the teaching scene setting data; thereby realizing real-time monitoring of classroom teaching quality and improving classroom teaching effect.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the technical field of educational informatization, and in particular to a method, system, equipment, and medium for detecting classroom head-up rate in universities. Background Technology

[0002] In higher education, student head-up rate in the classroom, as an important indicator of teaching effectiveness and student concentration, has always received much attention. With the development of educational informatization, how to accurately and in real time detect student head-up rate in university classrooms, and then dynamically adjust teaching strategies based on student concentration levels, has become a key issue in improving the quality of classroom teaching.

[0003] In traditional university teaching management, teachers often find it difficult to understand the real-time and objective attention status of all students in a class. Currently, common methods for assessing classroom attention include manual observation, questionnaires and feedback, wearable devices based on sensors, and traditional image processing methods. Manual observation involves teachers subjectively judging students' head-up status through classroom observation and visual inspection; this method is inefficient, highly subjective, and difficult to quantify. Questionnaires and feedback involve collecting student feedback after class, but this method suffers from latency and recall bias. Wearable devices based on sensors, such as head-mounted attention detection devices, can monitor student attention in real time, but they are costly, invasive, and difficult to promote. Traditional image processing methods are based on face detection or simple motion detection, which suffer from poor accuracy and low robustness in complex scenarios such as multiple people, multiple postures, and changing lighting conditions. Summary of the Invention

[0004] In order to achieve real-time monitoring of classroom teaching quality and improve classroom teaching effectiveness, this application provides a method, system, equipment and medium for detecting head-up rate in university classrooms.

[0005] Firstly, this application provides a method for detecting head-up rate in university classrooms, employing the following technical solution: A method for detecting classroom head-up rate in universities includes: Receive the teaching scenario setting data for this lesson; After the start of this lesson, the original video stream in the classroom is captured, and each frame of the original image is preprocessed to obtain a standard image frame. The standard image frame is input into a pre-trained YOLO neural network model, which outputs a list of corresponding detection results. Based on the detection result list of the current frame and the tracked target list of the previous frame, determine the list of stable tracked targets in the current frame; Based on the list of tracking targets for all frames within the statistical period, calculate the periodic head-up rate in the classroom within the statistical period; Calculate the mean of the periodic head-up rate sequence for N statistical periods, and when the mean is less than a set threshold, control the teacher's terminal to pop up a notification to adjust the teaching pace according to the teaching scenario settings.

[0006] By employing the aforementioned technical solution, and utilizing a pre-trained YOLO neural network model to perform frame-level processing on the original classroom video stream, combined with multi-frame target tracking technology, it is possible to stably identify student head postures in complex classroom environments. This ensures the accuracy and robustness of head-up rate statistics, avoiding the subjectivity and lag of manual observation. By setting statistical periods and calculating multi-period averages, dynamic quantitative assessment of classroom status is achieved. Furthermore, a threshold trigger mechanism promptly pushes teaching pace adjustment suggestions to teachers, helping them flexibly optimize teaching strategies based on changes in student attention levels, enhancing teacher-student interaction efficiency, and thus improving classroom teaching effectiveness. By constructing a closed-loop mechanism encompassing teaching scenario setting, intelligent video stream analysis, dynamic tracking statistics, and teaching feedback intervention, real-time, accurate monitoring and intelligent assistance for classroom teaching quality are realized.

[0007] Optionally, the specific steps for determining the list of stable tracking targets in the current frame based on the detection result list of the current frame and the tracked target list of the previous frame include: Calculate the cosine similarity between the apparent features of each detection result in the current frame and the identity features of each tracked target in the previous frame; If a match is determined to be successful based on the cosine similarity, the detection information in the detection result is assigned to the matched tracking target, and the identity features and motion state of the tracking target are updated. If no match is found, the detection result is initialized as the new tracking target, and the old tracking target is retained for M consecutive frames; After all detection results are matched, a list of stable tracking targets for the current frame is output.

[0008] By employing the aforementioned technical solution and calculating the cosine similarity of the apparent features of the current frame detection result and the tracked target in the previous frame, the same student target in consecutive frames can be accurately associated in complex classroom environments. This solves the tracking interruption problem caused by interference factors such as changes in student head posture and partial occlusion, improving the accuracy and stability of target matching. For successfully matched targets, their identity features and motion states are updated in real time to ensure the timeliness and accuracy of tracking information, allowing each student's focus to be continuously and accurately captured. For unmatched detection results, new tracking targets are initialized in a timely manner to cover all students in the classroom, while the old tracking targets are retained for M consecutive frames to avoid target loss due to brief occlusion or sudden changes in posture, achieving full and dynamic tracking of the entire student population in the classroom.

[0009] Optionally, the specific steps for calculating the periodic head-up rate in the classroom within the statistical period, based on the list of tracking targets in all frames within the statistical period, include: The cumulative number of people who effectively looked up and the total number of people detected within the statistical period are calculated based on the effective number of people who looked up and the total number of people detected in each frame of the tracked target within the statistical period. The ratio of the cumulative number of students who looked up to the cumulative total number of students tested is used as the periodic head-up rate in the classroom during the statistical period.

[0010] By employing the aforementioned technical solution, based on the number of students effectively looking up and the total number of students detected in each frame of the tracked target, and through the accumulation of frame-by-frame data within the statistical period, a complete record of the head-up status of an individual student throughout the entire statistical period is achieved. This also comprehensively covers the attention status of all students in the classroom, avoiding evaluation bias caused by the randomness of single-frame data. The head-up rate, calculated as the ratio of the cumulative number of students looking up to the cumulative total number of students detected, reflects the overall attention level of the student group in the classroom throughout the entire statistical period. This provides teachers with intuitive and quantifiable indicators of classroom attention, making teaching intervention suggestions more targeted, thereby effectively helping teachers optimize teaching strategies and improve the quality of classroom teaching.

[0011] Optionally, the head-up rate detection method further includes: After each lesson, query the behavior log database for all frame-level data of that lesson; Group by student ID, sort all records of the same student by time, and filter out records with confidence scores lower than the first confidence threshold to form an individual's original behavioral sequence; The head tilt angle is calculated based on the detection box information corresponding to each student, and then associated with the individual's original behavior sequence to form an individual behavior sequence. Scan the individual behavior sequence, identify consecutive head-up category segments, and obtain a valid head-up event set; Update the corresponding personal profile parameters based on the valid head-up event set described in this lesson.

[0012] By employing the aforementioned technical solution, after each lesson, full frame-level data is retrieved from the behavior log database. This data is then grouped by student ID and low-confidence records are filtered out, enabling the extraction of effective classroom behavior data for each student. Combined with head tilt angle calculation, the raw behavior data is transformed into a more valuable individual behavior sequence, further revealing detailed characteristics of students' attention spans. Furthermore, by scanning the behavior sequence to identify consecutive head-up segments, effective head-up event sets can be obtained, pinpointing students' attention periods and changes in attention levels during class, avoiding the limitations of a single head-up rate indicator. Updating individual profile parameters based on these effective head-up event sets not only establishes long-term learning behavior profiles for each student, visually presenting trends in their attention span, but also provides teachers with personalized teaching references, helping them adjust teaching methods according to the behavioral characteristics of different students and achieve individualized instruction.

[0013] Optionally, the specific steps for scanning individual behavioral sequences, identifying consecutive head-up category segments, and obtaining a valid set of head-up events include: Scan individual behavior sequences, and when the confidence level of the head-up category in a certain frame is greater than the second confidence threshold, it is marked as the starting point of a potential event; When a consecutive Z-frame does not meet the head-up condition, mark the end of the event; If the duration of the event is not less than the set duration, it is determined to be a valid head-up event; After scanning the individual behavior sequence, the set of valid headshot events is output.

[0014] By employing the aforementioned technical solution, based on single-frame head-up categories and confidence levels, and by marking potential event start points and event endpoints where conditions are not met in consecutive Z frames, it is possible to capture nodes where students briefly lose focus or switch between focused states, avoiding misjudgments caused by the randomness of single-frame data. By setting a minimum duration to filter valid head-up events, interference data caused by irrelevant actions such as occasional head movements of students is further filtered out, ensuring the authenticity and representativeness of valid head-up events. This clearly reconstructs students' focus periods and state changes in the classroom, extending the assessment of student focus from macro-level head-up rate indicators to micro-level behavioral pattern analysis. This provides teachers with more targeted teaching interventions and helps students better understand their own learning status, facilitating the cultivation of personalized learning habits and ultimately promoting a dual improvement in classroom teaching quality and student learning outcomes.

[0015] Optionally, the specific steps for updating the corresponding personal profile parameters based on the valid head-up event set described in this lesson include: Calculate the head-up frequency based on the total duration of this lesson and the total number of valid head-up events; Calculate the average head-up duration based on the duration of each valid head-up event; Based on the head tilt angle of each valid head-up event, calculate the average head-up tilt angle and the reference tilt angle, where the reference tilt angle is the average head tilt angle of all head-down state frames; The head-up frequency, average head-up duration, average head-up tilt angle, and reference tilt angle described in this lesson are weighted and fused with the corresponding historical profile parameters to generate new personal profile parameters and update the personal profile database.

[0016] By employing the aforementioned technical solutions, this approach comprehensively captures key information about students' attention intensity, sustained attention, and postural characteristics in the classroom from four dimensions: head-raising frequency, average head-raising duration, average head-raising angle, and baseline head-raising angle. Compared to a single head-raising rate indicator, this approach delves deeper into students' learning behavior patterns, such as whether they are frequently and briefly looking up or focusing for extended periods, and whether their head-raising posture is standard and upright or slightly casual and tilted. These details provide a basis for analyzing students' learning engagement and habit preferences. Furthermore, the design of integrating multi-dimensional data from the current lesson with historical profile parameters breaks through the limitations of single-lesson data, dynamically presenting trends in students' learning status. For example, it shows whether a student's head-raising frequency is gradually increasing or whether the average head-raising duration is increasing. The accumulation of this long-term data not only helps teachers more accurately grasp each student's learning characteristics and develop personalized teaching guidance strategies, but also allows students to intuitively see changes in their own learning status, thereby adjusting their learning habits and improving learning efficiency.

[0017] Optionally, the head-up rate detection method further includes: The timeline of the entire lesson is divided into several teaching segments based on the teaching segment markers in the teaching scenario setting data. For each teaching segment, based on the behavior log database and the student's personal profile database, the average head-raising rate of the whole class and the personal profile parameters of each student are calculated within this time period; The attention curve for this lesson is generated based on the average head-up rate of the whole class for each teaching segment, and the individual performance of each segment is generated based on the individual profile parameters of each student for each teaching segment. Classroom reports are generated based on the attention curve, and individual student reports are generated based on individual performance and profile parameters in all teaching segments.

[0018] By employing the aforementioned technical solution, and using markers at each teaching stage as the dividing line, the complete classroom is broken down into several teaching segments. This transforms student head-up rate data from a vague overall average into a precise correlation with specific teaching scenarios such as explanation, questioning, and practice. This accurately reflects the impact of different teaching activities on student attention, helping teachers intuitively see which segments are more engaging and which require design adjustments. Simultaneously calculating the class average head-up rate and individual student profile parameters within each teaching segment generates an attention curve reflecting the overall class focus trend while also capturing the fluctuations in each student's state under different teaching scenarios. This analytical approach, which considers both the group and the individual, makes classroom attention assessment more layered. The resulting classroom reports and individual student reports achieve layered application of data value: the classroom reports, centered on the attention curve, present the class's focus status at each teaching stage, helping teachers optimize the teaching pace and adjust segment design; the individual student reports focus on individual performance differences across different segments, and combined with long-term individual profile parameters, clearly demonstrate students' learning habits and state changes, providing a basis for personalized tutoring.

[0019] Secondly, this application provides a classroom head-up rate detection system for universities, which adopts the following technical solution: A classroom head-up rate detection system for universities includes: The data receiving module is used to receive the teaching scenario setting data for this lesson. The image acquisition and processing module is used to acquire the raw video stream in the classroom after the start of this lesson, and to preprocess each frame of the raw image to obtain a standard image frame. The YOLO processing module is used to input the standard image frame into a pre-trained YOLO neural network model and output the corresponding detection result list. The target tracking module is used to determine the stable target list for the current frame based on the detection result list of the current frame and the target list of the previous frame; to calculate the periodic head-up rate of the classroom within the statistical period based on the target list of all frames within the statistical period; and to calculate the mean of the periodic head-up rate sequence of N statistical periods. The teaching prompt module is used to control the teacher's end to pop up a teaching pace adjustment notification when the mean value is less than a set threshold, based on the data set in the teaching scenario.

[0020] Thirdly, this application provides a computer device that adopts the following technical solution: A computer device includes a memory, a processor, and a computer program stored in the memory, wherein the processor executes the computer program to implement the classroom head-up rate detection method as described in the first aspect.

[0021] Fourthly, this application provides a computer-readable storage medium, which adopts the following technical solution: A computer-readable storage medium storing a computer program that can be loaded by a processor and executed as described in the first aspect of the method for detecting head-up rate in a university classroom.

[0022] In summary, this application includes at least one of the following beneficial technical effects: By employing the YOLO model and multi-frame tracking technology, stable recognition and dynamic statistics of student head postures are achieved in complex classroom scenarios, constructing a closed loop of "monitoring-analysis-feedback." Based on a periodic average head-up rate and threshold mechanism, teaching strategies are adjusted in real time to improve the quality of classroom interaction.

[0023] Data is segmented by teaching segment to establish a correlation between head-up rate and specific teaching activities. Simultaneously, class attention curves and individual status profiles are output, enabling dual-track analysis of "group trends + individual differences." Furthermore, a tiered reporting system (classroom reports / student reports) precisely empowers teaching optimization and personalized tutoring. Attached Figure Description

[0024] Figure 1 This is a first flowchart of an embodiment of the method of this application; Figure 2 This is a second flowchart of an embodiment of the method of this application; Figure 3 This is a third flowchart of an embodiment of the method of this application; Figure 4 This is the fourth flowchart of an embodiment of the method of this application; Figure 5 This is the fifth flowchart of an embodiment of the method of this application; Figure 6 This is the sixth flowchart of an embodiment of the method of this application. Detailed Implementation

[0025] To make the purpose, technical solution, and advantages of this application clearer, the following description is provided in conjunction with the appendix. Figures 1-6 The present application will be further described in detail below with reference to embodiments. It should be understood that the specific embodiments described herein are for illustrative purposes only and are not intended to limit the scope of the application.

[0026] The first embodiment of this application discloses a method for detecting head-up rate in university classrooms. (Refer to...) Figure 1 The head-up rate detection method includes S110-S160: S110, receives the teaching scenario setting data for this lesson; S120: After the start of this lesson, the original video stream in the classroom is captured, and each frame of the original image is preprocessed to obtain a standard image frame. S130: Input the standard image frame into the pre-trained YOLO neural network model and output the corresponding detection result list; S140, Based on the detection result list of the current frame and the tracked target list of the previous frame, determine the list of stable tracked targets in the current frame; S150, calculate the periodic head-up rate in the classroom within the statistical period based on the list of tracking targets in all frames within the statistical period; S160 calculates the mean of the periodic head-up rate sequence for N statistical periods, and when the mean is less than a set threshold, the teacher's end is popped up with a notification to adjust the teaching pace according to the data set in the teaching scenario.

[0027] Specifically, in step S110, the teaching scenario setting data includes course metadata and teacher metadata. Course metadata includes information such as course, class time, and class, while teacher metadata includes information such as teacher ID and teaching segment markers.

[0028] The system automatically synchronizes course metadata such as course information, class details, and time by connecting with academic affairs platforms (such as Zhengfang and URP) via API. Five minutes before class, the teacher's app proactively triggers a "Preparation for Class" event, uploading the teacher's ID (bound to the school's unified authentication system) and the current teaching segment marker, such as "Import New Lesson" or "Group Discussion." Furthermore, each teaching segment marker not only carries a string label but also an associated three-dimensional context vector, covering the time dimension (estimated duration / actual time of this segment), the spatial dimension (whether the teacher is moving around, whether the projection / whiteboard area is enabled), and the interaction dimension (whether a quiz device is enabled, whether groups are formed). For example, when the system detects a "Group Discussion" segment, it can dynamically lower the confidence threshold for head posture detection to accommodate increased occlusion caused by students turning sideways to communicate. In addition, the system has a pre-built standard classroom template library (including three types: tiered classrooms, single-level large classes, and seminar-style small classes). When teachers give their first lecture, they can complete the "virtual seating chart" marking through a tablet drag-and-drop interface, including marking the orientation of the podium, the number of columns, the number of seats in each column, and the aisle location. This topology will serve as the basis for subsequent anchor frame priors and spatial relationship modeling. For example, for a university's "Advanced Mathematics" Class B, which corresponds to a 4×8 rectangular layout, the system generates 64 virtual seat nodes with geographical coordinates, which are used for the spatial size constraints of the adaptive anchor frames in S130.

[0029] In step S120, a 4K wide-angle camera deployed on the rear ceiling of the classroom continuously streams the image to the edge computing box at 30fps and 1920×1080 resolution. The edge computing box performs the following normalization operations on each frame of the raw image: Grayscale conversion: Converting a color image to a grayscale image. Formula: Grayscale image , where R, G, and B are the intensity values ​​of the red, green, and blue channels, respectively.

[0030] Histogram equalization: The CLAHE (Contrast-Limited Adaptive Histogram Equalization) algorithm was used, with a block size of 16×16 and a cropping limit of 3.0, to enhance image contrast and mitigate the effects of uneven lighting, resulting in the desired image. .

[0031] Resizing: Using bicubic interpolation and forcibly maintaining the aspect ratio, the image was first scaled to 640 pixels along the longer side and then cropped in the center to avoid distortion, thus uniformly scaling the image to 640 pixels (width) × 640 pixels (height). This is to meet the model input requirements.

[0032] Gaussian filtering: Uses a Gaussian kernel to smooth the surface and suppress noise. Formula: Where G is the standard deviation. The Gaussian kernel function is used, where (x, y) are pixel coordinates, i represents the row offset of an element in the kernel relative to the center position, and j represents the column offset of an element in the kernel relative to the center position.

[0033] In step S130, the YOLO neural network model adopts the improved YOLOv5s model. Its core improvements are: (1) The CBAM module is embedded at the end of the C3 structure of the backbone network (i.e., after SPPF and before Neck input). After each C3 module output, the channel dimension is compressed and recalibrated by the channel attention submodule, and then the spatial mask is generated by the spatial attention submodule. The two are multiplied and added to the original features. The channel attention submodule calculates the global average pooling (overall features) and the global max pooling (salient features) at the same time, and uses two 1x1 convolutions to learn the relationship between channels (first reduce the dimension and then increase the dimension). Then the Sigmoid function outputs a weight value of 0~1, and the larger the value, the more important it is. The spatial attention submodule takes the maximum value and average value of all channels for each pixel position (to obtain a feature map of H×W×2), and then uses a 7×7 large convolution kernel to analyze the positional relationship. The Sigmoid outputs a spatial weight map, and the bright area represents the important position. (2) Adaptive anchor box design based on prior knowledge of classroom seating: By analyzing 100,000 frame labeled samples (covering different classrooms, grades, and lighting conditions), it was found that the width of the bounding box of the student's head in the 640×640 image is concentrated in [42,98] pixels and the height is in [56,132] pixels. Therefore, the default 9 sets of anchor boxes of YOLOv5s were replaced with 3 sets of custom anchor boxes (W×H: 64×80, 76×104, 88×120), and the Anchor Loss item was frozen. (3) Lightweight, depth-separable convolutions completely replace standard convolutions, but retain the first layer of the backbone network with 3×3 convolutions to ensure the extraction of underlying textures. The detection head still uses standard convolutions to maintain localization accuracy. The 128-dimensional feature vector output by the model is generated by the ReID branch: 7×7 RoIAlign features are extracted from the P3 / P4 / P5 feature pyramids respectively, reduced in dimensionality by 3 layers of 1×1 convolutions and concatenated, and then output through the BNNeck layer (BatchNorm1d+ReLU+Linear). The output detection result list includes detection box information (including the coordinates of the box center point (pixels), the width and height of the box (pixels)), the predicted head pose category (such as looking up, looking down, etc.), the confidence of the detection result, and a 128-dimensional feature vector to characterize the appearance features of the detected target.

[0034] Reference Figure 2 The specific steps of S140 include S210-S240: S210, Calculate the cosine similarity between the appearance features of each detection result in the current frame and the identity features of each tracked target in the previous frame; S220, if the matching is successful based on the cosine similarity, the detection information in the detection result is assigned to the matched tracking target, and the identity features and motion state of the tracking target are updated. S230, if a match is not found, the detection result is initialized to the new tracking target, and the old tracking target is retained for M consecutive frames; S240, after all detection results have been matched, output the list of stable tracking targets for the current frame.

[0035] Specifically, in step S210, before calculating the cosine similarity, the 128-dimensional feature vector is L2 normalized, and a trajectory consistency constraint is introduced. Matching only occurs when the Euclidean distance between two frames is less than a preset threshold, avoiding cross-row mismatches. The preset threshold can be determined based on the physical dimensions of the classroom. The Hungarian algorithm is used for matching, and the cost matrix elements of the Hungarian algorithm are defined as follows: ,in For experience weight, Encode the difference between the pose categories of two frames, such as head up = 0, head straight up = 1, head down = 2. Here, cos_sim is the adaptive estimate of the historical motion variance, and cos_sim is the cosine similarity. This represents the lateral positional difference, specifically the offset of the detected target in the current frame from the predicted target in the previous frame in the x-coordinate. This represents the vertical position difference, indicating the offset of the detected target in the current frame from the predicted target in the previous frame in the y-coordinate.

[0036] In step S220, if a match is determined to be successful, the detection information in the detection result is assigned to the matched tracking target, and the identity features and motion state of the tracking target are updated.

[0037] In step S230, the M-frame is typically set to 8 frames. If a match is not found for 8 consecutive frames, it is deleted. This value is derived from kinematic analysis of students' natural classroom behavior, especially their gaze shifting movements.

[0038] Observations revealed that in normal classroom settings, even when students briefly look away from the blackboard to think, listen attentively, or slightly adjust their posture, the duration of this visual interruption is typically very short. Measurements and analysis of numerous natural head-turning movements showed that such visual interruptions rarely exceed 300 milliseconds. Considering the system's frame rate (30 frames per second), the duration of 8 frames falls precisely within this typical "brief visual interruption" time window. Therefore, if there is no match for 8 consecutive frames, it is highly likely that the target has disappeared, such as leaving their seat, being severely obstructed, or being out of view.

[0039] In step S240, each tracked target in the output list includes a unique ID, bounding box, pose category, confidence level, and complete historical trajectory. The ID uses a composite encoding of "class ID + student ID hash + first appearance timestamp" to ensure uniqueness across classes. The historical trajectory is fitted with a B-spline curve, and a control point is sampled every 5 frames, which compresses the storage while preserving the motion trend.

[0040] Furthermore, the specific steps of S150 include S151-S152 (not shown in the figure): S151, calculate the cumulative number of people who have looked up and the cumulative total number of people detected in each frame of the tracked target within the statistical period based on the effective number of people who have looked up and the total number of people detected within the statistical period; S152, calculate the ratio of the cumulative number of students who looked up to the cumulative total number of students tested as the periodic head-up rate in the classroom within the statistical period.

[0041] Specifically, in step S151, the statistical cycle is dynamically linked to the teaching segment: the system obtains the teaching segment markers in S110, triggers cycle segmentation, and calculates the head-up rate independently for each segment; the effective head-up determination adopts a dual-threshold mechanism, the posture category must be "head up", and the confidence level > 0.65 (this threshold is determined by ROC curve analysis); the cumulative number of head-up participants is counted using deduplication: the same student only counts one head-up if they head up multiple times within the cycle, avoiding high-frequency jitter interference; the cycle head-up rate formula is R = Nup / Ntotal, where Ntotal is the number of all effective detected targets within the cycle (including head-down and eye-level targets), and Nup is the cumulative number of head-up participants within the cycle; this design reflects the real participation level rather than simply the frequency of the action.

[0042] In step S160, the threshold setting is course-adaptive: the system maintains a baseline head-up rate distribution at the course level. For example, for the "University Physics" course, the average head-up rate for 30 historical lessons is 68.3%, with a standard deviation of 9.2%. Therefore, the threshold is set to the difference between the two, which is 59.1%. When the average head-up rate sequence for N statistical periods (such as three consecutive question-and-answer sessions) is less than the set threshold, a pop-up window on the teacher's end displays "The current head-up rate for the [Question] session is 52.1%, which is 7% lower than the baseline. It is recommended to switch to the group answering mode," along with a trend chart of the head-up rate for the previous three similar sessions. The notification delay can be controlled within 200ms, and push notifications are made via a WebSocket long connection to avoid HTTP polling overhead.

[0043] Reference Figure 3 Furthermore, head-up rate detection methods also include S310-S350: S310, after each lesson, queries the behavior log database for all frame-level data of that lesson; S320: Group by student ID, sort all records of the same student by time, and filter out records with confidence scores less than the first confidence threshold to form an individual's original behavior sequence; S330 calculates the head tilt angle based on the detection box information corresponding to each student and associates it with the individual's original behavior sequence to form an individual behavior sequence; S340, scan individual behavior sequences, identify continuous head-up category segments, and obtain a valid head-up event set; S350, update the corresponding personal profile parameters based on the valid head-up event set of this lesson.

[0044] Specifically, S310 queries all frame-level data of the current course from the behavior log database by a composite index of course ID + lesson ID + student ID. The log volume of a single lesson reaches 2 million frame-level records. The query optimization adopts a partitioning strategy, such as partitioning by date + sharding by student ID hash.

[0045] In step S320, after filtering records with confidence levels less than the first confidence threshold (e.g., 0.65), the same student sequence is sorted by timestamp, outlier frames with time intervals greater than 500ms are removed, and the individual's original behavior sequence is output.

[0046] In step S330, head tilt angle H and W represent the height and width (in pixels) of the detection box, respectively, and K is a scaling factor obtained through calibration, which maps the head's aspect ratio to the actual physical tilt angle range. A head tilt angle of approximately 0 degrees indicates looking straight ahead, a positive value indicates looking up, and a negative value indicates looking down. The absolute value reflects the magnitude of looking up / down. The head tilt angle is then correlated with the individual's original behavioral sequence to generate a corresponding personal behavioral sequence.

[0047] Reference Figure 4 The specific steps of S340 include S410-S440: S410, scan individual behavior sequences, and when the confidence level of the head-up category in a certain frame is greater than the second confidence threshold, mark it as the starting point of a potential event; S420: Mark the end of the event when consecutive Z frames do not meet the head-up condition; S430, if the duration of the event is not less than the set duration, it is determined to be a valid head-up event; S440, after completing the scan of the individual behavior sequence, outputs the set of valid head-up events.

[0048] Specifically, in step S410, the individual behavior sequence is scanned, and when a frame with a pose of head up and a confidence level greater than the second confidence threshold appears, it is marked as the starting point of a potential event.

[0049] Then, subsequent frames are continuously counted. When five consecutive frames (e.g., five consecutive frames) do not meet the aforementioned head-up condition, the event is marked as ending. If the event duration is not less than a set duration, such as 2 seconds, it is determined to be a valid head-up event.

[0050] Once all individual behavior sequences have been scanned, a set of valid head-up events is output, which constitutes the valid head-up event set. Each event is recorded. Each valid head-up event record includes: [start time, end time, average tilt angle within the event, event duration]. Reference Figure 5 The specific steps of S350 include S510-S540: S510, Calculate the head-up frequency based on the total duration of this lesson and the total number of valid head-up events; S520, calculate the average head-up duration based on the duration of each valid head-up event; S530: Calculate the average head tilt angle and the reference tilt angle based on the head tilt angle of each valid head tilt event. The reference tilt angle is the average head tilt angle of all head-down state frames. S540 weighted and fused the head-up frequency, average head-up duration, average head-up tilt angle, and reference tilt angle of this lesson with the corresponding historical profile parameters to generate new personal profile parameters and update the personal profile database.

[0051] Specifically, the behavioral parameters for the current course are calculated as follows: head-up frequency is defined as the total number of events / total course duration (unit: times / minute) to avoid being affected by course length; average head-up duration is the average of the duration of all events (unit: seconds); average head-up tilt angle is the average of the average tilt angle of all events (unit: degrees); and the reference tilt angle is the average of the head tilt angle of all down-head state frames, representing the student's typical non-focused posture (unit: degrees).

[0052] The profile update uses an exponentially weighted moving average (EWMA): Adapt to different course types, such as theoretical courses. (Focusing on long-term stability), experimental class (Emphasis on immediate feedback). The updated personal profile parameters are stored in the student personal profile database to update the database.

[0053] In addition, during the course, the average estimated tilt angle within the student's current short-term window can be calculated in real time. If the difference between the average estimated tilt angle and the baseline tilt angle in the personal profile is less than -2 of the tilt angle standard deviation in the personal profile within the duration threshold, a personalized attention notification will pop up on the teacher's end.

[0054] Specifically, the short-term window is set to 15 consecutive frames. The average estimated tilt angle is inverted through the geometric relationship of the detection box. Taking the midpoint of the upper boundary of the detection box as the reference point, the detection points of the left and right earlobes are connected (output by the key point detection sub-network, which shares the backbone network with YOLO, outputting 12 head key points). The angle between this line and the horizontal line is calculated, and then perspective distortion is corrected by combining the aspect ratio of the frame. The reference tilt angle in the personal portrait is a dynamic parameter updated in S530, and its initial value comes from the posture statistics of the free activity period 10 minutes before the first class. When the short-term average tilt angle is less than -2 standard deviations from the reference tilt angle, and the duration threshold is set to 3 seconds, the system determines that there is abnormal attention decay. The system controls the teacher to display the student's name and seat number in a pop-up window, and also presents a heatmap of the time distribution of the student's last 3 similar events, prompting the teacher to check for physiological factors (such as fatigue) or problems with the suitability of the teaching content.

[0055] Reference Figure 6 Furthermore, head-up rate detection methods also include S610-S640: S610 divides the timeline of the entire lesson into several teaching segments based on the teaching segment markers in the teaching scenario setting data. S620 calculates the average head-raising rate of the whole class and the personal profile parameters of each student for each teaching segment, based on the behavior log database and the student personal profile database. S630 generates the attention curve for this lesson based on the average head-up rate of the whole class for each teaching segment, and generates individual performance of each segment based on the individual profile parameters of each student in each teaching segment; S640 generates classroom reports based on the attention curve and individual student reports based on individual performance and profile parameters in all teaching segments.

[0056] Specifically, in step S610, while strictly adhering to the teaching segment markers in S110, a semantic continuity detection mechanism is introduced to optimize the segment merging logic. This includes dynamic adjustment of the time threshold: the basic merging threshold is 90 seconds, but it will intelligently fluctuate according to the class type (e.g., 90 seconds for theoretical classes and 120 seconds for experimental classes to accommodate operational gaps); semantic fusion of segments: for adjacent markers with logically progressive relationships such as "classroom questioning → group discussion", they are forcibly merged even if the interval is >90 seconds to ensure the integrity of the teaching; and fragment filtering: if there are still isolated segments <45 seconds after merging, they are merged into the preceding segments, and the final output is a segment sequence Seg with timestamps.

[0057] In step S620, the mean of all effective head-up frames of all students in each teaching segment is calculated. At the same time, the baseline tilt angle and standard deviation of tilt angle for each student are obtained from the personal profile database. The relative head-up amplitude is calculated as (mean - baseline tilt angle) / standard deviation of tilt angle, which is used for cross-student normalized comparison.

[0058] The attention curve plotting in step S630 uses a dual vertical axis: the left axis represents the percentage of head tilt rate (0-100%), and the right axis represents the average relative head tilt amplitude. The curve is smoothed using a Savitzky-Golay filter (window length = 5, polynomial order = 2). The horizontal axis represents the teaching segment. Individual performance within a segment is presented as a radar chart with five dimensions: head tilt frequency, average duration, average tilt angle, segment response delay (time from segment marker to first head tilt), and posture stability (tilt angle standard deviation). This allows teachers to easily identify student characteristics, such as "high-frequency short-duration head tilter" or "low-frequency long-duration focused student."

[0059] The classroom report and student individual reports in step S640 are automatically generated as PDFs based on the above data. The classroom report includes a heatmap (horizontal axis: time; vertical axis: seat row number; color intensity indicates head-up rate at that position), a radar chart comparing different teaching segments (three dimensions: head-up rate / frequency / duration), and annotations of abnormal behavior (e.g., "At the 32nd minute, three students in the 4th row looked down for more than 45 seconds consecutively"). The student individual reports highlight growth: the homepage displays the head-up frequency of this lesson versus the class average, the peak tilt angle versus the historical top 10%, and focus endurance (longest continuous head-up time) versus the student's personal best.

[0060] In addition, this head-up rate detection method also includes the following steps: Retrieve current course data, historical course database data, and teacher and course metadata to conduct horizontal comparative analysis, vertical comparative analysis, and pattern mining analysis; generate a teaching analysis report based on the analysis results.

[0061] Specifically, the current course data refers to the raw data such as classroom reports and individual student reports output by S640; the historical course database represents historical data such as attention curves, stage markers, and teacher evaluations for all courses over the past 3 years; and the metadata repository includes teacher metadata and course metadata.

[0062] Horizontal comparison refers to comparing the overall attention indicators (such as average head-up rate) of the same course across different teaching dates or different classes. Vertical comparison refers to analyzing the stability of the attention curve of the same teacher in different courses or at different time periods. Pattern mining refers to analyzing the general effect of a certain type of teaching segment (such as "classroom questioning") on improving attention in different courses. The teaching analysis report includes showing the differences in the effectiveness of the same course in different classes, the time patterns of individual teachers or courses, and the general effects of different teaching strategies.

[0063] Horizontal comparison uses a cube of course ID × class ID × date ID to calculate the coefficient of variation (CV) of head-up rate for each class in the same course. CV = standard deviation of class head-up rate / mean of class head-up rate. When CV > 0.25, it is marked as "significant class differentiation," and root cause analysis is performed by associating class learning data (such as average score of previous courses and attendance rate). Vertical comparison uses teacher ID as the key to aggregate attention curves for all courses. Dynamic Time Warping (DTW) is used to calculate the similarity between curves. A similarity < 0.65 is judged as "unstable teaching style," and the time periods of difference are located. The standard deviation of head-up rate for each teaching segment is extracted, and style change points are marked in conjunction with the teaching video, such as "the speaking speed in the concept explanation segment leads to a 15% decrease in head-up rate." Pattern mining uses association rule learning (Apriori algorithm): minimum support = 0.1, minimum confidence = 0.8, to discover strong rules of "teaching segment → attention improvement." The teaching segment type (question / demonstration / discussion), the magnitude of head-up rate improvement ( Duration () Set it as an itemset and mine strong rules such as {question, open-ended question} → { (Confidence level 87.3%, support level 3.1) These rules, after being verified by teaching experts, have been incorporated into a school-based teaching strategy database.

[0064] The final teaching analysis report is presented in an interactive dashboard: Global View: Displays attention curve clusters for the same course in different classes, highlighting classes with abnormal CVs (red alerts). Teacher Development Module: Presents a DTW similarity matrix, marks unstable teaching periods, and recommends excellent examples of similar styles, such as "Teacher Zhang's head-up rate is consistently 82% in similar sessions." Strategy Recommendation Engine: Generates strategy suggestions based on association rules, for example: Detecting "group discussion" sessions. Push strong rules {introduce timer tool} → { Drill-down analysis function: Click on any high-performance step (such as a rule with confidence > 85%) to drill down and view: classroom heatmap animation of that step (5 seconds / frame playback); teacher-student interaction video clips (automatically located to the start point of the step); comparison of individual student performance (radar charts of excellent / poor students are displayed side by side).

[0065] Based on the above method embodiments, the second embodiment of this application discloses a classroom head-up rate detection system for universities. This classroom head-up rate detection system can implement any of the above-described methods for detecting classroom head-up rate, and the specific working process of each module in the system can be referred to the corresponding process in the above method embodiments.

[0066] For ease of understanding, an example is as follows: A classroom head-up rate detection system for universities includes: The data receiving module is used to receive the teaching scenario setting data for this lesson. The image acquisition and processing module is used to acquire the raw video stream in the classroom after the start of this lesson, and to preprocess each frame of the raw image to obtain a standard image frame. The YOLO processing module is used to input standard image frames into a pre-trained YOLO neural network model and output a list of corresponding detection results. The target tracking module is used to determine the stable target list for the current frame based on the detection result list of the current frame and the target list of the previous frame; to calculate the periodic head-up rate of the classroom within the statistical period based on the target list of all frames within the statistical period; and to calculate the mean of the periodic head-up rate sequence of N statistical periods. The teaching prompt module is used to pop up a teaching pace adjustment notification on the teacher's end when the average value is less than a set threshold, based on the data set in the teaching scenario.

[0067] The third embodiment of this application provides a computer device, which may include a memory, a processor, and a computer program stored in the memory. The processor executes the computer program to implement a method for detecting the head-up rate in a university classroom.

[0068] The memory can communicate with the processor via a communication bus, which can be an address bus, a data bus, a control bus, etc.

[0069] Additionally, the memory may include random access memory (RAM) or non-volatile memory (NVM), such as at least one disk storage device.

[0070] Furthermore, the processor can be a general-purpose processor, including a central processing unit (CPU), a network processor (NP), etc.; it can also be a digital signal processor (DSP), an application-specific integrated circuit (ASIC), a field-programmable gate array (FPGA), or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc.

[0071] The fourth embodiment of this application provides a computer-readable storage medium storing a computer program that can be loaded by a processor and executed as a method for detecting head-up rate in university classrooms.

[0072] The computer-readable storage medium can be any tangible medium that contains or stores a program that can be used by or in connection with an instruction execution system, apparatus, or device; the program code contained on the computer-readable medium can be transmitted using any suitable medium, including but not limited to wireless, wire, optical fiber, RF, etc., or any suitable combination thereof.

[0073] It should be noted that the computer device and storage medium in the embodiments of this application are respectively electronic devices and storage media that apply the above-described method for detecting head-up rate in university classrooms. That is, all embodiments of the above-described method for detecting head-up rate in university classrooms are applicable to the computer device and storage medium, and can achieve the same or similar beneficial effects. As for the computer device / storage medium embodiments, since they are basically similar to the method embodiments, the description is relatively simple, and relevant parts can be referred to in the description of the method embodiments.

[0074] Although this application has been described herein in conjunction with various embodiments, those skilled in the art, by reviewing the accompanying drawings, disclosure, and appended claims, will understand and implement other variations of the disclosed embodiments in carrying out the claimed application. In the claims, the word "comprising" does not exclude other components or steps, and "a" or "an" does not exclude a plurality. A single processor or other unit can implement several functions listed in the claims. While different dependent claims may recite certain measures, this does not mean that these measures cannot be combined to produce a good effect.

[0075] The above are all preferred embodiments of this application and are not intended to limit the scope of protection of this application. Any feature disclosed in this specification (including the abstract and drawings) may be replaced by other equivalent or similar features unless specifically stated otherwise. That is, unless specifically stated otherwise, each feature is only one example of a series of equivalent or similar features.

Claims

1. A method for detecting classroom head-up rate in universities, characterized in that, include: Receive the teaching scenario setting data for this lesson; After the start of this lesson, the original video stream in the classroom is captured, and each frame of the original image is preprocessed to obtain a standard image frame. The standard image frame is input into a pre-trained YOLO neural network model, which outputs a list of corresponding detection results. Based on the detection result list of the current frame and the tracked target list of the previous frame, determine the list of stable tracked targets in the current frame; Based on the list of tracking targets for all frames within the statistical period, calculate the periodic head-up rate in the classroom within the statistical period; Calculate the mean of the periodic head-up rate sequence for N statistical periods, and when the mean is less than a set threshold, control the teacher's terminal to pop up a notification to adjust the teaching pace according to the teaching scenario settings.

2. The method for detecting head-up rate in a university classroom according to claim 1, characterized in that, The specific steps for determining the list of stable tracking targets in the current frame based on the detection result list of the current frame and the tracked target list of the previous frame include: Calculate the cosine similarity between the apparent features of each detection result in the current frame and the identity features of each tracked target in the previous frame; If a match is determined to be successful based on the cosine similarity, the detection information in the detection result is assigned to the matched tracking target, and the identity features and motion state of the tracking target are updated. If no match is found, the detection result is initialized as the new tracking target, and the old tracking target is retained for M consecutive frames; After all detection results are matched, a list of stable tracking targets for the current frame is output.

3. The method for detecting head-up rate in a university classroom according to claim 1, characterized in that, The specific steps for calculating the periodic head-up rate in the classroom during the statistical period, based on the list of tracking targets for all frames within the statistical period, include: The cumulative number of people who effectively looked up and the total number of people detected within the statistical period are calculated based on the effective number of people who looked up and the total number of people detected in each frame of the tracked target within the statistical period. The ratio of the cumulative number of students who looked up to the cumulative total number of students tested is used as the periodic head-up rate in the classroom during the statistical period.

4. The method for detecting head-up rate in a university classroom according to claim 1, characterized in that, The head-up rate detection method also includes: After each lesson, query the behavior log database for all frame-level data of that lesson; Group by student ID, sort all records of the same student by time, and filter out records with confidence scores lower than the first confidence threshold to form an individual's original behavioral sequence; The head tilt angle is calculated based on the detection box information corresponding to each student, and then associated with the individual's original behavior sequence to form an individual behavior sequence. Scan the individual behavior sequence, identify consecutive head-up category segments, and obtain a valid head-up event set; Update the corresponding personal profile parameters based on the valid head-up event set described in this lesson.

5. The method for detecting head-up rate in a university classroom according to claim 4, characterized in that, The specific steps for scanning individual behavioral sequences, identifying consecutive head-up category segments, and obtaining a valid set of head-up events include: Scan individual behavior sequences, and when the confidence level of the head-up category in a certain frame is greater than the second confidence threshold, it is marked as the starting point of a potential event; When a consecutive Z-frame does not meet the head-up condition, mark the end of the event; If the duration of the event is not less than the set duration, it is determined to be a valid head-up event; After scanning the individual behavior sequence, the set of valid headshot events is output.

6. The method for detecting classroom head-up rate in a university classroom according to claim 4, characterized in that, The specific steps for updating the corresponding personal profile parameters based on the effective head-up event set described in this lesson include: Calculate the head-up frequency based on the total duration of this lesson and the total number of valid head-up events; Calculate the average head-up duration based on the duration of each valid head-up event; Based on the head tilt angle of each valid head-up event, calculate the average head-up tilt angle and the reference tilt angle, where the reference tilt angle is the average head tilt angle of all head-down state frames; The head-up frequency, average head-up duration, average head-up tilt angle, and reference tilt angle described in this lesson are weighted and fused with the corresponding historical profile parameters to generate new personal profile parameters and update the personal profile database.

7. The method for detecting classroom head-up rate in a university classroom according to claim 6, characterized in that, The head-up rate detection method also includes: The timeline of the entire lesson is divided into several teaching segments based on the teaching segment markers in the teaching scenario setting data. For each teaching segment, based on the behavior log database and the student's personal profile database, the average head-raising rate of the whole class and the personal profile parameters of each student are calculated within this time period; The attention curve for this lesson is generated based on the average head-up rate of the whole class for each teaching segment, and the individual performance of each segment is generated based on the individual profile parameters of each student for each teaching segment. Classroom reports are generated based on the attention curve, and individual student reports are generated based on individual performance and profile parameters in all teaching segments.

8. A classroom head-up rate detection system for universities, characterized in that, The method for detecting classroom head-up rate as described in any one of claims 1 to 7 includes: The data receiving module is used to receive the teaching scenario setting data for this lesson. The image acquisition and processing module is used to acquire the raw video stream in the classroom after the start of this lesson, and to preprocess each frame of the raw image to obtain a standard image frame. The YOLO processing module is used to input the standard image frame into a pre-trained YOLO neural network model and output the corresponding detection result list. The target tracking module is used to determine the stable target list for the current frame based on the detection result list of the current frame and the target list of the previous frame; to calculate the periodic head-up rate of the classroom within the statistical period based on the target list of all frames within the statistical period; and to calculate the mean of the periodic head-up rate sequence of N statistical periods. The teaching prompt module is used to control the teacher's end to pop up a teaching pace adjustment notification when the mean value is less than a set threshold, based on the data set in the teaching scenario.

9. A computer device, characterized in that, The method includes a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor, when executing the program, implements the classroom head-up rate detection method as described in any one of claims 1 to 7.

10. A computer-readable storage medium, characterized in that, The computer program is stored and can be loaded by a processor and executed as described in any one of claims 1 to 7 for detecting head-up rate in a college classroom.