Board structure retrieval method based on convolutional neural network and time series clustering
By using convolutional neural networks and temporal clustering methods, the problem of misjudgment of blackboard writing under occlusion and reflection was solved, and accurate identification and structured retrieval of blackboard writing status were achieved, enabling the location of the corresponding classroom recording segment.
Patent Information
- Application Number
- CN202611356413.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-09-03
- Publication Date
- 2026-11-24
AI Technical Summary
Existing technologies are easily affected by occlusion, reflection, and perspective changes when processing blackboard writing, leading to misjudgments of the writing status as erased. They cannot accurately distinguish between actual erasure and temporary invisibility, and structured searches have difficulty locating the corresponding classroom segment.
Convolutional neural networks are used for board surface detection and feature encoding to establish a unified board surface coordinate system. Reliable visible locations and anchor points are used to confirm erasure events, generate local erasure barriers, and perform temporal clustering to build a board writing evolution graph and multi-path index.
It reduces the impact of occlusion and reflection, accurately distinguishes between erased and reproduced content, preserves the relationship between blackboard derivation and version evolution, and achieves precise positioning of structured search results.
Smart Images

Figure CN123157939A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the fields of computer vision and educational information processing, and in particular to a method for retrieval of structured blackboard writing based on convolutional neural networks and temporal clustering. Background Technology
[0002] Classroom recording systems typically capture images of blackboards, whiteboards, or projected screens continuously, and then generate post-class materials through image cropping or text recognition. With the application of computer vision technology in teaching scenarios, blackboard detection, perspective correction, text recognition, and video time localization can each process parts of the screen content. However, blackboard writing is continuously added, modified, and erased during the class, so the technical object is not a single static image, but a continuous state with spatial location and temporal evolution.
[0003] Existing processing methods are susceptible to interference from teachers or students, glare on the board, camera shake, and perspective changes, which can lead to temporary invisibility being mistakenly identified as erased and written into the board's state. New content appearing in the same location after erasure is also prone to merging with old content due to coordinate overlap. Even when the text is recognized, the evolutionary relationships between text hierarchy, formula derivation, and graphic orientation may still be lost. There is a lack of stable mapping between index items, content versions, and effective times, making it difficult to locate the corresponding classroom segment at the initial formation, key modification, or completion time of the search results.
[0004] Therefore, a structured retrieval method for blackboard writing is needed to address the shortcomings of the existing technologies. Summary of the Invention
[0005] One objective of this invention is to propose a structured whiteboard retrieval method based on convolutional neural networks and temporal clustering. Addressing the problems of existing technologies such as contamination of the whiteboard surface due to occlusion, reflection, and registration mismatch; inability to distinguish between genuine erasure and temporary invisibility; easy merging of erased content at the same location into older versions; and difficulty in accurate playback of structured retrieval, this invention proposes a technical solution that registers video frames to a unified whiteboard coordinate system, uses convolutional feature encoding to obtain handwriting and visibility representations, freezes long-term states at unobservable locations, and jointly confirms erasure through two types of anchors—continuous reliable visibility and occlusion recovery—to form a spatiotemporal local erasure barrier. Then, temporal clustering is performed using the barrier to generate mandatory and prohibited connections, thereby establishing a whiteboard evolution graph and multi-path index. This invention has the technical effects of reducing false erasure due to occlusion and erroneous merging of content reused at the same location, preserving the whiteboard derivation and version evolution relationship, and locating the retrieval results to the corresponding classroom recording segment.
[0006] This invention provides a method for structured whiteboard retrieval based on convolutional neural networks and temporal clustering, including:
[0007] S1. Obtain classroom recording videos with frame timestamps, use a board detection network to detect writable board surfaces in each video frame and perform cross-frame registration to obtain a unified board surface frame sequence and registration quality values for each frame.
[0008] S2. Input the unified board frame sequence into the convolutional feature encoding network to obtain handwriting representation and board visibility representation, and determine the reliable visible position by combining the registration quality value; at the reliable visible position, generate new handwriting events and erasure candidates based on the current observation, long-term board state and the most recent reliable visible observation, and freeze the update of the long-term board state at the unreliable visible position.
[0009] S3. Establish a front anchor and a back anchor based on reliable visible observations before and after the eraser candidate, compare the front anchor and the back anchor with the long-term plate state, and confirm the eraser event when the handwriting contained in the front anchor is continuously missing in the back anchor and subsequent continuous reliable observations; convert the confirmed eraser event into a local eraser barrier with spatial range and temporal boundaries.
[0010] S4. Generate handwriting trajectory segments based on the newly added handwriting events and the confirmed erase handwriting events. Establish mandatory connection constraints for handwriting trajectory segments that do not cross the local erase barrier and have an incremental inheritance relationship. Establish prohibition connection constraints for handwriting trajectory segments located before and after the local erase barrier. Perform constrained temporal clustering based on the mandatory connection constraints and prohibition connection constraints to obtain a version of the blackboard structure unit with a valid time interval.
[0011] S5. Perform structural identification on the version of the blackboard structure unit, and establish a blackboard evolution diagram based on the identification results and the temporal, spatial and version relationships between the blackboard structure unit versions; establish a structured retrieval index based on the blackboard evolution diagram that associates the blackboard structure unit version, effective time interval and video address, and determine the matching blackboard structure unit version and corresponding classroom recording segment in response to the retrieval request.
[0012] Optionally, S1 includes: the board surface detection network outputting the category probability, boundary point coordinates, and boundary point confidence of the writable board surface;
[0013] In adjacent video frames and intervening video frames, feature points located within the writable surface are matched, and the homography transformation used for the cross-frame registration is estimated based on the reprojection error of the matched points and the proportion of inliers.
[0014] The in-place ratio and the inversely normalized value of the reprojection error are combined to form the registration quality value;
[0015] When the registration quality value does not meet the preset registration threshold, the video frame is stopped from participating in the handwriting event confirmation.
[0016] Furthermore, when the registration quality values of video frames that have reached a preset number of mismatched frames do not meet the preset registration threshold, registration anomaly recovery is performed, the confirmation of new handwriting events and erased handwriting events is paused, the writable board surface and its boundary points are re-detected, and an updated unified board surface coordinate system is established.
[0017] The matching relationship between the feature points of the board surface before and after the update, which both satisfy the preset reprojection error threshold after bidirectional reprojection, is taken as the coordinate system correspondence. Only the board surface area with the coordinate system correspondence inherits the long-term board surface state and the version of the board writing structure unit. For the board surface area without the coordinate system correspondence, a new long-term board surface state is established.
[0018] Optionally, S2 includes: using the unified board frame sequence and the registration quality value of each frame as input data sources, extracting multi-scale features of the unified board frame sequence by a shared convolutional feature encoder, outputting a handwriting probability map, a background probability map, an occlusion probability map, and a reflection probability map by a pixel classification branch, using the occlusion probability map and the reflection probability map to constitute the board visibility representation, and outputting a handwriting feature map by a handwriting representation branch;
[0019] The reliable visible position is defined as the plate surface position where the registration quality value is not less than the preset registration threshold, the occlusion probability is not greater than the preset occlusion threshold, and the reflection probability is not greater than the preset reflection threshold.
[0020] The differences between the current handwriting probability and handwriting characteristics at the reliable visible location and the long-term board state and the most recent reliable visible observation are calculated respectively, and the probability of new handwriting events and the probability of erasure candidates are generated according to the direction of the difference.
[0021] The probability of new handwriting events in consecutive reliable frames is accumulated. When the accumulated frame count reaches a preset confirmation frame count, the new handwriting event is confirmed and the long-term board state is updated.
[0022] Furthermore, the training of the board detection network and the convolutional feature encoding network includes: applying perspective transformation, motion blur, local occlusion, reflection superposition, and handwriting erasure sequence enhancement to classroom board images with board boundaries, handwriting, background, occlusion, and reflective markings;
[0023] The board detection network is trained using board category loss and boundary point regression loss;
[0024] The convolutional feature encoding network is trained using pixel classification loss, handwriting feature contrast loss, and consistency loss of adjacent reliable frames. The same handwriting region before and after erasure is used as temporal variation sample, and the same handwriting region that remains before and after occlusion is used as temporal consistency sample.
[0025] Optionally, S3 includes: for erase candidates formed during continuous reliable visibility, recording the most recent reliable visible observation before the candidate is formed as the previous anchor, and recording the first reliable visible observation after the candidate is formed as the next anchor;
[0026] For the erased candidate formed after the corresponding plate position undergoes an unobservable process and is restored to reliable visibility, the last reliable visible observation before becoming unobservable is recorded as the front anchor, and the first reliable visible observation after being restored to reliable visibility is recorded as the back anchor.
[0027] The front anchor is recorded as a handwriting spatial mask, handwriting features, and the last visible moment; the rear anchor is recorded as a handwriting spatial mask, handwriting features, and the reliably visible moment of the rear anchor.
[0028] Within the overlapping area of the two anchors, the handwriting spatial mask of the front anchor is differentially compared with the handwriting spatial mask of the rear anchor and subsequent reliable frames, and the differential is verified by the matching result of the corresponding handwriting features.
[0029] When the difference result continues until the preset number of confirmation frames are reached, the reliable visible moment of the back anchor is determined as the first visible missing moment, and a confirmation erase handwriting event is generated, which includes the erase space mask, event confidence, the last visible existence moment and the first visible missing moment. The two moments are used as the lower and upper bounds of the time boundary, respectively.
[0030] Optionally, S4 includes: connecting the handwriting trajectory segments based on the event connectivity of the newly added handwriting event and the confirmed erased handwriting event, as well as the board coordinate overlap, handwriting feature similarity and temporal adjacency of the event connectivity.
[0031] Trajectory pairs that do not have local erase barriers and where the latter stroke trajectory segment contains the former stroke trajectory segment are marked as the mandatory connection constraints;
[0032] The trajectory pairs that terminate before the lower bound of the time boundary and begin after the upper bound of the time boundary within the erase space mask that confirms the erasure event are marked as the forbidden connection constraints;
[0033] Under the condition of satisfying all mandatory and prohibited constraints, temporal clustering is performed according to the spatial distance between trajectories, handwriting feature distance and time interval, and the creation time, modification time and erasure time of the version of the whiteboard structure unit are recorded according to the event time sequence, and the effective time interval is determined according to the adjacent event times;
[0034] Furthermore, in addition to the local erasure barrier, common trajectory ancestors with continuously visible trajectories and matching handwriting features before and after the barrier will be retained as the same content version relationship.
[0035] Within the local erasure barrier, it is prohibited to merge the trajectories located before and after the barrier separately based on the overlap of the panel coordinates;
[0036] The eraser candidate is removed when the handwriting marked as an eraser candidate reappears before a preset number of confirmation frames are reached, or when the handwriting features of the previous anchor are re-matched in consecutive reliable frames after the later anchor.
[0037] Optionally, S5 includes: recognizing headings, step numbers, and indentation relationships for text structural units and generating a key point hierarchy;
[0038] Identify the symbol bounding box, relative position of symbols, and operator connection relationships for formula structure units, and generate a symbol layout tree and an operator tree;
[0039] Identify the outline, arrows, and the version of the blackboard structural unit into which the arrow endpoints fall for the graphic structural unit;
[0040] The predecessor edge is established based on the creation time and effective time interval; the derivation edge is established based on the subtree changes of the formula operator tree; the inclusion edge is established based on the inclusion relationship of the board coordinates; the annotation edge and the pointing edge are established based on the adjacency of the text structure unit and the graphic structure unit and the arrow endpoint; and the same content version edge is established between the versions of the board structure unit with a common trajectory ancestor. The board evolution diagram is composed of each version of the board structure unit and the established edges.
[0041] Furthermore, the text recognition results are segmented into words and a keyword inverted index is established. A formula tree path index is established for the root-to-leaf path and subtree normalization encoding of the symbol layout tree and operator tree. A step graph path index is established for the step number and its predecessor edge and derivation self edge sequence in the blackboard evolution graph.
[0042] Each index entry is recorded as a retrieval record containing the index key, the version identifier of the whiteboard structure unit, the coordinates of the whiteboard, the recognition confidence level, the start and end times of the effective time interval, and the video address.
[0043] Retrieve search records based on keywords, formula structures, or step numbers in the search request, and return the version connected to the recalled version through the edge in the blackboard evolution graph as the evolution context;
[0044] The creation and modification times are determined based on the event sequence of the recalled version. The replay anchor point is determined based on the jump type carried by the search request. The first formation type is mapped to the creation time. The key modification type is mapped to the first modification time when the text level, formula tree subtree, or graphic pointing relationship meets the preset structural change conditions. The completion type is mapped to the last modification time after the recalled version has reached a preset stable time without any new handwriting events or erased handwriting events. When the search request does not carry a jump type, the creation time is used as the replay anchor point.
[0045] The beneficial effects of this invention are:
[0046] 1. By determining reliable visible positions based on registration quality and occlusion / reflection characteristics, and generating unobservable events and freezing long-term board state writing at unreliable visible positions, it is possible to avoid occlusion frames, reflection frames, and unreliable registration frames directly changing the board state, reducing the possibility of temporary invisibility being judged as erasure.
[0047] 2. By establishing front anchors and back anchors for continuous and reliable visible scenes and unobservable scenes respectively, the dual anchors are jointly compared with the long-term board state, and the confirmed erasure event is converted into a local erasure barrier defined by spatial mask and temporal boundary. This allows for the application of disassociation constraints on the trajectories before and after the barrier during the clustering stage, while preserving the version relationship of the common trajectory ancestor outside the barrier, thereby distinguishing between real erasure, handwriting reproduction and content reuse at the same location.
[0048] 3. By identifying the text hierarchy, formula tree structure, and graphic pointing relationship of the blackboard structural unit version, a blackboard evolution diagram containing time, space, and version relationships is established. The effective time information and video address are written into the structured search index, which can return the evolution context by keywords, formula structure, or step number, and locate the corresponding classroom recording segment according to the first formation, key modification, or completion type. Attached Figure Description
[0049] The accompanying drawings are provided to further illustrate the invention and form part of the specification. They are used in conjunction with embodiments of the invention to explain the invention and do not constitute a limitation thereof. In the drawings:
[0050] Figure 1 This is a flowchart of the whiteboard structured retrieval method based on convolutional neural networks and temporal clustering according to the present invention.
[0051] Figure 2 This is a flowchart of the present invention S3, which confirms the erasure event based on dual-anchor audit and generates a local erasure barrier. Detailed Implementation
[0052] The present invention will now be described in further detail with reference to the accompanying drawings. These drawings are simplified schematic diagrams, illustrating only the basic structure of the invention, and therefore only show the components relevant to the invention.
[0053] refer to Figures 1-2 A structured whiteboard retrieval method based on convolutional neural networks and temporal clustering includes:
[0054] S1. Obtain classroom recording videos with frame timestamps, use a board detection network to detect writable board surfaces in each video frame and perform cross-frame registration to obtain a unified board surface frame sequence and registration quality values for each frame.
[0055] S2. Input the unified board frame sequence into the convolutional feature encoding network to obtain handwriting representation and board visibility representation, and determine the reliable visible position by combining the registration quality value; at the reliable visible position, generate new handwriting events and erasure candidates based on the current observation, long-term board state and the most recent reliable visible observation, and freeze the update of the long-term board state at the unreliable visible position.
[0056] S3. Establish a front anchor and a back anchor based on reliable visible observations before and after the eraser candidate, compare the front anchor and the back anchor with the long-term plate state, and confirm the eraser event when the handwriting contained in the front anchor is continuously missing in the back anchor and subsequent continuous reliable observations; convert the confirmed eraser event into a local eraser barrier with spatial range and temporal boundaries.
[0057] S4. Generate handwriting trajectory segments based on the newly added handwriting events and the confirmed erase handwriting events. Establish mandatory connection constraints for handwriting trajectory segments that do not cross the local erase barrier and have an incremental inheritance relationship. Establish prohibition connection constraints for handwriting trajectory segments located before and after the local erase barrier. Perform constrained temporal clustering based on the mandatory connection constraints and prohibition connection constraints to obtain a version of the blackboard structure unit with a valid time interval.
[0058] S5. Perform structural identification on the version of the blackboard structure unit, and establish a blackboard evolution diagram based on the identification results and the temporal, spatial and version relationships between the blackboard structure unit versions; establish a structured retrieval index based on the blackboard evolution diagram that associates the blackboard structure unit version, effective time interval and video address, and determine the matching blackboard structure unit version and corresponding classroom recording segment in response to the retrieval request.
[0059] In this specific embodiment, S1 includes:
[0060] The classroom video access module reads a classroom recording video with a resolution of 1920×1080 and a frame rate of 25 frames per second. It obtains the video identifier, source video address, frame sequence number, and millisecond-level frame timestamp from the encapsulation layer frame by frame. At the same time, it retrieves the archive mapping identifier from the archive mapping table using the video identifier as the search key. If there is no archive record, it generates a mapping identifier to be archived and keeps the source video address. Frames with an adjacent timestamp difference of more than 80ms are marked as acquisition interruption frames. Acquisition interruption frames only participate in the board re-detection and do not participate in the handwriting event confirmation.
[0061] The board detection network uses a convolutional backbone with a feature pyramid and two output branches: category and boundary points. The detection module first scales the video frames to 960×540 and normalizes them according to the channel mean and standard deviation of the training set. The category branch outputs the category probability of the writable board surface, and the boundary point branch outputs the coordinates and corresponding confidence scores of the four boundary points: top left, top right, bottom right, and bottom left. The board surface detection result is retained when all four boundary points fall within the frame and the category probability is not less than 0.85 and the minimum confidence score of the boundary points is not less than 0.80.
[0062] For the retained panel detection results, a perspective transformation is performed in clockwise order according to the four boundary points, mapping the panel region to a unified panel coordinate system of 1600×900. The unified panel image, the original frame timestamp, the transformation matrix from the original frame to the unified panel, and the panel detection confidence are written into the unified panel frame record. If multiple panels are detected in the same frame, they are sorted by the product of the panel category probability and the quadrilateral area ratio, and the panel with the largest product is retained. When no panel detection result that meets the retention criteria exists in a frame, the panel is still... The video identifier and frame number generate a record without board surface placeholders. The board surface detection status is recorded as failed, the registration quality value is set to 0, the event confirmation permission field is set to prohibited, and the continuous mismatch count shared with the registration failure is incremented. The pseudo-uniform board surface image is not generated by transforming the previous frame. When the continuous mismatch count reaches 6 frames, the registration anomaly recovery described later in this S1 is entered. The board surface detection is rerun and the updated coordinate system is established only after obtaining the result that meets the retention conditions. Any successful frame with a registration quality value of not less than 0.78 will reset the count to zero.
[0063] When a new video does not yet have a qualified reference frame, or after a series of no board surfaces, the first board surface detection result that meets the retention conditions is obtained, or when there is an area outside the coverage of the coordinate system correspondence table in the updated coordinate system, the registration module registers the first valid board surface frame as the registration seed frame for the corresponding video, coordinate system version, or newly created area, and directly establishes unified board surface coordinates based on the quadrilateral boundary of the frame; the seed frame does not perform frame pair matching, and its registration quality value is the minimum value between the board surface category probability and the confidence of the four boundary points, the event confirmation permission field is set to prohibited, the continuous mismatch count is cleared to zero, and the seed type, seed frame number, applicable coordinate system version, and applicable area are written; the next frame that meets the board surface detection conditions uses the seed frame as the reference frame, and only when the registration quality value obtained according to the frame pair formula described later in this S1 is not less than 0.78 and the number of interior points is not less than 30, is the event confirmation permission field set to allowed and included in the confirmation of new handwriting events or erased handwriting events; if the next frame matching fails, the seed frame and event confirmation prohibited state are maintained and the existing key frame is re-matched and continuous mismatch processing is performed;
[0064] The personnel occlusion pre-detection module runs independently on the original video frames before unified board registration. It uses a lightweight convolutional segmentation network trained with teacher and student contour annotations to output a personnel probability map of the same size as the 960×540 scaled frame. A binary occlusion segmentation mask is generated with a threshold of 0.60. The occlusion segmentation mask is converted to the corner coordinate system through the scaling between the original frame and the scaled frame. The cross-frame registration module extracts corner points and 256-bit binary descriptors located inside the writable board surface and at least 12 pixels from the boundary in adjacent video frames and video frames with a 5-frame interval. Candidate matching points are formed by bidirectional nearest neighbor and 0.75 ratio test. Matching points that fall into the personnel occlusion segmentation mask of the reference frame or target frame are removed. The remaining matching points are written into the frame pair matching record according to the frame timestamp. If the personnel occlusion pre-detection fails or the effective mask area exceeds 60% of the board area, the mask removal is not performed. Instead, the random sampling consensus algorithm is used to exclude outliers, and a mask failure mark is written into the frame pair matching record.
[0065] Before deployment, the board detection network is trained using the classroom board training set described in S2. The input is a 960×540 image with board quadrilateral annotations. The convolutional backbone outputs a four-level feature map. The category branch uses the board category as the supervision target, and the boundary point branch uses the normalized coordinates of the four boundary points as the supervision target. After training, the network parameters are frozen and the model version, training sample batch, and average error of the boundary points in the validation set are recorded. Model versions with an average error of boundary points in the validation set higher than 4 pixels are not included in the classroom video processing flow.
[0066] In addition to the coordinates of the matching points and the descriptor distance, the frame pair matching record also stores the reference frame number, target frame number, frame interval type, number of candidate matching points, number of inliers, and random sampling consistency status. If there are fewer than 30 candidate matching points, four-point samples degenerate into near collinearity, or the algorithm fails to obtain a homography transformation that meets the conditions within 2000 iterations, the frame pair is marked as a registration failure and is rematched by the most recent key frame with a qualified registration quality value. If the rematch of the key frame still fails, the registration quality value of the target frame is set to 0 and the continuous mismatch count is incremented. Any successful frame with a registration quality value not lower than 0.78 resets the continuous mismatch count to zero.
[0067] The reference frame coordinate components used in the formula for the adjacent average reprojection error are read directly from the frame pair matching record, where Indicates reference frame The Middle The x-coordinate of each corresponding interior point in a unified pixel coordinate system, in pixels. Indicates reference frame The Middle The ordinates of the corresponding interior points in the unified pixel coordinate system of the board surface, in pixels, are consistent with the same symbol in the three-dimensional homogeneous coordinate vector expansion formula in the adjacent formula.
[0068] For each frame pair of matching records, a random sampling consensus algorithm is used to estimate the homography transformation. Each sampling uses four non-collinear matching points, with a maximum of 2000 iterations. Matching points with a reprojection error of no more than 3 pixels are recorded as inliers, and the results are calculated according to the formula... Calculate the average reprojection error, where Indicates target frame The average reprojection error relative to the selected reference frame, in pixels. Indicates the target frame number. Indicates target frame The number of interior points, in units of , Indicates an interior point index. Indicates target frame The Middle The interior points have two-dimensional Euclidean coordinates in a unified pixel coordinate system, with a dimension of 2 and units of pixels. This indicates the selected reference frame number, its source as an adjacent frame, an interval of 5 frames, or a qualified keyframe. Indicates reference frame The three-dimensional homogeneous coordinate vector of the corresponding interior point. , Indicates that the reference frame To target frame The 3×3 homography transformation matrix, Indicates in When the value is non-zero, perform homogeneous mapping and output two-dimensional pixel coordinates. express The first homogeneous component, Indicates its second homogeneous component. Indicates its non-zero scale component, , and They share a common homogeneous scale. and The output unit is pixels. Indicates vector transpose; when When the value is 0, the matching point is discarded and written into the invalid projection record, preventing it from entering. The count; This represents the two-dimensional Euclidean norm, and the result is in pixels.
[0069] The registration module calculates the proportion of interior points using the number of candidate matching points as the denominator, and follows the formula... Generate registration quality values, where Indicates the first The registration quality value of a frame is a dimensionless number between 0 and 1, with a larger value indicating more reliable registration. Indicates the first The ratio of in-frame points is a dimensionless number between 0 and 1. Indicates the first The average reprojection error of a frame, in pixels. This represents the upper limit of the normalized reprojection error, which is set to 8 pixels in this specific embodiment. This represents a function that truncates the calculation results to a given upper and lower bound. 0.65 and 0.35 are dimensionless weights that are determined on the independent validation set by minimizing the corner positioning error of the board surface and whose sum is 1.
[0070] The preset registration threshold is stored in the board registration parameter record. In this specific embodiment, it is set to 0.78. When the registration quality value is lower than 0.78, the number of interior points is less than 30, or the confidence of any of the four board boundary points is lower than 0.80, the event confirmation permission field of the corresponding unified board frame record is set to prohibited. The frame is still retained for subsequent re-inspection and visibility analysis, but it does not participate in the confirmation of new handwriting events or erased handwriting events.
[0071] When registration fails for 6 consecutive frames or the registration quality value is lower than 0.78, registration anomaly recovery is triggered. Among them, the registration failure frames are counted as the same consecutive mismatch count with a registration quality value of 0. The anomaly recovery module suspends the confirmation of new handwriting events and erase handwriting events, re-runs the board surface detection network and establishes an updated unified board surface coordinate system based on the new quadrilateral boundary. At the same time, the old coordinate system version, the new coordinate system version, the trigger frame timestamp and the number of consecutive mismatch frames are written into the anomaly recovery record.
[0072] The coordinate system inheritance module performs bidirectional reprojection on the feature points of the board surface before and after the update, from the old coordinate system to the new coordinate system and from the new coordinate system to the old coordinate system. Only the matching relationships with reprojection errors in both directions not exceeding 2.5 pixels and descriptor Hamming distance not exceeding 48 are written into the coordinate system correspondence table. The triangular mesh coverage of the corresponding points forms an inheritable region. The long-term board surface state and board structure unit version within the inheritable region are inherited after coordinate transformation. For the region outside the coverage area, a new long-term board surface state with a different coordinate system version number is established.
[0073] The registration parameter record is generated by the pre-deployment calibration program using a verification video with manually annotated uniform corner points and occlusion areas on the board surface. The record fields include board surface type, camera resolution, registration quality threshold, reprojection error upper limit, minimum number of inliers, number of consecutive mismatch frames, model version, and effective time. The calibration program scans the candidate registration quality threshold from 0.60 to 0.90 in increments of 0.01. The threshold with the highest reliable frame recall rate when the false acceptance rate is no higher than 2% is used as the corresponding board surface type record. During runtime, the board surface type and camera resolution are jointly searched. When no matching record is found, a safe record of 0.78, 8 pixels, 30 inliers, and 6 frames is used and marked as to be recalibrated.
[0074] The keyframe manager prioritizes a uniform frame with a registration quality value of at least 0.85 and a time interval of no more than 2 seconds from the current frame as the reference frame. If the effective matching point coverage area between the reference frame and the current frame is less than 20% of the frame area, the three most recent qualified keyframes are retrieved in reverse chronological order, and the homography transformation is estimated for each. The successfully estimated results are grouped into a successful subset. If the successful subset is not empty, it is sorted first by inlier ratio from high to low. If the inlier ratios are the same, it is sorted by average reprojection error from low to high. If both are still the same, the newer keyframe with the larger reference frame number is selected, and the unique result ranked first is used as the registration result for the current frame. At the same time, the estimation status, reference frame selection number, coverage area ratio, three sorting keys, and selection reason of each of the three candidate keyframes are written into the registration audit field. If the successful subset is empty, i.e., all three keyframes fail, the prohibition event confirmation branch is triggered directly without extrapolating the transformation.
[0075] S1 ultimately outputs a unified board layout frame sequence sorted by frame timestamp, registration quality values for each frame, event confirmation permission field, coordinate system version, source video address, and archive mapping identifier. The unified board layout frame record is stored in the frame sequence cache with the video identifier and frame number as a joint key. The source video address and archive mapping identifier are both associated with the same video identifier and are passed to S2 along with the frame sequence metadata. The output serves as the input to the S2 convolutional feature encoding network and reliable visibility location determination, thereby forming a unified board layout data entry point for the board layout structure retrieval method based on convolutional neural networks and temporal clustering.
[0076] In this specific embodiment, S2 includes:
[0077] The feature encoding module reads the unified board frame sequence output by S1 according to the frame timestamp, divides the 1600×900 unified board image into 512×512 image blocks with a 64-pixel overlap area, and forms an encoding batch record with the image block, registration quality value, event confirmation permission field, unified board coordinate offset and coordinate system version. When writing back the output of the overlap area, the center area priority rule is used to eliminate duplication.
[0078] The convolutional feature encoding network adopts a shared residual convolutional backbone and a four-level feature pyramid. The pixel classification branch outputs handwriting probability maps, background probability maps, occlusion probability maps and reflection probability maps with the same resolution as the unified board surface through step-by-step upsampling. The handwriting representation branch outputs handwriting feature maps with a stride of 4 and 64 channels, and maps the handwriting features back to the unified board surface coordinates using bilinear interpolation.
[0079] The network training data consists of classroom board images and continuous erasing segments collected from no fewer than 20 classrooms. The annotation records include board boundaries, handwriting pixels, background pixels, occlusion pixels, reflective pixels, and the identification of the same handwriting area across frames. The training set is divided into 70% training set, 15% validation set, and 15% test set according to the classroom dimension to avoid the same classroom background appearing in both the training set and the validation set at the same time.
[0080] The training pipeline sequentially applies perspective transformation with a perspective angle not exceeding 12 degrees, motion blur with a kernel size of 3 to 9 pixels, local occlusion with an area ratio of 5% to 35%, reflection overlay with an intensity coefficient of 0.15 to 0.45, and handwriting erasure sequence enhancement that maintains the time order to the training samples. It also forms temporally varied samples by combining the same handwriting area before and after erasure, and forms temporally consistent samples by combining the same handwriting area that remains before and after occlusion.
[0081] The board detection network and the convolutional feature encoding network use a joint loss. Training was conducted, among which Represents the joint training loss, a non-negative dimensionless scalar whose mean is calculated over training batches; This represents a non-negative dimensionless scalar obtained by summing the cross-entropy of the board classes for each sample and dividing by the batch size; This means that the coordinates of the four boundary points are first normalized to 0 to 1 by dividing them by the image width and height respectively, and then the average of the smoothed absolute error of the eight coordinate components is calculated according to the sample and the components to obtain a non-negative dimensionless scalar. It represents a non-negative dimensionless scalar obtained by dividing the sum of the cross-entropies of the four categories of handwriting, background, occlusion, and reflection across all valid labeled pixels by the total number of valid pixels; This represents a non-negative dimensionless scalar obtained by calculating the contrast loss of 64-dimensional handwriting features after L2 normalization and dividing it by the number of valid positive and negative sample pairs. It is valid only if the L2 norm of the feature vectors at both ends of the sample pair is greater than 1. Normalization is performed and included in the valid sample pairs only when the L2 norm is not greater than 1. The sample pair is removed and written to the zero norm marker of the training features; when the number of valid sample pairs in the next training batch is 0, the sample pair is removed. Set the value to 0 and write a flag indicating no valid sample pair; do not perform division. This represents a non-negative dimensionless scalar obtained by dividing the sum of squared differences in handwriting probability and handwriting feature within the overlapping region after registration of adjacent reliable frames by the number of reliable pixels and the number of effective frame pairs. When the number of reliable pixels or the number of effective frame pairs is 0, it is... Set to 0 and write a non-reliable overlap flag; do not perform division. , , , and These represent the dimensionless weights of the corresponding losses, which are set to 1.0, 2.0, 1.0, 0.5 and 0.5 respectively in this specific implementation. Each weight is jointly determined by the cross-intersection over union ratio of the validation set pixels and the cross-frame feature retrieval accuracy.
[0082] Training was performed using an adaptive moment estimation optimizer with a batch size of 8 and an initial learning rate of 0.0001 for 80 rounds. After each round, the error of the board boundary points, the intersection-union ratio of handwriting pixels, the intersection-union ratio of occlusion and reflection classification, and the cross-frame retrieval accuracy of the same handwriting were calculated on the validation set. If the comprehensive index did not improve for 8 consecutive rounds, training was stopped and rolled back to the model version with the highest index. Only this frozen version was loaded during the inference phase. The classification threshold and the acceptance threshold of the contrast feature were written into the model parameters record by the error rate points of the validation set, etc.
[0083] The long-term state of the panel is saved with the coordinate system version and the 8×8 pixel grid number as the joint key. Each grid records the long-term handwriting probability, the mean of 64-dimensional handwriting features, the timestamp of the most recent reliable visible frame, the number of consecutive existing frames, the number of consecutive missing frames, and the state version number. The most recent reliable visible observation cache separately saves the handwriting probability, handwriting features, occlusion probability, reflection probability, and the corresponding frame timestamp of the current grid.
[0084] For new videos, new coordinate systems, or meshes outside the coverage area of coordinate system correspondence tables that do not yet have a long-term panel state to inherit, the state initialization module waits for the first reliable visible observation of that mesh. When the first reliable visible observation is obtained, the long-term handwriting probability is initialized with the current handwriting probability of that observation, the long-term handwriting feature mean is initialized with the 64-dimensional handwriting features of that observation, and the current handwriting probability, handwriting features, occlusion probability, reflection probability, and frame timestamp are simultaneously written to the most recent reliable visible observation cache. The most recent reliable visible frame timestamp is set to the current frame timestamp, and the state version number is set to 1. When the handwriting probability is not less than 0.50, the number of consecutive existing frames is set to 1 and the number of consecutive missing frames is set to 0; when it is less than 0.50, the number of consecutive existing frames is set to 0 and the number of consecutive missing frames is set to 1. This initial observation only establishes the baseline state and does not calculate the probability of new handwriting events or eraser candidates, nor does it generate new handwriting events or eraser candidates. Events are generated according to the difference formula and consecutive confirmation rules described later in this S2 starting from the next reliable visible observation. The initialization module also sets the 8 neighboring pixels with an average handwriting probability of not less than 0.65 and an area of not less than 16 uniform panel pixels in the first reliable visible observation. The domain connectivity domain is written into the initial board content record. The record is explicitly marked as baseline content rather than a new handwriting event or an erasure candidate, and saves the baseline content identifier, visible start time, spatial mask, 64-dimensional average handwriting features of effective pixels within the mask, number of effective feature pixels, feature encoding model version, source frame number, video identifier, source video address, archive mapping identifier, and coordinate system version. If there are no effective feature pixels within the mask or the average feature does not pass the existing L2 norm gate in this specific implementation, the baseline content record is still retained and an invalid feature mark is written, so that S4 establishes it as an independent initial The initial version does not perform trajectory connection based on this feature; if a record with no board spacer, an event confirmation permission field that is prohibited and no valid unified board image, an observation with a reliable visibility marker of 0, or a missing image patch is received before initialization is complete, the corresponding grid is kept in an uninitialized state, event confirmation is prohibited, and the reason for non-initialization is recorded in the frame-level status table; although the registration seed frame sets the event confirmation permission field to prohibited, it can only be used to perform the initialization of this section and generate the initial board content record when there is a valid unified board image and the reliable visibility marker is 1, and cannot be used for event confirmation;
[0085] The reliable visibility determination module follows the formula Generate a reliable visible mask, in which Indicates the first Frame board surface position A reliable visible marker, taking either 0 or 1. This is an indicator function that takes the value 1 if the condition is true and 0 otherwise. Indicates the first The registration quality value of the frame is a dimensionless number ranging from 0 to 1. This indicates the preset registration threshold, which is set to 0.78 in this specific embodiment. Indicates the first Frame board surface position The probability of occlusion, This indicates the preset occlusion threshold, which is set to 0.35 in this specific embodiment. Indicates the first Frame board surface position The probability of reflection, This indicates the preset reflectivity threshold, which is set to 0.30 in this specific embodiment. Indicates the frame number. Indicates the coordinate position of the unified board surface;
[0086] At a reliably visible location, the event generation module reads the current handwriting probability, current handwriting features, long-term handwriting probability, and most recently reliably visible handwriting features; when the L2 norm of both 64-dimensional handwriting feature vectors is greater than... Perform L2 normalization at each time, according to the formula Calculate the normalized cosine distance, then follow the formula. Generate confidence adjustment coefficients; where Indicates the first Frame position The dimensionless characteristic distance, taking values from 0 to 1, This represents a 64-dimensional handwriting feature vector representing the current position. This represents the 64-dimensional handwriting feature vector from the most recent reliable visible observation. This represents the cosine similarity between two L2-normalized vectors. This represents the dimensionless confidence adjustment coefficient obtained by mapping the feature distance through a slope of 0.5 and a bias of 0.5, ranging from 0.5 to 1. This represents a function that truncates the first parameter to the second and third parameters, given upper and lower bounds. The truncation results in all three formulas in this section are dimensionless numbers between 0 and 1; the most recently reliably visible feature is missing, or the L2 norm of any eigenvector is not greater than... Normalization and cosine operations are not performed at this time. Set to 0, Set to 1, and write the feature missing marker or zero norm backoff marker respectively. At this time, only the pixel probability difference is used and the difference is not reduced by invalid feature evidence; the event generation module then follows the formula and Calculate the probability of new handwriting events and the probability of eraser candidates separately, where This indicates the probability of a new handwriting event. represents the probability of erasing candidates; both are dimensionless numbers between 0 and 1, with larger values indicating a higher probability of the corresponding event. This indicates the probability of the current handwriting. This represents the probability of long-term handwriting. and In Using the definition immediately preceding this section, Indicates the frame number. It represents the unified board coordinate position; when a feature is restored from invalid to valid, the aforementioned feature adjustment formula is reapplied from the restored frame, but the continuous count of pixels that have met the pixel probability threshold in the same spatial area is retained, and the count is cleared according to the existing rules only when the restored frame itself is unreliable or the probability is lower than the corresponding threshold.
[0087] The newly added handwriting confirmation module accumulates the probability of new handwriting events only in consecutive frames where the event confirmation permission field is allowed and the reliable visibility flag is 1. Connected regions with a probability of not less than 0.72 are written into the new handwriting candidate queue. When the threshold is reached for 3 consecutive frames in the same connected region, the new handwriting event is confirmed. If any intermediate frame is unreliable or the probability is less than 0.72, the consecutive count of the region is cleared. During confirmation, the effective pixels covered by the event space mask are read from the 64-dimensional handwriting feature map bound to the source frame number and feature encoding model version, and the average value is calculated by dimension. The obtained 64-dimensional average handwriting feature, the number of effective pixels of the feature, the feature encoding model version, and the source feature map identifier are written into the new handwriting event record. If there are no effective pixels in the mask, the effective features in the most recently reliable visible observations of the same spatial mask are read in reverse chronological order and the average value is calculated in the same way. If there are still no effective features or the average feature does not pass the existing L2 gate of this specific implementation, the 64-dimensional average handwriting feature is set to a zero vector and written into the feature invalid flag. The feature cannot be used to calculate the connection cost or similarity in subsequent S4.
[0088] The eraser candidate generation module writes regions with an eraser candidate probability of not less than 0.68 and a connected area of not less than 16 uniform board surface pixels into the eraser candidate queue. The queue records the candidate identifier, spatial mask, formation time, most recent reliable visible observation identifier and average candidate probability. The eraser candidate does not directly change the long-term board surface state in S2, but is handed over to S3 for confirmation based on the front anchor, back anchor and continuous reliable observation.
[0089] The most recently reliable visible observation cache is atomically refreshed according to the frame timestamp: When processing the current frame, the event generation module first reads the most recently reliable observation before the arrival of the current frame as the comparison benchmark, and sequentially completes the difference calculation, new candidate accumulation, eraser candidate generation and event confirmation for this frame. Then, when the current observation is reliable and the image patch is valid, the handwriting probability, 64-dimensional handwriting features, occlusion probability, reflection probability, observation identifier, frame number and timestamp of the current grid are appended to the cache and set as the most recently reliable observation for the next frame. The registration seed frame is only allowed to initialize or refresh the cache and does not enter the event continuous count. Unreliable frames, no board surface placeholder records and image patch missing records are neither refreshed in the cache nor used as S3 evidence. The cache retains the bounded temporal history of the most recently 15 seconds and no less than 20 reliable observations according to the video identifier, coordinate system version and grid number. When there is an eraser candidate that has not been closed, the last reliable observation before the previous anchor, the subsequent anchor and the observation in the continuous confirmation window before the candidate is retained until the candidate is confirmed or closed. The observation identifier provides an overridable temporal chain reference to S3.
[0090] For reliably visible locations, after confirming a new handwriting event, the long-term board state is updated only within the mesh covered by the event space mask. An exponential coefficient of 0.85 is explicitly used as the weight of the old state: the probability of the new long-term handwriting is the sum of 0.85 times the probability of the old long-term handwriting and 0.15 times the probability of the handwriting in the current confirmed frame; when both the old 64-dimensional long-term handwriting features and the current 64-dimensional handwriting features pass the existing L2 gate, for each dimension, the sum of 0.85 times the old feature component and 0.15 times the current feature component is taken, and then the resulting vector is normalized using L2 before being written into the long-term handwriting feature mean; old features When an invalid feature is present but the current feature is valid, the old feature is replaced with the current normalized feature. When the current feature is invalid but the old feature is valid, the old feature remains unchanged. When both are invalid, the vector is kept as all zeros and a long-term feature invalidation flag is written. When the confirmation update is completed, the status version number is incremented, the timestamp of the most recently reliably visible frame is set to the timestamp of the current confirmation frame, the number of consecutively existing frames is incremented by 1 and the number of consecutively missing frames is set to 0. For positions where the event confirmation permission field is prohibited, the reliable visibility flag is 0, or the image patch is missing, all fields of the long-term panel status remain unchanged, and only the freeze reason and freeze start and end time are recorded in the frame-level status table.
[0091] Model parameter records are stored with model version and board type as joint keys, including reliable visibility threshold, new confirmation threshold, erase candidate threshold, number of consecutive confirmation frames, distance type used for confidence adjustment coefficient, mapping slope 0.5, mapping bias 0.5, default value of missing features 1, old state index weight 0.85, and their validation sample batches. During runtime, if a matching record exists for the current board type, the corresponding threshold and mapping parameters are loaded. If no matching record exists, global security parameters are loaded and online modification is prohibited. When the validation set detects that the false alarm rate of new handwriting exceeds 3%, only a recalibration task is generated. The threshold of the currently processed classroom video is not directly rewritten. The new version will only take effect in the next video after the recalibration passes the independent test set.
[0092] S2 outputs the initial board content record, the newly added handwriting event record, the eraser candidate record, the reliable visible mask, the most recent reliable visible observation cache, and the updated long-term board state. The initial board content record and the newly added handwriting event record both carry video identifier, source video address, archive mapping identifier, coordinate system version, spatial mask, formation time or visible start time, average probability, 64-dimensional average handwriting feature, number of effective feature pixels, feature encoding model version, source feature map identifier or source frame sequence number, and feature validity marker. The source video address and archive mapping identifier are copied from the frame sequence metadata of the same video identifier in S1 and must not be rewritten by the event module. The initial board content record and the newly added handwriting event are used by S4 to generate initial or subsequent handwriting trajectory fragments, and the eraser candidate and the observation cache with bounded temporal history are used by S3 to establish anchor points.
[0093] In this specific embodiment, S3 includes:
[0094] The anchor point management module reads the erase candidate record, reliable visible mask, most recent reliable visible observation cache and long-term board state of S2 according to the erase candidate identifier, and organizes reliable observations with an overlap of not less than 0.6 with the candidate spatial mask into the same candidate time-series observation chain. The overlap is obtained by dividing the number of intersection pixels by the number of union pixels.
[0095] The anchor point management module first removes candidates whose event confirmation permission is prohibited, whose coordinate system version cannot be matched, or whose candidate spatial mask has less than 16 effective pixels. Then, it processes the candidates from the earliest to the latest according to their formation time. Candidates with the same formation time are sorted from the highest to the lowest according to the average erase candidate probability. Candidates with a spatial mask crossover ratio of not less than 0.80 and a formation time interval of not more than 200ms are merged into the same candidate. This makes the selection of the front anchor and the back anchor only target the candidate records that have been deduplicated and have the most complete evidence.
[0096] For erase candidates formed in consecutive reliable visible frames, the anchor management module records the last reliable visible observation before the candidate is formed as the previous anchor and the first reliable visible observation after the candidate is formed as the next anchor. It also requires that the timestamps of the previous anchor and the next anchor be monotonically increasing and the interval not exceeding 2 seconds. Candidates exceeding this interval are transferred to the queue to be re-established.
[0097] For candidates that are erased after undergoing an unobservable process and regaining reliable visibility, the anchor management module records the last reliable visible observation before becoming unobservable as the front anchor and the first reliable visible observation after regaining reliable visibility as the back anchor. It also writes the start and end times of unobservability, the number of frozen frames, and the registration quality value of the restored frames into the anchor pair record.
[0098] Each front anchor and back anchor stores the anchor point identifier, candidate identifier, coordinate system version, handwriting space mask, 64-dimensional handwriting features, observation frame number, and reliable visibility time. The front anchor additionally stores the last visible existence time, and the back anchor additionally stores the reliable visibility time of the back anchor. When the coordinate system versions are inconsistent, the two anchors are compared only within the inheritable area covered by the corresponding table of the S1 coordinate system.
[0099] The differential module operates within the overlapping area of the front and rear anchors according to the formula. Calculate the first The missing mask of subsequent reliable observations, among which , and All belong to And have the same size, Indicates the first A binary missing mask relative to the preceding anchor for subsequent reliable observations. This represents the front anchor binary handwriting space mask. Indicates the first A binary handwriting spatial mask for subsequent reliable observations. and These represent the number of pixel rows and columns in the overlapping area, respectively, both in pixels. 1 indicates overlap with... A matrix of all ones of the same size Represents the logical complement of each pixel. Indicates a pixel-by-pixel logical AND. Indicates a reliable observation index counting from the rear anchor;
[0100] The feature verification module first reads the long-term board state before candidate formation, and checks the L2 norm of the 64-dimensional handwriting feature vectors at both ends before each cosine comparison. Only when both L2 norms are greater than 1 will the verification be successful. Normalization and cosine operations are performed at the same time; any feature is missing or the L2 norm is not greater than 1. If cosine matching is not performed, the observation is marked as invalid feature evidence and is not included in the persistent missing confirmation frame. If invalid feature evidence occurs three times consecutively, the current candidate is closed and the anchor point is re-established from the next reliable visible observation. If no valid feature evidence is obtained after a maximum wait of 5 seconds, the candidate is closed and the reason for feature unavailability is recorded. When the feature is valid, the joint comparison of the back anchor and subsequent reliable observations continues only when both the front anchor mask and the long-term board state support the existence of handwriting in the candidate region, i.e., the front anchor coverage is not less than 0.70, the long-term handwriting probability mean of the candidate region is not less than 0.65, and the cosine similarity between the long-term 64-dimensional handwriting feature and the front anchor feature is not less than 0.70. Subsequently, cosine matching is performed on the handwriting features of the front anchor covered by the missing mask and the handwriting features at the same position in the back anchor and subsequent reliable frames. Only the maximum cosine similarity is calculated based on the valid comparison results. ,like If the error rate is below 0.45 and the cross-union ratio of the missing mask and the candidate space mask for erasure is not less than 0.70, then the reliable observation is recorded as persistently missing. When the long-term state conflicts with the previous anchor, erasure is not confirmed and state reconstruction is initiated. When the coordinate system has just switched or the long-term state version is more than two versions earlier than the previous anchor, only the long-term state is reconstructed and the frame is not used as evidence of erasure. The error rates of 0.45, 0.65, 0.70 and coverage threshold are determined by the equal error rate points of the real erasure fragments and occluded fragments in the validation set and stored in the erasure confirmation parameter record.
[0101] When the handwriting contained in the front anchor is continuously missing in the subsequent reliable observations of the rear anchor, the event of erasing handwriting is confirmed. Specifically, the differential result is allowed to enter the confirmation branch only when the preset number of confirmation frames is reached. In this specific implementation, the preset number of confirmation frames is 3 frames. If there are unobservable frames in the reliable observation chain, the counting is paused but the unobservable frames are not regarded as missing evidence. After the reliable visibility is restored, 3 consecutive differential results that meet the conditions must still be obtained.
[0102] For each candidate to be confirmed, the confirmation queue saves the current number of consecutive missing frames, the most recent differential mask, the maximum value of feature matching, the cumulative number of reliable observations, and the timeout status. If a candidate does not reach 3 consecutive reliable confirmation frames within 5 seconds, the candidate is closed and the reason for closure is retained. If the effective overlap area between the front anchor spatial mask and subsequent reliable observations is less than 50% of the front anchor area, the evidence is deemed insufficient and a new back anchor is selected to avoid using a small visible area to confirm that the entire piece of handwriting has been erased.
[0103] The erase confirmation module requires that three consecutive reliable observations starting from the rear anchor meet the continuous missing condition. When three frames are reached, the reliable visible moment of the rear anchor is determined as the first visible missing moment, the last visible existence moment of the front anchor is determined as the lower bound of the time boundary, and the first visible missing moment is determined as the upper bound of the time boundary. If the handwriting features of the front anchor are rematched during the continuous counting period, the confirmation count is cancelled.
[0104] Event confidence is calculated according to the formula Calculation, where The value represents the confidence level in confirming the erasure of handwriting; it is a dimensionless number between 0 and 1, with a larger value indicating more sufficient evidence of erasure. The mean value of the crossover ratio of consecutive missing masks, ranging from 0 to 1. This indicates the maximum feature similarity between subsequent reliable observations and the preceding anchor, ranging from 0 to 1. The mean of the registration quality of the back anchor and consecutive confirmation frames is 0 to 1. 0.4, 0.35, and 0.25 are dimensionless weights on the validation set that maximize confirmation accuracy and sum to 1. A gap indicates where a feature no longer matches, and the larger the gap, the more supportive it is of erasure.
[0105] A confirmation event for erasing handwriting is generated when the event confidence level is not lower than 0.75. The event record includes the event identifier, erase spatial mask, event confidence level, last visible existence time, first visible missing time, previous anchor identifier, next anchor identifier, 64-dimensional handwriting feature snapshot of the previous anchor, coordinate system version, and source candidate identifier. After the confirmation event is written, the probability of long-term handwriting is decayed to the original value multiplied by the event confidence level within the intersection of the erase spatial mask and the reliable visible mask. Long-term handwriting features with a confidence level below 0.10 are removed and the status update time, source erase event identifier, and new status version number are written. The updated long-term board status feedback is used as the input for subsequent S2. When erase and new events exist simultaneously in the same frame, they are processed in the order of event time. If the times are the same, the erase event is written back first and then the new event is written back. When the event confidence level is below 0.75, the candidate is retained but no confirmation event is output, and the long-term board status is not changed. The update continues when a reliable observation arrives.
[0106] The local erase barrier is defined by the erase spatial mask, the lower bound of the temporal boundary, the upper bound of the temporal boundary, and the coordinate system version. Its spatial range is the result of a closing operation with a radius of 3 pixels on the intersection of pixels of consecutive missing masks to avoid the barrier being expanded by single-frame noise. The barrier record is written into the erase barrier table with the erase event confirmation identifier as the key.
[0107] The erase confirmation state is stored with the candidate identifier as the key to save the previous anchor, the next anchor, the consecutive missing count, the current event confidence, and the evidence validity mark. The confirmation module performs a state transition once it reaches a reliable observation. When the differential, feature, and consecutive frame conditions are met, the action of generating a confirmation event is executed. When the reappearance, insufficient evidence coverage, or timeout conditions are met, the actions of canceling the candidate, reselecting the next anchor, or closing the candidate are executed respectively. When any state transition fails, the original state is maintained and the failure reason is written, and no local erase barrier is generated.
[0108] The erase confirmation parameter record is calibrated by four types of verification segments: real erase, short-term occlusion, reflection change, and writer's body occlusion. The record includes the missing mask crossover threshold, feature similarity threshold, event confidence threshold, number of confirmation frames, and maximum waiting time. During calibration, the parameter combination is selected with the constraint that the real erase recall rate is not less than 95% and the occlusion false confirmation rate is not higher than 2%. When the board type of the running video does not match the parameter record, the aforementioned safe combination of 0.70, 0.45, 0.75, 3 frames, and 5 seconds is used.
[0109] S3 ultimately outputs to S4 the confirmed set of erased handwriting events, the set of partial erased barriers, and the long-term panel state version after erasure. At the same time, it outputs the candidate states that have been revoked or are still pending confirmation, so that S4 can only establish disabling constraints on confirmed barriers and not mistakenly treat unconfirmed short-term occlusion as content erasure.
[0110] In this specific embodiment, S4 includes:
[0111] The trajectory construction module reads the initial board content record, confirmed new handwriting events, and confirmed erased handwriting events from S2 in chronological order. It generates an initial trajectory segment marked as the baseline source from the spatial mask of the initial board content record, taking the visible start time as its starting time, and copies the bound 64-dimensional average handwriting features, valid feature markers, video identifiers, and coordinate system version. This record is not counted as a new handwriting event. The module performs 8-neighborhood connected component labeling on the spatial mask of the new handwriting events, discarding isolated connected components with an area less than 12 pixels as noise, and then assigns the centroid, bounding rectangle, skeleton pixels, and other data to the source frame and module of the remaining new connected components. The 64-dimensional average handwriting feature and event time bound to the type version are written into the event connected component record to generate or extend handwriting trajectory fragments. Initial or newly added fragments with invalid features are retained as independent trajectories but cannot participate in the feature distance, mandatory connection, common ancestor or alternative connection judgment described later in this S4. It is confirmed that the erase handwriting event does not generate new handwriting trajectory fragments, but matches and terminates existing trajectories according to the overlap of the erase space mask and the temporal boundary. The 64-dimensional handwriting feature snapshot of the previous anchor of the event is copied in the trajectory termination record. When multiple existing trajectories overlap at the same time, they are terminated in descending order of the number of overlapping pixels. When no existing trajectory is matched, an isolated erase record is output without fabricating average handwriting features.
[0112] The handwriting trajectory fragment uses the following fields: trajectory identifier, coordinate system version, source record identifier set, baseline source marker, start time, end time, cumulative spatial mask, 64-dimensional handwriting feature mean, and common trajectory ancestor identifier. The source record identifier set can reference the initial board content identifier or the newly added handwriting event identifier, and the two types cannot be confused. The trajectory construction module first searches for candidate connected components by a time adjacency window of 1.2 seconds, and then connects the candidate connected components based on the board coordinate overlap and handwriting feature similarity.
[0113] Trajectory features and cosine distance are uniformly calculated according to the formula. Calculation, where Representing trajectory segments With trajectory fragments The 64-dimensional handwriting feature cosine distance is a dimensionless number between 0 and 1. Representing trajectory segments The 64-dimensional handwriting feature vector, Representing trajectory segments The 64-dimensional handwriting feature vector, This represents the cosine similarity of the feature vectors at both ends after L2 normalization, ranging from negative 1 to 1. The constant 1 and divisor 2 are dimensionless mapping parameters. Normalization and calculation are performed only when the L2 norms of both feature vectors pass the existing unified validity gate of this S4 formula. If either feature vector is invalid, the trajectory pair is not defined. This trajectory pair will then be excluded from subsequent connection cost and similarity assessments.
[0114] The connection cost of trajectory pairs is calculated according to the formula. Calculation, where Representing trajectory segments With trajectory fragments The connection cost is a dimensionless number between 0 and 1, with smaller values indicating a greater likelihood of connection. The intersection-union ratio (IU) of two cumulative spatial masks is between 0 and 1. The cosine distance between two handwriting feature vectors is represented by a value between 0 and 1. This represents the time interval between two trajectory segments, in seconds. This indicates the upper limit of the normalized time interval, which is set to 1.2 seconds in this specific implementation. and Indicates the index of the trajectory segment. The function represents the cutoff function, where the three dimensionless weights are labeled by the validation set of the labeled trajectory pairs and sum to 1; Calculate... Previously, we examined the L2 norm of the 64-dimensional trajectory feature vectors at both ends, and only when both L2 norms were greater than... Normalization and cosine operations are performed and calculations are performed. Any feature is missing or the L2 norm is not greater than 0. Marking this trajectory as a feature is invalid, and it is not calculated. and Furthermore, it excludes candidates from similarity judgments based on candidate connections, mandatory connection constraints, common trajectory ancestors, candidate cancellations, and alternative connections. This rule serves as a unified validity gate for calculating the cosine distance and cosine similarity of all subsequent trajectory features in this S4.
[0115] Candidate connections are established when the connection cost is no greater than 0.42, the overlap of the board coordinates is no less than 0.20, and the time interval is no more than 1.2 seconds. If the connection cost of multiple successor trajectories is the same, the connections are determined in the order of smaller handwriting feature distance, earlier event time, and smaller lexicographical order of trajectory identifier. The connection parameter records are saved with version numbers according to the classroom board type and recalibration is triggered when the false connection rate of the validation set exceeds 3%.
[0116] For trajectory pairs that do not have local erasure barriers, where the subsequent trajectory segment contains the continuous handwriting region of the previous trajectory segment, and the handwriting feature similarity of the common region is not less than 0.82, a mandatory connection constraint is established. The mandatory connection constraint records store the two trajectory identifiers, the continuous region mask, the constraint source event, and the constraint creation time, and are combined into an indivisible supernode through a union-find set before clustering.
[0117] Establish a disconnection constraint for trajectory pairs that terminate before the lower bound of the local erase barrier time boundary and begin after the upper bound of the time boundary, and whose overlapping pixel count with the erase spatial mask is not less than 12. The disconnection constraint records and saves the barrier identifier, the previous trajectory identifier, the next trajectory identifier, and the time boundary. In any merging stage of subsequent clustering, the merging of two clusters containing this trajectory pair is prohibited.
[0118] Outside of the local erasure barrier, the trajectory construction module retrieves common trajectory ancestors that have continuously visible trajectories before and after the barrier and whose handwriting feature similarity is not less than 0.82. The common trajectory ancestor is retained as the same content version relationship and written into the version relationship cache. Within the local erasure barrier, even if the overlap of the board coordinates of two trajectories reaches the connection threshold, it is prohibited to establish a connection or the same content version relationship based solely on the overlap of coordinates.
[0119] When a handwriting marked as an erasure candidate reappears before three consecutive reliable confirmation frames, or when the handwriting features of the previous anchor are re-matched in consecutive reliable frames after the subsequent anchor and the cosine similarity is not less than 0.82, the corresponding erasure candidate is revoked and its temporary barrier reference that has not yet taken effect is deleted. Newly generated handwriting events retain the original event time and are not merged into subsequent trajectories within the barrier due to the candidate revocation.
[0120] The constrained temporal clustering module first uses the mandatory supernodes as initial clusters, and then follows the formula... Calculate the average connection cost between candidate clusters, where Indicates candidate clusters With candidate clusters The average connection cost is a dimensionless number between 0 and 1, and the smaller the value, the better for merging. and This represents two trajectory families to be compared. and These represent the number of trajectory segments contained in the two trajectory clusters, in units of 1 and 2. Representing trajectory segments With trajectory fragments The connection cost is a dimensionless number between 0 and 1, with smaller values being more suitable for connection. The connection cost formula and its immediate neighboring complete symbol interpretations are calculated according to the aforementioned trajectory in S4. and This represents the index of the trajectory segment within the corresponding cluster; candidate cluster pairs are calculated only if all their cross-cluster trajectory pairs pass the aforementioned unified validity gate. If any cross-cluster trajectory is deemed invalid as a feature, the candidate cluster pair is marked as infeasible and the two clusters remain separated, thus avoiding the use of undefined features. Participate in the summation;
[0121] The clustering module processes candidate cluster pairs in ascending order of average connection cost. Merging is only performed when the average connection cost is not greater than 0.38, the merged cluster does not contain any prohibition constraints, and the time span of events within the cluster does not exceed 15 minutes. When the average connection costs are the same, cluster pairs with a larger intersection-union ratio of their spatial bounding rectangles are merged first, until no candidate cluster pairs that meet the conditions are found.
[0122] Before each cluster merge, the cluster constraint checker reads both the mandatory disjoint set and the forbidden adjacency list. If a candidate cluster pair contains forbidden edges, crosses non-inheritable regions of two coordinate systems, or causes the same event to fall into two versions after merging, the cluster pair is marked as infeasible and the next candidate cluster pair is processed. If a forbidden edge appears inside a mandatory supernode, the affected merge in this round is rolled back, and forbidden constraints are always retained first. Conflicting supernodes are reverted to their original trajectories and marked as pending manual review and prohibited from indexing. At the same time, the set of unaffected stable versions, the set of conflicting trajectories, and the constraint conflict record are output. S5 only processes stable versions and only retains video time localization for conflicting trajectories without building a formal structure index.
[0123] For trajectory pairs that fail the original connection criterion but whose time interval does not exceed 1.2 seconds, the S4 built-in lightweight pre-identifier performs a coarse classification of text lines, formula symbol layout, and arrow endpoints on adjacent candidate trajectory images before clustering. Any of the following conditions—forbidden edges, non-inheritable regions across coordinate systems, and failure to meet the time window—are rejected as alternative connections. Other trajectory pairs are considered alternative candidates if the shortest distance on the board is less than 24 pixels, or if the vertical difference between the centers of the two trajectories is no greater than 12 pixels and the horizontal interval is no greater than 40 pixels. When the output probability of the same coarse classification for two trajectory pairs is not less than 0.70, the minimum probability of the two probabilities is subtracted from the first probability to obtain the coarse classification difference, and the handwriting feature similarity is subtracted from the first probability to obtain the feature difference. The difference is calculated by dividing the shortest distance on the board by 24 and truncating it to 0 to 1 as the distance difference. The alternative connection cost is obtained by weighting the sums of the alternative connection costs with 0.45, 0.35 and 0.20 respectively. When the alternative connection cost is no greater than 0.38, the two trajectories are connected, thus allowing the spatial intersection ratio to be lower than 0.20 but belonging to the same text line, formula layout or arrow structure to be definitively grouped. When there are multiple alternative candidates for the same trajectory, the smaller alternative connection cost, the smaller time interval and the smaller lexicographical order of the trajectory identifier are selected in turn. The pre-identification result does not depend on S5 and is not written into the formal index. When there is no consistent evidence, evidence conflict or the alternative connection cost is still higher than 0.38, the trajectories are kept separate and separate board structure unit versions are generated.
[0124] For each clustering result, immutable whiteboard structure unit state versions are generated in chronological order. When there is an initial whiteboard content record, an initial version with the sequence number 1 is generated from the corresponding baseline trajectory, and the visible start time is recorded as the creation time. When there is no baseline trajectory, a version with the sequence number 1 is generated from the first newly added handwriting event, and the event time is recorded as the creation time. Each subsequent confirmation of addition, partial modification, or confirmation of erasure copies the state of the previous version and generates a new version with an incrementing sequence number, and the corresponding event time is recorded as the modification time of this version. The effective time interval of each version adopts a left-closed and right-open interval from the creation or modification event time of this version to the end of the next confirmation event time. The terminating version generated by the erasure event takes the first visible missing time as the starting point of the interval and marks its state as erased. The final stable version without subsequent events takes the end time of the class video as the interval end time.
[0125] The version identifier of the whiteboard structure unit is determined by the common trajectory ancestor identifier, coordinate system version, and monotonically increasing state number, and cannot be modified after creation. The version record includes version identifier, previous version identifier, common trajectory ancestor identifier, trajectory segment identifier set, cumulative spatial mask, whiteboard bounding rectangle, creation time, current version modification time, erasure time, unique valid time interval, state type, coordinate system version, video identifier, source video address, and archive mapping identifier. The latter three items are copied from the S2 initial whiteboard content record or event record that makes up this version according to the same video identifier. If the video identifier of the source record is inconsistent, aggregation is rejected and video association conflict is output. The version record also writes the relationship between adjacent previous and next versions and the same content version into the version relationship cache, so that each version identifier uniquely corresponds to a valid time interval and a set of video address associations.
[0126] Clustering parameter records use course board type, coordinate system version, and feature encoding model version as retrieval keys to save connection cost threshold, cluster merging threshold, feature similarity threshold, maximum temporal adjacency window, and verification sample batch. Before deployment, manually labeled trajectory pairs of the same structural unit and trajectory pairs of different structural units are used to scan parameter combinations. The combination with zero disabling violation number and the highest clustering adjustment Rand index is used as the effective version and the effective date is recorded. If the record is not hit during runtime, the trajectory segments are kept separated and parameter missing markers are output. Unlabeled thresholds are not used to force merging.
[0127] S4 ultimately outputs a set of blackboard structure unit versions with valid time intervals, version relationships of the same content, event time series, and a mapping table from trajectory to version. This output serves as the unified data source for S5 structure recognition, blackboard evolution graph edge construction, and retrieval index record generation.
[0128] In this specific embodiment, S5 includes:
[0129] The structure recognition module reads the state type, cumulative spatial mask, and circumscribed rectangle of the board surface according to the version of the board structure unit output by S4. For versions whose state type is not erased, it first filters uniform board surface frames within the corresponding valid time interval that have an event confirmation permission field that is allowed, feature encoding model version that matches, and a reliable visible pixel ratio within the cumulative spatial mask that is not less than 0.85. Then, it selects the frame with the highest registration quality from the qualified frames, crops the structure unit image, and expands the context area by 16 pixels around the circumscribed rectangle. The cropped image, version identifier, coordinate system version, local reliable visible pixel ratio, and valid time interval are combined to form the recognition task record. If there are no qualified frames within the valid time interval, it sequentially backtracks to the source reliable frame of the creation event or the modification event of this version, as well as the most recent local reliable frame of the same version. The backtracked frame must still meet the requirement that the local reliable visible pixel ratio is not less than 0.85 and the model version matches; otherwise, recognition is not started and the version is marked as unavailable for recognition. To be reviewed, frames with only globally registered quality but unreliable local structural units will not be used; for the initial version formed by the registration seed frame, recognition is allowed to be performed using the seed frame that generates the initial board content record, but the aforementioned local reliable visibility and model version gate must still be met; for the terminated version with the state type of erased, the image is not cropped from the effective time interval after the first visible missing moment, but along the previous version identifier, the accepted recognition result of the most recent non-erased version and the last visible frame identifier are obtained, copied as a pre-deletion recognition snapshot and marked as erased, if there is no available previous version or accepted recognition result, image recognition will not be started and the terminated version will be marked as unrecognizable, but its time interval, video address association and erasure relationship will still be retained for edge construction of the evolution graph; all recognition tasks and pre-deletion recognition snapshots read the video identifier, source video address and archive mapping identifier from the S4 version record, and the three are verified to be consistent with the video identifier before being passed to the index record;
[0130] The type classifier uses a convolutional backbone and a three-classification output head. After scaling the structural unit image to 384×384, it outputs the class probabilities of text, formulas and graphics. When the maximum class probability is not less than 0.70, the class is adopted. When it is less than 0.70, the text recognition and formula recognition branches are run simultaneously and the class is determined by the rules composed of character coverage, operator recognition rate and contour closure. If it still cannot be determined, the type is recorded as pending review, but the version and time index are retained.
[0131] The structure type classifier, text recognition branch, formula recognition branch, and arrow direction classifier all use training and validation sets divided according to the class. The type classifier is trained with cross-entropy, the text recognition branch is trained with connection time classification loss and character box regression loss, the formula recognition branch is trained with symbol classification loss, bounding box regression loss, and tree edge classification loss, and the arrow direction classifier is trained with endpoint direction labels. If any model does not improve the corresponding task metric on the validation set for 6 consecutive rounds, it will be rolled back to the best version.
[0132] The structure recognition results are accepted and written to the node according to the following rules: when the average confidence of the text characters is less than 0.65, the text is marked as pending verification; when there are unclosed brackets in the formula tree, the formula is marked as pending verification; when neither of the two endpoints of the arrow falls into or is adjacent to any structural unit version, the isolated arrow is marked; when the probability difference between the text and formula categories in the same cropped image is less than 0.10, both candidate categories are saved simultaneously; when the model version is inconsistent with the version required by the index record, the incremental index update is paused and inference is restarted.
[0133] For text structure units, the text recognition branch uses a convolutional feature extractor and a Transformer sequence decoder to output character sequences, character boxes, and character confidence scores. Then, it performs word segmentation according to the Chinese word segmentation dictionary and the classroom subject vocabulary. The step number is identified by the pattern of the first number of the line or the Chinese character sequence number. The indentation level is determined by the difference of the left boundary of adjacent text lines and the line height normalization result. The title probability, step number, indentation level, and parent key point identifier are written into the text level record.
[0134] For formula structure units, the formula recognition branch first outputs the symbol category, symbol bounding box, and recognition confidence score using a convolution detector. Then, it generates a symbol layout tree based on the horizontal order of the bounding box center, the relative positions of the superscript and subscript, the crossing relationship of the fraction line, and the covering relationship of the square root. It also generates an operator tree based on the operator priority, bracket pairing, and the connection relationship on both sides of the equal sign. Unclosable brackets or symbols with a confidence score below 0.65 are marked with a check mark for the corresponding tree node but the original symbol is not deleted.
[0135] For graphic structure units, the graphic recognition branch obtains the contour through edge tracking, and obtains the arrow axis, arrow direction, and start and end endpoints through line segment detection and endpoint direction classification. The endpoints are converted to a unified board coordinate system, and the moment of arrow formation is used as the relationship establishment moment. First, the board structure unit versions that contain the moment in the effective time interval are filtered. The graphic structure unit version to which the current arrow belongs is excluded from the candidate pool. Then, the candidate versions that the endpoint falls into or are within 20 pixels of the endpoint are retrieved. When there are multiple candidates for the same endpoint, the unique version is determined in the following order: smaller endpoint distance, higher recognition confidence, later start time of the effective time interval, and smaller lexicographical order of the version identifier. If the start and end points to the same candidate version, only the end with the smaller endpoint distance is retained. If the distances are the same, the start point is retained, and the other end is marked as pending verification and no self-loop pointing edge is established. If there are no candidates with coexisting time, no pointing edge is established for the endpoint, and the arrow is marked as an isolated arrow or a single-end pending verification arrow. The graphic relationship record saves the contour identifier, arrow identifier, relationship establishment moment, start version identifier, end version identifier, self-loop exclusion status, and time filtering status.
[0136] The blackboard evolution diagram uses the version of the blackboard structure unit as nodes. Each node stores the version identifier, structure type, board coordinates, recognition result, recognition confidence, creation time, effective time interval and video address. Predecessor edges are established based on the connection relationship between creation time and effective time interval, and derivation self edges are established based on the subtree normalization encoding changes of the formula operator tree.
[0137] The graph construction module also establishes containing edges based on the inclusion relationship of the bounding rectangle of the board surface, establishes annotation edges based on the adjacency relationship between text structural units and graphic structural units, establishes pointing edges based on the starting and ending versions of arrows, and establishes edges with the same content version between versions of S4 that have a common trajectory ancestor. Before establishing containing edges or annotation edges, it is required that the effective time intervals of the source version and the target version have a non-empty intersection. Then, the spatial inclusion or adjacency relationship is calculated within the intersection time. When there are multiple spatial candidates for the same source version, the selection is determined by the longer effective time intersection duration, the higher spatial inclusion ratio or adjacency degree, the higher recognition confidence, and the smaller the lexicographical order of the version identifier. When there is no time intersection, no edge is established and the time non-coexistence state is recorded. Each edge saves the edge type, source node, target node, evidence identifier, establishment time, and effective time intersection.
[0138] The text indexing module segments the text recognition results into words and performs synonym normalization. It writes the keywords into the inverted table as index keys. The formula indexing module traverses the root-to-leaf paths of the symbol layout tree and the operator tree and the subtrees with a depth of no more than 4. It uniformly replaces the variable names with placeholders and sorts the child nodes according to the commutative law to form the formula tree path index key.
[0139] The step index module uses the step number, key level, and the sequence of predecessor edges and derived edges of the corresponding node in the blackboard evolution diagram to form the step graph path index key. When consecutive versions have the same step number, all version identifiers with the same content version edge are retained, so that the search results can return the formation and modification process of the step.
[0140] Each keyword, formula tree path, or step diagram path index item records the index key, whiteboard structure unit version identifier, whiteboard coordinates, recognition confidence, start and end times of the effective time interval, video address, structure type, and diagram node identifier. The index records are used to build a composite inverted table based on the video identifier and index key, and the affected index items are incrementally reconstructed after the whiteboard structure unit version is updated.
[0141] The retrieval service converts keywords, formula structures, or step numbers in the request into corresponding index keys, and records the existence and parsing status of each query type before recall. Only when at least one query type is not empty and parsed successfully, resulting in a sum of effective weights greater than 0, is the candidate version recalled from the corresponding index table and processed according to the formula. Calculate the fusion matching degree of the candidate versions, where Indicates candidate version The fusion matching degree is a dimensionless number ranging from 0 to 1, with a larger value indicating a better match. Indicates keyword matching degree, ranging from 0 to 1. This indicates the formula tree path matching degree, ranging from 0 to 1. This indicates the path matching degree of the step graph, ranging from 0 to 1. This represents the candidate version index. 0.45, 0.35, and 0.20 are dimensionless weights that are calibrated based on the average reciprocal rank of the validation query set and sum to 1. For a single query type that is missing or fails to be parsed, its corresponding weight is reset to zero, and only the remaining positive weights are renormalized by the sum of the positive weights. When all three types of query inputs are missing, all are empty, or all fail to be parsed, recall, weight renormalization, and fusion matching degree calculation are stopped, and an empty result of unavailable query conditions, a list of missing or failed-to-parse fields, and an empty set of used index keys are returned, thus avoiding zero denominator operations.
[0142] The retrieval service sorts the results from highest to lowest based on the fusion matching score. When the scores are the same, the results are determined in the following order: higher identification confidence, earlier start time of the effective time interval, and smaller lexicographical order of the version identifier. The top 20 candidates with a fusion matching score of not less than 0.55 are used as the recalled versions. The versions are then extended by one hop along the predecessor edge, derivation edge, containing edge, annotation edge, pointing edge, and edge of the same content version in the blackboard evolution graph. The connected versions are used as the evolution context.
[0143] For each recalled version, the replay positioning module reads the creation and modification times from the event time series and uses the previous valid version as the benchmark for structural changes: the text level change ratio is taken as the maximum value of the number of characters added, deleted, or replaced divided by the number of characters in the previous and subsequent versions, with the denominator being the smallest and set to 1; the formula tree subtree change ratio is taken as the maximum value of the number of tree nodes inserted, deleted, or replaced divided by the number of tree nodes in the previous and subsequent versions, with the denominator being the smallest and set to 1; the graphic pointing relationship change ratio is taken as the maximum value of the number of directed edges added, deleted, or changed endpoints divided by the number of directed edges in the previous and subsequent versions, with the denominator being the smallest and set to 1; when there is no previous version, all three change ratios are set to 0; when multiple structures change simultaneously, the maximum value of the three is taken, and the parallel types are recorded in a fixed order of text, formula, and graphic; the structural change ratio of 0.25 is determined by minimizing the average error of the replay anchor points on the annotation query verification set and written into the versionable replay parameter record along with the calculation caliber; the jump type of the retrieval request is the initial version with sequence number 1 located along the common trajectory ancestor identifier and previous version identifier chain when it is first formed. This method uses the creation time of the initial version as the playback anchor point and the effective time interval of the initial version including the creation time as the actual playback interval, without truncating according to the effective time interval of the current recalled version. For critical modifications, the modification time when any structural change ratio first reaches 0.25 is selected. If there is no qualified modification but there is a modification event, the modification time with the largest change ratio is used as the rollback anchor point. If the ratios are the same, the earlier time is selected and marked as critical modification unconfirmed. If there are no modification events, the creation time of the current recalled version is used and the critical modification is marked as unavailable. For completion, the last modification time after no new handwriting event or erase handwriting event has occurred for 8 consecutive seconds is selected. If the stable window is not formed before the end of the video, the last modification time within the effective time interval of the current recalled version is used and marked as completion unconfirmed. If there is no modification time, the creation time of the current recalled version is used and marked as completion unconfirmed. When the search request does not carry a jump type, the creation time of the current recalled version is used as the playback anchor point.
[0144] The playback positioning module writes the determined playback anchor point, anchor point status, rollback reason, corresponding video address, actual playback valid time interval, current recall version identifier, actual playback target version identifier, and panel coordinates into the retrieval response. For initial type formation, the anchor point is restricted to the initial version's valid time interval. For critical modifications, completions, or when no jump type is included, the anchor point is restricted to the version's valid time interval for the corresponding target event. If the target version record lacks a valid time interval or creation time, or if both the video address and archive address are unavailable, a playback anchor point is not fabricated, and a playback unavailable status and a list of missing fields are returned. If the video address of an indexed record is invalid but an archive address exists under the same video identifier, the archive address is returned and marked as an address replacement status. If a candidate version has a pending review mark, the result is retained but its final display priority is reduced.
[0145] Before returning results, the retrieval service performs consistency checks. If the version identifier of an index item does not exist in the whiteboard evolution diagram, the recall item is deleted. When a playback anchor point exists but the effective time interval of the actual playback target version does not include the anchor point, the first type returns the reason for playback unavailability and the initial version chain break, without truncating the anchor point to the current recall version interval. Only other jump types truncate the anchor point to the start time of the actual playback target version interval. When the playback status is unavailable, only the version, whiteboard coordinates, reason for unavailability, and query index key are returned, without returning the video time position. When the video address does not match the video identifier, the address with the same identifier in the archive mapping table is used instead. When the fusion matching degree is less than 0.55, the candidate is not returned. When all candidates are filtered, an empty result and the used query index key are returned, so that each abnormal input has a definite processing rule.
[0146] The final output of S5 is the version of the whiteboard structure unit sorted by fusion matching degree, the corresponding classroom recording segment, the playback anchor point and the evolution context. The query log only saves the anonymous query identifier, the index type used, the recall version identifier and the response time, which are used for subsequent threshold calibration and incremental index updates.
[0147] The above description is only a preferred embodiment of the present invention, but the scope of protection of the present invention is not limited thereto. Any equivalent substitutions or modifications made by those skilled in the art within the scope of the technology disclosed in the present invention, based on the technical solution and inventive concept of the present invention, should be covered within the scope of protection of the present invention.
[0148] This invention organizes the board registration results, convolutional feature encoding results, long-term board state, and most recent reliable visible observations into a continuous state estimation chain, so that the confirmation of board writing events is subject to the joint constraints of registration quality, visibility, and continuous reliable observations; the resulting board writing structure unit version retains effective time information and can establish an index mapping with the original classroom recording segments through the relation edges in the board writing evolution graph.
[0149] This invention addresses the issues of occlusion recovery and erasure evolution in classroom blackboard writing by altering the processing structure between state estimation and temporal clustering: first, dual-anchor visibility auditing is used to confirm erasure; then, the confirmed event is constructed into a spatiotemporal local erasure barrier and transformed into clustering disconnection constraints; simultaneously, mandatory connection constraints are set for incremental inheritance trajectories that do not cross the barrier, thereby allowing the determination result of actual erasure to directly constrain version aggregation, better preserving the temporal boundaries, derivation context, and retrieval and playback positions of the blackboard content.
Claims
1. A structured whiteboard retrieval method based on convolutional neural networks and temporal clustering, characterized in that, include: S1. Obtain classroom recording videos with frame timestamps, use a board detection network to detect writable board surfaces in each video frame and perform cross-frame registration to obtain a unified board surface frame sequence and registration quality values for each frame. S2. Input the unified board frame sequence into the convolutional feature encoding network to obtain handwriting representation and board visibility representation. Combine the registration quality value to determine the reliable visible position. At the reliable visible position, generate new handwriting events and erasure candidates based on the current observation, long-term board state and the most recent reliable visible observation. Freeze the update of the long-term board state at the unreliable visible position. S3. Establish front and back anchors based on reliable visible observations before and after erasure candidates, compare the front and back anchors with the long-term plate state, and confirm the erasure event when the handwriting contained in the front anchor is continuously missing in the back anchor and subsequent continuous reliable observations; convert the confirmed erasure event into a local erasure barrier with spatial range and temporal boundaries. S4. Generate handwriting trajectory fragments based on newly added handwriting events and confirmed erase handwriting events. Establish mandatory connection constraints for handwriting trajectory fragments that do not cross the local erase barrier and have an incremental inheritance relationship. Establish prohibition connection constraints for handwriting trajectory fragments located before and after the local erase barrier. Perform constrained temporal clustering based on mandatory connection constraints and prohibition connection constraints to obtain a version of the blackboard structure unit with a valid time interval. S5. Perform structural identification on the versions of the blackboard writing structure units, and establish a blackboard writing evolution diagram based on the identification results and the temporal, spatial, and version relationships between the versions of the blackboard writing structure units; establish a structured retrieval index based on the blackboard writing evolution diagram that associates the versions of the blackboard writing structure units, the effective time intervals, and the video addresses, and determine the matching blackboard writing structure unit versions and the corresponding classroom recording segments in response to retrieval requests.
2. The method for structured whiteboard retrieval based on convolutional neural networks and temporal clustering according to claim 1, characterized in that, S1 includes: The writable surface detection network outputs the category probability, boundary point coordinates, and boundary point confidence of the writable surface; it matches feature points located within the writable surface in adjacent video frames and intervening video frames, and estimates the homography transformation used for the cross-frame registration based on the reprojection error and inlier ratio of the matched points; it combines the inlier ratio and the inverse normalized value of the reprojection error to form the registration quality value; when the registration quality value does not meet the preset registration threshold, the video frame is stopped from participating in handwriting event confirmation.
3. The method for structured whiteboard retrieval based on convolutional neural networks and temporal clustering according to claim 1, characterized in that, S2 includes: Using the unified board frame sequence and the registration quality value of each frame as the input data source, the shared convolutional feature encoder extracts the multi-scale features of the unified board frame sequence. The pixel classification branch outputs a handwriting probability map, a background probability map, an occlusion probability map, and a reflection probability map. The occlusion probability map and the reflection probability map constitute the board visibility representation. The handwriting representation branch outputs a handwriting feature map. The reliable visible position is determined as the board surface position where the registration quality value is not less than the preset registration threshold, the occlusion probability is not greater than the preset occlusion threshold, and the reflection probability is not greater than the preset reflection threshold. The current handwriting probability and handwriting characteristics of the reliable visible position are calculated with the long-term board surface state and the most recent reliable visible observation, and the probability of new handwriting events and the probability of erasure are generated according to the direction of the difference. The probability of new handwriting events in consecutive reliable frames is accumulated. When the accumulated number of frames reaches a preset number of confirmation frames, the new handwriting event is confirmed and the long-term board state is updated.
4. The method for structured whiteboard retrieval based on convolutional neural networks and temporal clustering according to claim 1, characterized in that, S3 includes: for eraser candidates formed during continuous reliable visibility, the most recent reliable visible observation before the candidate formation is recorded as the front anchor, and the first reliable visible observation after the candidate formation is recorded as the back anchor; for eraser candidates formed after the corresponding board position undergoes an unobservable process and regains reliable visibility, the last reliable visible observation before becoming unobservable is recorded as the front anchor, and the first reliable visible observation after regaining reliable visibility is recorded as the back anchor; the front anchor is recorded as a handwriting spatial mask, handwriting features, and the last visible existence time, and the back anchor is recorded as the handwriting... Spatial mask, handwriting features, and reliable visible time of the rear anchor; within the overlapping area of the two anchors, the handwriting spatial mask of the front anchor is differentially analyzed with the handwriting spatial mask of the rear anchor and subsequent reliable frames, and the differential is verified by the matching result of the corresponding handwriting features; when the differential result continues until a preset number of confirmation frames are reached, the reliable visible time of the rear anchor is determined as the first visible missing time, and a confirmed erase handwriting event is generated, which includes the erase spatial mask, event confidence, the last visible existence time, and the first visible missing time, with the two times as the lower and upper bounds of the time boundary, respectively.
5. The method for structured whiteboard retrieval based on convolutional neural networks and temporal clustering according to claim 1, characterized in that, S4 includes: Based on the event connectivity of the newly added handwriting events and the confirmed erased handwriting events, and the overlap of the board coordinates, handwriting feature similarity, and temporal adjacency of the event connectivity, the handwriting trajectory segments are connected; the trajectory pairs of continuous handwriting regions without local erase barriers and where the later handwriting trajectory segment contains the previous handwriting trajectory segment are marked as the mandatory connection constraint; the trajectory pairs within the erase space mask of the confirmed erased handwriting events that terminate before the lower bound of the time boundary and begin after the upper bound of the time boundary are marked as the prohibited connection constraint; under the condition of satisfying all mandatory connection constraints and prohibited connection constraints, temporal clustering is performed according to the board space distance, handwriting feature distance, and time interval between trajectories, and the creation time, modification time, and erase time are recorded for the version of the whiteboard structure unit according to the event time sequence, and the effective time interval is determined according to the adjacent event times.
6. The method for structured whiteboard retrieval based on convolutional neural networks and temporal clustering according to claim 1, characterized in that, S5 includes: identifying titles, step numbers, and indentation relationships for text structure units and generating key point levels; identifying symbol bounding boxes, symbol relative positions, and operator connection relationships for formula structure units and generating symbol layout trees and operator trees; identifying outlines, arrows, and the version of the blackboard structure unit into which the arrow endpoints fall for graphic structure units; establishing predecessor edges based on creation time and effective time intervals; establishing derivation edges based on subtree changes in the formula operator tree; establishing inclusion edges based on the inclusion relationship of board coordinates; establishing annotation edges and pointing edges based on the adjacency of text structure units and graphic structure units and arrow endpoints; and establishing the same content version edge between blackboard structure unit versions with a common trajectory ancestor. The blackboard evolution diagram is composed of each blackboard structure unit version and the established edges.
7. The method for structured whiteboard retrieval based on convolutional neural networks and temporal clustering according to claim 6, characterized in that, The text recognition results are segmented into words and a keyword inverted index is established. A formula tree path index is established for the root-to-leaf paths and subtree normalized encoding of the symbol layout tree and operator tree. A step graph path index is established for the step number and its predecessor and derivation sequence in the blackboard evolution diagram. Each index item is recorded as a retrieval record containing the index key, blackboard structure unit version identifier, board coordinates, recognition confidence, start and end times of the effective time interval, and video address. Retrieval records are recalled based on keywords, formula structures, or step numbers in the retrieval request, and the retrieved version is returned via the blackboard... The versions connected by edges in the book evolution graph serve as the evolution context; the creation time and modification time are determined according to the event sequence of the recalled version; the replay anchor point is determined according to the jump type carried by the retrieval request; the first formation type is mapped to the creation time; the key modification type is mapped to the first modification time when the text level, formula tree subtree, or graphic pointing relationship meets the preset structural change conditions; the completion type is mapped to the last modification time after the recalled version has continuously reached a preset stable time without any new handwriting events or erased handwriting events; and the creation time is used as the replay anchor point when the retrieval request does not carry a jump type.
8. The method for structured whiteboard retrieval based on convolutional neural networks and temporal clustering according to claim 5, characterized in that, Outside the local erase barrier, common trajectory ancestors with continuously visible trajectories and matching handwriting features before and after the barrier are retained as the same content version relationship; inside the local erase barrier, trajectories located before and after the barrier are prohibited from being merged separately based on the overlap of board coordinates; when a handwriting marked as an eraser candidate reappears before reaching a preset number of confirmation frames, or when the handwriting features of the previous anchor are rematched in consecutive reliable frames after the previous anchor, the eraser candidate is withdrawn.
9. The method for structured whiteboard retrieval based on convolutional neural networks and temporal clustering according to claim 3, characterized in that, The training of the board detection network and the convolutional feature encoding network includes: applying perspective transformation, motion blur, partial occlusion, reflection superposition, and handwriting erasure sequence enhancement to a classroom board image with board boundaries, handwriting, background, occlusion, and reflection markings; training the board detection network using board category loss and boundary point regression loss; and training the convolutional feature encoding network using pixel classification loss, handwriting feature contrast loss, and consistency loss of adjacent reliable frames. Specifically, the same handwriting region before and after erasure is used as a temporal variation sample, and the same handwriting region that remains present before and after occlusion is used as a temporal consistency sample.
10. The method for structured whiteboard retrieval based on convolutional neural networks and temporal clustering according to claim 2, characterized in that, When the registration quality values of video frames that have reached a preset number of mismatched frames do not meet the preset registration threshold, registration anomaly recovery is performed, the confirmation of new handwriting events and erased handwriting events is paused, the writable board surface and its boundary points are re-detected, and an updated unified board surface coordinate system is established; the matching relationship between the board surface feature points before and after the update and those that meet the preset reprojection error threshold after bidirectional reprojection is taken as the coordinate system correspondence relationship, and only the board surface area with the coordinate system correspondence relationship inherits the long-term board surface state and board writing structure unit version, and a new long-term board surface state is established for the board surface area without the coordinate system correspondence relationship.
