Intelligent park target detection method and system for incomplete images
By constructing teacher and student models, combining low-light detectors and graph neural networks, and optimizing feature extraction and loss functions, the problem of decreased imaging quality of park surveillance cameras under adverse weather conditions was solved, achieving high-precision target detection under occluded and incomplete image conditions.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- SUN YAT SEN UNIV
- Filing Date
- 2026-04-07
- Publication Date
- 2026-05-19
AI Technical Summary
Under adverse weather conditions, the image quality of park surveillance cameras deteriorates, resulting in low target detection accuracy. In particular, traditional detectors are prone to missed detections, false detections, or frame misalignment when images are obscured or incomplete.
By constructing teacher and student models, and combining low-light detectors, hierarchical class activation mapping algorithms, Laplacian pyramid image fusion, and lightweight mask generation networks, feature extraction and object detection are optimized. Global feature alignment is performed using graph neural networks, and an occlusion-robust loss function is designed to improve object detection accuracy.
It significantly improves the accuracy of target detection under incomplete image conditions, enhances the model's ability to handle complex occluded scenes, and improves the robustness and accuracy of target recognition.
Smart Images

Figure CN122066935A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of machine learning, and more specifically, to a method and system for target detection in smart parks using incomplete images. Background Technology
[0002] Currently, with the increasing number of park environments, such as residential communities and campuses, there is a greater need for more refined management at the park level. In the perimeter security and road access management system of smart parks (e.g., vehicle recognition at park entrance gates and underground parking entrances, patrol car / electric vehicle recognition on park roads, and pedestrian intrusion detection at building perimeters and parking areas), the image quality of park surveillance cameras deteriorates significantly under adverse weather conditions such as low light at night, rain, fog, and sandstorms. Furthermore, there are factors such as foreground occlusion (e.g., pedestrians being obscured by umbrellas, greenery, pillars, or parked vehicles) and the phenomenon of "incomplete features" (e.g., raindrops causing local blurring on the lens, strong reflections causing texture loss, and haze causing reduced contour contrast, resulting in incomplete information on the local boundaries, textures, and key components of the target). As a result, traditional detectors are prone to missed detections, false detections, or bounding box misalignment.
[0003] In existing technologies for detecting occluded targets, the generation of random masks is a coarse-grained, target-level mask that lacks explicit modeling of the importance of target region features and integration of global semantic information. As a result, the ability to process complex occluded scenes is limited, leading to low accuracy in target detection of incomplete images.
[0004] Existing technology discloses a real-time object detection method with enhanced occlusion detection capability, comprising the following steps: S1: Constructing an image data training set; S2: Designing the backbone structure of a convolutional neural network, extracting features from the training set, and ensuring the extracted features possess inductive bias properties; S3: Designing a detection neck network to bridge the gap between the detection backbone network and the head network, providing high-resolution and high-semantic features for the detection head network, and compressing the channel dimension of some layers; S4: Designing a detection head network to enhance information interaction between detection head branches and improve the detection model's utilization of information around the boundary, representing the object category and coordinates in the image through probability prediction; S5: Training using a training method suitable for boundary probability prediction; S6: Performing detection on a natural dataset and filtering the prediction results using a non-maximum suppression algorithm. This method does not involve simulating object occlusion, nor does it perform aggregated modeling of the overall semantics of the image, resulting in low object detection accuracy in cases of image incompleteness. Summary of the Invention
[0005] This invention addresses the shortcomings of existing technologies in target detection with incomplete images by providing a smart park target detection method and system for incomplete images. This method features high target detection accuracy even with incomplete images.
[0006] The primary objective of this invention is to solve the aforementioned technical problems. The technical solution of this invention is as follows: A smart park target detection method for incomplete images includes: S1: Obtain the incomplete image dataset, which includes: multiple incomplete images and the corresponding ground truth label for each incomplete image; construct the teacher model and the student model; S2: Preprocess each incomplete image in the incomplete image dataset to obtain a mask image corresponding to each incomplete image; S3: Select one incomplete image from the incomplete image dataset as the first image; S4: Input the first image into the teacher model to obtain the teacher model target detection result and the teacher model intermediate features; input the mask image corresponding to the first image into the student model to obtain the student model target detection result and the student model intermediate features; The intermediate features of the teacher model and the intermediate features of the student model are extracted respectively to obtain the network feature map of the teacher model and the network feature map of the student model. S5: Calculate the detection task loss value based on the target detection results of the teacher model and the target detection results of the student model; calculate the global feature alignment loss value based on the network feature map of the teacher model and the network feature map of the student model. S6: Optimize the student model based on the detection task loss value and the global feature alignment loss value to obtain a new student model; S7: Based on the new student model, update the teacher model using the exponential moving average method to obtain a new teacher model; S8: Select another incomplete image from the incomplete image dataset as the new first image; repeat steps S4 to S7 until the first preset condition is met to obtain the trained teacher model. S9: Obtain the incomplete image to be detected; S10: Input the incomplete image to be detected into the trained teacher model to obtain the final target detection result.
[0007] Further, in step S2, the preprocessing includes: S201: The incomplete image is cropped using a low-light detector to obtain the cropped incomplete image and the low-light detector intermediate vector; S202: The hierarchical class activation mapping algorithm is used to perform class activation mapping on the intermediate vector of the low-light detector to obtain multiple saliency heatmaps; S203: The multiple saliency heatmaps are fused using a multi-scale image fusion strategy based on the Laplacian pyramid to obtain a fused saliency heatmap; S204: The fused saliency heatmap is processed using a lightweight mask generation network to obtain a binary mask; S205: Based on the binary mask, the cropped incomplete image is masked using element-wise multiplication to obtain the mask image corresponding to the incomplete image.
[0008] Further, in step S201, the low-light detector includes: a first ResNet50 backbone network, a first feature pyramid network, and a first detection head network connected end to end; The first ResNet50 backbone network includes a first convolutional layer, a first max pooling layer, and multiple residual blocks connected end-to-end; the outputs of the multiple residual blocks are spliced together to form the intermediate vector of the low-light detector; The outputs of the multiple residual blocks are respectively input into the first feature pyramid network, and after upsampling, multiple first feature maps are obtained; Multiple first feature maps are input into the first detection head network, and after classification and regression processing, preliminary target detection results are obtained. The incomplete image is cropped based on the bounding box in the preliminary target result to obtain the cropped incomplete image.
[0009] Furthermore, the formula for calculating the significance heatmap is as follows:
[0010] This represents the k-th significance heatmap, where ReLU represents the activation function. This represents the gradient of the intermediate vector of the k-th layer low-light detector with respect to the preset highest confidence level. Let represent the intermediate vector of the low-light detector in layer k, where k represents the layer number of the intermediate vector, and c represents the channel index of the channel dimension summation. This represents element-wise multiplication in matrix operations.
[0011] Furthermore, in step S204, the lightweight mask generation network includes: an encoder, a decoder, and a pass-through estimator connected end to end; The encoder includes a first convolutional layer, a first activation layer, a second convolutional layer, a second activation layer, a third convolutional layer, and a third activation layer connected end to end; The decoder includes a fourth convolutional layer, a fourth activation layer, a fifth convolutional layer, a fifth activation layer, a sixth convolutional layer, and a sixth activation layer, all connected end-to-end.
[0012] Further, in step S4, network feature maps of the teacher model and the student model are extracted respectively, including: S401: Extract intermediate features from the teacher model to obtain a first teacher model feature map; extract intermediate features from the student model to obtain a first student model feature map; S402: Divide the first teacher model feature map into multiple image blocks to obtain multiple teacher model image blocks; divide the first student model feature map into multiple image blocks to obtain multiple student model image blocks; S403: Using multiple teacher model image blocks that meet the second preset conditions as teacher nodes, and the semantic similarity between each teacher node as an edge, construct a second teacher model feature map; using multiple student model image blocks that meet the third preset conditions as student nodes, and the semantic similarity between each student node as an edge, construct a second student model feature map. S404: Input the second teacher model feature map and the second student model feature map into the trained graph neural network for processing to obtain the teacher model network feature map and the student model network feature map.
[0013] Furthermore, the formula for the trained graph neural network is as follows:
[0014] u and v represent nodes in the model's feature map. Let v represent the set of adjacent nodes of node v. This represents the feature vector representation of node u in the graph neural network of layer l. This represents the feature vector representation of node v in the (l+1)th layer of the graph neural network. Indicates the first Attention weights of layers Indicates the first Graph convolution weights of layers represents the activation function, and l represents the layer number of the graph neural network;
[0015] Represents the feature aggregation function, This represents the feature vector representation of graph node v obtained from the final layer of the graph neural network. This represents the weight assigned to node v during the weighted average aggregation phase. Indicates the total number of nodes in the final layer. Let L represent the feature map of the model network, and let L represent the final layer of the graph neural network.
[0016] Furthermore, the global feature alignment loss values include:
[0017] Represents the network feature map of the teacher model. Represents the feature map of the student model network. This represents the global feature alignment loss value. express The L2 norm.
[0018] Furthermore, the detection task loss values include:
[0019] Indicates the weights of the bounding box consistency loss. This represents the weight of the confidence consistency loss. Indicates the weight of the class consistency loss. This represents the loss value of the detection task. This represents the bounding box consistency loss. This represents the confidence consistency loss. This represents the loss of class consistency. The bounding box consistency loss includes:
[0020] This represents the bounding box in the object detection results of the student model. This represents the bounding box in the object detection results of the teacher model. This represents the bounding box of the unmasked region in the object detection results of the teacher model. This represents the GIoU loss function, and max indicates taking the maximum value.
[0021] A smart park target detection system for incomplete images, comprising: Dataset Acquisition Module: Acquires a fragmented image dataset, which includes: multiple fragmented images and the corresponding ground truth label for each fragmented image; constructs teacher and student models; Preprocessing module: preprocesses each incomplete image in the incomplete image dataset to obtain a mask image corresponding to each incomplete image; Image selection module: Selects one incomplete image from the incomplete image dataset as the first image; Result inference module: Input the first image into the teacher model to obtain the teacher model target detection result and teacher model intermediate features; input the mask image corresponding to the first image into the student model to obtain the student model target detection result and student model intermediate features; The intermediate features of the teacher model and the intermediate features of the student model are extracted respectively to obtain the network feature map of the teacher model and the network feature map of the student model. Loss calculation module: Calculates the detection task loss value based on the target detection results of the teacher model and the target detection results of the student model; calculates the global feature alignment loss value based on the network feature map of the teacher model and the network feature map of the student model. Student model optimization module: Optimizes the student model based on the detection task loss value and the global feature alignment loss value to obtain a new student model; Teacher model optimization module: Based on the new student model, update the teacher model using the exponential moving average method to obtain a new teacher model; Repeat module: Select another incomplete image from the incomplete image dataset as the new first image; repeat training until the first preset condition is met to obtain the trained teacher model; Image acquisition module: Acquires the incomplete image to be detected; Final Result Inference Module: Input the incomplete image to be detected into the trained teacher model to obtain the final target detection result.
[0022] A lightweight mask generation network training method includes: S01: Obtain the training dataset; the training dataset includes multiple training data, each training data including a heatmap and a threshold segmentation heatmap; construct the initial encoder; S02: Select one data point from the training dataset as the first data point; S03: Input the heat map data of the first data into the initial encoder to obtain the first code; S04: Based on the threshold segmentation heatmap of the first data and the first encoding, calculate the binary cross-entropy loss and Dice loss; S05: Optimize the initial encoder based on the binary cross-entropy loss and the Dice loss; S06: Select another piece of data from the training dataset as the new first data; repeat steps S03~S05 until the first preset round is reached; obtain the trained encoder; S07: Construct the initial decoder; S08: Select one data point from the training dataset as the second data point; S09: Input the heatmap data of the second data into the trained encoder to obtain the second code; S010: Input the second code into the initial decoder to obtain the third code; S011: Based on the third encoding, the edge strength loss and corrosion connectivity loss are calculated; S012: Optimize the initial decoder based on the edge strength loss and the erosion connectivity loss; S013: Select another piece of data from the training dataset as the new second data; repeat steps S09~S012 until the second preset round is reached; obtain the trained decoder; S014: Construct a pass-through estimator and combine the trained encoder, the trained decoder, and the pass-through estimator to obtain a lightweight mask generation network.
[0023] Compared with the prior art, the beneficial effects of the present invention are: This invention preprocesses each incomplete image in the incomplete image dataset to obtain a mask image corresponding to each incomplete image. By preserving the essential features in target detection and simulating scenarios where secondary features are missing, the ability of the trained teacher model to recognize targets in incomplete images is improved.
[0024] This invention optimizes the ability of a trained teacher model to extract semantic information from incomplete features by comprehensively calculating the detection task loss value and the global feature alignment loss value, thereby improving the ability of the trained teacher model to identify targets in incomplete images. Attached Figure Description
[0025] Figure 1 This is a flowchart of a smart park target detection method for incomplete images provided in Example 1.
[0026] Figure 2 This is a schematic diagram of the structure of the low-light detector backbone network and pyramid network provided in Example 1.
[0027] Figure 3 This is a schematic diagram of the detection head provided in Example 1.
[0028] Figure 4 This is a schematic diagram of the low-light detector provided in Example 1.
[0029] Figure 5 This is a schematic diagram of the detection task loss calculation process provided in Example 1.
[0030] Figure 6 This is a schematic diagram of the process for calculating the global feature alignment loss value provided in Example 1.
[0031] Figure 7 This is a schematic diagram of the training process of the graph neural network provided in Example 1.
[0032] Figure 8 This is a schematic diagram of the reasoning process provided in Example 1.
[0033] Figure 9 This is a flowchart illustrating a smart park target detection method for incomplete images, as provided in Example 2. Detailed Implementation
[0034] The accompanying drawings are for illustrative purposes only and should not be construed as limiting the scope of this application. To better illustrate this embodiment, some parts in the accompanying drawings may be omitted, enlarged, or reduced, and do not represent the actual product dimensions; It will be understood by those skilled in the art that certain well-known structures and their descriptions may be omitted in the accompanying drawings.
[0035] The technical solution of the present invention will be further described below with reference to the accompanying drawings and embodiments.
[0036] Example 1 like Figure 1 As shown, a smart park target detection method for incomplete images includes: S1: Obtain the incomplete image dataset, which includes: multiple incomplete images and the corresponding ground truth label for each incomplete image; construct the teacher model and the student model; S2: Preprocess each incomplete image in the incomplete image dataset to obtain a mask image corresponding to each incomplete image; S3: Select one incomplete image from the incomplete image dataset as the first image; S4: Input the first image into the teacher model to obtain the teacher model target detection result and the teacher model intermediate features; input the mask image corresponding to the first image into the student model to obtain the student model target detection result and the student model intermediate features; The intermediate features of the teacher model and the intermediate features of the student model are extracted respectively to obtain the network feature map of the teacher model and the network feature map of the student model. S5: Calculate the detection task loss value based on the target detection results of the teacher model and the target detection results of the student model; calculate the global feature alignment loss value based on the network feature map of the teacher model and the network feature map of the student model. S6: Optimize the student model based on the detection task loss value and the global feature alignment loss value to obtain a new student model; S7: Based on the new student model, update the teacher model using the exponential moving average (EMA) method to obtain a new teacher model; S8: Select another incomplete image from the incomplete image dataset as the new first image; repeat steps S4 to S7 until the first preset condition is met to obtain the trained teacher model. S9: Obtain the incomplete image to be detected; S10: Input the incomplete image to be detected into the trained teacher model to obtain the final target detection result.
[0037] Further, in step S2, the preprocessing includes: S201: The incomplete image is cropped using a low-light detector to obtain the cropped incomplete image and the low-light detector intermediate vector; S202: The hierarchical class activation mapping algorithm is used to perform class activation mapping on the intermediate vector of the low-light detector to obtain multiple saliency heatmaps; It should be noted that by cropping high-confidence target regions from the image and generating a saliency heatmap, the model effectively focuses on detecting strongly correlated regions, thereby improving its ability to focus on key features.
[0038] S203: The multiple saliency heatmaps are fused using a multi-scale image fusion strategy based on the Laplacian pyramid to obtain a fused saliency heatmap; S204: The fused saliency heatmap is processed using a lightweight mask generation network to obtain a binary mask; It should be noted that a natural-shaped mask is constructed by using a lightweight mask generation network (MaskNet) and a random occlusion fusion method. Important features are preserved through feature importance evaluation, and the diversity of mask images during training is achieved through random masks, thereby enhancing the model's adaptability.
[0039] S205: Based on the binary mask, the cropped incomplete image is masked using element-wise multiplication to obtain the mask image corresponding to the incomplete image.
[0040] In one specific embodiment, in step S201, as follows: Figure 2As shown, the low-light detector backbone network adopts a four-stage ResNet-50 structure to extract multi-level semantic features from the input image. The first stage consists of a 7×7 convolutional layer (stride of 2) and a max pooling layer, used for initial image size compression; the second to fourth stages each consist of multiple residual blocks, where each residual block contains multiple convolution, normalization, and activation operations to progressively extract deeper semantic features of the image; the backbone output features include four feature maps: C2, C3, C4, and C5, corresponding to different receptive fields and semantic levels, respectively.
[0041] Further, in step S201, the low-light detector includes: a first ResNet50 backbone network, a first feature pyramid network, and a first detection head network connected end to end; The first ResNet50 backbone network includes a first convolutional layer, a first max pooling layer, and multiple residual blocks connected end-to-end; the outputs of the multiple residual blocks are spliced together to form the intermediate vector of the low-light detector; The outputs of the multiple residual blocks are respectively input into the first feature pyramid network, and after upsampling, multiple first feature maps are obtained; Multiple first feature maps are input into the first detection head network, and after classification and regression processing, preliminary target detection results are obtained. The incomplete image is cropped based on the bounding box in the preliminary target result to obtain the cropped incomplete image.
[0042] like Figure 2 , Figure 3 As shown, the C2-C5 feature maps output by the backbone network are fed into a five-layer Feature Pyramid Network (FPN) for multi-scale fusion. After top-down progressive upsampling, five layers of P2-P5 feature maps are output for detecting targets of different sizes. The P2-P5 feature maps output by the Feature Pyramid Network (FPN) are fed into the detection head. Each layer of pyramid features is processed through parallel classification and regression branches, outputting the class probability distribution and bounding box offset for each spatial location.
[0043] The detection results are output after the detection, including the target confidence level. Target Category and object detection bounding box Set threshold ,like They considered it a high-quality test result. Using the center point as a reference, cut out the width and height as follows: Images that are 1.1 to 1.3 times the width and height. The output is the cropped image. .
[0044] like Figure 4 As shown, in step S202, the... The input is then fed into the low-light detector (D1), and a saliency heatmap is extracted from the backbone network of D1 using LayerCAM (Hierarchical Class Activation Mapping). Forward hooks and backward hooks are set in the four layers of the backbone network of the low-light detector (D1). During forward propagation, the activation map (intermediate vector of the low-light detector) of a specific layer is obtained through the forward hooks, as shown in Equation (1):
[0045] This is the activation graph of the k-th layer. This represents the forward propagation of the k-th feature map channel in the backbone network. For the input image, Here are the model parameters, K is the total number of layers, which is 4 in this application, and k represents the layer number.
[0046] After forward propagation, select the highest result from the results. Perform backpropagation, calculate the gradient of the feature map, and obtain the saliency heatmap, as shown in formula (2):
[0047] This represents the k-th significance heatmap, where ReLU represents the activation function. This represents the gradient of the intermediate vector of the k-th layer low-light detector with respect to the preset highest confidence level. Let represent the intermediate vector of the low-light detector in layer k, where k represents the layer number of the intermediate vector, and c represents the channel index of the channel dimension summation. This represents element-wise multiplication in matrix operations. The final output is... It is a saliency heatmap of the selected layer, which is an evaluation index of the importance of features in the original image.
[0048] In step S203, a multi-scale image fusion strategy based on the Laplacian pyramid is used to saliency heatmaps. and The mixture is then fused to obtain a mixed heat map. First, a three-layer Gaussian pyramid is constructed for each of the two input heatmaps. Then, the corresponding Laplacian pyramid is calculated to capture the detailed information of the image at different scales. At each scale, the corresponding layers in the two Laplacian pyramids are weighted and fused to maintain the structure of the main image while introducing the details of the auxiliary image. The fused pyramid is then upsampled and superimposed from the bottom layer to reconstruct the final fused heatmap. The fusion process is shown in formula (3):
[0049] in: They are respectively The constructed first Layered Laplace Pyramid; For the first Layer fusion weights; This represents the process of upsampling layer by layer from the merged Laplacian pyramid and reconstructing the image by weighted summation.
[0050] right and Perform the same fusion operation to obtain Until finally merging into a single heat map That is, the final one. (Significance heatmap after fusion).
[0051] In step S204, a lightweight mask generation network MaskNet is used. This network takes a saliency heatmap as input and outputs a predicted binary mask. At the same time, a random mask is generated using an image generation algorithm based on random noise. By taking the intersection of the predicted mask and the random mask, a mask with randomness and retaining important image features is obtained.
[0052] Furthermore, in step S204, the lightweight mask generation network includes: an encoder, a decoder, and a pass-through estimator connected end to end; The encoder includes a first convolutional layer, a first activation layer, a second convolutional layer, a second activation layer, a third convolutional layer, and a third activation layer connected end to end; The decoder includes a fourth convolutional layer, a fourth activation layer, a fifth convolutional layer, a fifth activation layer, a sixth convolutional layer, and a sixth activation layer, all connected end-to-end.
[0053] It should be noted that data augmentation techniques such as Cutout and Hide-and-Seek can be used to replace mask generation. However, random occlusion methods randomly select regions in the image for occlusion without considering the importance of the features in the occluded regions, which may cause the model to focus on irrelevant areas and affect the effectiveness of feature learning. Based on prior knowledge of the importance of strongly correlated features, this approach retains the important features of the target and randomly occludes secondary features, generating complex and random masks to help the model adapt to various feature loss situations and improve its robustness.
[0054] The encoder aims to extract features from the input saliency prior heatmap, and the decoder aims to generate a continuous value mask with the same size as the heatmap and values in the interval [0,1] based on the features. The continuous value mask is converted into a binary mask with values in {0,1} through the straight-through estimator (STE), while preserving the gradient of the backpropagation of the decoding process, as shown in Equation (4):
[0055] in, This is the unnormalized mask output for the network output; For element-wise Sigmoid function, output a continuous mask. ; Set a fixed binarization threshold (usually 0.5); Represents an element-wise step function; This indicates an operation that blocks gradient propagation and only takes effect during backpropagation.
[0056] The following describes the training process of the lightweight mask generation network (MaskNet): The input to MaskNet is a heatmap and a target occlusion rate value. Before being fed into the network, the target occlusion rate value is converted into a tensor with the same size as the heatmap and all values being that value. This tensor is then used as the second channel and concatenated with the heatmap before being input into the MaskNet encoder. In the first 8 training rounds, the mask generated by thresholding the heatmap is used as the supervision signal for MaskNet. The MaskNet is trained using BCE (Binary Cross-Entropy) loss and Dice loss, as shown in Equation (5):
[0057] in and The weighting hyperparameter for the proportion of loss is... This represents the mask generated by MaskNet prediction. This represents the threshold segmentation heatmap mask that needs to be aligned for the first 8 epochs of MaskNet training. This is a minima to prevent division by zero errors and improve numerical stability. The threshold-segmented heatmap is a binary mask obtained by setting regions of the heatmap greater than a threshold to 1 and the remaining regions to 0.
[0058] In the last 12 rounds of training, based on the first 8 rounds, the encoder was frozen and the decoder was trained. Based on this, mask connectivity loss and mask ratio loss are added, and mask connectivity loss is... Encourage the formation of compact, continuous block-shaped mask regions, resulting in a mask ratio loss. The ratio of the constraint mask region to the image region is set to a specific value. The loss functions mentioned above are then combined to obtain the loss function for this stage. As shown in formula (6): Formula (6) Where M is the predicted output of MaskNet. Edge strength loss is used to measure the degree of structural fragmentation in zero-mask regions; B is the erosion connectivity loss, used to measure the proportion of the area retained after multiple erosions of the zero-mask region; B is the total number of pixels in the binary mask. This represents the percentage of the current masked area that is obscured. The percentage of the target occlusion area. The definitions of edge strength loss and corrosion connectivity loss in formula (6) are shown in formula (7):
[0059] in The gradient magnitude is represented by , and B represents a batch of mask images. The erosion connectivity loss is defined in the following context: , The definition is shown in formula (8):
[0060] in Let represent the initial area of the zero-mask region in the b-th image. This represents the remaining area of the zero-mask region in the b-th image after one or more erosion operations. This indicates that morphological erosion operations are simulated through max pooling.
[0061] In summary, using the pre-trained MaskNet model, a binary mask is obtained from the input image. The value 0 represents the "occluded region," and the value 1 represents the "retained region." This mask effectively indicates the important regions identified by the detection model; a naturally shaped occlusion mask is constructed using an image generation algorithm based on random noise. The specific method involves Gaussian blurring and smoothing a uniformly distributed two-dimensional random noise image, combined with threshold segmentation and morphological transformation, to obtain an irregular binary image with connectivity and natural edges. and The intersection of the occluded regions is used to obtain the final binary mask Mask, as shown in Equation (9):
[0062] In step S205, a mask image is obtained by multiplying part of the features in the mask image element by element, as shown in formula (10):
[0063] Further, in step S4, network feature maps of the teacher model and the student model are extracted respectively, including: S401: Extract intermediate features from the teacher model to obtain a first teacher model feature map; extract intermediate features from the student model to obtain a first student model feature map; S402: Divide the first teacher model feature map into multiple image blocks to obtain multiple teacher model image blocks; divide the first student model feature map into multiple image blocks to obtain multiple student model image blocks; S403: Using multiple teacher model image blocks that meet the second preset conditions as teacher nodes, and the semantic similarity between each teacher node as an edge, construct a second teacher model feature map; using multiple student model image blocks that meet the third preset conditions as student nodes, and the semantic similarity between each student node as an edge, construct a second student model feature map. S404: Input the second teacher model feature map and the second student model feature map into the trained graph neural network for processing to obtain the teacher model network feature map and the student model network feature map.
[0064] It's important to note that by using graph neural networks to construct graphs and aggregate semantic features for salient regions, the model can be guided to focus on incomplete visual features in complex masked scenes. This enables the model to possess global semantic awareness and improves its semantic consistency learning performance in complex scenarios. After applying a mask to an image, the visual information becomes complex; each image pair has a mask with a different shape and structure, but the commonality is that important features of the image target are preserved. By aggregating the feature maps extracted by the backbone network of the detector using graph neural networks, the decisive features of the target can be extracted under complex-shaped masks through the graph structure, guiding the model to focus on the visible part of the mask map.
[0065] In one specific embodiment, student model D3 and teacher model D2 share a structure, having the same backbone network, detection neck, and detection head, and initially share parameters.
[0066] The construction and training process of the teacher and student models is as follows: like Figure 5 As shown, the teacher model receives the cropped image. As input, the output of layer 3 of the backbone network ResNet-50 is used as the feature map for alignment: The extracted features are input to the semantic feature alignment module of the graph neural network for global feature alignment. These features are then input to the detection neck, processed by the detection neck and detection head, and output as target detection boxes. Target confidence level And target classification result prediction , as a pseudo-label for student model learning.
[0067] It should be noted that in the global semantic alignment step of graph neural networks, other global feature alignment methods, such as self-attention and non-local neural networks, can be used to capture global contextual information and achieve semantic feature alignment. Self-attention and non-local operations typically require calculating the relationships between global features, leading to excessive computational overhead. Furthermore, these methods do not explicitly utilize the structured information of the data, i.e., feature fragmentation caused by complex masks, and are less effective than GNNs when modeling complex relationships.
[0068] Student model receives masked image As input, the features extracted by the student model are input to the feature alignment module for feature alignment, and after processing by the detection neck and detection head, the predicted bounding box is output. Target confidence level And target classification result prediction .
[0069] Align the detection outputs of the student model and the teacher model, and design a bounding box consistency loss. Confidence consistency loss and category consistency loss The bounding box consistency loss employs an improved loss based on GIoU (Generalized Intersection over Union). To mitigate the interference of occluded regions on bounding box regression training, an improved intersection over union loss function is proposed. An occlusion robustness design is introduced on top of the standard GIoU. This loss function constructs two reference regions on each target pseudo-label box: For the complete pseudo-label bounding box, Subtract the masked area from the pseudo-label bounding box to obtain the sub-boundary formed by the visible area. Calculate the predicted bounding box separately. The GIoU between these two regions is used as the optimization objective, and the larger one is selected. It should be noted that by designing an occlusion-robust IoU loss function, the interference of occlusion regions on the regression accuracy of the target bounding box is avoided, significantly improving detection accuracy. Traditional IoU and GioU methods can be used instead. However, when the target is occluded, the traditional IoU loss function may lead to a reduction in the overlap between the predicted bounding box and the ground truth bounding box, affecting gradient calculation and causing a decrease in regression accuracy.
[0070] The bounding box consistency loss is shown in Equation (11):
[0071] This represents the bounding box in the object detection results of the student model. This represents the bounding box in the object detection results of the teacher model. This represents the bounding box of the unmasked region in the object detection results of the teacher model. This represents the GIoU loss function, where max indicates taking the maximum value. in This represents the area of the intersection between the predicted bounding box and the ground truth label. This represents the area of the union of the two boxes. The smallest bounding rectangle that simultaneously encloses the predicted bounding box and the ground truth label. This represents the portion of the bounding rectangle that is not part of the union.
[0072] The confidence consistency loss is calculated as the difference between the prediction confidence of the student model and the teacher model, as shown in formula (12):
[0073] express The L1 norm, This represents the confidence level in the object detection results of the student model. This represents the confidence level in the target detection results of the teacher model; The class consistency loss uses KL divergence to measure the difference between the class probability distributions output by the student model and the teacher model, as shown in formula (13):
[0074] This represents the classification result in the object detection results of the student model. This represents the classification result in the teacher model's object detection results. Indicates to , Find the KL divergence.
[0075] The detection task loss value is shown in formula (14):
[0076] Indicates the weights of the bounding box consistency loss. This represents the weight of the confidence consistency loss. Indicates the weight of the class consistency loss. This represents the loss value of the detection task. This represents the bounding box consistency loss. This represents the confidence consistency loss. This represents the loss of class consistency.
[0077] like Figure 6 As shown, feature maps are extracted from the teacher model branch. The feature map is divided into uniformly sized patches, flattened, and then embedded with sinusoidal positional encoding, with each patch serving as a candidate node. The binary mask is downsampled using average pooling to obtain a non-binary downsampled mask. : and These represent the number of patches in the height and width directions, respectively. It is a continuous value matrix, where the value of each element represents the visibility of the patch. Candidate nodes with visibility greater than a threshold (set to 0.3) are selected as graph construction nodes, and edges are constructed through semantic similarity between nodes. For the input feature map, a specific graph structure is formed, as shown in formula (15):
[0078] in, . .
[0079] in, and They are two different image patches. This indicates that the semantic similarity between the feature vectors of image patches is greater than a set semantic similarity threshold.
[0080] Graph neural networks Using the input as input, message passing and node updates are performed at layer L. The propagation form of the trained graph neural network is shown in equation (16):
[0081] u and v represent nodes in the model's feature map. Let v represent the set of adjacent nodes of node v. This represents the feature vector representation of node u in the graph neural network of layer l. This represents the feature vector representation of node v in the (l+1)th layer of the graph neural network. Indicates the first Attention weights of layers Indicates the first Graph convolution weights of layers represents the activation function, and l represents the layer number of the graph neural network; After propagation through L layers, nodes are aggregated using a weighted average aggregation method to generate a graph-level semantic representation vector, as shown in formula (17):
[0082] Represents the feature aggregation function, This represents the feature vector representation of graph node v obtained from the final layer of the graph neural network. This represents the weight assigned to node v during the weighted average aggregation phase. Indicates the total number of nodes in the final layer. Let L represent the feature map of the graph neural network; this formula can be used as a teacher model or a student model to generate the corresponding feature map. The subscript "masked" corresponds to the output of the teacher model feature input, and the subscript "full" corresponds to the output of the student model feature input.
[0083] like Figure 7 As shown, to improve the discriminative power of graph-level semantic representation, graph vectors... Further input of classification header Output category probability distribution The class probability distribution output by the teacher model branch As a monitoring signal, a cross-entropy loss function is constructed. As shown in formula (18):
[0084] Where K represents the total number of categories in the classification task. The value of the class probability distribution of the teacher model branch output on the k-th class is used as a pseudo-label supervision signal; This represents the value of the class probability distribution output by the graph neural network on the k-th class. The above steps and loss function are used to train the graph neural network and classifier, enabling the graph-level semantic vector to accurately represent the semantic content of the entire image.
[0085] After training the graph neural network, its parameters are frozen for global semantic alignment between the teacher and student models. For the teacher model features, the input feature map... And perform downsampling mask weighting and node selection; for student model features, input feature map The downsampling mask is only used to eliminate candidate nodes in low-visibility regions and is not weighted. For the teacher-student model features of an image pair, the graph neural network processes them to obtain two graph vectors. and The alignment loss is defined as the mean square error between two vectors. The global feature alignment loss value is shown in formula (19):
[0086] Represents the network feature map of the teacher model. Represents the feature map of the student model network. This represents the global feature alignment loss value. express The L2 norm.
[0087] It should be noted that in the mean teacher training framework, the teacher model and the student model use images that have undergone different processing (in this invention, a complete cropped image and an image with an occlusion mask). During the training phase, the teacher model does not update its parameters through backpropagation, but instead updates them from the parameters of the student model through exponential moving average. Multiple studies have shown that the EMA teacher is equivalent to a time-weighted average of the student parameter trajectories, thus approximating a low-variance ensemble model. It has a more stable function output and better generalization under stochastic optimization and noise perturbation. Therefore, the teacher model is used instead of the student model as the final detector.
[0088] After training is complete, the system outputs the trained detection model for online object detection in smart parks. The difference between the inference and training phases is that the inference phase only retains the forward prediction chain (backbone network, feature pyramid network, and detection head) of the final detection model, and no longer performs training-specific steps such as LayerCAM saliency extraction, MaskNet mask generation, random noise mask construction, teacher-student consistency loss calculation, graph neural network alignment loss calculation, and EMA update. The role of the above modules is to shape the model parameters so that they are robust to occlusion and incomplete features, and they are not essential computational paths during inference.
[0089] It should be noted that the EMA mechanism and pseudo-label consistency loss are used to achieve iterative optimization of the model under weak supervision, thereby improving training stability and final performance.
[0090] like Figure 8As shown, during online operation in the park, the input consists of single-frame images or video frames captured by the park's cameras. The system first performs preprocessing on the input image consistent with training (scaling, normalization, etc.), then inputs the preprocessed image into the final detection model (corresponding to the teacher model D2 at the end of training, or exporting the teacher model parameters as the deployment model). The model backbone network extracts multi-layer semantic features from the entire frame image and outputs multi-scale feature maps. The feature pyramid network fuses the multi-scale features to adapt to targets of different scales. The detection head outputs the class probability distribution and bounding box regression results for each spatial location on each scale feature map, obtaining a set of candidate detection boxes and their confidence scores. Subsequently, the system performs post-processing: filtering the candidate boxes by confidence threshold according to category, and using non-maximum suppression (NMS) or an equivalent deduplication strategy to remove highly overlapping redundant boxes, finally outputting the detection results required by the park (including target category, target confidence score, and target bounding box coordinates). In terms of business logic, the output results can be further linked with the park rules, such as triggering alarms for pedestrian intrusion in specific areas, providing upstream ROI for license plate recognition of vehicles at entrances and exits, and providing obstacle avoidance prompts for patrol robots.
[0091] A smart park target detection system for incomplete images, comprising: Dataset Acquisition Module: Acquires a fragmented image dataset, which includes: multiple fragmented images and the corresponding ground truth label for each fragmented image; constructs teacher and student models; Preprocessing module: preprocesses each incomplete image in the incomplete image dataset to obtain a mask image corresponding to each incomplete image; Image selection module: Selects one incomplete image from the incomplete image dataset as the first image; Result inference module: Input the first image into the teacher model to obtain the teacher model target detection result and teacher model intermediate features; input the mask image corresponding to the first image into the student model to obtain the student model target detection result and student model intermediate features; The intermediate features of the teacher model and the intermediate features of the student model are extracted respectively to obtain the network feature map of the teacher model and the network feature map of the student model. Loss calculation module: Calculates the detection task loss value based on the target detection results of the teacher model and the target detection results of the student model; calculates the global feature alignment loss value based on the network feature map of the teacher model and the network feature map of the student model. Student model optimization module: Optimizes the student model based on the detection task loss value and the global feature alignment loss value to obtain a new student model; Teacher model optimization module: Based on the new student model, update the teacher model using the exponential moving average method to obtain a new teacher model; Repeat module: Select another incomplete image from the incomplete image dataset as the new first image; repeat training until the first preset condition is met to obtain the trained teacher model; Image acquisition module: Acquires the incomplete image to be detected; Final Result Inference Module: Input the incomplete image to be detected into the trained teacher model to obtain the final target detection result.
[0092] A lightweight mask generation network training method includes: S01: Obtain the training dataset; the training dataset includes multiple training data, each training data including a heatmap and a threshold segmentation heatmap; construct the initial encoder; S02: Select one data point from the training dataset as the first data point; S03: Input the heat map data of the first data into the initial encoder to obtain the first code; S04: Based on the threshold segmentation heatmap of the first data and the first encoding, calculate the binary cross-entropy loss and Dice loss; S05: Optimize the initial encoder based on the binary cross-entropy loss and the Dice loss; S06: Select another piece of data from the training dataset as the new first data; repeat steps S03~S05 until the first preset round is reached; obtain the trained encoder; S07: Construct the initial decoder; S08: Select one data point from the training dataset as the second data point; S09: Input the heatmap data of the second data into the trained encoder to obtain the second code; S010: Input the second code into the initial decoder to obtain the third code; S011: Based on the third encoding, the edge strength loss and corrosion connectivity loss are calculated; S012: Optimize the initial decoder based on the edge strength loss and the erosion connectivity loss; S013: Select another piece of data from the training dataset as the new second data; repeat steps S09~S012 until the second preset round is reached; obtain the trained decoder; S014: Construct a pass-through estimator and combine the trained encoder, the trained decoder, and the pass-through estimator to obtain a lightweight mask generation network.
[0093] Example 2 Based on the smart park target detection method for incomplete images described in Example 1, this example uses the same smart park target detection method for incomplete images as Example 1.
[0094] This invention can be deployed in the perimeter security and road access management system of smart parks. Typical scenarios include: vehicle recognition at park entrance gates and underground parking garage entrances, patrol car / electric vehicle recognition on park roads, and pedestrian intrusion detection at building perimeters and parking areas. The imaging quality of park surveillance cameras deteriorates significantly under adverse weather conditions such as low light at night, rain, fog, and sandstorms. Furthermore, they are often accompanied by foreground occlusion (such as pedestrians being obscured by umbrellas, greenery, pillars, or parked vehicles) and "incomplete feature" phenomena, such as raindrops causing local blurring, strong reflections causing texture loss, and haze causing reduced contour contrast. These issues result in incomplete information on the local boundaries, textures, and key components of targets, making traditional detectors prone to missed detections, false detections, or frame offsets. To address the complex imaging conditions in the aforementioned park, this invention uses "vehicle / pedestrian images captured by park cameras" as input. Through saliency and importance prior modeling, fine-grained occlusion mask generation, and teacher-student consistency learning, the detector is able to systematically expose itself to feature loss patterns induced by "severe weather + occlusion" during the training phase and learn to maintain stable detection capabilities even with incomplete visual evidence.
[0095] Taking "vehicle recognition under nighttime rain and fog conditions on park roads" as an example, the system first collects historical video frames or images from park cameras during the offline training phase, and completes vehicle category and bounding box annotations to form a park scene dataset. Then, according to... Figure 9 The process shown executes steps 1–8: In step 1, the park image is input into the pre-trained one-stage detector instance D1 to obtain vehicle candidate boxes and confidence scores; for high-quality vehicle boxes with confidence scores exceeding a threshold, the vehicle local image is cropped at the center of the vehicle box to reduce the interference of complex backgrounds on subsequent saliency modeling and to make the saliency prior more focused on areas strongly related to vehicle discrimination, such as "vehicle lights, license plate areas, and vehicle body edges". This step is consistent with the mechanism of "threshold screening of high-quality detection results and cropping output" in the existing process.
[0096] In step 2, the cropped vehicle image is input into D1 again, and LayerCAM is used to extract saliency heatmaps from the multi-layer features of the backbone network to characterize "which visible features are most critical for vehicle detection under low-light conditions of rain and fog in the park". In step 3, the multi-layer saliency heatmaps are fused at multiple scales to obtain a detection-correlated saliency prior heatmap, so that key clues at different scales are unified into the same prior representation. Then, in step 4, MaskNet is trained: its input is the saliency prior heatmap and the target occlusion rate. By learning, a binary mask is generated and its intersection with a random noise mask of natural shape is taken to form a fine-grained occlusion mask that preserves key areas while randomly occluding secondary areas. For the park scene, this mask can equivalently simulate a variety of real interferences: local texture loss caused by raindrops / water mist, local overexposure caused by backlight reflection, local occlusion caused by leaves / umbrellas / pillars, etc., thereby expanding the training data from occasional real occlusion samples to a controllable series of samples covering diverse occlusion forms and missing proportions.
[0097] In step 5, the mask is multiplied element-wise with the cropped vehicle image to obtain the masked vehicle image, which serves as the incomplete input. In step 6, a mean-based teacher framework is constructed: teacher model D2 receives the unoccluded cropped vehicle image and outputs pseudo-labels (category distribution, confidence, bounding box), while student model D3 receives the masked vehicle image and outputs predictions. Through bounding box consistency, confidence consistency, and category consistency losses, the student's output, even with incomplete visual cues, approximates the teacher's output with relatively complete evidence, thus explicitly improving the robustness of vehicle bounding box localization and category discrimination under adverse weather and occlusion conditions. Furthermore, in step 7, a global semantic alignment based on graph neural networks is introduced into the backbone features of the teacher and student: under the guidance of the downsampling mask, only highly visible patches are selected for graph construction and global semantics are aggregated, enabling the model to form a stable graph-level semantic representation using the remaining visible areas even when local defects are severe. The alignment loss constrains the consistency of the teacher and student at the global semantic level. Finally, in step 8, the student parameters are updated by combining the detection task loss and the global alignment loss, and the teacher parameters are updated by EMA, resulting in the final detection model for campus deployment.
[0098] The same or similar labels correspond to the same or similar parts; The terms used to describe positional relationships in the accompanying drawings are for illustrative purposes only and should not be construed as limiting this application. Obviously, the above embodiments of the present invention are merely examples for clearly illustrating the present invention, and are not intended to limit the implementation of the present invention. Those skilled in the art can make other variations or modifications based on the above description. It is neither necessary nor possible to exhaustively describe all embodiments here. Any modifications, equivalent substitutions, and improvements made within the spirit and principles of the present invention should be included within the scope of protection of the claims of the present invention.
Claims
1. A smart park target detection method for incomplete images, characterized in that, include: S1: Obtain the incomplete image dataset, which includes: multiple incomplete images and the corresponding ground truth label for each incomplete image; construct the teacher model and the student model; S2: Preprocess each incomplete image in the incomplete image dataset to obtain a mask image corresponding to each incomplete image; S3: Select one incomplete image from the incomplete image dataset as the first image; S4: Input the first image into the teacher model to obtain the teacher model target detection result and the teacher model intermediate features; input the mask image corresponding to the first image into the student model to obtain the student model target detection result and the student model intermediate features; The intermediate features of the teacher model and the intermediate features of the student model are extracted respectively to obtain the network feature map of the teacher model and the network feature map of the student model. S5: Calculate the detection task loss value based on the target detection results of the teacher model and the target detection results of the student model; calculate the global feature alignment loss value based on the network feature map of the teacher model and the network feature map of the student model. S6: Optimize the student model based on the detection task loss value and the global feature alignment loss value to obtain a new student model; S7: Based on the new student model, update the teacher model using the exponential moving average method to obtain a new teacher model; S8: Select another incomplete image from the incomplete image dataset as the new first image; repeat steps S4 to S7 until the first preset condition is met to obtain the trained teacher model. S9: Obtain the incomplete image to be detected; S10: Input the incomplete image to be detected into the trained teacher model to obtain the final target detection result.
2. The smart park target detection method for incomplete images according to claim 1, characterized in that, In step S2, the preprocessing includes: S201: The incomplete image is cropped using a low-light detector to obtain the cropped incomplete image and the low-light detector intermediate vector; S202: The hierarchical class activation mapping algorithm is used to perform class activation mapping on the intermediate vector of the low-light detector to obtain multiple saliency heatmaps; S203: The multiple saliency heatmaps are fused using a multi-scale image fusion strategy based on the Laplacian pyramid to obtain a fused saliency heatmap; S204: The fused saliency heatmap is processed using a lightweight mask generation network to obtain a binary mask; S205: Based on the binary mask, the cropped incomplete image is masked using element-wise multiplication to obtain the mask image corresponding to the incomplete image.
3. The smart park target detection method for incomplete images according to claim 2, characterized in that, In step S201, the low-light detector includes: a first ResNet50 backbone network, a first feature pyramid network, and a first detection head network connected end to end; The first ResNet50 backbone network includes a first convolutional layer, a first max pooling layer, and multiple residual blocks connected end-to-end; the outputs of the multiple residual blocks are spliced together to form the intermediate vector of the low-light detector; The outputs of the multiple residual blocks are respectively input into the first feature pyramid network, and after upsampling, multiple first feature maps are obtained; Multiple first feature maps are input into the first detection head network, and after classification and regression processing, preliminary target detection results are obtained. The incomplete image is cropped based on the bounding boxes in the preliminary target detection results to obtain the cropped incomplete image.
4. The smart park target detection method for incomplete images according to claim 2, characterized in that, The formula for calculating the significance heatmap is as follows: This represents the k-th significance heatmap, where ReLU represents the activation function. This represents the gradient of the intermediate vector of the k-th layer low-light detector with respect to the preset highest confidence level. Let represent the intermediate vector of the low-light detector in layer k, where k represents the layer number of the intermediate vector, and c represents the channel index of the channel dimension summation. This represents element-wise multiplication in matrix operations.
5. The smart park target detection method for incomplete images according to claim 1, characterized in that, In step S4, network feature maps of the teacher model and the student model are extracted respectively, including: S401: Extract intermediate features from the teacher model to obtain a first teacher model feature map; extract intermediate features from the student model to obtain a first student model feature map; S402: Divide the first teacher model feature map into multiple image blocks to obtain multiple teacher model image blocks; divide the first student model feature map into multiple image blocks to obtain multiple student model image blocks; S403: Using multiple teacher model image blocks that meet the second preset conditions as teacher nodes, and the semantic similarity between each teacher node as an edge, construct a second teacher model feature map; using multiple student model image blocks that meet the third preset conditions as student nodes, and the semantic similarity between each student node as an edge, construct a second student model feature map. S404: Input the second teacher model feature map and the second student model feature map into the trained graph neural network for processing to obtain the teacher model network feature map and the student model network feature map.
6. The smart park target detection method for incomplete images according to claim 5, characterized in that, The formula for a trained graph neural network is as follows: u and v represent nodes in the model's feature map. Let v represent the set of adjacent nodes of node v. This represents the feature vector representation of node u in the graph neural network of layer l. This represents the feature vector representation of node v in the (l+1)th layer of the graph neural network. Indicates the first Attention weights of layers Indicates the first Graph convolution weights of layers represents the activation function, and l represents the layer number of the graph neural network; Represents the feature aggregation function, This represents the feature vector representation of graph node v obtained from the final layer of the graph neural network. This represents the weight assigned to node v during the weighted average aggregation phase. Indicates the total number of nodes in the final layer. Let L represent the feature map of the model network, and let L represent the final layer of the graph neural network.
7. The smart park target detection method for incomplete images according to claim 1, characterized in that, Global feature alignment loss values include: Represents the network feature map of the teacher model. Represents the feature map of the student model network. This represents the global feature alignment loss value. express The L2 norm.
8. The smart park target detection method for incomplete images according to claim 1, characterized in that, The loss values for the detection task include: Indicates the weights of the bounding box consistency loss. This represents the weight of the confidence consistency loss. Indicates the weight of the class consistency loss. This represents the loss value of the detection task. This represents the bounding box consistency loss. This represents the confidence consistency loss. This represents the loss of class consistency. The bounding box consistency loss includes: This represents the bounding box in the object detection results of the student model. This represents the bounding box in the object detection results of the teacher model. This represents the bounding box of the unmasked region in the object detection results of the teacher model. This represents the GIoU loss function, and max indicates taking the maximum value.
9. A smart park target detection system for incomplete images, applied to the detection system according to any one of claims 1 to 8, characterized in that, include: Dataset Acquisition Module: Acquires a fragmented image dataset, which includes: multiple fragmented images and the corresponding ground truth label for each fragmented image; constructs teacher and student models; Preprocessing module: preprocesses each incomplete image in the incomplete image dataset to obtain a mask image corresponding to each incomplete image; Image selection module: Selects one incomplete image from the incomplete image dataset as the first image; Result inference module: Input the first image into the teacher model to obtain the teacher model target detection result and teacher model intermediate features; input the mask image corresponding to the first image into the student model to obtain the student model target detection result and student model intermediate features; The intermediate features of the teacher model and the intermediate features of the student model are extracted respectively to obtain the network feature map of the teacher model and the network feature map of the student model. Loss calculation module: Calculates the detection task loss value based on the target detection results of the teacher model and the target detection results of the student model; calculates the global feature alignment loss value based on the network feature map of the teacher model and the network feature map of the student model. Student model optimization module: Optimizes the student model based on the detection task loss value and the global feature alignment loss value to obtain a new student model; Teacher model optimization module: Based on the new student model, update the teacher model using the exponential moving average method to obtain a new teacher model; Repeat module: Select another incomplete image from the incomplete image dataset as the new first image; repeat training until the first preset condition is met to obtain the trained teacher model; Image acquisition module: Acquires the incomplete image to be detected; Final Result Inference Module: Input the incomplete image to be detected into the trained teacher model to obtain the final target detection result.
10. A lightweight mask generation network training method, applied to the smart park target detection method for incomplete images as described in any one of claims 2 to 4, characterized in that, In step S204, the lightweight mask generation network includes: an encoder, a decoder, and a pass-through estimator connected end to end; The encoder includes a first convolutional layer, a first activation layer, a second convolutional layer, a second activation layer, a third convolutional layer, and a third activation layer connected end to end; The decoder includes a fourth convolutional layer, a fourth activation layer, a fifth convolutional layer, a fifth activation layer, a sixth convolutional layer, and a sixth activation layer connected end to end; A lightweight mask generation network training method includes: S01: Obtain the training dataset; the training dataset includes multiple training data, each training data including a heatmap and a threshold segmentation heatmap; construct the initial encoder; S02: Select one data point from the training dataset as the first data point; S03: Input the heat map data of the first data into the initial encoder to obtain the first code; S04: Based on the threshold segmentation heatmap of the first data and the first encoding, calculate the binary cross-entropy loss and Dice loss; S05: Optimize the initial encoder based on the binary cross-entropy loss and the Dice loss; S06: Select another piece of data from the training dataset as the new first data; repeat steps S03~S05 until the first preset round is reached; obtain the trained encoder; S07: Construct the initial decoder; S08: Select one data point from the training dataset as the second data point; S09: Input the heatmap data of the second data into the trained encoder to obtain the second code; S010: Input the second code into the initial decoder to obtain the third code; S011: Based on the third encoding, the edge strength loss and corrosion connectivity loss are calculated; S012: Optimize the initial decoder based on the edge strength loss and the erosion connectivity loss; S013: Select another piece of data from the training dataset as the new second data; repeat steps S09~S012 until the second preset round is reached; obtain the trained decoder; S014: Construct a pass-through estimator and combine the trained encoder, the trained decoder, and the pass-through estimator to obtain a lightweight mask generation network.