Campus intelligent camera security system
Patent Information
- Application Number
- CN202611257153.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-08-19
- Publication Date
- 2026-10-30
AI Technical Summary
[0002]校园户外绿化带、林下、围墙边角易滋生蛇、野生刺猬等危险野生动物,该类生物存在双重检测难点:一是仅露出局部躯体,画面内像素尺寸极小;二是体表颜色与植被背景高度近似形成保护色,人工巡逻难以提前预警,伤人事故易造成学生人身伤害与校园恐慌,大幅提升安保管控压力
[0022]1.本发明自主设计多尺度特征编码模块,采用 4 倍下采样浅层特征单独构建预测分支并搭配跨层语义通路,完整保留小型动物像素细节,解决原生 YOLOv8-seg 深层检测头丢失微小目标纹理、极易漏检的缺陷。
Smart Images

Figure CN123016352A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of target detection technology, and more specifically, to a campus intelligent camera security system. Background Technology
[0002] Snakes, hedgehogs, and other dangerous wild animals easily breed in outdoor green belts, under trees, and along the edges of walls on campus. These creatures present a double challenge in detection: first, only parts of their bodies are visible, resulting in extremely small pixel sizes in the image; second, their body color closely blends with the vegetation background, creating camouflage, making early warning difficult for manual patrols. Incidents involving these creatures can easily cause injury to students and panic on campus, significantly increasing security and control pressure. Traditional campus surveillance systems only have video recording and storage functions, lacking targeted early warning and intelligent identification capabilities, and cannot achieve 24 / 7 risk control relying solely on manual monitoring.
[0003] IoT monitoring and general YOLO target detection networks have been applied to campus security, but existing general detection models cannot adapt to the dual challenges of detecting campus wildlife: general detection networks only have three-layer downsampling detection heads, and shallow, small targets lose significant spatial details after multiple downsamplings; at the same time, they lack multi-scale context-aware structures, making it difficult to distinguish camouflaged animals from similar vegetation backgrounds; existing technologies can only effectively identify regular-sized, high-contrast targets, and have an extremely high false negative rate for difficult samples with both small size and camouflage.
[0004] Existing technologies have the following two types of coupled technical bottlenecks: (1) Small target recognition bottleneck: When wild animals only expose part of their bodies, the target pixel area is less than 32×32. After the native YOLOv8-seg is downsampled by 8 / 16 / 32 times, the details of the small target are completely lost; (2) Protective color target recognition bottleneck: The color and texture of snakes and hedgehogs are very similar to grass and soil, and the target and background are highly coupled in the feature space. Summary of the Invention
[0005] The purpose of this invention is to overcome the shortcomings of the prior art and provide a campus intelligent camera security system.
[0006] In the first aspect, a campus intelligent camera security system is provided, comprising: multiple monitoring terminals fixedly distributed in corners of the campus and a cloud server, wherein the monitoring terminals establish a wireless communication connection with the cloud server;
[0007] The monitoring terminal uses an embedded main control board as the main controller, integrating a camera, a light warning module, and a local storage module. The main control board has a built-in WiFi module. The camera is used to capture campus surveillance images in real time, and continuously uploads the real-time video stream to the cloud server through the built-in WiFi module of the main control board. The light warning module is a full-area warning LED light group.
[0008] The cloud server incorporates an improved lightweight YOLOv8-seg target detection model. This model is lightweighted by adding a multi-scale feature encoding module, a feature decoupling and fusion module, and a multi-task prediction module. The cloud server uses the improved model to perform real-time inference on the received images and identify preset dangerous animals. When a dangerous animal is identified, an alarm signal is sent to the monitoring terminal. Upon receiving the alarm signal, the monitoring terminal drives the entire area lighting warning module to flash.
[0009] Preferably, after the cloud server identifies a dangerous animal, it calculates the center point of the target based on the coordinates of the target detection box, and sends a warning instruction containing the camera number, alarm time, and the center point of the target to the corresponding monitoring terminal.
[0010] Preferably, the monitoring terminal continuously uploads the real-time video stream captured by the camera to the designated IP address of the cloud server via the built-in WiFi module on the main control board.
[0011] Preferably, the monitoring terminal continuously listens for alarm signals from the cloud server through the built-in WiFi module on the main control board, and immediately drives the entire area lighting warning module to flash alarm upon receiving an alarm signal.
[0012] Preferably, the multi-scale feature encoding module includes a small target detection branch built on a shallow high-resolution feature map. This branch adds a shallow detection head on the basis of the YOLOv8-seg native detection head, which is responsible for detecting small targets with pixel size smaller than a preset threshold. It uses the spatial details and edge information preserved by the shallow feature map to improve the detection capability of targets whose torso is partially occluded.
[0013] Preferably, the multi-scale feature encoding module further includes a multi-scale dilated convolutional context encoding unit, which is set in multiple layers of the neck network of the YOLOv8-seg feature pyramid. The encoding unit includes multiple parallel dilated convolutional branches, each branch adopts a different dilation rate to simulate the multi-scale receptive field, and the output of each branch is adaptively weighted and fused by the coordinate attention mechanism, and then residually connected with the output of SCConv to enhance the model's ability to distinguish subtle texture differences between camouflage targets and background.
[0014] Preferably, the multi-task prediction module introduces feature contrast enhancement loss during the model training phase. This loss function calculates the contrast loss between the features of the foreground target region within the detection box and the features of the background region outside the detection box, guiding the model to increase the embedding distance between the foreground target and the background in the feature space.
[0015] Preferably, the feature contrast enhancement loss is incorporated as an auxiliary loss term into the joint loss function of the multi-task prediction module, and only takes effect during the training phase, without adding additional computational overhead during the inference phase.
[0016] Secondly, a method for security monitoring using intelligent cameras on campus is provided, executed by any of the systems described in the first aspect, including:
[0017] S1. Distributed monitoring terminals deployed in corners of the campus collect monitoring images in real time and continuously upload video streams to the cloud server via built-in WiFi modules;
[0018] S2. After receiving the video stream, the cloud server uses an improved lightweight YOLOv8-seg target detection model to perform real-time inference on the image. The improved YOLOv8-seg model extracts multi-level features through a multi-scale feature encoding module and enhances the feature representation of small targets and camouflage targets. It also adaptively fuses multi-level features and suppresses background interference through a feature decoupling and fusion module, and synchronously outputs the target detection results through a multi-task prediction module.
[0019] S3. When a preset dangerous animal is detected, the cloud server sends an alarm signal to the corresponding monitoring terminal.
[0020] S4. After receiving the alarm signal, the monitoring terminal will drive the entire area lighting warning module to flash alarm.
[0021] The beneficial effects of this invention are:
[0022] 1. This invention independently designs a multi-scale feature encoding module, which uses 4x downsampled shallow features to construct a prediction branch separately and is combined with a cross-layer semantic path to fully preserve pixel details of small animals, thus solving the defects of the native YOLOv8-seg deep detection head in losing the texture of small targets and being prone to missed detection.
[0023] 2. This invention independently constructs a feature decoupling and fusion module, which adopts a fusion logic of hierarchical adaptive weighting + background texture suppression to achieve differentiated processing of foreground and background features, rather than the general simple channel splicing, and accurately distinguishes camouflaged wild animals from weeds and vegetation with similar appearance.
[0024] 3. This invention independently designs a multi-task prediction module to collaboratively optimize the recognition accuracy of two types of difficult samples: tiny and camouflaged. It also simultaneously increases the feature distance between the foreground animal and the surrounding background. The experimental data compared later confirms that this model has a stable recognition advantage over the native YOLOv8-seg in different vegetation and lighting campus scenes.
[0025] 4. The improvement of the entire network computing power of this invention has a very low increase, is compatible with the lightweight deployment of Raspberry Pi edge devices, and has a very small increase in inference overhead while ensuring low false negative accuracy, thus balancing detection accuracy and on-site engineering feasibility. Attached Figure Description
[0026] Figure 1 This is a diagram illustrating the overall architecture of the campus intelligent camera security system provided by the present invention.
[0027] Figure 2 The data processing and signal flow timing diagram provided by this invention;
[0028] Figure 3 The improved YOLOv8-seg model network structure diagram provided by this invention;
[0029] Figure 4 This is a detailed diagram of the multi-scale dilated convolution and coordinate attention fusion provided by the present invention. Detailed Implementation
[0030] The present invention will be further described below with reference to embodiments. The description of the embodiments below is only for the purpose of helping to understand the present invention. It should be noted that those skilled in the art can make several modifications to the present invention without departing from the principle of the present invention, and these improvements and modifications also fall within the protection scope of the claims of the present invention.
[0031] Example 1:
[0032] To address the problems of existing technologies, Embodiment 1 of the present invention provides a campus intelligent camera security system, comprising: multiple monitoring terminals fixedly distributed in corners of the campus and a cloud server, wherein the monitoring terminals establish a wireless communication connection with the cloud server;
[0033] Figure 1 This is a diagram illustrating the overall architecture of the campus intelligent camera security system provided by this invention. As shown, the system consists of two main parts: a distributed monitoring terminal group and a cloud server. The monitoring terminals include modules for image acquisition, light alerts, and local storage, with an embedded main control board serving as the core control unit. The cloud server incorporates an improved lightweight YOLOv8-seg model, including a multi-scale feature encoding module, a feature decoupling and fusion module, and a multi-task prediction module, and connects to a database and a visualization panel, forming a complete closed loop from front-end data acquisition and cloud inference to alarm feedback.
[0034] The monitoring terminal uses an embedded main control board as the main controller, integrating a camera, a light warning module, and a local storage module. The main control board has a built-in WiFi module. The camera is used to capture campus surveillance images in real time, and continuously uploads the real-time video stream to the cloud server through the built-in WiFi module of the main control board. The light warning module is a full-area warning LED light group.
[0035] The cloud server incorporates an improved lightweight YOLOv8-seg target detection model. This model is lightweighted by adding a multi-scale feature encoding module, a feature decoupling and fusion module, and a multi-task prediction module. The cloud server uses the improved model to perform real-time inference on the received images and identify preset dangerous animals. When a dangerous animal is identified, an alarm signal is sent to the monitoring terminal. Upon receiving the alarm signal, the monitoring terminal drives the entire area lighting warning module to flash.
[0036] After the cloud server identifies a dangerous animal, it calculates the center point of the target based on the coordinates of the target detection box, and sends a warning command containing the camera number, alarm time, and the center point of the target to the corresponding monitoring terminal. Figure 2 This invention provides a timing diagram of data processing and signal flow for the campus intelligent camera security system. As shown in the diagram, after the monitoring terminal powers on, it continuously uploads the real-time video stream captured by the camera to the cloud. The cloud server decodes and preprocesses the video stream, then uses an improved YOLOv8-seg model for real-time inference. When a dangerous animal target is detected, the cloud calculates the target's center point based on the detection frame coordinates, displays it on the visualization panel, and generates an early warning command which is sent to the monitoring terminal. Upon receiving the command, the terminal immediately activates a full-area LED warning light group to flash alarm.
[0037] The monitoring terminal continuously uploads the real-time video stream captured by the camera to the designated IP address of the cloud server via the built-in WiFi module on the main control board.
[0038] The monitoring terminal continuously listens for alarm signals from the cloud server through the built-in WiFi module on the main control board. Upon receiving an alarm signal, it immediately drives the entire area lighting warning module to flash alarm.
[0039] The cloud server incorporates an improved YOLOv8-seg model for real-time image inference. Specifically, the established YOLOv8-seg model has three main improvements: a multi-scale feature encoding module, a feature decoupling and fusion module, and a multi-task prediction module. The multi-scale feature encoding module integrates a shallow small target detection branch, a multi-scale dilated convolutional context encoding unit, SCConv convolution, and a Coordinate Attention mechanism to enhance the detection capability of dangerous animals in grassy backgrounds. It selects a loss function and optimizer and determines hyperparameters such as the number of training epochs and the learning rate, adjusting them according to changes in loss during training. It monitors the model's loss and accuracy metrics in real time, observes the model's convergence, and adjusts the training strategy accordingly.
[0040] The multi-scale feature encoding module includes a small target detection branch built on shallow high-resolution feature maps. This branch adds a shallow detection head on the basis of the YOLOv8-seg native detection head, which is responsible for detecting small targets with pixel size smaller than a preset threshold. It uses the spatial details and edge information preserved by the shallow feature map to improve the detection capability of targets whose torso is partially occluded.
[0041] The multi-scale feature encoding module also includes a multi-scale dilated convolutional context encoding unit, which is set in multiple layers of the neck network of the YOLOv8-seg feature pyramid. The encoding unit contains multiple parallel dilated convolutional branches, each branch adopts a different dilation rate to simulate the multi-scale receptive field. The outputs of each branch are adaptively weighted and fused by the coordinate attention mechanism, and then residually connected with the output of SCConv to enhance the model's ability to distinguish subtle texture differences between camouflage targets and background.
[0042] The multi-task prediction module introduces feature contrast enhancement loss during the model training phase. This loss function calculates the contrast loss between the features of the foreground target region within the detection box and the features of the background region outside the detection box, guiding the model to increase the embedding distance between the foreground target and the background in the feature space.
[0043] The feature contrast enhancement loss is incorporated as an auxiliary loss term into the joint loss function of the multi-task prediction module. It only takes effect during the training phase and does not add any additional computational overhead during the inference phase.
[0044] Example 2:
[0045] Based on Example 1, Example 2 of the present invention provides a more specific campus intelligent camera security system, including: a distributed monitoring terminal, a cloud management platform, and a wildlife detection model.
[0046] The distributed monitoring terminal uses a Raspberry Pi 5 as the main controller. The image acquisition module outputs a 25fps RGB video stream, and the SD card stores the video in a loop (automatically deleted after 90 days). GPIO drives the LED warning light module, and the WiFi module establishes a long TCP connection to complete video uploading and command transmission and reception. The above hardware control and storage strategies are all standard solutions for existing embedded monitoring systems.
[0047] The cloud management platform is built on a general web development framework and enables video stream reception, MySQL data storage, visual panel display, and early warning command issuance, all of which are standard functions of existing cloud management systems.
[0048] The wildlife detection model consists of an image preprocessing module, a multi-scale feature encoding module, a feature decoupling and fusion module, and a multi-task prediction module.
[0049] The image preprocessing module is used to adaptively enhance the brightness and contrast of the input video frames, and to complete pixel normalization and size scaling. Figure 3 A schematic diagram of the network structure of the improved lightweight YOLOv8-seg object detection model provided by this invention. Figure 3 As shown, the model is based on the YOLOv8-seg backbone network, extracting feature maps from four layers: P2, P3, P4, and P5. The multi-scale feature encoding module adds a shallow, small-object detection branch with 4x downsampling in layer P2, and connects multi-scale dilated convolutional context encoding units and coordinate attention mechanisms after each layer. The feature decoupling and fusion module adaptively weights and fuses the four enhanced features. The fused global feature vector is input to the multi-task prediction module, which simultaneously outputs the target bounding box, class confidence, and instance segmentation mask.
[0050] The multi-scale feature encoding module extracts multi-level feature maps based on the YOLOv8-seg backbone network. It builds a small target detection branch based on the shallow feature map with 4x downsampling to preserve the details of small targets. It is combined with multi-scale dilated convolution and coordinate attention weighting to complete multi-scale contextual feature extraction, which can explicitly distinguish the local texture of animals from the surrounding vegetation background.
[0051] The feature decoupling and fusion module adopts residual connection to fuse multi-scale contextual features, which is different from the shallow fusion method of direct channel splicing in existing technologies. It adaptively suppresses the background weed texture response and amplifies the unique features of wild animals, providing highly discriminative fused features for subsequent prediction.
[0052] The multi-task prediction module is based on the fused global multi-scale features. It synchronously outputs the target bounding box, category, and instance segmentation mask through the multi-task prediction head. During the training phase, it superimposes the foreground and background feature contrast enhancement loss and the multi-task joint weighted loss to collaboratively optimize the network weights. During the inference phase, it directly outputs the coordinates of dangerous animals and early warning information.
[0053] The complete processing flow of the wildlife detection model starts with the original RGB video frame image uploaded from the terminal. First, it performs adaptive brightness and contrast enhancement and standardization preprocessing. Then, it extracts multi-level feature maps through the backbone network, adds a shallow, small target detection branch to complete detail extraction, fuses contextual features through multi-scale dilated convolution and coordinate attention encoding, introduces a residual structure to decouple foreground and background features, and finally feeds it into a multi-task prediction head to simultaneously output target bounding boxes, animal categories, and instance segmentation masks. Specifically, it mainly includes the following four standardization processing steps:
[0054] S1. Data Acquisition and Processing: Before inputting the campus video data captured by the front-end image acquisition module into the detection model, the cloud server first performs image preprocessing on the original video frame sequence to overcome the interference of dim lighting at night and tree shadows on target features. This operation aims to highlight the outline features of dangerous animals hidden in the grass environment by dynamically adjusting pixel brightness and contrast. The contrast and brightness adjustment formulas for image preprocessing are expressed as follows:
[0055]
[0056] in, These are the pixel values of the original video frame image. The enhanced pixel value, These are the contrast adjustment parameters. This is a brightness adjustment parameter, with a value range of [-30, 30].
[0057] After enhancement, the image is uniformly scaled to a standard size of 640×640, and pixel normalization is performed to map to the range of [0,1]. After preprocessing, the image is sent to the multi-scale feature encoding module. The brightness adjustment, size scaling, and normalization in this step are all common preprocessing methods in the field of image recognition.
[0058] S2. Multi-scale Feature Encoding: The multi-scale feature encoding module integrates a shallow micro-target detection branch, a multi-scale dilated convolutional context encoding unit, SCConv convolution, and a coordinate attention mechanism. It extracts multi-layer feature maps based on the YOLOv8-seg backbone network, with the original P3 / P4 / P5 feature maps corresponding to 8×, 16×, and 32× downsampling, respectively. The module builds a shallow micro-target detection branch based on the high-resolution shallow feature map of the P2 layer. This branch is only downsampled by 4 times, fully preserving the pixel details of micro-targets. A new P2 detection head is added on the basis of the original P3 / P4 / P5 detection heads as a dedicated detection branch for micro-wild animals. At the same time, a top-down cross-layer semantic pathway is built to supplement the high-level category semantic features to the shallow P2 branch, suppressing shallow noise misjudgments. After each layer of features (P2 / P3 / P4 / P5), the module's built-in multi-scale dilated convolutional context encoding unit is connected. Three sets of dilated convolutional branches with dilation rates r=1, 3, and 5 are set in parallel to capture local animal texture, medium contour, and global vegetation background features, respectively. The output of each branch is sent to the Coordinate Attention module to complete spatial-channel weighted aggregation. Figure 4 This is a detailed structural diagram of the multi-scale dilated convolutional context coding unit and coordinate attention fusion provided by the present invention. As shown in the figure, the input feature map is fed in parallel into three dilated convolutional branches with dilation rates of r=1, r=3, and r=5, respectively. The output feature map of each branch is subjected to global average pooling along the height and width directions to generate directional feature aggregation vectors. These vectors are then processed by convolution and activation functions to generate spatial-channel joint attention weights, which are adaptively weighted and fused to the outputs of each branch. The fused features are residually concatenated with the output of the SCConv module to obtain the final enhanced feature map. The formulas for feature aggregation in the height and width directions are as follows:
[0059]
[0060]
[0061] in, For the input feature map in the channel eigenvalues, For feature map height, The width of the feature map. For the height direction The feature aggregation output of the row is as follows: For the width direction The column's features are aggregated and output.
[0062] Attention-weighted multi-scale features are residually connected to the SCConv convolution output to obtain enhanced feature maps at each level. This fully preserves the edges of small targets and the unique scale / thorn textures of animals, while weakening the background feature responses of weeds and soil. The multi-level encoded features are then fed into the feature decoupling and fusion module.
[0063] S3. Feature Decoupling and Fusion: The feature decoupling and fusion module performs adaptive weighted fusion on the four enhanced features of layers P2, P3, P4, and P5. Unlike the shallow fusion method of direct channel splicing in existing technologies, it sets background texture suppression weights, automatically reducing vegetation feature responses that are similar to the appearance of wild animals, and outputs a globally fused multi-scale feature vector F. The fusion process uses nonlinear mapping to decouple foreground and background features, providing more discriminative feature inputs for subsequent predictions.
[0064] S4. Multi-task prediction: The multi-task prediction module fuses the feature vector F into the multi-task prediction head and simultaneously outputs bounding box regression values, animal classification confidence scores, and instance segmentation masks. The output expression is:
[0065]
[0066] in, These are the predicted coordinates of the target bounding box. Confidence level for dangerous animal categories such as snakes and hedgehogs; A segmentation mask for pixel-level instances.
[0067] During the model training phase, a multi-task joint weighted loss function is used to optimize the network weights. The total loss consists of four parts: bounding box loss, classification loss, segmentation loss, and feature contrast enhancement loss. The formula for the total loss is:
[0068]
[0069] in, This represents the total loss value of the model. For bounding box regression loss, For category classification loss, For instance segmentation mask loss, This invention features a unique foreground / background feature contrast enhancement loss. , , , This is the weighting coefficient for each loss.
[0070] Feature Contrastive Enhancement Loss (FCE Loss) only applies during the training phase and incurs no additional computational overhead during inference; for each labeled positive sample, it extracts the foreground feature vector within the detection box. Background feature vector of the region 1.2 times the outer edge of the frame The cosine similarity between the two is constrained to be lower than a preset margin m, as shown in the following formula:
[0071]
[0072] This loss-forced model widens the embedding distance between the animal foreground and the vegetation background in the feature space, significantly reducing the missed detection of camouflaged targets.
[0073] After the cloud-based detection model identifies dangerous animals such as snakes and hedgehogs, it extracts the diagonal coordinates of the target detection box to calculate the target's center point. This center point is used to accurately mark the monitored area when an alarm is triggered. The formula for calculating the center point is as follows:
[0074]
[0075] in, The center coordinates of the dangerous animal and These are the coordinates of the top left and bottom right corners of the target detection box, respectively.
[0076] The cloud generates an early warning command containing the camera number, alarm time, and target center coordinates, and sends it to the corresponding distributed monitoring terminal via WiFi. The terminal drives the LED warning lights to trigger a global audible and visual alarm, and at the same time stores the early warning record in the cloud database for security personnel to trace and verify.
[0077] To quantitatively verify the independent gain and synergistic effect of the three innovative modules of this invention, and to compare the detection performance of the native YOLOv8-seg baseline model, a standardized campus wildlife dataset was built. An incremental superposition ablation control experiment was used to uniformly complete the horizontal comparison and module effectiveness verification. All experimental groups maintained the same hyperparameters such as image preprocessing, dataset partitioning, training hardware, optimizer, and training rounds, with only the newly added innovative module being controlled as the sole variable.
[0078] The experimental dataset construction process includes: using campus green belts, under trees, and corners of walls as collection areas, a hidden wildlife detection dataset is constructed, including two types of dangerous animals: snakes and hedgehogs; the dataset contains a total of 32,160 sets of surveillance video frame samples, covering three typical campus environments: strong light during the day, shade from trees, and low light at night; the dataset is divided into training set, validation set, and test set in a 7:2:1 ratio.
[0079] The samples include two types of high-difficulty detection samples: tiny targets with a pixel size of less than 32×32 that only reveal a part of the body; and camouflaged targets with surface color and texture similar to grass and soil. All samples are manually labeled with bounding boxes, categories, and instance segmentation masks as real labels for model training and testing.
[0080] Experimental group setup rules: Using native YOLOv8-seg as the baseline, four control groups were set up by incrementally adding the three innovative modules of this invention. Each time, only one independent innovative module was added completely, with single variable control, to clearly verify the individual effects of each module and the synergistic effects of multiple modules.
[0081] Experimental Group 1: Native YOLOv8-seg, configured only with general image preprocessing modules, without multi-scale feature encoding modules, feature decoupling and fusion modules, multi-task prediction modules, and all innovative structures are not enabled;
[0082] Experimental Group 2: Based on the baseline model, only a multi-scale feature encoding module was added;
[0083] Experimental Group 3: Based on the baseline model, a multi-scale feature encoding module and a feature decoupling and fusion module were added simultaneously;
[0084] Experimental Group 4 (Complete Model Group of This Invention): Based on the benchmark model, a multi-scale feature encoding module, a feature decoupling and fusion module, and a multi-task prediction module are fully superimposed.
[0085] Evaluation metrics: This task is an instance segmentation target detection task, and uses general quantitative evaluation metrics in the security detection field. The higher the metric value, the higher the model recognition accuracy: AP@0.5 (IoU=0.5 average accuracy), false negative rate for small difficult samples (the proportion of targets with pixel sizes smaller than 32×32 pixels that are not detected), and false negative rate for camouflage difficult samples (the proportion of targets with texture similarity to the background that are not detected when the similarity is higher than a preset threshold). The average detection performance on the test set is shown in Table 1.
[0086] Table 1
[0087]
[0088] Analysis of experimental results:
[0089] By simply adding a multi-scale feature encoding module (experimental group 2), the false negative rate of small targets was significantly reduced compared to the native YOLOv8-seg, proving that the shallow small target detection branch and multi-scale dilated convolutional attention encoding inside the module can specifically solve the problem of texture loss of small targets, but the improvement in the ability to distinguish camouflage targets is limited.
[0090] By superimposing a feature decoupling and fusion module on the multi-scale feature encoding module (experimental group 3), the false negative rate of camouflaged targets was significantly reduced, verifying that the feature decoupling and fusion module can adaptively suppress the feature response of similar vegetation background and enhance the feature distinction between foreground animals and background.
[0091] The complete model (experimental group 4) after all three innovative modules are superimposed achieves the highest AP accuracy and the lowest false negative rate for two types of difficult samples. This indicates that the multi-scale feature coding module, feature decoupling and fusion module, and multi-task prediction module have strong synergistic gains, and the absence of any one of these modules will cause a significant decrease in detection performance.
[0092] The foreground-background feature contrast enhancement loss and multi-task joint weighted loss built into the multi-task prediction module can constrain the distance between foreground and background features and balance the multi-task regression accuracy during the training phase. These are key structures for further reducing false negatives of protective color samples and improving overall detection robustness.
[0093] The entire incremental ablation experiment was completed in a unified manner to verify the baseline comparison and the effectiveness of the modules. The experimental results can directly prove that after the three innovative modules of this invention are superimposed step by step, they can simultaneously solve three major industry pain points: missed detection of small targets, confusion of protective color targets, and imbalance of multi-task accuracy. It has stable recognition advantages in the case of variable campus lighting and complex vegetation. Moreover, after the lightweight transformation of the entire model, the inference computing power increase is less than 8%, which is suitable for real-time deployment of Raspberry Pi edge devices.
[0094] Through the aforementioned image adaptive preprocessing, multi-scale feature encoding, feature decoupling and fusion, and multi-task joint loss training, this invention can fully utilize shallow high-resolution details and global contextual information to achieve accurate identification, segmentation, and automatic early warning of hidden and dangerous wild animals on campus without significantly increasing inference computing power overhead.
[0095] It should be noted that the parts in this embodiment that are the same as or similar to those in Embodiment 1 can be referred to each other, and will not be repeated in this application.
[0096] Example 3:
[0097] Based on Example 1, Example 3 of the present invention provides a campus smart camera security monitoring method, including:
[0098] S1. Distributed monitoring terminals deployed in corners of the campus collect monitoring images in real time and continuously upload video streams to the cloud server via built-in WiFi modules;
[0099] S2. After receiving the video stream, the cloud server uses an improved lightweight YOLOv8-seg target detection model to perform real-time inference on the image. The improved YOLOv8-seg model extracts multi-level features through a multi-scale feature encoding module and enhances the feature representation of small targets and camouflage targets. It also adaptively fuses multi-level features and suppresses background interference through a feature decoupling and fusion module, and synchronously outputs the target detection results through a multi-task prediction module.
[0100] S3. When a preset dangerous animal is detected, the cloud server sends an alarm signal to the corresponding monitoring terminal.
[0101] S4. After receiving the alarm signal, the monitoring terminal will drive the entire area lighting warning module to flash alarm.
[0102] It should be noted that the method provided in this embodiment is the same as the method of the system provided in embodiment 2. Therefore, the parts that are the same as or similar to those in embodiment 1 can be referred to each other and will not be repeated in this application.
[0103] In summary, this invention, through the close collaboration of distributed monitoring terminals, cloud management platforms, and wildlife detection models, completes a full technical loop from campus video acquisition, cloud preprocessing, multi-scale feature extraction, feature decoupling to automatic alarm for dangerous animals. This enables 24 / 7 unattended risk monitoring of high-risk areas on campus, enhancing the initiative and security of campus security early warning.
Claims
1. A campus intelligent camera security system, characterized in that, include: Multiple monitoring terminals and cloud servers are fixedly distributed in various corners of the campus, and the monitoring terminals establish wireless communication connections with the cloud servers; The monitoring terminal uses an embedded main control board as the main controller and integrates a camera, a light warning module, and a local storage module. The main control board has a built-in WiFi module. The camera is used to capture campus monitoring images in real time and continuously uploads the real-time video stream to the cloud server through the built-in WiFi module of the main control board. The lighting warning module is a full-area warning LED light group; The cloud server incorporates an improved lightweight YOLOv8-seg target detection model. This model is lightweighted by adding a multi-scale feature encoding module, a feature decoupling and fusion module, and a multi-task prediction module. The cloud server uses the improved model to perform real-time inference on the received images and identify preset dangerous animals. When a dangerous animal is identified, an alarm signal is sent to the monitoring terminal. Upon receiving the alarm signal, the monitoring terminal drives the entire area lighting warning module to flash.
2. The campus intelligent camera security system according to claim 1, characterized in that, After the cloud server identifies a dangerous animal, it calculates the center point of the target based on the coordinates of the target detection box, and sends a warning command containing the camera number, alarm time, and the center point of the target to the corresponding monitoring terminal.
3. The campus intelligent camera security system according to claim 2, characterized in that, The monitoring terminal continuously uploads the real-time video stream captured by the camera to the designated IP address of the cloud server via the built-in WiFi module on the main control board.
4. The campus intelligent camera security system according to claim 3, characterized in that, The monitoring terminal continuously listens for alarm signals from the cloud server through the built-in WiFi module on the main control board. Upon receiving an alarm signal, it immediately drives the entire area lighting warning module to flash alarm.
5. The campus intelligent camera security system according to claim 4, characterized in that, The multi-scale feature encoding module includes a small target detection branch built on shallow high-resolution feature maps. This branch adds a shallow detection head on the basis of the YOLOv8-seg native detection head, which is responsible for detecting small targets with pixel size smaller than a preset threshold. It uses the spatial details and edge information preserved by the shallow feature map to improve the detection capability of targets whose torso is partially occluded.
6. The campus intelligent camera security system according to claim 5, characterized in that, The multi-scale feature encoding module also includes a multi-scale dilated convolutional context encoding unit, which is set in multiple layers of the neck network of the YOLOv8-seg feature pyramid. The encoding unit contains multiple parallel dilated convolutional branches, each branch adopts a different dilation rate to simulate the multi-scale receptive field. The outputs of each branch are adaptively weighted and fused by the coordinate attention mechanism, and then residually connected with the output of SCConv to enhance the model's ability to distinguish subtle texture differences between camouflage targets and background.
7. The campus intelligent camera security system according to claim 6, characterized in that, The multi-task prediction module introduces feature contrast enhancement loss during the model training phase. This loss function calculates the contrast loss between the features of the foreground target region within the detection box and the features of the background region outside the detection box, guiding the model to increase the embedding distance between the foreground target and the background in the feature space.
8. The campus intelligent camera security system according to claim 7, characterized in that, The feature contrast enhancement loss is incorporated as an auxiliary loss term into the joint loss function of the multi-task prediction module. It only takes effect during the training phase and does not add any additional computational overhead during the inference phase.
9. A method for security monitoring using intelligent campus cameras, characterized in that, Performed by the system according to any one of claims 1 to 8, comprising: S1. Distributed monitoring terminals deployed in corners of the campus collect monitoring images in real time and continuously upload video streams to the cloud server via built-in WiFi modules; S2. After receiving the video stream, the cloud server uses an improved lightweight YOLOv8-seg target detection model to perform real-time inference on the image. The improved YOLOv8-seg model extracts multi-level features through a multi-scale feature encoding module and enhances the feature representation of small targets and camouflage targets. It also adaptively fuses multi-level features and suppresses background interference through a feature decoupling and fusion module, and synchronously outputs the target detection results through a multi-task prediction module. S3. When a preset dangerous animal is detected, the cloud server sends an alarm signal to the corresponding monitoring terminal. S4. After receiving the alarm signal, the monitoring terminal will drive the entire area lighting warning module to flash alarm.