A method and system for identifying hidden logistics risks based on moving target trajectories and spatial semantics, and a medium
Patent Information
- Application Number
- CN202610922207.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-06-25
- Publication Date
- 2026-11-03
AI Technical Summary
Existing video recognition methods for urban governance struggle to integrate moving target information from external videos with spatial semantic data to identify hidden logistics risks without entering enclosed or semi-enclosed spaces. Furthermore, they suffer from high computational costs and a high false positive rate.
By collecting video data from peripheral observation points, moving target detection, cross-frame trajectory construction, displacement ratio filtering, cargo status recognition, and spatial semantic fusion are performed. Combined with multi-target tracking algorithms and image recognition models, structured risk evidence data is output.
It enables accurate identification of hidden logistics risks without entering enclosed spaces, reduces computational overhead and false alarm rates, and provides structured risk evidence to support urban governance.
Smart Images

Figure CN123033177A_ABST
Abstract
Description
Technical Field
[0001] This invention belongs to the fields of urban governance risk perception, intelligent video analysis, multi-target tracking, trajectory semantic analysis and geospatial information processing technology, specifically involving a method, system and medium for identifying hidden logistics risks based on the trajectory and spatial semantics of moving targets. Background Technology
[0002] With the advancement of urban renewal, urban health checks, and the construction of urban operation management service platforms, the targets of urban governance have gradually expanded from open public spaces such as main and secondary roads, squares, and parks to existing spaces such as urban villages, old neighborhoods, back streets and alleys, backyards of street-front shops, small factories, warehouse courtyards, and enclosed business spaces. These areas typically feature enclosed spaces, complex property rights, narrow roads, mixed functions, diverse business entities, and irregular activity times. Activities such as residence, business, warehousing, processing, distribution, and life services overlap within limited spaces, easily leading to various safety and governance risks, including informal logistics, oversized transport, mixed passenger and freight transport, obstruction of fire lanes, hidden processing and related transportation, and traffic disorder.
[0003] For the aforementioned enclosed and semi-enclosed areas requiring governance, it is often difficult for governance personnel to conduct regular, in-depth inspections of the internal spaces. Regular, fixed-point monitoring also struggles to achieve full coverage of internal warehousing, processing, and cargo transfer activities. However, various illegal business operations and logistics activities within these areas exhibit observable characteristics through external nodes such as street entrances and exits, courtyard perimeters, road sections, key intersections, and store back boundaries. Specifically, this manifests as freight vehicles, tricycles / two-wheeled vehicles, and pedestrians carrying large items frequently entering and exiting the same locations; transport vehicles repeatedly passing through a single courtyard or alleyway entrance; and abnormal behaviors such as concentrated loading and unloading of goods by vehicles at specific times. Therefore, leveraging the semantic information of moving target trajectories, cargo status, direction of travel, and spatial location collected from external monitoring to uncover the informal logistics and hidden transportation risks concealed within enclosed spaces has become a pressing technical challenge for front-end risk screening in current urban governance blind spots.
[0004] Existing urban operation management service platforms, smart city management systems, and unified management platforms have gradually incorporated functions such as video surveillance, mobile inspections, artificial intelligence recognition, event reporting, and work order dispatch to identify observable urban management events such as street vending, illegal parking, exposed garbage, and damaged road facilities. However, these events are determined solely by a single target category or behavioral characteristic. Hidden logistics risks, on the other hand, are not generated by single vehicles or pedestrians. They require comprehensive analysis of multiple dimensions, including target type, cargo status, traffic frequency, travel time, entrance / exit spatial attributes, and surrounding land use functions. Existing smart governance platforms lack the capability for multi-dimensional feature joint analysis, making it difficult to accurately identify hidden illegal transportation risks.
[0005] In the field of intelligent video analytics, existing target detection algorithms can accurately locate and identify objects such as vehicles, non-motorized vehicles, pedestrians, and cargo packages within video frames. Multi-target tracking frameworks based on detection, combined with strategies such as Kalman filtering, intersection-union-ratio matching, and the Hungarian algorithm, can perform cross-frame target association, short-term occlusion compensation, and continuous motion trajectory construction, and are widely used in scenarios such as traffic flow statistics and routine vehicle behavior monitoring. However, these technologies can only output three basic types of data: target category, spatial coordinates, and tracking identifiers, exhibiting three significant limitations: First, they cannot determine whether a target's cargo loading or traffic behavior constitutes irregular logistics or covert processing and transportation clues; second, they do not incorporate spatial semantic information such as courtyards, factories, and street entrances / exits for modeling, making it difficult to distinguish between daily resident handling, immediate delivery, and abnormal freight behavior; third, they do not filter statically parked vehicles or invalid occluded segments, resulting in a large amount of redundant data that not only significantly increases backend computational costs but also easily leads to misjudgments.
[0006] Traditional traffic video anomaly detection technologies primarily target urban open roads and intersections, focusing on issues such as traffic flow statistics, illegal parking, traffic accidents, wrong-way driving, congestion, and abnormal trajectories. They lack adaptation for mixed-use areas like urban village alleyways, store back areas, and enclosed factories. The same freight transport behavior exhibits significantly different risk levels in different locations, including residential areas, commercial delivery routes, warehouse areas, and urban village entrances. Existing technologies lack spatial semantic feature fusion mechanisms and rely solely on target quantity and vehicle type for risk assessment, making them highly susceptible to underreporting and false alarms of hidden logistics risks.
[0007] In practice, some urban governance scenarios have begun to use video intelligent recognition and automated work order processing. However, existing systems typically focus more on the process of converting recognition results into work orders, lacking joint modeling of moving target trajectories, cargo status, entrance directions, and spatial semantic relationships. They can only provide basic facts about target passage and cannot output structured evidence information that can be used for on-site verification, such as effective movement segments of targets, high-frequency entry and exit frequencies, and concentrated freight by multiple vehicle types. This makes it difficult to achieve automated conversion from raw video motion data to clues of hidden logistics risks. At the same time, urban surveillance videos are characterized by high frame rates, long-term continuous recording, complex scenes, and frequent target occlusion. Directly inputting the original complete video into a large model or handing it over to manual review would result in huge data transmission, computing power consumption, and human review costs. Existing technologies lack lightweight preprocessing mechanisms at the front end and cannot achieve data dimensionality reduction through static target filtering, effective trajectory screening, and risk segment extraction, which restricts the practical application of blind spot risk screening.
[0008] In summary, current technologies lack a method for identifying hidden logistics risks in blind spots of urban governance. They cannot integrate external video moving target information and spatial semantic data without entering enclosed or semi-enclosed spaces. This requires methods such as target detection, cross-frame multi-target tracking, invalid trajectory filtering, cargo status identification, traffic pattern statistics, and spatial semantic correlation analysis of entrances and exits to automatically uncover risks associated with informal transportation and hidden processing logistics. Simultaneously, it outputs structured analysis data including movement trajectories, key evidence fragments, risk levels, spatial locations, and original video backtracking paths. Developing this identification method can significantly improve the pre-emptive risk screening capabilities for blind spots in urban governance, such as urban villages, old neighborhoods, and enclosed commercial courtyards, reducing the cost of routine manual patrols. It provides comprehensive evidence support for the early detection and handling of hidden urban violations, possessing significant engineering application value. Summary of the Invention
[0009] To address the challenges of existing urban governance video recognition methods, such as difficulty in identifying hidden logistics risks from visible moving targets, the limitations of conventional target detection (which can only identify vehicles or pedestrians but not their governance implications), the failure of multi-target tracking results to integrate with spatial semantics (such as street entrances, courtyard boundaries, road network topology, and nearby production and business sites), and the redundancy, high cost, and low review efficiency resulting from directly inputting complete videos into models or manual review, this invention proposes a method, system, and medium for identifying hidden logistics risks based on moving target trajectories and spatial semantics.
[0010] The core idea of this invention is as follows: For urban governance scenarios where it is difficult to directly observe internal activities, such as urban villages, old neighborhoods, back areas of street-front shops, areas adjacent to small factories, the perimeter of enclosed courtyards, and entrances to streets and alleys, it does not require entry into the internal space or direct identification of internal production activities as a necessary condition. Instead, it uses the visible moving target trajectories in the peripheral observation points as external signs. Through moving target detection, cross-frame trajectory construction, displacement ratio filtering, effective motion segment clipping, cargo status identification, trajectory direction statistics, and spatial semantic fusion, the visible activities of vehicles, two-wheeled vehicles, three-wheeled vehicles, vans, trucks, handcarts, or pedestrians carrying goods are transformed into clues of abnormal logistics, irregular transportation, or suspected hidden processing-related transportation risks. The invention outputs structured risk evidence data that is verifiable, traceable, and spatially expressible.
[0011] To achieve the above objectives, the present invention adopts the following technical solution.
[0012] A method for identifying hidden logistics risks based on moving target trajectories and spatial semantics includes the following steps: Step 1. Set up observation points on the periphery of blind spots in urban governance, and use camera equipment to collect video data and obtain spatial semantic data of the observation points; Step 2. Extract video frame sequences from the video data, and perform frame extraction and candidate frame filtering on the video frame sequences in sequence to remove low-value frames, and classify the retained frames into the frame set to be detected according to the location number, acquisition time or time window. Step 3. For all frames in the obtained set of frames to be detected, perform motion candidate target detection to obtain the detection bounding box, target category, and detection confidence of the motion candidate targets. After confidence filtering, NMS deduplication, and service category filtering, obtain the set D of all valid motion candidate target detection results in each frame. t The detection results of all valid moving candidate targets include the detection bounding box of the valid moving candidate targets, the detection confidence, and the target category; Step 4. Obtain the set D of all valid moving candidate target detection results. t The video frames are processed sequentially from earliest to latest. Each iteration includes: using a multi-target tracking algorithm to correlate detection boxes across frames, including: first, outputting the detection results D of valid moving candidate targets for each frame. t Based on temporal sequence, the detection bounding boxes of valid motion candidate targets in the first frame are used as trajectories. The detection bounding boxes of valid motion candidate targets in subsequent frames are matched with the trajectory prediction bounding boxes obtained through Kalman prediction. The matching cost is calculated, and the optimal matching result can be obtained using the Hungarian algorithm. When a detection bounding box successfully matches a trajectory prediction bounding box region, the trajectory is updated using the new detection bounding box. When a trajectory prediction bounding box region is not matched by a detection bounding box, the trajectory is marked as lost and retained for several frames to tolerate short-term occlusion. When a detection bounding box does not match any trajectory prediction bounding box region, a new trajectory is created for it. When a trajectory is not matched for several consecutive frames, it is deleted. Each detection bounding box of a tracked valid motion candidate target is marked with a unique trajectory identifier for cross-frame identity association. Step 5. For detection boxes with the same trajectory identifier at adjacent sampling times, calculate the target center point displacement, target scale and displacement ratio, and total cumulative trajectory displacement. Filter out stationary targets and low-value targets to obtain a set of effective moving target trajectories. Step 6. For trajectories determined to be valid moving targets, crop them according to the trajectory time range to generate target screenshots, trajectory visualization images, or keyframe short video clips; Step 7. Input the target screenshot, trajectory visualization image or key short video clip output from step S6 into the image recognition model, multimodal semantic recognition model or local rule model, and output the target cargo status, cargo description and risk warning; Step 8. Calculate trajectory statistics based on the effective moving target trajectory, including trajectory direction, trajectory direction angle, entrance / exit direction consistency coefficient, total passage frequency per unit time, target cargo ratio, entrance directional passage ratio, cargo high frequency index, and multi-vehicle coordination index; Step 9. Use the raw spatial semantic data of the points collected in Step S1 and the trajectory statistical indicators obtained in Step S8 together to calculate the spatial semantic score for each observation point. .
[0013] Furthermore, in step 1: the target observation points include at least one of the following: street entrances, courtyard perimeters, road cross-sections, entrances and exits of urban villages, back perimeters of store areas, adjacent road sections of small factories, logistics access channels, or outer edges of enclosed spaces; The spatial semantic data includes at least one of the following: point number, latitude and longitude coordinates, road name, road network topology, point type, street / alley entrance direction, courtyard or factory boundary, nearby points of interest, passage width, road grade, spatial proximity between the target observation point and the potential risk area, and the governance grid to which it belongs. The spatial semantic data is obtained through at least one of the following methods: video file name parsing, acquisition device location information, manually marked point list, geographic information system spatial matching, point of interest data matching, or road network topology analysis. In step 2, the frame extraction process includes extracting initial frames from the video frame sequence according to a preset frame interval or a preset time interval; low-value frames are frames whose candidate frame quality scores are lower than a preset frame quality threshold, and the candidate frame quality scores are: ; in, Rate the image sharpness. For brightness rating, For effective visible area scoring, To score the differences between the frames and those already retained, , , , Let be the weighting coefficients, and satisfy: .
[0014] Furthermore, steps 3 and 4 include: In step 3, the moving candidate targets include at least one of two-wheeled electric vehicles, motorcycles, tricycles, vans, small trucks, handcarts, pedestrians carrying goods, cargo packages, or other transport objects; the moving candidate target detection is achieved through a target detection model, which includes at least one of YOLO series models, Faster R-CNN, SSD, DETR, lightweight edge detection models, or other detection models capable of outputting target detection boxes and target categories; In step 4, the multi-target tracking algorithm uses the ByteTrack algorithm for two-stage matching: in the first stage, high-confidence detection boxes are matched with existing trajectory prediction box regions, and in the second stage, low-confidence detection boxes are matched with trajectory prediction box regions that were not matched in the first stage. The matching cost can be calculated based on the intersection-union ratio:
[0015]
[0016] Where A and B represent the detection box and trajectory prediction box regions, respectively.
[0017] Furthermore, in step 5, the inter-frame target center point displacement d t Calculate according to the following formula: ; Among them, (x t-1 ,y t-1 ) represents the trajectory τ j The pixel coordinates of the center point of the valid motion candidate target detection box within the valid sampling frame at the (t-1)th sampling time; (x t ,y t ) represents the pixel coordinates of the center point of the detection box of the same valid moving candidate target within the valid sampling frame corresponding to the t-th sampling time; d t It represents the pixel straight-line distance of the target center point movement between two adjacent frames, characterizing the actual movement range of the target; Based on the width w of the effective motion candidate target detection box at the t-th sampling time t and height h t Calculate the target scale s t : ; Displacement ratio r t Calculate according to the following formula: ; Where δ is a stabilizing term to prevent the denominator from being zero; Total cumulative displacement D of the trajectory sum The sum of displacements of all adjacent frames within the complete lifetime of the trajectory: ; Where t0 is the starting frame where the trajectory first appears; t1 is the last valid update frame of the trajectory; D sum The total pixel distance the target moves from its appearance to its disappearance. When the displacement ratio r of the same target trajectory at N consecutive sampling times t All are greater than the first motion threshold θ r Or the cumulative displacement of the center point is greater than the second motion threshold θD If any one of the conditions is met, the target trajectory is determined to be a valid moving target trajectory, where N is an integer not less than 2; if neither condition is met, it is determined to be a stationary or invalid trajectory and is directly eliminated.
[0018] Furthermore, the target cargo status in step 7 includes: cargo area ratio : ; in, This represents the total area of the cargo pixels obtained from the image recognition model. This represents the total pixel area of the target vehicle / pedestrian carrier. This refers to the area ratio of goods relative to their carrier. Cargo height percentage : ; in, The maximum height of pixels in the stacked area; The total pixel height of the vehicle carrier itself; The height of the cargo relative to the vehicle body is the percentage of its height. Target cargo load confidence level : ; in, The confidence level for cargo identification output by the image recognition model or multimodal semantic model; , The percentage of cargo area or height; The validation confidence score output by the local rule model, for matching cargo types. Pre-configure rule sets: Each rule Configure corresponding weights ,and If the first If the rule is satisfied, then If not satisfied, then Based on this calculation: ; μ1, μ2, μ3, and μ4 are the weighting coefficients for each indicator, satisfying μ1 + μ2 + μ3 + μ4 = 1, and can be adaptively adjusted according to different scenarios such as urban villages and factories; when When the threshold is exceeded, the target is determined to be a valid cargo target; based on the target category, cargo area or height percentage, cargo placement location, and loading method, different types of non-compliant logistics behaviors are distinguished, and risk warnings are generated, specifically including: The aforementioned illegal logistics activities include at least one of the following: oversized two-wheeled vehicles, three-wheeled vehicles or small trucks carrying goods together, and vans suspected of carrying both passengers and cargo.
[0019] Furthermore, step 8 includes: For any valid moving target trajectory τ j Extract the center point of the detection box of the first global sampling frame of the trajectory as the trajectory starting point. The center point of the detection box in the last sampling frame is taken as the trajectory endpoint. ), to obtain the trajectory direction vector Trajectory direction angle Consistency coefficient of entrance and exit directions A j ; ; ; ; in, The preset entrance / exit reference vector is generated from the orientation of street / courtyard entrances in the spatial semantic data of step S1, representing the standard direction of travel towards the closed risk area; This represents the dot product of the trajectory direction vector and the entrance / exit reference vector; This represents the magnitude of the trajectory direction vector; The magnitude of the reference vector at the entrance / exit is represented; δ is a minimal constant to prevent calculation errors caused by a denominator of 0. The closer the value is to 1, the more consistent the target's direction of travel is with the direction of the entrance to the closed courtyard or factory, and the stronger the risk correlation. Target goods proportion Entrance-oriented passage ratio Total frequency of passage per unit time Freight High Frequency Index Multi-model coordination index , Where δ is the stable term and Δt is the length of the statistical time window; This represents the number of different types of freight vehicles appearing in the current statistics window. To preset the total number of categories for all freight vehicle types, N v Total number of all valid moving target trajectories within the time window. This represents the number of trajectories identified as cargo targets within the time window, as determined in step S7. The consistency coefficient A of entrance and exit directions within the time window j The number of trajectories that exceed the directional threshold and point to the entrance of a closed courtyard / factory.
[0020] Furthermore, in step 9: ; ω1, ω2, ω3, and ω4 represent the weighting coefficients corresponding to the four sub-weights, satisfying the constraint ω1 + ω2 + ω3 + ω4 = 1. This represents the weight of neighboring risk points of interest, used to indicate the spatial correlation between the target observation point and points of interest such as production, warehousing, processing, wholesale, logistics, markets, store backyards, or small factories. It is calculated using a distance decay function. ; in, This represents the straight-line spatial distance from the current observation point to the nearest production / warehousing / processing risk interest point; This represents the distance attenuation control coefficient, which is a preset constant used to control how quickly the score decreases with distance. This represents the constraint weight of narrow passages, used to quantify the aggravating effect of road narrowness on freight violations. Narrow alleys and passageways with small entrances are prone to encroachment on the road for cargo loading and oversized transport. The calculation formula is as follows: ; in, This indicates the actual physical width of the passageway corresponding to the current location; This indicates the preset standard reference road width; min(·,1) constrains the ratio to an upper limit of 1 to prevent negative values when the road is too wide. The narrower the road, the lower the value. The smaller, The closer to 1, the better; if the road width is greater than or equal to the reference width, the minimum value is 1. No risk of narrow passages added; The weight of the entrance / exit node indicates whether the target observation point belongs to the entrance / exit or internal / external connection node of the risk area. If the observation point is the core entrance / exit of an urban village, street / alley entrance, courtyard entrance, store back entrance, factory adjacent entrance, or outer edge entrance of a closed space, then... If the observation point is no more than 30 meters away from the aforementioned entrance, but is not the entrance itself, then If the observation point is a regular road section but leads to a risk area, then... If the observation point is not clearly related to the entrance or exit of the risk area, then ; This is a weighted indicator of road grade or road network accessibility, used to characterize whether the road where the target location is located has significance for concealed logistics passage or internal transshipment. If the location is located in a back street or alley, an internal road in an urban village, the only passage for a factory or courtyard, or a logistics access route, then... If the location is situated on a side road, alleyway connecting road, or secondary road providing access to the risk area, then If the location is situated on a secondary arterial road or a general urban road, but has a connection to the high-risk area, then If the location is situated on a main road, expressway, or open public road and has no clear connection to the risk area, then .
[0021] Furthermore, step 9 is followed by step 10: applying the target cargo confidence level obtained in step S7. The consistency coefficient A of the entrance / exit direction obtained in step S8 j Entrance-oriented passage ratio Freight High Frequency Index Synergy Index with Multiple Vehicle Models The results obtained in step S9 Furthermore, by overlaying risk coefficients for pre-defined business time periods, a unified confidence level for hidden logistics risks is calculated through multi-dimensional weighted fusion. Subsequently, risk levels are obtained by segmenting and mapping based on the confidence level of hidden logistics risks, and corresponding risk type labels are output by combining the sub-indicators of each dimension to form the hidden logistics risk identification results. ; λ1, λ2, λ3, λ4, and λ5 represent the weighting coefficients corresponding to the five dimensions, satisfying the constraint λ1+λ2+λ3+λ4+λ5=1; The trajectory feature score, i.e., the correlation with key entrances, characterizes the strength of the movement characteristics of a target cluster moving towards a closed blind area. , This is used to calculate the consistency coefficient of the entrance and exit directions of effective cargo trajectories that meet the criteria of pointing to key entrances or risk areas within a statistical time window. The average value; if no trajectory meets the conditions within the statistical time window, then Set to 0; The score represents the frequency of passage, indicating the level of activity of multiple vehicle types carrying goods passing through within a unit of time. , As a high-frequency reference, 5 times / hour; : Represents the risk score for a given time period, which is a preset fixed coefficient used to differentiate the risk intensity between normal daytime delivery and illegal nighttime processing and shipment; Risk levels are obtained by segmenting and mapping the risk confidence of concealed logistics, including: when C L When the risk level is below the first threshold, it is classified as low risk; when C L When the risk level is not lower than the first threshold but lower than the second threshold, it is classified as medium risk; when C L If the risk level is not lower than the second threshold, it is determined to be high-risk; corresponding hidden logistics risk identification results are generated.
[0022] Furthermore, step 10 is followed by step 11, which performs a secondary spatial semantic verification to evaluate the comprehensive risk confidence obtained in step S10. Based on geographical constraints, the system performs fine-tuning and outputs the corrected confidence level of hidden logistics risks and the corresponding risk level, which are used to determine the final risk type. When the image recognition model, multimodal semantic recognition model interface is unavailable, the call times out, the output format is abnormal, or the confidence level of hidden logistics risks is low. When the risk level is below the confidence threshold, switch to the local rule model to generate basic hidden logistics risk identification results, including risk type and manual review requirements, to ensure that usable results can still be output in the event of algorithm failure. Based on the corrected confidence level of hidden logistics risks and the corresponding risk level, as well as the multi-dimensional information generated in steps 1-10, a structured risk evidence dataset is generated through standardized encapsulation. Structured risk evidence data includes at least one of the following: location number, collection time, latitude and longitude coordinates, target category, target trajectory, total number of all valid moving target trajectories, number of cargo-carrying target trajectories, target cargo percentage, consistency coefficient of entrance and exit directions, correlation of key entrances, spatial semantic score, risk type, risk level, comprehensive risk confidence of concealed logistics, evidence summary, target screenshot, key frame short video clips, original video path, and manual review requirements. Before generating structured risk evidence data, the process also includes blurring, occluding, pixelating, hashing, or de-identifying the faces, license plates, or other personally identifiable information in the target images, trajectory images, or key video clips.
[0023] A computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements all the steps of the concealed logistics risk identification method based on moving target trajectory and spatial semantics.
[0024] Compared with the prior art, the present invention has at least the following beneficial effects: 1. This invention does not require direct entry into the interior of a closed or semi-closed space as a necessary condition. Instead, it uses the trajectory of moving targets and the cargo status at external observation points such as street entrances, courtyard perimeters, and road cross-sections to infer hidden logistics risks.
[0025] 2. This invention achieves stable construction of continuous trajectories of moving targets by combining multi-model target detection with two-stage cross-frame correlation tracking with high and low confidence levels; and innovatively introduces a normalized displacement ratio judgment method between the displacement of the target center point and the target scale to accurately filter stationary vehicles and low-value targets; significantly reducing the probability of invalid calculations and misjudgments, and improving the accuracy of subsequent feature recognition and risk statistics.
[0026] 3. Based on the effective target trajectory time interval and the outer cropping of key images, trajectory images and video clips outside the detection box, the system integrates image pixel segmentation, multimodal semantic recognition and local rule engine multi-verification to quantitatively calculate the cargo area ratio, height ratio and comprehensive cargo confidence, and accurately identify hidden logistics violations such as oversized two-wheeled vehicles, mixed passenger and cargo loading in vans and concentrated cargo loading of multiple vehicle types. 4. This invention uses a fixed time window to statistically analyze multi-dimensional trajectory indicators such as traffic frequency, cargo ratio, entrance directional passage rate, and multi-vehicle coordination index. Combined with the consistency of trajectory direction, it quantitatively distinguishes traffic behaviors such as entering, exiting, and crossing, and aggregates individual target evidence into risk clues at the point level and time window level. 5. This invention quantifies spatial elements such as entrance nodes, warehousing and logistics interest points, road network accessibility, and narrow passage constraints into a unified spatial semantic score. It combines trajectory features, cargo characteristics, and time-period anomaly features to complete multi-dimensional weighted confidence calculation, which can finely distinguish between ordinary traffic, daily delivery and hidden illegal logistics behavior. The risk judgment logic is more in line with the actual scenario of urban governance.
[0027] 6. This invention outputs standardized, multi-format, and interoperable structured risk evidence data, including target trajectory, target image, key video clips, spatial semantic score, risk level, risk confidence, evidence summary, and original video backtracking path. It can support manual review, departmental verification, platform integration, and spatial display. Attached Figure Description
[0028] Figure 1 A flowchart illustrating the overall process of identifying hidden logistics risks based on the trajectory of moving targets and spatial semantics; Figure 2 This is a schematic diagram for target detection and cross-frame trajectory construction. Detailed Implementation
[0029] To make the objectives, technical solutions, and beneficial effects of this invention clearer, the invention will be further described in detail below with reference to specific embodiments. It should be understood that the following embodiments are for illustrative purposes only and are not intended to limit the scope of protection of this invention. All equivalent substitutions, parameter adjustments, module combinations, algorithm replacements, or application scenario extensions made to this invention within the spirit and principles of this invention should be included within the scope of protection of this invention.
[0030] This embodiment provides a method, system, and medium for identifying concealed logistics risks based on moving target trajectories and spatial semantics. This method is primarily aimed at urban governance blind spots or semi-blind spots such as urban villages, old neighborhoods, back areas of street-front shops, areas adjacent to small factories, perimeters of enclosed courtyards, street entrances, and road intersections. These scenarios typically feature difficulties in direct access to internal spaces, limited coverage by conventional monitoring, concealed production and business activities, narrow roads, mixed pedestrian and vehicle traffic, and frequent informal transportation activities.
[0031] The hidden logistics risks referred to in this embodiment are risk clues that are difficult to observe directly, but can be indirectly inferred from the trajectory of moving targets, cargo status, entry and exit directions, traffic frequency, vehicle type combinations, and spatial semantic relationships at external observation points. These hidden logistics risks include types such as abnormal logistics, informal transportation, suspected hidden processing-related transportation, mixed passenger and cargo loading, logistics occupation of narrow passages, oversized transportation, and high-frequency entry and exit of cargo targets into enclosed spaces.
[0032] The moving targets in this embodiment include, but are not limited to, two-wheeled electric vehicles, motorcycles, tricycles, vans, small trucks, handcarts, pedestrians carrying large packages, cargo combination targets, and other moving objects that can reflect logistics activities.
[0033] Example 1: A method for identifying hidden logistics risks based on the trajectory of moving targets and spatial semantics.
[0034] The overall process of the method in this embodiment can be found in [reference]. Figure 1 . Figure 1 It can be configured as a general flowchart for identifying hidden logistics risks based on moving target trajectories and spatial semantics. The process includes, in sequence: target observation point data acquisition, video frame extraction and candidate frame screening, moving target detection, cross-frame trajectory construction, displacement ratio filtering, effective motion segment cropping, cargo status identification, trajectory direction and frequency statistics, spatial semantic scoring, hidden logistics risk fusion judgment, structured evidence output, and privacy protection processing.
[0035] Step S1: Acquisition of video data and spatial semantic data of target observation points.
[0036] First, determine the target observation points. The target observation points include at least one of the following: street entrances, courtyard perimeters, road cross-sections, entrances and exits of urban villages, the outer perimeter of storefronts, road sections adjacent to small factories, logistics access channels, the outer edge of enclosed spaces, or core transportation hub nodes.
[0037] In one specific implementation, the Lujiang urban village cluster and its surrounding blocks in Haizhu District, Guangzhou City, are selected as the application area. The area has dense roads and buildings, creating blind spots that are difficult to cover with conventional patrols. The urban villages have formed a garment and textile processing industry of a certain scale, as well as its production, transportation, and distribution activities. This makes it easy to observe high-frequency freight traffic activities at entrances and exits and in the surrounding streets and alleys, making it an ideal scenario for testing this method.
[0038] Video data acquisition: A GoPro Hero9 high-definition action camera was used to acquire data from the target observation points from a fixed position and a horizontal perspective. Video parameters were 1080P resolution, 24 frames per second, and GPS positioning was enabled to record latitude and longitude coordinates. The sampling scale included, but was not limited to: a total of 19 street observation points, obtaining 136 MP4 audio and video samples, with a total duration of approximately 390 minutes; the samples covered commercial streets, residential areas, urban villages, alleyway entrances, and areas near factories. Alternatively, in other implementations, observation points could be set up at key intersections around or within the target area to collect approximately 390 minutes of video data, used to characterize key traffic windows for entering and exiting vehicles.
[0039] Spatial semantic data acquisition: The spatial semantic data includes at least one of the following: point number, latitude and longitude coordinates, road name, road network topology, point type, street entrance direction, courtyard or factory boundary, nearby points of interest, passage width, road grade, spatial proximity between the target observation point and the potential risk area, and the governance grid to which it belongs.
[0040] The system can automatically extract latitude and longitude coordinates, acquisition date, location number, and media type from video filenames using Python regular expressions. For irregularly named files, a multi-rule matching strategy is employed to improve parsing robustness. Based on the extracted latitude and longitude coordinates and location number, subfolders named after the spatial entities of the locations are automatically created, merging scattered videos, extracted frames, target thumbnails, trajectory fragments, JSON results, PDF work orders, and Shapefile spatial point features into the corresponding location folders. When acquiring or importing videos, an original video path (video_path) is generated for each video segment and bound to the location number, acquisition time, target trajectory number, and evidence file path in subsequent steps.
[0041] Step S2: Extract video frame sequences from the video data, and sequentially perform frame extraction and candidate frame filtering on the video frame sequences to remove low-value frames and obtain a set of frames to be detected.
[0042] (1) To reduce redundant input and computational overhead, the video frame sequence is arranged at a preset frame interval. Or preset time interval Perform frame extraction to obtain the initial frame set: Equation (1); Among them, I i Let represent the i-th frame, and N be the total number of video frames. The frame sampling frequency can be adaptively adjusted based on the motion characteristics of the point, the channel width, and the occlusion situation. For points with fast-moving targets, narrow channels, or frequent occlusion, the frame sampling frequency can be appropriately increased; for points under continuous monitoring for a long time or with low target speed, the frame sampling frequency can be appropriately decreased.
[0043] (2) Perform quality screening on the initial frame set F0 to remove low-value frames.
[0044] Low-value frames are those whose candidate frame quality score is lower than a preset frame quality threshold. The candidate frame quality score can be represented as: Equation (2); in, Rate the image sharpness. For brightness rating, For effective visible area scoring, To score the differences between the frames and those already retained, , , , Let be the weighting coefficients, and satisfy: Equation (3); , , , =0.20;
[0045] in, The larger the value, the clearer the image edges. When the resolution reaches 100 or above, the image sharpness is considered to meet the requirements for candidate frames.
[0046]
[0047] Average brightness of grayscale image The absolute difference between the average brightness of the grayscale image and 128. When the average brightness of the grayscale image is close to 128, the brightness score is high; when the grayscale image is too dark or overexposed, the brightness score is low.
[0048]
[0049] The proportion of the entire image occupied by occluded, black borders, severely blurred, or invalid areas. It can be determined based on the foreground occlusion mask, the proportion of black areas, the proportion of overexposed areas, or the semantic segmentation results.
[0050]
[0051] The maximum similarity between the current frame and the retained frames; Structural similarity index, image histogram correlation, or perceptual hash similarity can be used. If the current frame is highly similar to the retained frames, then... A lower value indicates that the frame provides less incremental information for subsequent detection. Set the quality threshold θ f =0.60, when Qf(I i ) lower than the preset frame quality threshold θ f If the frame is not detected, discard it; otherwise, add it to the set of frames to be detected, F. d : Equation (4); For nighttime, low-light, or heavily obstructed scenes, θ f It can be appropriately reduced to 0.50; for fixed monitoring scenarios with good image quality, θ f It can be increased to 0.65.
[0052] Step S3: For the set of frames to be detected F obtained in the previous step... d For all image frames, motion candidate target detection is performed to obtain the detection bounding box, target category, and detection confidence of the motion candidate targets. After confidence filtering, NMS deduplication, and business category filtering, a set of all valid motion candidate target detection results in each image frame is obtained. All valid motion candidate target detection results include valid motion candidate target detection bounding box, detection confidence, and target category.
[0053] The motion candidate targets include at least one of two-wheeled electric vehicles, motorcycles, tricycles, vans, small trucks, handcarts, pedestrians carrying goods, cargo parcels, or other transport objects.
[0054] In one specific implementation, a YOLOv8s object detection model is used to perform object detection on video frames, retaining object categories related to dynamic logistics risks. Detection boxes, object categories, and detection confidence scores are generated by the object detection model through inference, and the final valid detection results are obtained after filtering and deduplication based on confidence thresholds. Object categories related to dynamic logistics risks include bicycles and motorcycles, tricycles, vans, light trucks, pedestrians carrying large items, parcels, handcarts, and other cargo-carrying combinations from the COCO category.
[0055] All valid motion candidate targets, after confidence-based filtering, NMS deduplication, and service category filtering, are encapsulated in a unified format and used as input for the next stage of cross-frame trajectory construction. The detection result of the j-th valid motion candidate target in frame t can be expressed as: Equation (5); Where, x t,j and y t,j w represents the coordinates of the center point of the detection box. t,j and h t,j q represents the width and height of the detection box, respectively. t,j c represents the detection confidence level. t,j Indicates the target category.
[0056] The detection set, which comprises the detection results of all valid moving candidate targets in frame t, can be represented as: , Equation (6); Where, m t This represents the number of detected targets in frame t.
[0057] Step S4: Perform cross-frame association and trajectory construction on the effective moving candidate target detection results to obtain the target trajectory corresponding to the same effective moving target, such as... Figure 2 .
[0058] The input for this step is the set of valid moving candidate target detection results D obtained in step S3. t The video frames are processed sequentially from earliest to latest. Each iteration includes: using a multi-target tracking algorithm to correlate detection boxes across frames, including: first, outputting the detection results D of valid moving candidate targets for each frame. t Based on temporal sequence, the detection bounding boxes of valid motion candidate targets in the first frame are used as trajectories. The detection bounding boxes of valid motion candidate targets in subsequent frames are matched with the trajectory prediction bounding boxes obtained through Kalman prediction. The matching cost is calculated, and the optimal matching result can be found using the Hungarian algorithm. When a detection bounding box successfully matches a trajectory prediction bounding box region, the trajectory is updated with a new detection bounding box. If a trajectory prediction bounding box region is not matched by a detection bounding box, the trajectory is marked as lost and retained for several frames to tolerate short-term occlusion. If a detection bounding box does not match any trajectory prediction bounding box region, a new trajectory is created for it. If a trajectory is not matched for several consecutive frames, it is deleted. Each detected bounding box of a tracked valid motion candidate target is marked with a unique trajectory identifier for cross-frame identity association.
[0059] The multi-target tracking algorithm can employ ByteTrack, DeepSORT, OC-SORT, or other tracking algorithms based on bounding box association. Preferably, the ByteTrack algorithm is used for two-stage matching: the first stage matches high-confidence bounding boxes with existing trajectory prediction box regions, and the second stage matches low-confidence bounding boxes with trajectory prediction box regions not matched in the first stage, thereby reducing trajectory interruptions caused by short-term occlusion and low-confidence detection. The matching cost can be calculated based on the intersection-union ratio: Equation (7) Equation (8) Where A and B represent the detection box and trajectory prediction box regions, respectively.
[0060] The detection information of the same physical target across multiple frames of a video constitutes a global trajectory. This global trajectory set is denoted as T = {τ1, τ2, ..., τ...}. M}, M is the total number of currently surviving trajectories; τ j For the j-th trajectory, τ j The stored content includes at least: unique trajectory ID, target category, historical detection box sequence, trajectory prediction box area obtained from Kalman prediction, trajectory status, and last update time.
[0061] Step S5: For detection boxes with the same trajectory identifier at adjacent sampling times, calculate the target center point displacement, target scale and displacement ratio, and total cumulative trajectory displacement, filter stationary targets and low-value targets, and obtain a set of effective moving target trajectories; Street video contains numerous stationary vehicles, temporarily parked vehicles, falsely detected targets at the edges of the frame, and low-value repetitive segments. Inputting all these targets into a large model or requiring manual review would waste computing power and result in false alarms. This step filters stationary and low-value targets based on the proportional relationship between the target's center point displacement and the target's scale, retaining the trajectories of targets that have actually moved and pose logistical risks.
[0062] When N consecutive sampling times If the cumulative displacement exceeds the first motion threshold or the second motion threshold, the target corresponding to the trajectory is determined to be a valid moving target trajectory. N is preferably 2 to 5, the first motion threshold is preferably 0.03 to 0.20, and the second motion threshold can be set according to the video resolution and camera distance. If neither condition is met, the trajectory is determined to be invalid due to stationary motion, slight movement, or false detection, and is directly discarded. Trajectories that simultaneously meet any one of the valid motion determination conditions are summarized to form a set of valid moving target trajectories. This serves as the input data source for the S6 valid motion segment clipping.
[0063] (1) Inter-frame target center point displacement dt Calculate according to the following formula: Equation (9); Among them, (x t-1 ,y t-1 ) represents the trajectory τ j The pixel coordinates of the center point of the valid motion candidate target detection box within the valid sampling frame at the (t-1)th sampling time; (x t ,y t ) represents the pixel coordinates of the center point of the detection box of the same valid moving candidate target within the valid sampling frame corresponding to the t-th sampling time; d t It represents the pixel straight-line distance of the target center point movement between two adjacent frames, characterizing the actual movement range of the target.
[0064] (2) Based on the width w of the effective motion candidate target detection box at the t-th sampling time t and height h t Calculate the target scale s t : Equation (10); (3) Displacement ratio r t Calculate according to the following formula: , Equation (11); δ is a minimal constant (taken as 10 in engineering). -6 This prevents calculation anomalies caused by the denominator being 0 when the target scale s(t) approaches 0. The larger r(t) is, the more significant the movement of the target relative to its own size.
[0065] (4) Total cumulative displacement D of the trajectory sum The sum of displacements of all adjacent frames within the complete lifetime of the trajectory: Equation (12); t0 is the starting frame where the trajectory first appears; t1 is the last valid update frame of the trajectory; D sum The total pixel distance the target moves from its appearance to its disappearance is used to identify slowly moving cargo targets.
[0066] Step S6: For trajectories determined to be valid moving targets, crop them according to the trajectory's time range to generate target screenshots, trajectory visualization images, or keyframe short video clips. Store these in a unified file path to provide image material for cargo status recognition in S7, and retain them as original visual evidence for subsequent risk verification. During cropping, a preset percentage can be added outside the detection box, such as 10% to 30%, to preserve the surrounding context information of the target. If the same target appears in multiple frames, the first, middle, and last frames can be extracted as keyframes, or keyframe short video clips can be generated. Output dynamic activity evidence.
[0067] The purpose of outward trimming is to preserve the surrounding cargo, vehicle structure, traffic environment, and obstruction relationships, so as to facilitate subsequent assessment of risks such as overloaded cargo, mixed passenger and cargo loading, or narrow passage occupancy.
[0068] Step S7: Input the target screenshot, trajectory visualization image or key short video clip output from Step S6 into the image recognition model, multimodal semantic recognition model or local rule model, and output the target cargo status, cargo description and risk warning.
[0069] For the target vehicle in the input image, two standardized cargo ratio indicators are calculated using the pixel segmentation results of the image recognition model to suppress the bias caused by differences in vehicle size; in the formula, δ is a minimal constant (engineering value of 10). -6 This prevents calculation errors caused by a denominator value of 0.
[0070] (1) Proportion of cargo area : Equation (13); in, This represents the total area of the cargo pixels obtained from the image recognition model. This represents the total pixel area of the target vehicle / pedestrian carrier. This represents the area ratio of goods to their carrier; a higher value indicates a larger volume of goods being stacked.
[0071] (2) Cargo height percentage : , Equation (14); in, The maximum height of pixels in the stacked area; The total pixel height of the vehicle carrier itself; It represents the height ratio of the cargo relative to the vehicle body, used to identify oversized cargo, excessive cargo stacking on the roof, and other over-limit behaviors.
[0072] (3) Calculate the target cargo load confidence level : Equation (15); in, The confidence level for cargo identification output by the image recognition model or multimodal semantic model; , The percentage of cargo area or height; The validation confidence score output by the local rule model, for matching cargo types. Pre-configure rule sets: Each rule Configure corresponding weights ,and If the first If the rule is satisfied, then If not satisfied, then Based on this calculation: ; μ1, μ2, μ3, and μ4 are the weight coefficients of each indicator, satisfying μ1+μ2+μ3+μ4=1, equation (16), which can be adaptively adjusted according to different scenarios such as urban villages and factories.
[0073] A higher value indicates a higher confidence level that the target is carrying cargo. A preset cargo-carrying confidence threshold is set; only when... When the threshold is exceeded, the target is determined to be a valid cargo target, and the process enters S8 to perform trajectory traffic pattern statistics.
[0074] Based on the target category, the proportion of cargo area or height, the placement of cargo, and the loading method, different types of non-compliant logistics behaviors are distinguished, and risk warnings are generated, including: (1) Oversized transport of two-wheeled electric vehicles and motorcycles If the target category is a two-wheeled electric vehicle or motorcycle, and the cargo area is located on the rear seat, sides, or top of the vehicle, the cargo area percentage is... and height ratio This was determined to be overloaded cargo transport by a two-wheeled vehicle, constituting a risk associated with informal logistics. If and If so, it is considered that the cargo-carrying characteristics are not obvious.
[0075] (2) Suspected mixed passenger and cargo loading, unauthorized modification of passenger vehicles for cargo loading If the target category is a minivan, and the screenshot identifies large textiles, packaged goods, dark-tinted windows, or rear seats occupied by goods, and the cargo area ratio is high, it is judged as a suspected mixed passenger and cargo vehicle or an unauthorized modification of a passenger vehicle for cargo transport.
[0076] (3) Judgment of concentrated cargo transportation by tricycles and small trucks If the target category is a tricycle or a light truck, and based on the S8 trajectory statistics, this vehicle type frequently travels through the same courtyard and factory entrances, and the confidence level of the target being loaded with cargo meets the standard, it is determined to be a centralized batch cargo transportation activity, with the suspicion of concealed processing and supporting logistics.
[0077] Step S8: Calculate trajectory statistical indicators based on the effective moving target trajectory, including trajectory direction, trajectory direction angle, entrance / exit direction consistency coefficient, total passage frequency per unit time, target cargo ratio, entrance directional passage ratio, cargo high-frequency index, and multi-vehicle coordination index. The calculation process specifically includes: For any valid moving target trajectory τ jExtract the center point of the detection box of the first global sampling frame of the trajectory as the trajectory starting point. The center point of the detection box in the last sampling frame is taken as the trajectory endpoint. Trajectory direction vector Represented as: , Equation (17); trajectory direction angle It can be represented as: Equation (18); Consistency coefficient of entrance and exit directions A j It can be represented as: , Equation (19); in, The preset entrance / exit reference vector is generated from the orientation of street / courtyard entrances in the spatial semantic data of step S1, representing the standard direction of travel towards the closed risk area; This represents the dot product of the trajectory direction vector and the entrance / exit reference vector; This represents the magnitude of the trajectory direction vector; The magnitude of the reference vector at the entrance / exit is represented; δ is a minimal constant to prevent calculation errors caused by a denominator of 0. The closer the value is to 1, the more consistent the target's direction of travel is with the entrance direction into the closed courtyard or factory, and the stronger the risk correlation.
[0078] Within a fixed statistical time window Δt, basic statistics are calculated, including: The total number of all valid moving target trajectories within the time window; The number of trajectories identified as cargo targets in step S7 within the time window; Consistency coefficient A of entrance and exit directions within the time window j The number of trajectories exceeding the directional threshold and pointing towards the entrance of a closed courtyard / factory; The number of different types of cargo vehicles (electric vehicles, tricycles, vans, small trucks, etc.) within the time window; The total number of all freight vehicle types included in the statistics is preset.
[0079] Based on the above basic statistics, the following five categories of indicators are calculated: (1) Proportion of target goods : Equation (20); (2) Percentage of directional access at entrances : , Equation (21); (3) Total frequency of passage per unit time : Equation (22); (4) Freight High Frequency Index : Equation (23); (5) Multi-vehicle coordination index : , Equation (24); The logic relating the above-mentioned indicators to business operations and risks is as follows: When the target goods account for And the high frequency index of cargo loading At that time, the indicator points consistently saw a large volume of cargo traffic, indicating the existence of regular informal logistics; when When a vehicle enters a closed, unregulated area such as an urban village, factory, or warehouse, it is highly likely that goods processing, warehousing, or transshipment activities are taking place inside. A value ≥0.50 indicates a combination of vehicle types in transportation, often involving small workshops receiving and shipping materials in batches, reflecting the risk of mixed transportation associated with concealed processing; trajectory direction angle Consistency coefficient with entrance / exit direction This is used to distinguish between directional traffic entering a risk area and general road-crossing vehicles, thereby improving the targeting of risk statistics. When If the trajectory endpoint is located within a 20-meter buffer zone at the entrance of a street or alley, the entrance of a courtyard, the adjacent area of a factory, the back of a store, or the outer edge of an enclosed space, and the trajectory start point is closer to the external road side than the endpoint, or the trajectory direction is consistent with the road network entry direction, then the trajectory is determined to be a directional passage trajectory entering a risk area; when Or trajectory direction angle If the trajectory is large, or if the trajectory only crosses the road and neither the starting point nor the ending point falls within the key entrance or risk area buffer zone, the trajectory will be identified as a general road-crossing interference vehicle and will not be included in the entrance directional passage count. .
[0080] All trajectory statistical indicators are bound to the corresponding observation points and statistical time windows, and uniformly output to step S9 for spatial semantic scoring fusion, providing trajectory frequency dimension features for the comprehensive risk confidence calculation in step S10.
[0081] Step S9: Use the raw spatial semantic data of the points collected in Step S1 and the trajectory statistical indicators obtained in Step S8 together to calculate the spatial semantic score for each observation point. This is used to characterize the inherent correlation between this location and hidden logistics risks. (Score) The higher the score, the more likely that the location is to be involved in covert logistics or illegal freight activities.
[0082] Equation (25); ω1, ω2, ω3, and ω4 represent the weighting coefficients corresponding to the four sub-weights, satisfying the constraint ω1+ω2+ω3+ω4=1, equation (26). The weight ratio can be manually adjusted according to different governance scenarios such as urban villages, industrial parks, and street-front shops. In this embodiment, ; This represents the weight of neighboring risk points of interest, used to indicate the spatial correlation between the target observation point and points of interest such as production, warehousing, processing, wholesale, logistics, markets, store back-of-house areas, or small factories. It is calculated using a distance decay function. Equation (27); in, This represents the straight-line spatial distance from the current observation point to the nearest production / warehousing / processing risk interest point; This represents the distance decay control coefficient, a preset constant used to control how quickly the score decreases with distance; the function characteristic indicates that the closer the location is to the risky area, the higher the score decreases. The smaller the value, The closer it is to 1, the greater the distance, the more the score index decays and approaches 0.
[0083] This represents the constraint weight of narrow passages, used to quantify the aggravating effect of road narrowness on freight violations. Narrow alleys and passageways with small entrances are prone to encroachment on the road for cargo loading and oversized transport. The calculation formula is as follows: Equation (28); in, This indicates the actual physical width of the passageway corresponding to the current location; This represents the preset standard reference road width (the baseline width of open municipal roads); min(·,1) constrains the ratio to an upper limit of 1 to prevent negative values when the road is too wide. The narrower the road, the better. The smaller, The closer to 1, the better; if the road width is greater than or equal to the reference width, the minimum value is 1. There is no risk of narrow passages.
[0084] The weight of the entrance / exit node indicates whether the target observation point belongs to the entrance / exit or internal / external connection node of the risk area. In this embodiment, if the observation point is the core entrance / exit of an urban village, a street / alley entrance, a courtyard entrance, a store's back entrance, a factory's adjacent entrance, or an entrance to the outer edge of a closed space, then... If the observation point is no more than 30 meters away from the aforementioned entrance, but is not the entrance itself, then If the observation point is a regular road section but leads to a risk area, then... If the observation point is not clearly related to the entrance or exit of the risk area, then ; This is a road grade or road network accessibility weight, used to characterize whether the road where the target location is located has significance for concealed logistics passage or internal transshipment. In this embodiment, if the location is located in a back street, alley, internal road of an urban village, the only passage of a factory or courtyard, or a logistics access passage, then... If the location is situated on a side road, alleyway connecting road, or secondary road providing access to the risk area, then If the location is situated on a secondary arterial road or a general urban road, but has a connection to the high-risk area, then If the location is situated on a main road, expressway, or open public road and has no clear connection to the risk area, then .
[0085] Step S10: Calculate the target cargo load confidence level obtained in step S7. The consistency coefficient A of the entrance / exit direction obtained in step S8 j Entrance-oriented passage ratio Freight High Frequency Index Synergy Index with Multiple Vehicle Models The results obtained in step S9 Furthermore, by overlaying risk coefficients for pre-defined business time periods, a unified confidence level for hidden logistics risks is calculated through multi-dimensional weighted fusion. Subsequently, risk levels are obtained by segmenting and mapping based on confidence levels, and corresponding risk type labels are output by combining the sub-indicators of each dimension, thus forming the results of hidden logistics risk identification.
[0086] Equation (29); C L The value represents the comprehensive risk confidence of hidden logistics. The higher the value, the greater the possibility of illegal hidden logistics. λ1, λ2, λ3, λ4, and λ5 represent the weighting coefficients corresponding to the five dimensions, satisfying the constraint λ1+λ2+λ3+λ4+λ5=1, equation (31). The weights of each dimension can be adaptively adjusted according to different scenarios such as urban villages, street shops, and small factories. ; The trajectory feature score, i.e., the correlation of key entrances, is determined by the consistency coefficient A of entrance / exit directions in step S8. j Entrance-oriented passage ratio The comprehensive calculation yields a characteristic representing the strength of the motion features of the target cluster moving towards the closed blind zone;
[0087] in, This is used to calculate the consistency coefficient of the entrance and exit directions of effective cargo trajectories that meet the criteria of pointing to key entrances or risk areas within a statistical time window. The average value; if no trajectory meets the conditions within the statistical time window, then Set to 0; The score represents the frequency of passage, indicating the level of activity of multiple vehicle types carrying goods passing through within a unit of time. , As a high-frequency reference, 5 times / hour; This represents the risk score for a specific time period. It uses a preset fixed coefficient to differentiate the risk intensity of different time periods, such as normal daytime delivery and illegal nighttime processing and shipping. The score is higher during non-operational nighttime hours. Non-typical operating hours at night or in the early morning, i.e., from 22:00 to 06:00 the next day, Peak periods for logistics or processing activities are during the morning and evening hours, namely 06:00 to 08:00 and 18:00 to 22:00. During normal daytime hours, i.e., from 08:00 to 18:00, When the collection period is unknown or cannot be determined, .
[0088] Then, based on the confidence level C of hidden logistics risks L Segmented mapping yields risk level G: Equation (30); Where Grade(·) represents the preset segmentation mapping rule. An example of the grade standard in this embodiment is as follows: Low risk: 0≤C L <0.4, only a small amount of scattered cargo passes through, with no characteristics of centralized freight transport; Medium risk: 0.4≤C L <0.7 indicates that there are continuous freight vehicles entering the closed area in a directed manner, requiring manual on-site verification; High risk: 0.7≤C L ≤1.0, multiple vehicle types, high-frequency cargo loading, locations adjacent to processing and storage plants, highly suspected of being concealed processing and supporting logistics.
[0089] In another implementation, a risk type weight ψ is introduced. l To amplify or suppress risk level G: , Equation (31); ψ l This indicates the risk type adjustment weight, with a value greater than 0. Different risk types are assigned independent weights. 1) Suspected concealed processing and related transportation, long-term obstruction of narrow passages for cargo transport: ψl is assigned a high weight greater than 1 to amplify the risk level; 2) Ordinary scattered cargo transport, routine delivery: ψl is assigned a low weight less than 1 to reduce the risk level; within the same C L Based on numerical values, the risk level of more harmful violations will be upgraded, and manual verification will be prioritized.
[0090] Obtain confidence level of hidden logistics risks After calculation and risk level classification, the corresponding risk labels are matched with the sub-indicators of each dimension. The output results should include at least one of the following categories: Abnormal Logistics: Percentage of Target Goods At that time, but This constitutes scattered and illegal cargo transport; the target cargo accounts for a certain percentage. At that time, but This suggests a higher likelihood of suspected covert processing-related transportation or targeted logistics activities; Unregulated transportation: Overloaded two-wheeled / three-wheeled vehicles, mixed passenger and cargo vans, and passenger vehicles converted to carry cargo, without the characteristics of formal freight transport qualifications; Suspected covert processing and related transportation: , , The data was identified as "high frequency of passage, high spatial semantic score, and high proportion of entrance-oriented passage" in suspected concealed processing and related transportation. Narrow aisle logistics occupancy: Freight vehicles have long occupied narrow alleys and fire lanes in the village to load and unload goods; like and This indicates that the target location has both the spatial constraints of narrow passages, fire lanes, or narrow alleys inside urban villages, and a high frequency of cargo passage, which can be judged as a risk of logistics occupation in narrow passages.
[0091] Logistics activities awaiting review: All indicators are at a moderate level and the confidence level is in the critical range, making it impossible to directly determine violations. After marking, the activity will be sent for manual review.
[0092] The results of the hidden logistics risk identification are based on the risk type labels and risk levels mentioned above. Together, they form a cohesive unit for coordinated subsequent response strategies.
[0093] Step S11: To improve the stability and compliance of the hidden logistics risk identification results, perform a second spatial semantic verification to evaluate the comprehensive risk confidence obtained in step S10. Based on geographical constraints, the system performs fine-tuning and outputs the corrected confidence level of the hidden logistics risk and the corresponding risk level, which are used to determine the final risk type.
[0094] When the image recognition model, multimodal semantic recognition model interface is unavailable, the call times out, the output format is abnormal, or the confidence level of hidden logistics risks is low. When the risk level is below the confidence threshold, switch to the local rule model to generate basic hidden logistics risk identification results, including risk type and manual review requirements, to ensure that usable results can still be output even in the event of algorithm failure.
[0095] The adjustments and fine-tuning include: If the trajectory of a valid moving target crosses or points to a risk control area, including street entrances, courtyard entrances, store back areas, areas adjacent to factories, or the outer edge of enclosed spaces, then the initial confidence level of the hidden logistics risk obtained in step S10 is increased. Adjustments will be made upwards.
[0096]
[0097] If the number of cargo trajectories meeting the above conditions is no less than 2 within the same statistical time window, or the proportion of entrance-oriented passage is... The upward adjustment will be 0.10:
[0098] If the direction of the effective moving target trajectory is consistent with the road network topology and the direction of entrances and exits, and the consistency coefficient of the entrance and exit directions is... Then the confidence level of the initial hidden logistics risk Increased by 0.05.
[0099]
[0100] If both conditions are met If the trajectory endpoint falls within the 20-meter buffer zone of a key entrance or risk area, and the target is a cargo-carrying target, then the upward adjustment can be taken as 0.08.
[0101] If the location of the cargo target is spatially adjacent to high-risk points of interest, including those related to production, warehousing, processing, wholesale, or logistics, then a matching score will be assigned based on nearby points of interest. Adjust the risk confidence level.
[0102] when Or, if the target location is no more than 50 meters away from the nearest high-risk point of interest, then... Increase by 0.05:
[0103] when And when there is a trajectory indicating that a cargo target is heading directly into a key entrance, for Increase by 0.10:
[0104] If the cargo target frequently travels through restricted traffic sections, including narrow passages, fire lanes, core entrances and exits of urban villages, and storefront areas, then according to... and Adjust the confidence level of hidden logistics risks.
[0105] In this embodiment, when and At that time, CL was increased by 0.10:
[0106] when , Furthermore, if the target stays or loading / unloading time exceeds 10 seconds, it can be further marked as a risk of logistics occupation in narrow passages, but the confidence level of hidden logistics risks is still capped at 1.
[0107] The local rule model generates basic hidden logistics risk identification results, including: The proportion of target goods within the time window Greater than the first cargo loading threshold Furthermore, the proportion of entrances with designated entry points to key locations is [not specified]. Greater than the ingress association threshold And the current point spatial semantic score S g Greater than the spatial semantic threshold If the logistics are deemed abnormal, they are marked as risks requiring manual on-site verification.
[0108] When a van or light truck repeatedly travels along the direction of a key entrance within the statistical time window, and the confidence level of the target cargo load is high... When the confidence level exceeds the cargo load threshold (0.60), it is determined that there is suspicion of irregular transportation such as mixed passenger and cargo loading or unauthorized modification of passenger vehicles to load cargo, and it is marked as a risk requiring manual on-site verification.
[0109] Multiple passages along the direction of key entrances refer to situations where, within a statistical time window Δt = 1 hour, the effective cargo trajectories of vans or light trucks meet the consistency coefficient of the entrance / exit direction. Furthermore, the number of trajectories pointing to enclosed courtyards, factory entrances, store back areas, or logistics access channels reaches the preset threshold of 2 times.
[0110] When short-distance freight vehicles such as two-wheeled electric vehicles and three-wheeled vehicles are located in narrow passages, and the high frequency index F of freight passage per unit time is high... c Greater than the high frequency threshold When the risk is identified as logistics obstruction in narrow passages, it is marked as a risk requiring manual on-site verification.
[0111] When multiple types of freight vehicles travel together during non-typical operating hours such as nighttime and early morning, and their trajectories uniformly point to controlled entrances and exits such as the vicinity of factories, the back of stores, and enclosed courtyards, they are directly identified as suspected hidden processing-related transportation risks.
[0112] In summary, all the corrected risk data output in this step will serve as the final basis for determining the generation and archiving of structured risk evidence in step S12.
[0113] Step S12: Generation of structured risk evidence data.
[0114] Based on the final hidden logistics risk identification results output in step S11, and the multi-dimensional information generated in steps S1-S10, a structured risk evidence dataset is generated through standardized encapsulation.
[0115] Structured risk evidence data includes at least one of the following: location number, collection time, latitude and longitude coordinates, target category, target trajectory, total number of valid moving target trajectories, number of cargo-carrying target trajectories, target cargo percentage, consistency coefficient of entrance and exit directions, correlation of key entrances, spatial semantic score, risk type, risk level, confidence level of comprehensive risk of concealed logistics, evidence summary, target screenshot, key frame short video clips, original video path, and manual review requirements.
[0116] Structured risk evidence data can be output in at least one of the following formats: JSON file, PDF file, GeoJSON file, Shapefile point feature file, database record, or message interface data. JSON files are used for system integration and batch processing, PDF files are used for manual reading and archiving, and GeoJSON or Shapefile point feature files are used for spatial visualization and overlay analysis within geographic information systems.
[0117] The evidence summary shall include at least the target category, target cargo status, total passage frequency per unit time, trajectory direction angle, spatial semantic score, risk type, risk level, and key evidence path.
[0118] The original video path originates from the video data storage path or video file index acquired in step S1.
[0119] Before generating structured evidence in this step, a privacy protection process must be performed to de-identify sensitive personal information such as faces and license plates in target images and key videos. The de-identification operation only applies to the visual materials and will not modify the various statistical indicators, risk parameters, or evidence file storage paths that need to be encapsulated in this step, ensuring that the business validity of the structured risk evidence is not affected.
[0120] The privacy-preserving processing steps include blurring, occluding, pixelating, hashing, or de-identifying the faces, license plates, or other personally identifiable information in target images, trajectory images, or key video clips. This privacy-preserving processing does not alter the target category, cargo status, trajectory direction, statistical indicators, or evidence path required for risk identification.
[0121] Example 2: Case study on hidden logistics risk identification at the intersection of Lujiang South Street and Lujiang West Street.
[0122] This embodiment uses the intersection of Lujiang South Yue Street and Lujiang West Street in Haizhu District, Guangzhou City as an example to illustrate the application process of the method of the present invention. This intersection is an important traffic node for entering the interior of Lujiang Village, Lujiang East Yue Street, Lujiang Huiyuan Street and other streets and alleys in the urban village, and connects to the core production area inside the village from the northeast. Residential, commercial and small-scale processing activities are mixed in this area, and some store back areas and alleyways are difficult to observe directly through routine patrols; therefore, the video trajectory of the outer core traffic node can reflect the characteristics of internal logistics activities.
[0123] First, step S1 completes the acquisition of basic information and spatial semantic setting of the location, including location number, latitude and longitude coordinates, road name, collection time, and entrance direction information; based on manual annotation and road network analysis, the location is marked as the core transportation hub of the urban village, and the entrance direction is pointed to the production area inside the village. Subsequently, step S2 performs time sampling / frame extraction processing on the video collected at the location to obtain the set of frames to be detected.
[0124] In step S3, motion candidate target detection is performed on each frame in the set of frames to be detected to obtain the target category, detection box, and confidence level related to dynamic logistics risks; the detection results are then filtered by confidence level, deduplicated by NMS, and filtered by business category to obtain the set of valid detection results for each frame. The data is then packaged in a standardized format and used as input for step S4. In step S4, based on the effective moving target detection results... Cross-frame association and target trajectory construction are performed using a detection-based multi-target tracking framework (ByteTrack preferred). Hungarian matching is completed through Kalman position prediction and cost calculation. A two-stage hierarchical association strategy with high and low confidence is implemented to reduce trajectory breakage caused by short-term occlusion, ultimately generating a continuous temporal set of target trajectories. .
[0125] After trajectory construction is completed, in step S5, the displacement of the center point of the detection box in adjacent frames of the same trajectory is compared with the target-scale constructed displacement. The system combines single-frame thresholds and cumulative displacement thresholds to perform tiered filtering of trajectories, thereby filtering out stationary vehicles and invalid trajectories, and retaining only the set of valid moving target trajectories. Subsequently, in step S6, partial screenshots and key video clips are cropped from each valid moving target to form materials for subsequent cargo identification and evidence generation.
[0126] In step S7, based on the target local screenshot / key segment obtained in step S6, the target cargo status and cargo dimension feature parameters, including cargo area ratio, are output by fusing image recognition model, multimodal semantic recognition model and local rule model. Cargo height percentage Cargo confidence level The system also includes cargo loading behavior tags; under the constraint of cargo loading confidence threshold, the system determines the effective cargo loading targets and provides cargo loading status input for subsequent risk statistics.
[0127] In step S8, based on Calculate the trajectory direction and entry / exit direction parameters, statistically analyze the passage frequency and cargo loading frequency within a fixed time window, and obtain the trajectory direction consistency and the proportion of directional passage at the entrance. Freight High Frequency Index Multi-vehicle coordination index Trajectory statistics indicators.
[0128] In step S9, based on the spatial semantic data of the points in step S1 and the trajectory frequency statistics dimension in step S8, a comprehensive spatial semantic score of the points is calculated. This is to characterize the inherent correlation between this location and hidden logistics risks. Combining the location's spatial characteristics—as a core transportation hub, connecting internal production areas, and having relatively narrow passageways—a high spatial semantic score is generated.
[0129] In step S10, the trajectory feature score, cargo carrying behavior score, passage frequency score, spatial geographic score, and time period risk coefficient are fused together to calculate the confidence level of hidden logistics risk. The risk level is obtained through risk level mapping; at the same time, risk type labels are output by matching indicators of various dimensions. In this case, risk clues including "oversized transportation of two-wheeled electric vehicles, serious overload transportation" and "minivan suspected of being converted from passenger to freight to transport textile raw materials" were identified, and after comprehensive confidence and risk type label output, a hidden logistics risk identification result was formed (including at least one of the corresponding labels: informal transportation, suspected hidden processing-related transportation, or logistics activities pending verification).
[0130] To improve the stability of the results, in step S11, the risk confidence level in step S10 is subjected to a second spatial semantic verification (adjusted upwards / downwards based on geographical constraints such as trajectory attribution, direction consistency, cargo space proximity, and high-frequency passage attributes), and the local rule engine is triggered for fallback judgment when necessary; finally, the corrected risk results (confidence level, risk level, risk type, and manual review requirements) that can be used for evidence generation are obtained.
[0131] Finally, in step S12, based on the final risk identification results from step S11 and the spatiotemporal / target / cargo / spatial semantic information generated throughout the entire process, a standardized and encapsulated structured risk evidence dataset is generated. This dataset includes at least: location number, collection time, spatial coordinates, target category and target trajectory, number of targets and number of cargo targets, cargo ratio, entry and exit directions, correlation of key entrances, and spatial semantic score. Risk type, risk level, and risk confidence level The system provides evidence summaries, target image paths, key video clip paths, and original video paths, and outputs suggested verification scope and manual review status.
[0132] Subsequent field investigations revealed the presence of concealed workshops and processing plants near the site, posing significant fire safety hazards due to limited space. This finding demonstrates that by analyzing the trajectories, cargo loads, and spatial semantics of peripheral core transportation nodes, early-stage screening clues can be provided for concealed internal logistics and suspected processing activities.
[0133] Example 7: Electronic device and computer-readable storage medium.
[0134] The method described in this invention can also be implemented by an electronic device.
[0135] 1. Electronic equipment The electronic device includes a processor, memory, input / output interfaces, and a communication interface. The memory stores a computer program, which the processor executes to implement the aforementioned method for identifying concealed logistics risks based on moving target trajectories and spatial semantics. In one embodiment, it can be deployed on a computer with an 8-core, 16-thread or higher CPU and at least 32GB of RAM, with an optional GPU of at least 8GB of video memory for accelerating target detection, multi-target tracking, and image semantic recognition. The system supports Windows or Linux operating systems and can be developed using Python, employing libraries such as OpenCV, FFmpeg, Ultralytics, PyTorch, NumPy, and GDAL / OGR. OpenCV can be used for video reading, image processing, and trajectory visualization; FFmpeg can be used for video decoding and clip cropping; Ultralytics can be used for YOLO series model inference and ByteTrack interface calls; PyTorch can be used for deep model inference; NumPy can be used for trajectory index and risk score calculation; and GDAL / OGR can be used for spatial feature output and Shapefile generation.
[0136] 2. Computer-readable storage medium This invention can also be implemented as a computer-readable storage medium. The computer-readable storage medium stores a computer program, which, when executed by a processor, implements the aforementioned method for identifying covert logistics risks based on moving target trajectories and spatial semantics. The computer-readable storage medium includes, but is not limited to, hard disks, solid-state drives, flash memory, read-only memory, random access memory, optical disks, mobile storage devices, or cloud storage media.
[0137] Other alternative implementation methods.
[0138] It should be noted that this invention is not limited to the specific algorithms, models, and parameters described above. The target detection model can be replaced by other YOLOv8s models, Faster R-CNN, SSD, DETR, lightweight edge models, or other target detection models; the multi-target tracking algorithm can be replaced by ByteTrack with DeepSORT, OC-SORT, SORT, FairMOT, or other methods capable of cross-frame target identity association; the matching cost can be replaced by IoU matching with appearance feature matching, motion prediction matching, distance matching, or multi-feature fusion matching. Cargo status recognition can be implemented using image recognition models, multimodal semantic recognition models, local rule models, target segmentation models, or manually labeled models; spatial semantic scoring can be calculated based on different city data foundations using road network topology, point-of-interest density, functional zoning, building use, store type, passage width, historical patrol data, or governance grid data; risk level thresholds and weight parameters can be adjusted according to the governance scenario, manual review resources, and risk tolerance.
[0139] The above embodiments collectively demonstrate that the present invention can identify abnormal logistics, irregular transportation, and suspected hidden processing-related transportation risks by using the trajectory of moving targets, cargo status, entry and exit directions, and spatial semantic data in peripheral videos without directly entering the interior of a closed or semi-closed space, and form structured risk evidence data that can be verified, tracked, and spatially expressed.
Claims
1. A method for identifying hidden logistics risks based on moving target trajectories and spatial semantics, characterized in that, Includes the following steps: Step 1. Set up observation points on the periphery of blind spots in urban governance, and use camera equipment to collect video data and obtain spatial semantic data of the observation points; Step 2. Extract video frame sequences from the video data, and perform frame extraction and candidate frame filtering on the video frame sequences in sequence to remove low-value frames, and classify the retained frames into the frame set to be detected according to the location number, acquisition time or time window. Step 3. For all frames in the obtained set of frames to be detected, perform motion candidate target detection to obtain the detection bounding box, target category, and detection confidence of the motion candidate targets. After confidence filtering, NMS deduplication, and service category filtering, obtain the set D of all valid motion candidate target detection results in each frame. t The complete detection results of all valid moving candidate targets include the valid moving candidate target detection box, detection confidence, and target category; Step 4. Obtain the set D of all valid moving candidate target detection results. t The video frames are processed sequentially from earliest to latest. Each iteration includes: using a multi-target tracking algorithm to correlate detection boxes across frames, including: first, outputting the detection results D of valid moving candidate targets for each frame. t Based on temporal sequence, the detection bounding boxes of valid motion candidate targets in the first frame are used as trajectories. The detection bounding boxes of valid motion candidate targets in subsequent frames are matched with the trajectory prediction bounding boxes obtained through Kalman prediction. The matching cost is calculated, and the optimal matching result can be obtained using the Hungarian algorithm. When a detection bounding box successfully matches a trajectory prediction bounding box region, the trajectory is updated using the new detection bounding box. When a trajectory prediction bounding box region is not matched by a detection bounding box, the trajectory is marked as lost and retained for several frames to tolerate short-term occlusion. When a detection bounding box does not match any trajectory prediction bounding box region, a new trajectory is created for it. When a trajectory is not matched for several consecutive frames, it is deleted. Each detection bounding box of a tracked valid motion candidate target is marked with a unique trajectory identifier for cross-frame identity association. Step 5. For detection boxes with the same trajectory identifier at adjacent sampling times, calculate the target center point displacement, target scale and displacement ratio, and total cumulative trajectory displacement. Filter out stationary targets and low-value targets to obtain a set of effective moving target trajectories. Step 6. For trajectories determined to be valid moving targets, crop them according to the trajectory time range to generate target screenshots, trajectory visualization images, or keyframe short video clips; Step 7. Input the target screenshot, trajectory visualization image or key short video clip output from step S6 into the image recognition model, multimodal semantic recognition model or local rule model, and output the target cargo status, cargo description and risk warning; Step 8. Calculate trajectory statistics based on the effective moving target trajectory, including trajectory direction, trajectory direction angle, entrance / exit direction consistency coefficient, total passage frequency per unit time, target cargo ratio, entrance directional passage ratio, cargo high frequency index, and multi-vehicle coordination index; Step 9. Use the raw spatial semantic data of the points collected in Step S1 and the trajectory statistical indicators obtained in Step S8 together to calculate the spatial semantic score for each observation point. .
2. The method according to claim 1, characterized in that, In step 1: the target observation points include at least one of the following: street entrances, courtyard perimeters, road cross-sections, entrances and exits of urban villages, back perimeters of store areas, adjacent road sections of small factories, logistics access channels, or outer edges of enclosed spaces; The spatial semantic data includes at least one of the following: point number, latitude and longitude coordinates, road name, road network topology, point type, street / alley entrance direction, courtyard or factory boundary, nearby points of interest, passage width, road grade, spatial proximity between the target observation point and the potential risk area, and the governance grid to which it belongs. The spatial semantic data is obtained through at least one of the following methods: video file name parsing, acquisition device location information, manually marked point list, geographic information system spatial matching, point of interest data matching, or road network topology analysis. In step 2, the frame extraction process includes extracting initial frames from the video frame sequence according to a preset frame interval or a preset time interval; low-value frames are frames whose candidate frame quality scores are lower than a preset frame quality threshold, and the candidate frame quality scores are: ; in, The image sharpness score is calculated by dividing the image's Laplacian variance by 100 by the smaller of the two values: 1 and 2. For brightness rating, , Average brightness of grayscale image The absolute difference between 128 and 128 The effective visible area score is the difference between 1 and the proportion of the effective visible area. The score for the difference between the current frame and the retained frames is 1, which is the difference between the maximum similarity between the current frame and the retained frames. , , , Let be the weighting coefficients, and satisfy: .
3. The method according to claim 1, characterized in that, Steps 3 and 4 include: In step 3, the moving candidate targets include at least one of two-wheeled electric vehicles, motorcycles, tricycles, vans, small trucks, handcarts, pedestrians carrying goods, cargo packages, or other transport objects; the moving candidate target detection is achieved through a target detection model, which includes at least one of YOLO series models, Faster R-CNN, SSD, DETR, lightweight edge detection models, or other detection models capable of outputting target detection boxes and target categories; In step 4, the multi-target tracking algorithm uses the ByteTrack algorithm for two-stage matching: in the first stage, high-confidence detection boxes are matched with existing trajectory prediction box regions, and in the second stage, low-confidence detection boxes are matched with trajectory prediction box regions that were not matched in the first stage. The matching cost can be calculated based on the intersection-union ratio: Where A and B represent the detection box and trajectory prediction box regions, respectively.
4. The method according to claim 1, characterized in that, In step 5, the inter-frame target center point displacement d t Calculate according to the following formula: ; Among them, (x t-1 ,y t-1 ) represents the trajectory τ j The pixel coordinates of the center point of the valid motion candidate target detection box within the valid sampling frame at the (t-1)th sampling time; (x t ,y t ) represents the pixel coordinates of the center point of the detection box of the same valid moving candidate target within the valid sampling frame corresponding to the t-th sampling time; d t It represents the pixel straight-line distance of the target center point movement between two adjacent frames, characterizing the actual movement range of the target; Based on the width w of the effective motion candidate target detection box at the t-th sampling time t and height h t Calculate the target scale s t : ; Displacement ratio r t Calculate according to the following formula: ; Where δ is a stabilizing term to prevent the denominator from being zero; Total cumulative displacement D of the trajectory sum The sum of displacements of all adjacent frames within the complete lifetime of the trajectory: ; Where t0 is the starting frame where the trajectory first appears; t1 is the last valid update frame of the trajectory; D sum The total pixel distance the target moves from its appearance to its disappearance. When the displacement ratio r of the same target trajectory at N consecutive sampling times t All are greater than the first motion threshold θ r Or the cumulative displacement of the center point is greater than the second motion threshold θ D If any one of the conditions is met, the target trajectory is determined to be a valid moving target trajectory, where N is an integer not less than 2; if neither condition is met, it is determined to be a stationary or invalid trajectory and is directly eliminated.
5. The method according to claim 1, characterized in that, The target cargo status in step 7 includes: cargo area ratio : ; in, This represents the total area of the cargo pixels obtained from the image recognition model. This represents the total pixel area of the target vehicle / pedestrian carrier. This refers to the area ratio of goods relative to their carrier. Cargo height percentage : ; in, The maximum height of pixels in the stacked area; The total pixel height of the vehicle carrier itself; The height of the cargo relative to the vehicle body is the percentage of its height. Target cargo load confidence level : ; in, The confidence level for cargo identification output by the image recognition model or multimodal semantic model; , The percentage of cargo area or height; The validation confidence score output by the local rule model, for matching cargo types. Pre-configure rule sets: Each rule Configure corresponding weights ,and If the first If the rule is satisfied, then If not satisfied, then Based on this calculation: ; μ1, μ2, μ3, and μ4 are the weighting coefficients for each indicator, satisfying μ1 + μ2 + μ3 + μ4 = 1, and can be adaptively adjusted according to different scenarios such as urban villages and factories; when When the threshold is exceeded, the target is determined to be a valid cargo target; based on the target category, cargo area or height percentage, cargo placement location, and loading method, different types of non-compliant logistics behaviors are distinguished, and risk warnings are generated, specifically including: The aforementioned illegal logistics activities include at least one of the following: oversized two-wheeled vehicles, three-wheeled vehicles or small trucks carrying goods together, and vans suspected of carrying both passengers and cargo.
6. The method according to claim 1, characterized in that, Step 8 includes: For any valid moving target trajectory τ j Extract the center point of the detection box of the first global sampling frame of the trajectory as the trajectory starting point. The center point of the detection box in the last sampling frame is taken as the trajectory endpoint. ), to obtain the trajectory direction vector Trajectory direction angle Consistency coefficient of entrance and exit directions A j ; ; ; ; in, The preset entrance / exit reference vector is generated from the orientation of street / courtyard entrances in the spatial semantic data of step S1, representing the standard direction of travel towards the closed risk area; This represents the dot product of the trajectory direction vector and the entrance / exit reference vector; This represents the magnitude of the trajectory direction vector; The magnitude of the reference vector at the entrance / exit is represented; δ is a minimal constant to prevent calculation errors caused by a denominator of 0. The closer the value is to 1, the more consistent the target's direction of travel is with the direction of the entrance to the closed courtyard or factory, and the stronger the risk correlation. Target goods proportion Entrance-oriented passage ratio Total frequency of passage per unit time Freight High Frequency Index Multi-model coordination index , Where δ is the stable term and Δt is the length of the statistical time window; This represents the number of different types of freight vehicles appearing in the current statistics window. To preset the total number of categories for all freight vehicle types, N v Total number of all valid moving target trajectories within the time window. This represents the number of trajectories identified as cargo targets within the time window, as determined in step S7. The consistency coefficient A of entrance and exit directions within the time window j The number of trajectories that exceed the directional threshold and point to the entrance of a closed courtyard / factory.
7. The method according to claim 1, characterized in that, In step 9: ; ω1, ω2, ω3, and ω4 represent the weighting coefficients corresponding to the four sub-weights, satisfying the constraint ω1 + ω2 + ω3 + ω4 = 1. This represents the weight of neighboring risk points of interest, used to indicate the spatial correlation between the target observation point and points of interest such as production, warehousing, processing, wholesale, logistics, markets, store backyards, or small factories. It is calculated using a distance decay function. ; in, This represents the straight-line spatial distance from the current observation point to the nearest production / warehousing / processing-related risk point of interest; This represents the distance attenuation control coefficient, which is a preset constant used to control how quickly the score decreases with distance. This represents the constraint weight of narrow passages, used to quantify the aggravating effect of road narrowness on freight violations. Narrow alleys and passageways with small entrances are prone to encroachment on the road for cargo loading and oversized transport. The calculation formula is as follows: ; in, This indicates the actual physical width of the passageway corresponding to the current location; This indicates the preset standard reference road width; min(·,1) constrains the ratio to an upper limit of 1 to prevent negative values when the road is too wide. The narrower the road, the lower the value. The smaller, The closer to 1, the better; if the road width is greater than or equal to the reference width, the minimum value is 1. No risk of narrow passages added; The weight of the entrance / exit node indicates whether the target observation point belongs to the entrance / exit or internal / external connection node of the risk area. If the observation point is the core entrance / exit of an urban village, street / alley entrance, courtyard entrance, store back entrance, factory adjacent entrance, or outer edge entrance of a closed space, then... If the observation point is no more than 30 meters away from the aforementioned entrance, but is not the entrance itself, then If the observation point is a regular road section but leads to a risk area, then... If the observation point is not clearly related to the entrance or exit of the risk area, then ; This is a weighted indicator of road grade or road network accessibility, used to characterize whether the road where the target location is located has significance for concealed logistics passage or internal transshipment. If the location is located in a back street or alley, an internal road in an urban village, the only passage for a factory or courtyard, or a logistics access route, then... If the location is situated on a side road, alleyway connecting road, or secondary road providing access to the risk area, then If the location is situated on a secondary arterial road or a general urban road, but has a connection to the high-risk area, then If the location is situated on a main road, expressway, or open public road and has no clear connection to the risk area, then .
8. The method according to claim 1, characterized in that, Step 9 is followed by step 10: The target cargo load confidence level obtained in step S7 is then used. The consistency coefficient A of the entrance / exit direction obtained in step S8 j Entrance-oriented passage ratio Freight High Frequency Index Synergy Index with Multiple Vehicle Models The results obtained in step S9 Furthermore, by overlaying risk coefficients for pre-defined business time periods, a unified confidence level for hidden logistics risks is calculated through multi-dimensional weighted fusion. Subsequently, risk levels are obtained by segmenting and mapping based on the confidence level of hidden logistics risks, and corresponding risk type labels are output by combining the sub-indicators of each dimension to form the hidden logistics risk identification results. ; λ1, λ2, λ3, λ4, and λ5 represent the weighting coefficients corresponding to the five dimensions, satisfying the constraint λ1+λ2+λ3+λ4+λ5=1; The trajectory feature score represents the strength of the motion characteristics of the target set towards the closed blind area. , This is used to calculate the consistency coefficient of the entrance and exit directions of effective cargo trajectories that meet the criteria of pointing to key entrances or risk areas within a statistical time window. The average value; if no trajectory meets the conditions within the statistical time window, then Set to 0; The score represents the frequency of passage, indicating the level of activity of multiple vehicle types carrying goods passing through within a unit of time. , As a high-frequency reference, 5 times / hour; : Represents the risk score for a specific time period. It is a preset fixed coefficient that distinguishes the risk intensity of different time periods, such as normal daytime delivery and illegal processing and shipping at night. The score is higher during non-business hours at night. Risk levels are obtained by segmenting and mapping the risk confidence of concealed logistics, including: when C L When the risk level is below the first threshold, it is classified as low risk; when C L When the risk level is not lower than the first threshold but lower than the second threshold, it is classified as medium risk; when C L If the risk level is not lower than the second threshold, it is determined to be high-risk; corresponding hidden logistics risk identification results are generated.
9. The method according to claim 8, characterized in that, Step 10 is followed by step 11, which performs a secondary spatial semantic verification to evaluate the comprehensive risk confidence obtained in step S10. Based on geographical constraints, the system performs fine-tuning and outputs the corrected confidence level of hidden logistics risks and the corresponding risk level, which are used to determine the final risk type. When the image recognition model, multimodal semantic recognition model interface is unavailable, the call times out, the output format is abnormal, or the confidence level of hidden logistics risks is low. When the risk level is below the confidence threshold, switch to the local rule model to generate basic hidden logistics risk identification results, including risk type and manual review requirements, to ensure that usable results can still be output in the event of algorithm failure. Based on the corrected confidence level of hidden logistics risks and the corresponding risk level, as well as the multi-dimensional information generated in steps 1-10, a structured risk evidence dataset is generated through standardized encapsulation. Structured risk evidence data includes at least one of the following: location number, collection time, latitude and longitude coordinates, target category, target trajectory, total number of all valid moving target trajectories, number of cargo-carrying target trajectories, target cargo percentage, consistency coefficient of entrance and exit directions, correlation of key entrances, spatial semantic score, risk type, risk level, comprehensive risk confidence of concealed logistics, evidence summary, target screenshot, key frame short video clips, original video path, and manual review requirements. Before generating structured risk evidence data, the process also includes blurring, occluding, pixelating, hashing, or de-identifying the faces, license plates, or other personally identifiable information in the target images, trajectory images, or key video clips.
10. A computer-readable storage medium having a computer program stored thereon, characterized in that, When the computer program is executed by the processor, it implements all the steps of the concealed logistics risk identification method based on the trajectory of moving targets and spatial semantics as described in any one of claims 1 to 9.
