Scenic spot garbage identification method and device based on causal features, medium and product

By using an asymmetric twin network architecture based on causal features, the essential features of garbage are extracted and background information is ignored. This solves the problem of low recognition accuracy of garbage identification algorithms in scenic areas under complex backgrounds, achieving higher recognition accuracy and stability, and adapting to environmental changes in different seasons.

CN119942215BActive Publication Date: 2026-07-31BEIJING DECK SMART TECH CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
BEIJING DECK SMART TECH CO LTD
Filing Date
2025-01-21
Publication Date
2026-07-31

AI Technical Summary

Technical Problem

Existing litter identification algorithms in scenic areas have low accuracy in different background environments. In particular, leaves and flowers are easily missed in road and grass backgrounds, and paper scraps and fruit peels are misjudged in complex backgrounds, resulting in insufficient identification accuracy.

Method used

We employ an asymmetric twin network architecture based on causal features, and use image fusion and gradient blocking techniques to extract the essential features of garbage while ignoring background information. This allows us to construct a training dataset for model training and recognition.

Benefits of technology

It improved the accuracy of garbage identification under different backgrounds, reduced the false alarm rate, enhanced the adaptability and stability of the model, adapted to different seasonal environmental changes, and improved the identification effect.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119942215B_ABST
    Figure CN119942215B_ABST
Patent Text Reader

Abstract

A method, apparatus, medium, and product for identifying litter in scenic areas based on causal features, relating to the field of data recognition, is disclosed. The method includes: acquiring multiple monitoring images of a target park / scenic area and processing them to obtain multiple standardized images; extracting litter areas and background areas to obtain a litter sample set and a background sample set; performing image fusion to generate a litter image training set; constructing a Siamese network containing two coding branches, and setting a gradient backpropagation prevention operation on the second coding branch of the Siamese network to obtain an asymmetric Siamese network; inputting the two images of a litter image pair to the two coding branches of the asymmetric Siamese network respectively, training the model using minimizing the cosine distance between the output vectors of the two coding branches as the training criterion, and determining a feature extraction model based on the trained first coding branch; inputting the monitoring image to be tested to the feature extraction model to obtain the litter identification result. Implementing this application can accurately identify litter in scenic areas.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of data identification, and in particular to a method, device, medium, and product for identifying waste in scenic areas based on causal features. Background Technology

[0002] With the continuous advancement of urbanization and the sustained improvement of people's living standards, the construction and management of urban parks and scenic areas are receiving increasing attention. As important places for urban residents to relax, enjoy leisure activities, and exercise, the environmental sanitation quality of parks and scenic areas directly affects the citizens' visitor experience and the city's image.

[0003] In related technologies, object detection algorithms in the field of computer vision are widely used in waste identification tasks. These algorithms use deep learning models to extract features and classify images, enabling automatic waste identification. Common technical solutions employ object detection algorithms such as YOLO and Faster R-CNN, combined with images captured by surveillance cameras, to detect waste in real time, and then dispatch robots to clean it up after detection.

[0004] However, the distribution of different types of garbage in the scenic area's background environment varies. For example, leaves and flowers mainly appear on the road and water surfaces, while paper scraps and fruit peels are more common in the grass background. This leads to an unbalanced distribution of training samples for the model. Due to the lack of relevant training samples, the model may miss some garbage in non-featured scenes, such as leaves and petals on the grass and paper scraps and fruit peels in the road background. The accuracy of garbage recognition in related technologies needs to be improved. Summary of the Invention

[0005] This application provides a method, device, medium, and product for identifying litter in scenic areas based on causal features, for accurately identifying litter in scenic areas.

[0006] Firstly, this application provides a scenic area litter identification method based on causal features, applied to a scenic area litter identification device. The method includes: acquiring multiple scenic area monitoring images of a target park / scenic area and adjusting these images to a preset standard size to obtain multiple standardized images; extracting litter regions and background regions from the multiple standardized images to obtain a litter sample set and a background sample set; fusing each litter region in the litter sample set with multiple background regions in the background sample set to generate a litter image training set; the litter image training set includes multiple litter image groups, each group including multiple images of one piece of litter in multiple backgrounds; constructing a Siamese network containing two coding branches, setting a gradient backpropagation prevention operation on the second coding branch of the Siamese network to obtain an asymmetric Siamese network; selecting litter image pairs with the same litter but different backgrounds from the litter image groups in the litter image training set, inputting the two images of each litter image pair to the two coding branches of the asymmetric Siamese network, training the model using the minimum cosine distance between the output vectors of the two coding branches as the training criterion, and determining a feature extraction model based on the trained first coding branch; inputting the monitoring image to be tested to the feature extraction model to obtain the litter identification result.

[0007] In the above embodiments, the scenic area garbage identification device acquires scenic area monitoring images and extracts garbage and background samples, performs image fusion to generate training data, and uses an asymmetric twin network for model training. This enables the network to extract the features of the object itself (causal features) while ignoring changing background information (correlation features). By preventing gradient backpropagation of the second encoding branch, the stability of feature extraction is ensured, and the model's accuracy in identifying the same garbage under different backgrounds is improved.

[0008] In conjunction with some embodiments of the first aspect, in some embodiments, the step of acquiring multiple scenic area monitoring images of a target park and adjusting the multiple scenic area monitoring images to a preset standard size to obtain multiple standardized images specifically includes: acquiring multiple scenic area monitoring images of the target park and calculating the Laplacian operator variance of the scenic area monitoring images to obtain image sharpness; calculating the average value of the image pixel values ​​in the scenic area monitoring images to obtain image brightness values; when the image sharpness is greater than a preset sharpness threshold and the image brightness value is within a preset brightness range, the corresponding scenic area monitoring image is taken as a valid image; selecting a preset number of target images from the valid images, adjusting the target images to a preset standard size, and obtaining multiple standardized images.

[0009] In the above embodiments, the scenic area waste identification device filters the clarity and brightness of the input image by calculating the variance of the Laplacian operator and the average pixel value of the image, ensuring the quality of the training data, eliminating blurry and improperly exposed images, and retaining only valid images that meet the requirements, thereby improving the accuracy of subsequent feature extraction and recognition.

[0010] In conjunction with some embodiments of the first aspect, in some embodiments, the step of selecting a preset number of target images from the effective images and adjusting the target images to a preset standard size to obtain multiple standardized images specifically includes: selecting a preset number of target images from the effective images and obtaining image size data for each target image; when the image size data is smaller than the preset standard size, using a bicubic interpolation algorithm to enlarge the target image to obtain an enlarged target image; when the image size data is larger than the preset standard size, using a region mean pooling method to compress the target image to obtain a reduced target image; and performing normalization processing on the target image, the enlarged target image, and the reduced target image that are equal to the preset standard size to obtain multiple standardized images.

[0011] In the above embodiments, the scenic area garbage identification device uses bicubic interpolation algorithm to enlarge small images, uses regional mean pooling to compress large images, and finally performs normalization processing to ensure that all images meet the preset standard size requirements, which not only ensures the maximum preservation of image information, but also achieves data standardization.

[0012] In conjunction with some embodiments of the first aspect, in some embodiments, after the step of extracting garbage regions and background regions from multiple standardized images to obtain garbage sample sets and background sample sets, the method further includes: counting the number of garbage samples of each type in the garbage sample set; when the number of a certain garbage sample is less than a preset number of samples, treating the garbage sample as a missing garbage sample; and supplementing the number of missing garbage samples to the preset number of samples.

[0013] In the above embodiments, the scenic area garbage identification device identifies categories with insufficient sample numbers by counting the number of various types of garbage samples, and performs data augmentation processing such as rotation, flipping, and brightness adjustment on these missing samples, which effectively solves the problem of uneven distribution of training data and improves the model's ability to identify various types of garbage.

[0014] In conjunction with some embodiments of the first aspect, in some embodiments, the step of image fusion of each garbage region in the garbage sample set with multiple background regions in the background sample set to generate a garbage image training set specifically includes: acquiring historical monitoring images of the target park scenic area in different seasons as seasonal feature images; extracting the same background region with different image features in each seasonal feature image to obtain a seasonal feature background set; and image fusion of each garbage region in the garbage sample set with multiple background regions in the seasonal feature background set to generate a garbage image training set.

[0015] In the above embodiments, the scenic area garbage identification device constructs a seasonal feature background set based on historical monitoring images of different seasons, extracts seasonal background features, and realizes the fusion of garbage samples with different seasonal backgrounds, thereby enhancing the model's adaptability to garbage identification in different seasonal environments.

[0016] In conjunction with some embodiments of the first aspect, in some embodiments, the step of image fusion of each garbage region in the garbage sample set with multiple background regions in the seasonal feature background set to generate a garbage image training set specifically includes: calculating the dominant color tone, brightness distribution, and texture features of each background region in the seasonal feature background set to obtain seasonal feature parameters; performing color space conversion and parameter adjustment on the garbage regions in the garbage sample set according to the seasonal feature parameters to obtain seasonally adapted garbage samples; extracting the contour features of the seasonally adapted garbage samples and smoothing the contour edges to obtain edge-optimized garbage samples; performing gradient fusion of the edge-optimized garbage samples with the background regions in the seasonal feature background set to generate training images; and combining multiple training images with the same garbage but different seasons or different backgrounds into a garbage image group to generate a garbage image training set.

[0017] In the above embodiments, the scenic area garbage identification device extracts the main color tone, brightness distribution and texture features of the background area, performs color space conversion and parameter adjustment on the garbage samples, and performs contour optimization and gradient fusion to generate more natural training images, thereby improving the authenticity and diversity of the training data.

[0018] In conjunction with some embodiments of the first aspect, in some embodiments, after the step of inputting the monitoring image to be tested into the feature extraction model and obtaining the garbage identification result, the method further includes: obtaining user annotation information on the garbage identification result, statistically analyzing the difference between the annotation information and the garbage identification result, and obtaining model performance evaluation indicators; the model performance evaluation indicators include recognition accuracy, false negative rate, and false positive rate; based on the model performance evaluation indicators, determining the scene types whose performance is lower than a preset threshold, and obtaining the scene to be optimized; selecting training samples with the same features as the scene to be optimized from the garbage image training set, and constructing a scene-oriented training set; using the scene-oriented training set to incrementally train the feature extraction model, and obtaining the feature extraction optimization model; inputting the monitoring image to be tested into the feature extraction optimization model, and obtaining the garbage identification optimization result.

[0019] In the above embodiments, the scenic area waste identification device evaluates the model performance based on user-labeled information, constructs a targeted training set for scenarios with poor performance, and performs incremental training, which can continuously improve the model's recognition effect in various real-world scenarios and ensure the system's practicality.

[0020] Secondly, embodiments of this application provide a scenic area waste identification device, which includes: one or more processors and a memory; the memory is coupled to the one or more processors, and the memory is used to store computer program code, which includes computer instructions, and the one or more processors call the computer instructions to cause the scenic area waste identification device to perform the method described in the first aspect and any possible implementation thereof.

[0021] Thirdly, embodiments of this application provide a computer program product containing instructions that, when the computer program product is run on a scenic area waste identification device, cause the scenic area waste identification device to perform the method described in the first aspect and any possible implementation thereof.

[0022] Fourthly, embodiments of this application provide a computer-readable storage medium including instructions that, when executed on a scenic area waste identification device, cause the scenic area waste identification device to perform the method described in the first aspect and any possible implementation thereof.

[0023] Understandably, the scenic area waste identification device provided in the second aspect, the computer program product provided in the third aspect, and the computer storage medium provided in the fourth aspect are all used to execute the methods provided in the embodiments of this application. Therefore, the beneficial effects they can achieve can be referred to the beneficial effects in the corresponding methods, and will not be repeated here.

[0024] One or more technical solutions provided in the embodiments of this application have at least the following technical effects or advantages: 1. By employing image standardization and sample extraction to establish basic training data, and then using image fusion technology to construct a group of garbage images containing different backgrounds, and adopting an asymmetric Siamese network structure, the stability of feature extraction is maintained by preventing gradient back-passing of one encoding branch, while allowing the other branch to continuously optimize to extract the essential features of the garbage. This effectively solves the problems of model recognition being dependent on background information and insufficient generalization ability in related technologies. It achieves the extraction of the features of the object itself (causal features) while ignoring changing background information (correlation features), ensuring accurate identification of the same garbage in different scenarios, and improving the practical value and reliability of the model.

[0025] 2. By employing statistical analysis of sample quantity, various data augmentation processes such as rotation, flipping, and brightness adjustment are applied to garbage samples with missing quantities until the preset sample quantity requirement is reached. This effectively solves the problem of insufficient training and recognition bias caused by the scarcity of samples for certain garbage categories in related technologies, achieves a balanced distribution of training data, and improves the model's recognition accuracy for various types of garbage.

[0026] 3. By collecting historical monitoring images from different seasons and extracting the background features of each season, the system integrates garbage samples with diverse seasonal backgrounds, effectively solving the problem of poor adaptability of models to seasonal environmental changes in related technologies. This results in stable recognition performance under different seasonal backgrounds, enabling the system to adapt to various environmental conditions throughout the year in the scenic area, thus improving the practicality and reliability of the model. Attached Figure Description

[0027] Figure 1 This is a flowchart illustrating a scenic area waste identification method based on causal features in an embodiment of this application. Figure 2 (a) is a schematic diagram of the architecture for model training based on asymmetric twin networks in an embodiment of this application; Figure 2 (b) is a schematic diagram of a scenario for garbage identification using a feature extraction model in an embodiment of this application; Figure 3 This is another flowchart illustrating the scenic area waste identification method based on causal features in this application embodiment; Figure 4 This is a schematic diagram of the physical structure of a scenic area garbage identification device in the embodiments of this application. Detailed Implementation

[0028] The terminology used in the following embodiments of this application is for the purpose of describing particular embodiments only and is not intended to be limiting of this application. As used in the specification of this application, the singular expressions “a,” “an,” “the,” “the,” and “this” are intended to include the plural expressions as well, unless the context clearly indicates otherwise. It should also be understood that the term “and / or” as used in this application refers to any or all possible combinations including one or more of the listed items.

[0029] Hereinafter, the terms "first" and "second" are used for descriptive purposes only and should not be construed as implying or suggesting relative importance or implicitly indicating the number of indicated technical features. Thus, a feature defined as "first" or "second" may explicitly or implicitly include one or more of that feature, and in the description of the embodiments of this application, unless otherwise stated, "multiple" means two or more.

[0030] To facilitate understanding, the application scenarios of the embodiments of this application are described below.

[0031] In a large scenic area's park area, the number of visitors exceeds 8,000 daily. More than 50 high-definition surveillance cameras are deployed within the park to monitor various areas in real time. However, daily operations face significant challenges in waste management. For example, snack wrappers and beverage bottles in picnic areas are frequently discarded carelessly; cigarette butts on fitness trails are hidden in the grass and difficult to spot; scraps of paper in rest areas are mixed in with the ground texture and difficult to identify; and fallen leaves and branches in the green belts blend seamlessly into the environment.

[0032] In related technologies, YOLO-based object detection algorithms can be used for waste identification, enabling automatic detection of litter in scenic areas. The following describes a scenario using a causal feature-based waste identification method for scenic areas.

[0033] A scenic area introduced a smart waste identification system based on the YOLO algorithm, detecting waste on a 512×512 resolution monitoring screen. However, the system has significant shortcomings in practical applications. For example, when packaging bags or beverage bottles appear on textured surfaces, the system's accuracy rate is only 65%; in areas obscured by trees, due to uneven lighting, the detection rate for small waste such as cigarette butts is below 50%; waste in green belts is often confused with vegetation features, resulting in a false negative rate as high as 40%. Furthermore, due to the lack of recognition of the essential characteristics of waste, the system frequently misidentifies ground textures as paper scraps and vegetation as waste, leading to both false negatives and false negatives.

[0034] The feature extraction method based on asymmetric twin networks in this application, through learning the essential characteristics of waste, achieves accurate identification of waste in complex backgrounds, improving not only the identification accuracy but also reducing the false alarm rate. The following describes a scenario where the causal feature-based waste identification method for scenic areas described in this application is used.

[0035] The scenic area litter identification device using this solution first collected 20,000 real-world background images from a wetland park, along with sample images of eight common types of litter, including snack wrappers, beverage bottles, and cigarette butts. The device utilizes an asymmetric twin network architecture and a ResNet18 model for feature extraction. After 500 rounds of training, it successfully built an intelligent system capable of accurately identifying litter. In practical applications, the new system can complete the identification of input monitoring images in just 3 seconds. Compared to the traditional YOLO algorithm, the false negative rate for litter identification in complex backgrounds is reduced by approximately 10%: the accuracy rate for identifying litter in areas with complex ground textures increases to 85%; the detection rate for small litter in shady areas reaches 75%; and the accuracy rate for litter identification in green belts exceeds 80%.

[0036] As can be seen, the asymmetric twin network feature extraction method in this application can not only achieve accurate garbage identification, but also effectively solve the interference problem caused by complex backgrounds, thereby achieving stable and reliable garbage detection.

[0037] To facilitate understanding, the method provided in this implementation will be described in detail below, using the above scenario as an example. Please refer to [link / reference]. Figure 1 This is a flowchart illustrating a scenic area waste identification method based on causal features in an embodiment of this application.

[0038] S101. Acquire multiple scenic area monitoring images of the target park / scenic area, and adjust the multiple scenic area monitoring images to a preset standard size to obtain multiple standardized images.

[0039] Among them, the target park / scenic area refers to the specific area of ​​the park where garbage identification needs to be carried out; the scenic area monitoring image refers to the image data collected in real time by the monitoring cameras that are fixedly installed in the park; the preset standard size is used to represent the image size after uniform standardization, usually set to 512×512 or 1024×1024 pixels; the standardized image refers to the standardized image data after size adjustment and normalization processing.

[0040] When building a training dataset, the scenic area litter identification device first needs to acquire basic image data. Specifically, the device collects real-time images through a network of surveillance cameras distributed throughout the scenic area. It then performs quality checks and resolution checks on the raw images. When an image size is found to be inconsistent with a preset standard, an appropriate adjustment method is selected based on the actual size. Ultimately, all images are uniformly adjusted to the preset standard size, laying the foundation for subsequent extraction of litter and background areas.

[0041] S102. Extract the garbage region and background region from multiple standardized images to obtain the garbage sample set and background sample set.

[0042] Among them, the garbage area refers to the various object areas in the image that need to be cleaned up, such as leaves, beverage bottles, cigarette butts, etc.; the background area refers to the environmental scene area other than the garbage area, such as grass, water surface, road surface, etc.; the garbage sample set refers to the collection of all extracted garbage areas; and the background sample set refers to the collection of all extracted background areas.

[0043] After obtaining standardized images, the scenic area's waste identification device needs to separate and extract the image content. Specifically, the device first performs semantic segmentation on the standardized images to identify the boundaries between waste areas and background areas. Then, these areas are extracted and labeled. Waste areas are organized into a waste sample set according to category, and background areas are organized into a background sample set according to scene type, providing basic data for subsequent image fusion.

[0044] S103. Perform image fusion between each garbage region in the garbage sample set and multiple background regions in the background sample set to generate a garbage image training set.

[0045] The garbage image training set refers to the dataset obtained after fusion for model training. The garbage image training set includes multiple garbage image groups, and each garbage image group includes multiple images of a single piece of garbage in multiple backgrounds.

[0046] After obtaining the garbage sample set and background sample set, the scenic area garbage identification device needs to construct training data. Specifically, the device naturally merges each garbage sample with multiple background samples of different types to form image groups containing the same garbage but different backgrounds. All image groups together constitute the final training dataset, ensuring that the model can learn garbage features that are independent of the background.

[0047] In some embodiments, image fusion can be achieved in several ways: Optionally, the color space of the garbage region is first adjusted to match the hue of the target background, then edge feathering is performed to achieve a smooth transition, and finally a Poisson fusion algorithm is used to seamlessly embed the garbage region into the background; alternatively, the lighting conditions of the garbage region are first matched, then a gradient domain fusion method is used to stitch the regions together, and finally a global optimization algorithm is used to adjust the fusion effect. It is understood that other image processing algorithms can also be used to achieve a natural fusion effect, and this is not limited here.

[0048] After image fusion, each image consists of "trash + background," such as leaves in grass, cigarette boxes on water, flowers in snow, and beverage bottles on the ground. Let P = {pi} represent the trash to be identified, including leaves, cigarette boxes, flowers, and beverage bottles, and let G = {gi} represent all possible backgrounds, including grass, water, snow, ground, and road surfaces. When constructing the training set, a trash object pi (e.g., a leaf) to be identified is fused with each background element to obtain a set of samples Spi = {sk} = {leaves in grass, leaves on water, leaves in snow, leaves on the ground, etc.}. Each trash object to be identified generates such a set of samples, which are then merged together to form the trash image training set S = ∪Spi.

[0049] Furthermore, a single piece of trash here can take multiple forms, such as a complete cigarette box, a damaged cigarette box, and a folded cigarette box. This can lead to more trash images, such as Spi={{sk1}, {sk2}, {sk3}, ...}={{complete cigarette box in the grass, complete cigarette box on the water, complete cigarette box on the ground...}, {damaged cigarette box in the grass, damaged cigarette box on the water, damaged cigarette box on the ground...}, {folded cigarette box in the grass, folded cigarette box on the water, folded cigarette box on the ground...}...}.

[0050] S104. Construct a Siamese network with two coding branches. Set the gradient backpropagation operation to prevent the second coding branch of the Siamese network to obtain an asymmetric Siamese network.

[0051] A Siamese network is a special neural network architecture containing two or more identical sub-networks that share the same parameters and weights. It is primarily used for contrastive learning, comparing the similarity between two inputs. For example, two identical ResNet18 networks constitute a Siamese network. The encoding branch is a sub-network within the Siamese network responsible for encoding (converting) the input image into a feature vector. For example, an encoding branch could be a ResNet18 structure, converting a 512×512 image into a feature vector. In deep learning, the model updates parameters through backpropagation, while stop-gradient (preventing gradient backpropagation) prevents gradients from passing through certain layers or branches during backpropagation. An asymmetric Siamese network is a Siamese network structure where the two branches have different training strategies.

[0052] After obtaining the training dataset, the scenic area waste identification device needs to construct a feature extraction model. Specifically, the device first constructs a Siamese network containing two identical encoding network branches. Then, a gradient blocking operation is applied to the second branch, keeping its parameters unchanged during training while only updating the parameters of the first branch. This forms an asymmetric training structure, which helps to learn to extract the features of the waste itself (causal features) while ignoring changing background information (correlation features), thereby extracting stable feature representations. In other words, one branch acts as a stable feature extractor, while the other branch learns to extract key features through gradient updates. This prevents training instability caused by simultaneous changes in both branches and helps the network converge to better feature representations.

[0053] Accordingly, the ultimate goal of model training is to extract features from sk. To this end, self-supervised methods and decoupled representation learning methods are combined, and a contrastive learning framework based on asymmetric Siamese networks is adopted to extract feature information.

[0054] In some embodiments, asymmetric Siamese networks can be constructed in several ways: Optionally, a ResNet series model can be used as the base network for the encoding branch, a Siamese structure can be constructed by sharing weights, and then gradient blocking can be achieved using PyTorch's detach() function; alternatively, a Vision Transformer can be used as the feature extractor, a dual-branch structure can be constructed by copying it, and the asymmetry of parameter updates can be achieved through the stop_gradient operation. It is understood that other deep learning architectures can also be used to construct the feature extraction network, and this is not limited here.

[0055] S105. From the garbage image group in the garbage image training set, select garbage image pairs with the same garbage but different backgrounds, and input the two images of the garbage image pair to the two encoding branches of the asymmetric Siamese network respectively. Use minimizing the cosine distance of the output vectors of the two encoding branches as the training criterion to train the model, and determine the feature extraction model based on the first encoding branch after training.

[0056] Here, "garbage image pair" represents two images containing the same garbage but with different backgrounds; cosine distance is a metric for measuring the similarity between two vectors.

[0057] After the network structure of the scenic area litter identification device is built, model training is required. Specifically, the device selects image pairs of the same litter under different backgrounds from the training set and inputs them into two branches of an asymmetric Siamese network. The network is trained by minimizing the cosine distance between the output feature vectors of the two branches, enabling it to extract the essential features of the litter that are independent of the background. Finally, the first branch that has been trained, i.e. the sub-network used for parameter updates, is selected as the feature extraction model.

[0058] Correspondingly, by applying a stop-gradient operation to a pathway during training, the contrastive learning method can better learn the effective features of the samples. The model is trained on the data in each Spi in set S in the above manner until convergence. After training, the resulting encoding network has the ability to extract objects (i.e., causal features) from the input samples.

[0059] For details, please refer to Figure 2 , Figure 2 middle Figure 2 (a) is a schematic diagram of the architecture for model training based on asymmetric Siamese networks; Figure 2 In (a), the training architecture of the asymmetric Siamese network extracts causal features of objects by inputting image pairs containing the same object but different backgrounds.

[0060] The scenic area's waste identification device first merges the object to be identified (beverage bottle) with background i (grass) and background j (open space) respectively to generate two training samples. These two samples are then simultaneously input into two coding networks with identical structures.

[0061] Although the two encoding networks have the same structure, they employ an asymmetric training strategy. The right branch uses a gradient blocking mechanism (stop-gradient) to keep its parameters constant during training, while the left branch updates its parameters normally. This design allows the left branch to stably learn the essential features of the object, as it aims to make its output features as similar as possible to the output features of the right branch (achieved by minimizing their cosine distance).

[0062] Since the two input samples differ only in their background, this training process encourages the network to gradually ignore the influence of the background and focus on extracting the features of the samples themselves. The left branch also adds an additional prediction layer for the final classification task, generating the feature extraction model.

[0063] S106. Input the monitoring image to be tested into the feature extraction model to obtain the garbage identification result.

[0064] Among them, the monitoring image to be tested represents the real-time monitoring image that needs to be identified as garbage; the garbage identification result refers to the model's judgment result on whether garbage exists in the input image.

[0065] Once the model training is complete, the scenic area litter identification device can be put into practical use. Specifically, the device receives real-time images captured by the scenic area's surveillance cameras, inputs them into the trained feature extraction model, extracts and analyzes image features, determines whether there is litter in the image that needs to be cleaned up, and outputs the identification result, providing a basis for subsequent cleaning work.

[0066] For details, please refer to Figure 2 , Figure 2 middle Figure 2 (b) is a schematic diagram of a scenario using a feature extraction model for garbage identification; in Figure 2 In (b), the system receives a scene image (a beverage bottle on the grass) containing potential litter objects as input and feeds it into a trained encoding network (i.e., the left branch network after training) for processing.

[0067] The encoding network extracts key features of objects in an image and outputs recognition results based on these features. Possible recognition results include multiple predefined waste categories (such as packaging bags, beverage bottles, cigarette butts, etc.) or a "no litter" judgment.

[0068] Because the model has learned during training to ignore background interference and focus on extracting the essential features of objects, it can maintain stable recognition performance in various complex background environments. For example, for this scene image (beverage bottles on the grass), the model will prioritize the essential features of possible litter objects, such as shape and texture, without being disturbed by background features such as the green color or texture of the grass, thus making an accurate recognition judgment.

[0069] It should be noted that the scenic area's litter recognition device has already been tested in a railway park in a certain city. When identifying various types of litter in different environments, it shows a significant improvement compared to ordinary target recognition and litter detection algorithms. Details are as follows: 1. Environment Preparation: The operating environment for the "Scenic Area Waste Identification Device Based on Causal Feature Extraction" is: Intel i9-10900X processor, NVIDIA GeForce RTX 3090 GPU, 128G memory, and Python 3.6 and PyTorch 1.4.0.

[0070] 2. Training Data: To adapt to the actual environmental characteristics of parks and scenic areas in a certain city, we sampled 20,000 background images from real environments such as a railway park and a wetland park, each image being resized to 512 x 512 pixels. We also collected 80 images of eight common types of litter, including snack wrappers, beverage bottles, cigarette butts, cigarette boxes, paper scraps, twigs, leaves, and pebbles, each resized to 24 x 24 pixels, to construct the training dataset.

[0071] 3. Model Training and Packaging. ResNet18 is used as the basic architecture of the encoding network to form an asymmetric Siamese network. It is trained according to the aforementioned method for a total of 500 epochs to generate a parameterized encoding network, which is then packaged to form a "scenic spot garbage identification device based on causal feature extraction".

[0072] 4. Trash Identification: After resizing the single-frame images captured by the surveillance cameras in the park, the device outputs the images to determine whether trash is present. Each identification takes approximately 3 seconds.

[0073] 5. Recognition performance: Compared with traditional object detection models (such as YOLO), in real park and scenic environment, the false negative rate of this device for garbage recognition under various environmental backgrounds is reduced by about 10%.

[0074] In the above embodiment, the scenic area waste identification device uses image fusion technology to extract features of waste in different scenarios. In practical applications, the identification strategy can be dynamically adjusted according to the characteristics of different scenarios, such as identifying waste based on scenarios in different seasons, to further improve system performance. The following section supplements the scenarios described in this embodiment.

[0075] The scenic area's litter identification system underwent a seasonal upgrade six months later. By collecting data on seasonal environmental changes, the system established a seasonal feature database: when flowers bloom in spring, the system can accurately distinguish litter from petals; when vegetation is lush in summer, it maintains a high recognition rate for litter hidden in the vegetation; when leaves fall in autumn, it accurately distinguishes litter from fallen leaves; and even when snow accumulates in winter, it can still identify litter.

[0076] In light of the above scenarios, the method provided in this implementation will now be described in more detail. Please refer to [link / reference]. Figure 3 This is another flowchart illustrating the scenic area waste identification method based on causal features in this application embodiment.

[0077] S301. Acquire multiple scenic area monitoring images of the target park / scenic area, and calculate the variance of the Laplace operator of the scenic area monitoring images to obtain the image clarity.

[0078] Here, the Laplacian operator variance represents a mathematical metric used to evaluate image sharpness; image sharpness refers to the quantified value of the sharpness of the edges and details of an image.

[0079] When screening images, the waste identification device in the scenic area first needs to assess the image quality. Specifically, the device acquires original images through the scenic area's monitoring system, then calculates the second-order differential Laplace operator for each image, and calculates the variance of the operator's response. The larger this value, the clearer the image edges and details are, thus obtaining an objective assessment result of image sharpness.

[0080] S302. Calculate the average value of the image pixels in the scenic area monitoring image to obtain the image brightness value.

[0081] Among them, the image pixel value represents the brightness or color information of each pixel in the image; the image brightness value is a quantitative indicator of the overall brightness level.

[0082] When assessing image quality, the waste identification device in the scenic area needs to calculate the overall brightness of the image. Specifically, the device converts the color image to a grayscale image, counts the brightness values ​​of all pixels, calculates the arithmetic mean of these values, and obtains a quantitative index reflecting the overall brightness level of the image.

[0083] In some embodiments, brightness values ​​can be calculated in several ways: optionally, an RGB-to-YUV color space conversion can be used to directly extract the average value of the Y channel as the brightness index; alternatively, the V channel value of the HSV color space can be used, combined with the statistical characteristics of the image histogram, to calculate a weighted average brightness. It is understood that other brightness calculation methods can also be used to obtain image brightness values, and this is not limited here.

[0084] S303. When the image clarity is greater than the preset clarity threshold and the image brightness value is within the preset brightness range, the corresponding scenic area monitoring image is taken as a valid image.

[0085] Among them, the preset sharpness threshold represents the minimum acceptable value of image sharpness; the preset brightness range refers to the reasonable range of image brightness values; and the valid image represents an image that meets the quality requirements and can be used for subsequent processing.

[0086] After obtaining image quality assessment indicators, the waste identification device in the scenic area needs to screen qualified images. Specifically, the device compares the sharpness value of each image with a preset sharpness threshold, and at the same time checks whether the image brightness value falls within a preset reasonable range. Only images that meet both conditions are marked as valid images, ensuring that the images processed subsequently have sufficient quality.

[0087] In some embodiments, image filtering can be implemented in several ways: Optionally, a sharpness threshold can be set to 80% of the statistical mean of the variance of the Laplacian operator, with a brightness range of [40, 220], and effective images can be obtained through dual-condition filtering; alternatively, an adaptive threshold strategy can be adopted to dynamically adjust the filtering criteria based on the historical image quality distribution, achieving more flexible quality control. It is understood that other image quality control methods can also be used to achieve effective image filtering, and this is not limited here.

[0088] S304. Select a preset number of target images from the valid images, adjust the target images to a preset standard size, and obtain multiple standardized images.

[0089] Among them, the preset quantity indicates the number of target images to be selected; the target image refers to the image selected from the valid images for subsequent processing; the preset standard size indicates a uniform image processing size specification.

[0090] After obtaining a valid image set, the waste identification device in the scenic area needs to undergo standardization processing. Specifically, the device selects a predetermined number of images from the valid image set as target images according to a certain strategy, and then adjusts the size of these images to uniformly convert them into a preset standard size, providing standardized input data for subsequent feature extraction and analysis.

[0091] In some embodiments, the scenic area waste identification device will enlarge or reduce the target image based on a preset standard size. That is, it selects a preset number of target images from the valid images and obtains the image size data of each target image. When the image size data is smaller than the preset standard size, it uses a bicubic interpolation algorithm to enlarge the target image to obtain an enlarged target image. When the image size data is larger than the preset standard size, it uses a regional mean pooling method to compress the target image to obtain a reduced target image. The target image, the enlarged target image, and the reduced target image that are equal to the preset standard size are normalized to obtain multiple standardized images.

[0092] Among them, the preset standard size represents a unified image processing specification; bicubic interpolation is an image magnification method; regional mean pooling is a method of image compression; normalization refers to the operation of mapping pixel values ​​to a standard range.

[0093] When processing target images, the waste identification device in scenic areas needs to standardize their size. Specifically, the device first acquires the size information of each target image, then, based on the comparison with a preset standard size, it enlarges images that are too small using bicubic interpolation, compresses images that are too large using region mean pooling, and finally normalizes the pixel values ​​of all processed images to obtain standardized images with uniform specifications. The selection of the preset standard size needs to balance computational efficiency and image detail preservation; commonly used sizes are typically 224×224 or 256×256. The bicubic interpolation algorithm achieves smooth image enlargement through weighted calculation of 16 neighboring pixels, while region mean pooling compresses the image by calculating the average value of a local region. Normalization maps pixel values ​​to the [0, 1] interval to ensure consistent data distribution.

[0094] S305. Extract the garbage region and background region from multiple standardized images to obtain the garbage sample set and background sample set.

[0095] Referring to step S102, the scenic area waste identification device will acquire a waste sample set and a background sample set.

[0096] S306. Count the number of samples of each type of waste in the waste sample set.

[0097] Among them, "type" refers to different kinds of waste, such as plastic bottles, paper scraps, leaves, etc.; "sample quantity" refers to the statistical value of the number of samples of each type of waste.

[0098] After obtaining a waste sample set, the waste identification device in the scenic area needs to perform sample analysis. Specifically, the device classifies and statistically analyzes the samples in the waste sample set, calculating the number of samples of each type, providing a basis for decision-making in subsequent sample balancing and data augmentation.

[0099] In some embodiments, sample statistics can be implemented in several ways: Optionally, a garbage type dictionary can be established, and category mapping and counting can be performed by traversing the sample set to generate a sample distribution statistical report; alternatively, a database management system can be used to record sample information, and the number of samples in each category can be counted through SQL queries. It is understood that other data analysis methods can also be used to implement sample statistics, which are not limited here.

[0100] S307. When the number of samples in a certain garbage sample is less than the preset number of samples, the garbage sample shall be regarded as the garbage missing sample.

[0101] Among them, the preset sample quantity represents the minimum number of samples required for each type of waste; the missing waste samples refer to waste categories with insufficient sample quantities.

[0102] After completing sample statistics, the waste identification device in the scenic area needs to identify categories with insufficient samples. Specifically, the device compares the number of samples for each type of waste with a preset minimum sample requirement. When the number of samples for a certain type of waste is lower than the preset value, it is marked as a missing waste sample.

[0103] S308. Complete the number of missing garbage samples to the preset number of samples.

[0104] Among them, sample completion will apply data augmentation processing, which refers to the process of generating new samples through image transformation, including image rotation, flipping, and brightness adjustment; image rotation refers to angular transformation around the center point; flipping includes horizontal and vertical mirroring; brightness adjustment refers to changing the overall brightness of the image.

[0105] After identifying missing trash samples, the waste identification device in the scenic area needs to expand the sample pool. Specifically, the device applies various image transformation operations to each missing trash sample, including rotation at different angles, horizontal and vertical flipping, and varying degrees of brightness adjustment, to generate new samples until the number of samples reaches the preset requirement.

[0106] In some embodiments, data augmentation can be achieved in various ways: optionally, the image can be randomly rotated within the range of [-30°, 30°], randomly flipped horizontally, and the brightness adjusted to a value between [0.8, 1.2] times the original value; optionally, multiple augmentation methods can be combined, such as adding Gaussian noise, adjusting contrast, and cropping, to generate more diverse samples. It is understood that other image processing methods can also be used to achieve data augmentation, which are not limited here.

[0107] S309. Obtain historical monitoring images of the target park / scenic area in different seasons as seasonal feature images.

[0108] Among them, the seasonal feature images represent historical surveillance images that reflect the characteristics of different seasons, including the four periods of spring, summer, autumn and winter.

[0109] When expanding the background sample for waste identification devices in scenic areas, seasonal changes need to be considered. Specifically, the device selects images from historical monitoring data that clearly reflect the characteristics of different seasons (spring, summer, autumn, and winter) as seasonal feature images, providing a data source for subsequent background feature extraction.

[0110] In some embodiments, seasonal feature images can be acquired in several ways: optionally, historical images can be classified seasonally according to timestamps, and representative scene images can be selected from each season; optionally, cluster analysis can be performed based on the color and texture features of the images to extract typical scene images of different seasons. It is understood that other image analysis methods can also be used to acquire seasonal feature images, and this is not limited here.

[0111] S310. Extract the same background region with different image features from the seasonal feature images to obtain the seasonal feature background set.

[0112] Among them, image features refer to the visual features of the background under different seasons; the seasonal feature background set refers to the set of background samples containing different seasonal features.

[0113] After obtaining seasonal feature images, the scenic area waste identification device needs to extract seasonal background. Specifically, the device extracts background areas of the same location or similar type from the feature images of each season, analyzes their feature changes in different seasons, and compiles them into a background sample set containing seasonal variation features.

[0114] In some embodiments, seasonal background feature extraction can be achieved in several ways: Optionally, image registration techniques can be used to align images from different seasons, extract background samples from the same area, and form a seasonal change sequence; alternatively, based on scene classification results, background samples of the same scene in different seasons can be extracted to construct a seasonal background feature library. It is understood that other computer vision methods can also be used to achieve seasonal background feature extraction, and this is not limited here.

[0115] S311. Perform image fusion between each garbage region in the garbage sample set and multiple background regions in the seasonal feature background set to generate a garbage image training set.

[0116] After obtaining the seasonal background feature set, the scenic area litter identification device needs to generate training data. Specifically, the device naturally merges each litter area in the litter sample set with multiple backgrounds in the seasonal background feature set to generate image groups containing the same litter but with different seasonal backgrounds. All image groups together constitute the final training dataset.

[0117] In some embodiments, the scenic area litter identification device also adjusts the litter samples by calculating the dominant color tone, brightness distribution, and texture features of each background region in the seasonal feature background set to obtain seasonal feature parameters; based on the seasonal feature parameters, color space conversion and parameter adjustment are performed on the litter regions in the litter sample set to obtain seasonally adapted litter samples; the contour features of the seasonally adapted litter samples are extracted, and the contour edges are smoothed to obtain edge-optimized litter samples; the edge-optimized litter samples are gradually blended with the background regions in the seasonal feature background set to generate training images; and multiple training images with the same litter but different seasons or different backgrounds are combined into a litter image group to generate a litter image training set.

[0118] Among them, the dominant color tone refers to the main color distribution of the image; seasonal feature parameters include visual features such as color, brightness, and texture; and gradient blending refers to image synthesis methods that achieve smooth transitions.

[0119] When generating training data, the waste identification device in scenic areas needs to ensure the naturalness of the samples. Specifically, the device first analyzes the visual feature parameters of the background and adjusts the color and brightness features of the waste samples accordingly. Then, it optimizes the edges of the waste samples and finally uses gradient fusion technology to naturally embed the processed waste samples into backgrounds of different seasons, forming a realistic training dataset. Seasonal feature parameters can be extracted using methods such as color histograms and gray-level co-occurrence matrices. Adjusting the waste samples requires consideration of color balance and lighting consistency. Edge optimization can employ smoothing algorithms such as Gaussian blur, and gradient fusion can be achieved using techniques such as alpha blending or Poisson editing.

[0120] S312. Construct a Siamese network with two coding branches, and set a gradient backpropagation prevention operation on the second coding branch of the Siamese network to obtain an asymmetric Siamese network.

[0121] Referring to step S104, the scenic area waste identification device will construct an asymmetric twin network.

[0122] S313. From the garbage image group in the garbage image training set, select garbage image pairs with the same garbage but different backgrounds, and input the two images of the garbage image pair to the two encoding branches of the asymmetric Siamese network respectively. Use minimizing the cosine distance of the output vectors of the two encoding branches as the training criterion to train the model, and determine the feature extraction model based on the first encoding branch after training.

[0123] Referring to step S105, the scenic area waste identification device will be trained to obtain a feature extraction model.

[0124] S314. Input the monitoring image to be tested into the feature extraction model to obtain the garbage identification result.

[0125] Referring to step S106, the scenic area's waste identification device will identify waste based on the feature extraction model.

[0126] In some embodiments, the scenic area waste identification device performs targeted model optimization based on the identification results. Specifically, it acquires user annotations of the waste identification results, statistically analyzes the differences between the annotations and the waste identification results, and obtains model performance evaluation metrics. These metrics include recognition accuracy, false negative rate, and false positive rate. Based on the model performance evaluation metrics, it identifies scene types with performance below a preset threshold, thus obtaining scenes to be optimized. From the waste image training set, it selects training samples with the same characteristics as the scenes to be optimized, constructing a scene-oriented training set. It uses the scene-oriented training set to incrementally train the feature extraction model, obtaining a feature extraction optimization model. Finally, it inputs the monitoring image to be tested into the feature extraction optimization model to obtain the optimized waste identification result.

[0127] Among them, the annotation information refers to the garbage location information confirmed by humans; the performance evaluation index is used to quantify the recognition effect of the model; incremental training refers to targeted optimization based on the original model.

[0128] In practical applications, the waste identification device in scenic areas requires continuous optimization of model performance. Specifically, the device collects user feedback annotations and compares them with the model's recognition results to obtain performance metrics. It then identifies the types of scenarios requiring optimization and constructs targeted training sample sets for incremental model training, ultimately resulting in a better-performing optimized model. The performance evaluation metrics are calculated based on the confusion matrix and include standard metrics such as accuracy and recall. The construction of the scenario-specific training set needs to consider the representativeness and balance of the samples. Incremental training requires appropriate learning rates and training strategies to ensure that the model maintains its original performance while improving the recognition effect in specific scenarios.

[0129] Furthermore, after the waste identification devices in the scenic area had been running for a period of time, analysis of the operational data revealed differences in recognition performance across different time periods and areas. For example, in the fitness area between 7 and 9 a.m., due to dim lighting and dense crowds, the accuracy rate for identifying mineral water bottles was only 75%; in the catering area between 11 a.m. and 2 p.m., the false negative rate reached 30% due to the complex types of waste and severe obstruction; and on the viewing platform between 4 p.m. and 6 p.m., the false positive rate exceeded 20% due to backlighting.

[0130] To optimize recognition performance in these specific scenarios, the system first collects unidentified trash labeling information, including time, location, and trash type, through the target user's (cleaning staff's) mobile app, while also recording the location information of false alarms. Based on this trash labeling information, the system constructs a confusion matrix and calculates performance metrics for each time period and area. When the recognition performance in the fitness area, dining area, and viewing platform falls below a preset threshold of 80%, additional training samples are collected specifically for these scenarios. Subsequently, the system incrementally trains the model using a small learning rate of 0.001, improving the recognition performance in specific scenarios while maintaining the original recognition capabilities.

[0131] Specifically, the scenic area's waste identification device establishes a complete closed-loop model optimization system. It uses user feedback for scenario-specific performance evaluation and identifies optimization targets for targeted training. During the performance evaluation phase, the system uses a confusion matrix to calculate various metrics: accuracy equals the number of correctly identified samples divided by the total number of samples predicted as waste; false negative rate equals the number of unidentified waste samples divided by the total number of actual waste samples; and false positive rate equals the number of incorrectly identified samples divided by the total number of samples predicted as waste. During incremental training, the system uses gradient descent to update model parameters, but employs a small learning rate to ensure the model can be fine-tuned to a better state while maintaining its original performance.

[0132] For example, suppose that in a food court area during a certain time period, the system predicts a total of 100 suspected litter locations, of which 70 are correctly identified, 30 are false alarms, and 30 actual litter locations are not detected. In this scenario, the accuracy is 70% (70 / 100), the false negative rate is 30% (30 / 100), and the false alarm rate is 30% (30 / 100). Based on these metrics, the system determines that this scenario needs optimization. Subsequently, it selectively collects training samples containing various occlusion scenarios and complex backgrounds, and improves the model's performance in this specific scenario through incremental training.

[0133] In this embodiment, by employing a feature extraction method based on asymmetric twin networks and combining it with a seasonal background sample library for data augmentation and model training, background-independent garbage features can be effectively extracted, achieving accurate identification of garbage in different seasons and scenarios. This solution effectively solves the problems of low accuracy and high false alarm rate of traditional computer vision methods in complex backgrounds and seasonally changing environments, thus realizing intelligent garbage identification in all weather and all scenarios. Through a dynamically updated sample library and incremental training mechanism, the system can continuously optimize its recognition performance, adapt to newly emerging garbage types and environmental changes, and improve the efficiency and quality of scenic area environmental management.

[0134] The scenic area waste identification device in the embodiments of this invention is described below from the perspective of hardware processing. Please refer to [link / reference]. Figure 4 This is a schematic diagram of the physical structure of a scenic area garbage identification device in this application embodiment.

[0135] It should be noted that, Figure 4 The structure of the scenic area waste identification device shown is merely an example and should not impose any limitations on the functionality and scope of use of the embodiments of the present invention.

[0136] like Figure 4 As shown, the scenic area waste identification device includes a Central Processing Unit (CPU) 401, which can perform various appropriate actions and processes based on programs stored in Read-Only Memory (ROM) 402 or programs loaded from storage section 408 into Random Access Memory (RAM) 403, such as executing the methods described in the above embodiments. The RAM 403 also stores various programs and data required for system operation. The CPU 401, ROM 402, and RAM 403 are interconnected via a bus 404. An Input / Output (I / O) interface 405 is also connected to the bus 404.

[0137] The following components are connected to I / O interface 405: input section 406 including audio input devices, push-button switches, etc.; output section 407 including a liquid crystal display (LCD) and audio output devices, indicator lights, etc.; storage section 408 including a hard disk, etc.; and communication section 409 including a network interface card such as a LAN (Local Area Network) card, modem, etc. Communication section 409 performs communication processing via a network such as the Internet. Drive 410 is also connected to I / O interface 405 as needed. Removable media 411, such as a disk, optical disk, magneto-optical disk, semiconductor memory, etc., are installed on drive 410 as needed so that computer programs read from them can be installed into storage section 408 as needed.

[0138] In particular, according to embodiments of the present invention, the processes described above with reference to the flowcharts can be implemented as computer software programs. For example, embodiments of the present invention include a computer program product comprising a computer program carried on a computer-readable medium, the computer program containing computer programs for performing the methods shown in the flowcharts. In such embodiments, the computer program can be downloaded and installed from a network via communication section 409, and / or installed from removable medium 411. When the computer program is executed by central processing unit (CPU) 401, it performs the various functions defined in the present invention.

[0139] It should be noted that specific examples of computer-readable storage media may include, but are not limited to: electrical connections having one or more wires, portable computer disks, hard disks, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM), flash memory, optical fiber, portable compact disc read-only memory (CD-ROM), optical storage devices, magnetic storage devices, or any suitable combination thereof. In this invention, a computer-readable storage medium can be any tangible medium containing or storing a program that can be used by or in conjunction with an instruction execution system, apparatus, or device.

[0140] The flowcharts and block diagrams in the accompanying drawings illustrate the architecture, functionality, and operation of possible implementations of systems, methods, and computer program products according to various embodiments of the present invention. Each block in a flowchart or block diagram may represent a module, program segment, or portion of code, which contains one or more executable instructions for implementing a specified logical function. It should also be noted that in some alternative implementations, the functions indicated in the blocks may occur in a different order than those shown in the drawings.

[0141] Specifically, the scenic area waste identification device in this embodiment includes a processor and a memory. The memory stores a computer program. When the computer program is executed by the processor, it implements the scenic area waste identification method based on causal features provided in the above embodiment.

[0142] In another aspect, the present invention also provides a computer-readable storage medium, which may be included in the scenic area waste identification device described in the above embodiments; or it may exist independently and not assembled into the scenic area waste identification device. The storage medium carries one or more computer programs, which, when executed by a processor of the scenic area waste identification device, cause the scenic area waste identification device to implement the causal feature-based scenic area waste identification method provided in the above embodiments.

[0143] The above-described embodiments are only used to illustrate the technical solutions of this application, and are not intended to limit it. Although this application has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some of the technical features. Such modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the scope of the technical solutions of the embodiments of this application.

[0144] As used in the above embodiments, depending on the context, the term "when..." can be interpreted as meaning "if...", "after...", "in response to determining...", or "in response to detecting...". Similarly, depending on the context, the phrase "when determining..." or "if (the stated condition or event) is interpreted as meaning "if determining...", "in response to determining...", "when (the stated condition or event) is detected", or "in response to detecting (the stated condition or event)".

[0145] Those skilled in the art will understand that all or part of the processes in the methods of the above embodiments can be implemented by a computer program instructing related hardware. This program can be stored in a computer-readable storage medium, and when executed, it can include the processes described in the above method embodiments. The aforementioned storage medium includes various media capable of storing program code, such as ROM or random access memory (RAM), magnetic disks, or optical disks.

Claims

1. A scenic spot garbage identification method based on causal features, characterized in that, The method, applied to a waste identification device in a scenic area, includes: Acquire multiple scenic area monitoring images of the target park scenic area, and adjust the multiple scenic area monitoring images to a preset standard size to obtain multiple standardized images; Garbage regions and background regions are extracted from the multiple standardized images to obtain garbage sample sets and background sample sets; Historical surveillance images of the target park in different seasons are obtained as seasonal feature images. Extract the same background region with different image features from each of the seasonal feature images to obtain the seasonal feature background set; The dominant color tone, brightness distribution, and texture features of each background region in the seasonal feature background set are calculated to obtain seasonal feature parameters. Based on the seasonal feature parameters, color space conversion and parameter adjustment are performed on the garbage regions in the garbage sample set to obtain seasonally adapted garbage samples. The contour features of the seasonally adapted garbage samples are extracted, and the contour edges are smoothed to obtain edge-optimized garbage samples. The edge-optimized garbage samples are then gradually blended with the background regions in the seasonal feature background set to generate training images. Multiple training images with the same type of trash but different seasons or backgrounds are combined into a trash image group to generate a trash image training set; the trash image training set includes multiple trash image groups, and each trash image group includes multiple images of one piece of trash in multiple backgrounds; the trash can contain multiple forms; A Siamese network with two coding branches is constructed, and a gradient backpropagation prevention operation is set on the second coding branch of the Siamese network to obtain an asymmetric Siamese network. From the garbage image group in the garbage image training set, select garbage image pairs with the same garbage but different backgrounds, and input the two images of the garbage image pair to the two encoding branches of the asymmetric twin network respectively. The model is trained by minimizing the cosine distance of the output vectors of the two encoding branches. The feature extraction model is determined based on the first encoding branch after training. Input the monitoring image to be tested into the feature extraction model to obtain the garbage identification result.

2. The method of claim 1, wherein, The step of acquiring multiple scenic area surveillance images of the target park and adjusting the multiple scenic area surveillance images to a preset standard size to obtain multiple standardized images specifically includes: Multiple surveillance images of the target park are acquired, and the variance of the Laplace operator of the surveillance images is calculated to obtain the image sharpness. The average pixel value in the scenic area monitoring image is calculated to obtain the image brightness value; When the image clarity is greater than a preset clarity threshold and the image brightness value is within a preset brightness range, the corresponding scenic area monitoring image is considered a valid image. A preset number of target images are selected from the valid images, and the target images are adjusted to a preset standard size to obtain multiple standardized images.

3. The method of claim 2, wherein, The step of selecting a preset number of target images from the valid images and adjusting the target images to a preset standard size to obtain multiple standardized images specifically includes: Select a preset number of target images from the valid images, and obtain the image size data of each target image; When the image size is smaller than a preset standard size, a bicubic interpolation algorithm is used to enlarge the target image to obtain an enlarged target image; When the image size data is larger than the preset standard size, the target image is compressed using the region mean pooling method to obtain a reduced target image; The target image, the magnified target image, and the reduced target image, which are equal to the preset standard size, are normalized to obtain multiple standardized images.

4. The method according to claim 1, characterized in that, After the step of extracting garbage regions and background regions from the plurality of standardized images respectively to obtain garbage sample sets and background sample sets, the method further includes: Count the number of each type of waste sample in the waste sample set; When the number of samples in a certain garbage sample is less than the preset number of samples, the garbage sample is considered a garbage missing sample; The number of missing garbage samples is increased to the preset number of samples.

5. The method according to claim 1, characterized in that, After the step of inputting the monitoring image to be tested into the feature extraction model to obtain the garbage identification result, the method further includes: Obtain user annotation information for the garbage identification results, statistically analyze the differences between the annotation information and the garbage identification results, and obtain model performance evaluation indicators; the model performance evaluation indicators include recognition accuracy, false negative rate, and false positive rate; Based on the model performance evaluation indicators, the types of scenarios whose performance is below a preset threshold are determined, and the scenarios to be optimized are obtained. From the garbage image training set, training samples with the same characteristics as the scene to be optimized are selected to construct a scene-oriented training set; The feature extraction model is incrementally trained using the scene-oriented training set to obtain an optimized feature extraction model. The monitoring image to be tested is input into the feature extraction optimization model to obtain the garbage identification optimization result.

6. A waste identification device for scenic areas, characterized in that, The scenic area waste identification device includes: one or more processors and a memory; the memory is coupled to the one or more processors, the memory is used to store computer program code, the computer program code includes computer instructions, and the one or more processors call the computer instructions to cause the scenic area waste identification device to perform the method as described in any one of claims 1-5.

7. A computer-readable storage medium comprising instructions, characterized in that, When the instruction is executed on the scenic area waste identification device, the scenic area waste identification device performs the method as described in any one of claims 1-5.

8. A computer program product, characterized in that, When the computer program product is run on the scenic area waste identification device, the scenic area waste identification device performs the method as described in any one of claims 1-5.