Security check method and device based on image recognition, electronic equipment and storage medium

By performing double rectangle generation and double type detection of security inspection images, the problems of inaccuracy and efficiency in existing security inspection technologies are solved, and efficient and accurate detection of contraband is achieved.

CN120236114APending Publication Date: 2025-07-01SF TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202311870138.2
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2023-12-30
Publication Date
2025-07-01

AI Technical Summary

Technical Problem

Among the existing security inspection technologies, the accuracy of the contraband detection algorithm is low, resulting in low security inspection accuracy, low manual assisted detection efficiency and difficult to guarantee accuracy.

Method used

The security inspection method based on image recognition is adopted to generate the target security inspection image double rectangle, extract the object contour rectangular area and the object external rectangular area, and use the same object type detection model to double-type detection of the two area images to determine whether the target package is an abnormal package.

Benefits of technology

The accuracy and efficiency of security inspection are improved, and the accuracy of identification of target packages is ensured through dual detection, and the detection efficiency is improved.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120236114A_ABST
    Figure CN120236114A_ABST
Patent Text Reader

Abstract

The embodiment of the invention provides a security check method and device based on image recognition, electronic equipment and a storage medium, and relates to the technical field of artificial intelligence. The method comprises the following steps: acquiring a target security inspection image of a target package; performing rectangle generation on the target security check image to obtain an object contour rectangular area and an object external rectangular area; extracting a first area image of the object from the target security check image according to the object contour rectangular area, and extracting a second area image of the object from the target security check image according to the object external rectangular area; detecting the first area image of the object through an object type detection model to obtain a first object type; detecting the second area image of the object through an object type detection model to obtain a second object type; and if at least one of the first object type and the second object type is a preset target object type, determining that the target package is an abnormal package. According to the embodiment of the invention, the security check accuracy can be improved, and the security check efficiency is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of artificial intelligence technology, and in particular, to a security inspection method and device, an electronic device, and a storage medium based on image recognition. Background Art

[0002] The main task of object detection is to find all objects of interest in an image. Currently, object detection can be applied to a security inspection system for detecting prohibited items, such as package detection in the express delivery field. Generally, the steps for detecting prohibited items in the express delivery field usually include: 1. Obtaining the waybill number of the package by six-sided scanning; 2. Using a prohibited item detection algorithm + an X-ray machine to automatically detect the prohibited item information in each image; 3. Manually judging the image to confirm whether there are prohibited items; 4. Binding the image and the code to determine the express package containing prohibited items; 5. Intercepting the package across the network. However, the detection accuracy of the prohibited item detection algorithm is relatively low, and generally requires manual assistance for detection.

[0003] The disadvantages of the related technology are that the accuracy of the detection algorithm is relatively low, resulting in low security inspection accuracy. In addition, using manual assistance for security inspection not only has low security inspection efficiency, but also the accuracy is difficult to guarantee. Summary of the Invention

[0004] The main purpose of the embodiments of the present application is to propose a security inspection recognition method and device, an electronic device, and a storage medium based on image recognition, which can improve the accuracy of security inspection and at the same time improve the security inspection efficiency.

[0005] To achieve the above object, a first aspect of the embodiments of the present application proposes a security inspection method based on image recognition, and the security inspection method includes:

[0006] Obtaining a security inspection imaging image of a target package to obtain a target security inspection image of the target package; wherein, there are original objects in the target package;

[0007] Performing first rectangle generation on the target security inspection image to obtain an object contour rectangle area, and performing second rectangle generation on the target security inspection image to obtain an object circumscribed rectangle area;

[0008] Performing first region extraction on the target security inspection image according to the object contour rectangle area to obtain an object first region image, and performing second region extraction on the target security inspection image according to the object circumscribed rectangle area to obtain an object second region image;

[0009] Performing first object detection on the object first region image through a preset object type detection model to obtain a first object type; wherein, the first object type is used to represent the object type of the original object;

[0010] Performing a second object detection on the image of the second region of the object through the object type detection model to obtain a second object type; wherein, the second object type is used to characterize the object type of the original object.

[0011] If at least one of the first object type and the second object type is a preset target object type, then determine that the target package is an abnormal package.

[0012] In some embodiments, after extracting a second region from the target security inspection image according to the object circumscribed rectangle region to obtain an image of the second region of the object, the security inspection method further includes:

[0013] Obtaining any side of the image of the second region of the object to obtain a target side; wherein, the target side includes a first vertex.

[0014] Calculating an angle between the target side and a preset horizontal line to obtain a target angle; wherein, the horizontal line passes through the first vertex.

[0015] Taking the first vertex as a rotation center point, and rotating the image of the second region of the object according to the target angle to obtain an image of a rotated region of the object; wherein, the target side of the image of the rotated region of the object coincides with the horizontal line.

[0016] Taking the image of the rotated region of the object as the image of the second region of the object.

[0017] In some embodiments, the target side further includes a second vertex; the calculating an angle between the target side and a preset horizontal line to obtain a target angle includes:

[0018] Mapping the second vertex to the horizontal line to obtain a target mapping point; wherein, the first vertex and the target mapping point form a horizontal side.

[0019] Obtaining the coordinates of the first vertex to obtain first vertex coordinates, obtaining the coordinates of the second vertex to obtain second vertex coordinates, and obtaining the coordinates of the target mapping point to obtain target mapping point coordinates.

[0020] Calculating an angle between the horizontal side and the target side according to the first vertex coordinates, the second vertex coordinates, and the target mapping point coordinates to obtain the target angle.

[0021] In some embodiments, after if at least one of the first object type and the second object type is a preset target object type, then determining that the target package is an abnormal package, the security inspection method further includes:

[0022] If the first object type is the target object type, add the original object to a preset first object list as a first candidate object;

[0023] If the second object type is the target object type, add the original object to a preset second object list as a second candidate object;

[0024] Perform a first list merge based on the first object list and the second object list to obtain a target object security inspection list;

[0025] Determine object information based on the target object security inspection list to obtain the object security inspection information of the abnormal package.

[0026] In some embodiments, the performing a first list merge based on the first object list and the second object list to obtain a target object security inspection list includes:

[0027] Perform a first traversal of the first object list to obtain the first candidate object, and perform a second traversal of the second object list to obtain the second candidate object;

[0028] Obtain the outer border of the object first region image of the first candidate object to obtain a first outer border, and obtain the outer border of the object second region image of the second candidate object to obtain a second outer border;

[0029] Calculate the relevance based on the first outer border and the second outer border to obtain target relevance data; wherein the target relevance data represents the relevance between the first candidate object and the second candidate object;

[0030] If the target relevance data is greater than a preset relevance threshold, and if the first object type is the same as the second object type, then delete the second candidate object from the second object list to obtain a third object list;

[0031] Perform a second list merge based on the first object list and the third object list to obtain the target object security inspection list.

[0032] In some embodiments, the obtaining the outer border of the object second region image of the second candidate object to obtain a second outer border includes:

[0033] Obtain the coordinates of the object second region image to obtain object second region image coordinates;

[0034] Inverse calculate the coordinates of the second region image of the object based on the first vertex coordinates and the target angle to obtain the coordinates of the circumscribed rectangle region of the object; wherein, the coordinates of the circumscribed rectangle region of the object indicate the coordinates of the second candidate object in the target security inspection image.

[0035] Generate an outer border based on the coordinates of the circumscribed rectangle region of the object to obtain the second outer border.

[0036] In some embodiments, the obtaining of the security inspection imaging image of the target package to obtain the target security inspection image of the target package includes:

[0037] Extract pixel values from the security inspection imaging image to obtain initial pixel values.

[0038] Map the initial pixel values to a preset color space to obtain target color values.

[0039] Perform threshold segmentation on the security inspection imaging image according to the target color values and preset color thresholds to obtain the target security inspection image.

[0040] To achieve the above object, a second aspect of the embodiments of the present application proposes a security inspection device based on image recognition, and the security inspection device includes:

[0041] An image acquisition module, configured to acquire a security inspection imaging image of a target package to obtain a target security inspection image of the target package; wherein, the target package contains an original object.

[0042] A rectangle generation module, configured to perform a first rectangle generation on the target security inspection image to obtain an object contour rectangle region, and perform a second rectangle generation on the target security inspection image to obtain an object circumscribed rectangle region.

[0043] A region extraction module, configured to perform a first region extraction on the target security inspection image according to the object contour rectangle region to obtain an object first region image, and perform a second region extraction on the target security inspection image according to the object circumscribed rectangle region to obtain an object second region image.

[0044] A first detection module, configured to perform a first object detection on the object first region image through a preset object type detection model to obtain a first object type; wherein, the first object type is used to characterize the object type of the original object.

[0045] A second detection module, configured to perform a second object detection on the object second region image through the object type detection model to obtain a second object type; wherein, the second object type is used to characterize the object type of the original object.

[0046] Anomaly determination module, configured to determine that the target parcel is an abnormal parcel if at least one of the first object type and the second object type is a preset target object type.

[0047] To achieve the above object, a third aspect of the embodiments of the present application provides an electronic device, which includes a memory and a processor. The memory stores a computer program, and when the processor executes the computer program, the security inspection method based on image recognition described in the first aspect above is implemented.

[0048] To achieve the above object, a fourth aspect of the embodiments of the present application provides a storage medium, which is a computer-readable storage medium. The storage medium stores a computer program, and when the computer program is executed by a processor, the security inspection method based on image recognition described in the first aspect above is implemented.

[0049] The embodiments of the present application provide a security inspection method and device, an electronic device, and a storage medium based on image recognition. In the embodiments of the present application, the target parcel contains an original object. After obtaining the target security inspection image of the target parcel, on the one hand, a first rectangle is generated for the target security inspection image to obtain an object contour rectangle area. On the other hand, a second rectangle is generated for the target security inspection image to obtain an object circumscribed rectangle area. Both the object contour rectangle area and the object circumscribed rectangle area can indicate the area occupied by an original object on the target security inspection image, but the object contour rectangle area and the object circumscribed rectangle area are substantially different areas on the target security inspection image. The first area image and the second area image are extracted from the target security inspection image by using the above two rectangle areas. Then, the same object type detection model is used to perform object detection on the first area image and the second area image respectively to obtain a first object type and a second object type. The first object type is used to characterize the object type of the original object, and the second object type is used to characterize the object type of the original object. It is equivalent to performing double type detection on the original object on the target security inspection image. If at least one of the first object type and the second object type is a preset target object type, it is determined that the target parcel is an abnormal parcel. It can be seen that the embodiments of the present disclosure perform double detection on the original object of the target parcel through the above process, improving the accuracy of identifying whether the target parcel is abnormal. In addition, the object contour rectangle area and the object circumscribed rectangle area can be used to accurately and efficiently extract the first area image and the second area image from the target security inspection image, thereby improving the detection efficiency. In summary, the embodiments of the present application can improve the accuracy of security inspection and at the same time improve the security inspection efficiency. Description of the Drawings

[0050] Figure 1 It is a flowchart of the security inspection method based on image recognition provided by the embodiments of the present application;

[0051] Figure 2 is Figure 1 the flowchart of step 101 in

[0052] Figure 3 a schematic diagram of the rectangular area of the object contour;

[0053] Figure 4 a schematic diagram of the circumscribed rectangular area of the object;

[0054] Figure 5 is the flowchart of the security inspection method based on image recognition provided by another embodiment of the present application;

[0055] Figure 6 is Figure 5 the flowchart of step 502 in

[0056] Figure 7 is the flowchart of the security inspection method based on image recognition provided by another embodiment of the present application;

[0057] Figure 8 is Figure 7 the flowchart of step 703 in

[0058] Figure 9 is the module structure block diagram of the security inspection device based on image recognition provided by the embodiment of the present application;

[0059] Figure 10 is the schematic diagram of the hardware structure of the electronic device provided by the embodiment of the present application. Detailed implementation manners

[0060] In order to make the objectives, technical solutions and advantages of the present application clearer, the present application will be further described in detail below with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present application and are not used to limit the present application.

[0061] It should be noted that although the functional modules are divided in the device schematic diagram and the logical order is shown in the flowchart, in some cases, the steps shown or described may be executed in a different order from the module division in the device or the order in the flowchart. The terms "first", "second", etc. in the description, claims and the above drawings are used to distinguish similar objects and do not necessarily need to describe a specific order or sequence.

[0062] Unless otherwise defined, all technical and scientific terms used herein have the same meaning as commonly understood by those of ordinary skill in the technical field to which this application belongs. The terms used herein are only for the purpose of describing the embodiments of this application and are not intended to limit this application.

[0063] First, several nouns involved in the present application are analyzed:

[0064] Artificial Intelligence (AI): It is a new technical science that studies and develops theories, methods, technologies, and application systems for simulating, extending, and expanding human intelligence. Artificial intelligence is a branch of computer science. It attempts to understand the essence of intelligence and produce a new intelligent machine that can react in a way similar to human intelligence. The research in this field includes robots, speech recognition, image recognition, natural language processing, and expert systems, etc. Artificial intelligence can simulate the information processes of human consciousness and thinking. It also uses digital computers or machines controlled by digital computers to simulate, extend, and expand human intelligence, perceive the environment, acquire knowledge, and use knowledge to obtain the best results in terms of theories, methods, technologies, and application systems.

[0065] Image Recognition: It refers to the process of analyzing and recognizing images using computer vision technology. Through image recognition technology, a computer can recognize objects, scenes, text, etc. in an image, thereby achieving automated image understanding and classification. Image recognition technology has extensive applications in fields such as object detection.

[0066] Object Detection: Its main task is to find all the objects of interest (objects) in an image. Currently, object detection can be applied to security inspection systems for detecting contraband.

[0067] Security Inspection: It refers to safety inspection. For example, means such as X-ray scanning and metal detector inspection are used for security inspection.

[0068] In related technologies, when detecting contraband in the express delivery field, it is based on contraband detection algorithms for detection and manual-assisted detection. The disadvantages of related technologies are that the accuracy of the detection algorithm is relatively low, resulting in low security inspection accuracy. In addition, the use of manual-assisted detection leads to low security inspection efficiency and it is difficult to guarantee the accuracy.

[0069] The security inspection method based on image recognition, the security inspection device based on image recognition, the electronic device, and the storage medium provided by the embodiments of the present application aim to improve the accuracy of security inspection and at the same time improve the security inspection efficiency by performing double detection on the original objects in the target security inspection image.

[0070] The security inspection method based on image recognition provided by the embodiments of the present application is applied to the server side, or can also be software running on the server side. The server side can be configured as an independent physical server, or can be configured as a server cluster or distributed system composed of multiple physical servers, or can also be configured as a cloud server providing basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communications, middleware services, domain name services, security services, CDN, and big data and artificial intelligence platforms; the software can be an application that implements the security inspection method based on image recognition, etc., but is not limited to the above forms.

[0071] The present application can be used in many general or special computer system environments or configurations. For example: server computers, multiprocessor systems, microprocessor-based systems, set-top boxes, programmable consumer electronic devices, network PCs, distributed computing environments including any of the above systems or devices, and so on. The present application can be described in the general context of computer-executable instructions executed by a computer, such as program modules. Generally, program modules include routines, programs, objects, components, data structures, etc. that perform specific tasks or implement specific abstract data types. The present application can also be practiced in a distributed computing environment, where tasks are performed by remote processing devices connected through a communication network. In a distributed computing environment, program modules can be located in local and remote computer storage media including storage devices.

[0072] The embodiments of the present application provide a security inspection method based on image recognition, a security inspection device based on image recognition, an electronic device, and a storage medium, which will be specifically described through the following embodiments. First, the security inspection method based on image recognition in the embodiments of the present application will be described.

[0073] It should be noted that in each specific implementation manner of the present application, when it comes to performing relevant processing based on data related to the user's identity or characteristics, such as the security inspection image of the user's package, the user's permission or consent will be obtained first, and moreover, the collection, use, and processing of these data will comply with relevant laws, regulations, and standards.

[0074] Figure 1 FIG. is an optional flowchart of the security inspection method based on image recognition provided by the embodiments of the present application, which may include but is not limited to steps 101 to 106.

[0075] Step 101, obtain a security inspection imaging image of a target package to obtain a target security inspection image of the target package; wherein, the target package contains an original object.

[0076] Step 102: Generate a first rectangle for the target security inspection image to obtain the object contour rectangle area, and generate a second rectangle for the target security inspection image to obtain the object circumscribed rectangle area;

[0077] Step 103: Extract a first area from the target security inspection image according to the object contour rectangle area to obtain the first area image of the object, and extract a second area from the target security inspection image according to the object circumscribed rectangle area to obtain the second area image of the object;

[0078] Step 104: Perform a first object detection on the first area image of the object through a preset object type detection model to obtain a first object type; wherein, the first object type is used to represent the object type of the original object;

[0079] Step 105: Perform a second object detection on the second area image of the object through the object type detection model to obtain a second object type; wherein, the second object type is used to represent the object type of the original object;

[0080] Step 106: If at least one of the first object type and the second object type is a preset target object type, determine that the target package is an abnormal package.

[0081] Steps 101 to 106 shown in the embodiments of the present application, after obtaining the target security inspection image of the target package, on the one hand, generate a first rectangle for the target security inspection image to obtain the object contour rectangle area. On the other hand, generate a second rectangle for the target security inspection image to obtain the object circumscribed rectangle area. Both the object contour rectangle area and the object circumscribed rectangle area can indicate the area occupied by an original object on the target security inspection image, but the object contour rectangle area and the object circumscribed rectangle area are substantially different areas on the target security inspection image. Use the above two rectangle areas to extract the first area image and the second area image from the target security inspection image. Then use the same object type detection model to perform object detection on the first area image and the second area image respectively to obtain the first object type and the second object type. The first object type is used to represent the object type of the original object, and the second object type is used to represent the object type of the original object. It is equivalent to performing a dual type detection on the original object on the target security inspection image. If at least one of the first object type and the second object type is a preset target object type, determine that the target package is an abnormal package. It can be seen that the embodiments of the present disclosure perform a dual detection on the original object of the target package through the above process, improving the accuracy of identifying whether the target package is abnormal. In addition, using the object contour rectangle area and the object circumscribed rectangle area can accurately and efficiently extract the first area image and the second area image from the target security inspection image, thereby improving the detection efficiency. In summary, the embodiments of the present application can improve the accuracy of security inspection and at the same time improve the security inspection efficiency.

[0082] In step 101 of some embodiments, an X-ray imaging image of a target package is obtained to get a target X-ray image of the target package. The target package, also known as an express package, refers to a packaging item used for transporting and delivering goods in the logistics and supply chain fields. The target package is usually a container made of materials such as cardboard boxes, envelopes, and bags, used to load goods and transport them.

[0083] The target package contains original objects. The original objects may include clothes, shoes, documents, water bottles, cosmetics, teaching aids, sticks, etc.

[0084] In one embodiment, a high-speed X-ray machine can be used to obtain the X-ray imaging image of the target package; the X-ray imaging image is uploaded to a server through a network port, and the server uses the X-ray imaging image as the target X-ray image. The high-speed X-ray machine can perform X-ray imaging based on means such as X-ray scanning, CT scanning, and metal detectors.

[0085] The advantage of this embodiment is that the existing high-speed X-ray machine is used to obtain the X-ray imaging image and the image is uploaded based on the network port, which improves the efficiency of image acquisition and image transmission while achieving the acquisition of the X-ray image.

[0086] In one embodiment, referring to Figure 2 , step 101 includes:

[0087] Step 201, extract pixel values from the X-ray imaging image to get initial pixel values;

[0088] Step 202, map the initial pixel values to a preset color space to get target color values;

[0089] Step 203, perform threshold segmentation on the X-ray imaging image according to the target color values and a preset color threshold to get the target X-ray image.

[0090] Specifically, the X-ray imaging image is generally in the three-primary-color space, also known as the RGB space. In the RGB space, the information of the image is expressed by the three primary colors. The three primary colors include red, green, and blue. The color space consists of three parameters: hue, saturation, and value, and can also be called the HSV space. Compared with the RGB space, it is more in line with the way humans perceive colors and is easier to perform color adjustment and analysis. There is a part of the package area in the X-ray imaging image, but in the RGB space, it is difficult to accurately segment out the package area. For this reason, in this embodiment, the X-ray imaging image is converted from the RGB space to the color space (HSV), and then threshold segmentation is performed based on the value space to segment out the package area in the X-ray imaging image.

[0091] Steps 201 to 203 shown in the embodiments of the present application improve the accuracy of obtaining a target security inspection image by segmenting the security inspection imaging image into a package area by mapping the security inspection imaging image from the RGB space to the HSV space and utilizing the color representation ability of the HSV space for the image.

[0092] In step 102 of some embodiments, a first rectangle is generated for the target security inspection image to obtain an object contour rectangle area, and a second rectangle is generated for the target security inspection image to obtain an object circumscribed rectangle area.

[0093] The object contour rectangle area refers to the smallest rectangle area that encloses the object. The boundary of the object contour rectangle area is tangent to the contour of the object. Refer to Figure 3 , Figure 3 shows a schematic diagram of the object contour rectangle area. As Figure 3 shown, on the target security inspection image, the contour of the object is a circle, and the boundary of the object contour rectangle area is tangent to the contour of the object.

[0094] The object circumscribed rectangle area refers to the circumscribed rectangle area that encloses the object. The object circumscribed rectangle area refers to the rectangle area with the smallest area that encloses the object. The boundary of the object circumscribed rectangle area is not necessarily tangent to the contour of the object, but can enclose the object. Refer to Figure 4 , Figure 4 shows a schematic diagram of the object circumscribed rectangle area. As Figure 4 shown, on the target security inspection image, the contour of the object is in the shape of a lightning bolt, and the boundary of the object circumscribed rectangle area is not tangent to the contour of the object, but it is the rectangle area with the smallest area that encloses the object.

[0095] In one embodiment, generating a first rectangle for the target security inspection image in step 102 to obtain an object contour rectangle area includes:

[0096] Using a contour detection algorithm to detect the contour of the object in the target security inspection image to obtain the coordinates of the contour points;

[0097] According to the coordinates of the contour points, determine the minimum abscissa, the maximum abscissa, the minimum ordinate, and the maximum ordinate;

[0098] Based on the minimum abscissa, the maximum abscissa, the minimum ordinate, and the maximum ordinate, generate an object contour matrix area.

[0099] The advantage of this embodiment is that a contour detection algorithm is introduced to determine the coordinates of the contour points, and thus an object contour matrix area is generated based on the coordinates, improving the generation accuracy and efficiency.

[0100] In one embodiment, generating a second rectangle for the target security inspection image in step 102 to obtain an object circumscribed rectangle area includes:

[0101] The contour detection algorithm is used to detect the contour of the object in the target security inspection image, and the coordinates of the contour points are obtained;

[0102] The coordinates of the contour points are input into the circumscribed rectangle generation model to obtain the circumscribed rectangle region of the object.

[0103] The advantage of this embodiment is that the contour detection algorithm and the circumscribed rectangle generation model are introduced to jointly realize the generation of the circumscribed rectangle region of the object, improving the generation accuracy and efficiency.

[0104] In step 103 of some embodiments, the first region extraction is performed on the target security inspection image according to the object contour rectangle region to obtain the first region image of the object, and the second region extraction is performed on the target security inspection image according to the circumscribed rectangle region of the object to obtain the second region image of the object.

[0105] Specifically, after determining the object contour rectangle region, the first region image of the object can be extracted from the target security inspection image based on the coordinates of the object contour rectangle region. Similarly, after determining the circumscribed rectangle region of the object, the second region image of the object can be extracted from the target security inspection image based on the coordinates of the circumscribed rectangle region of the object.

[0106] It should be noted that Figure 3 the shown object contour rectangle region and Figure 4 the shown circumscribed rectangle region of the object are not the same object, but in essence, each object will have an object contour rectangle region and a circumscribed rectangle region of the object.

[0107] In one embodiment, referring to Figure 5 , after step 103, the security inspection method based on image recognition provided in this embodiment may further include:

[0108] Step 501, obtaining any side of the second region image of the object to obtain the target side; wherein, the target side includes the first vertex;

[0109] Step 502, calculating the angle between the target side and the preset horizontal line to obtain the target angle; wherein, the horizontal line passes through the first vertex;

[0110] Step 503, using the first vertex as the rotation center point, and rotating the second region image of the object according to the target angle to obtain the rotated region image of the object; wherein, at least one side of the rotated rectangle region of the object coincides with the horizontal line;

[0111] Step 504, using the rotated region image of the object as the second region image of the object.

[0112] In step 501, the images of the second regions of the objects correspond one-to-one with the circumscribed rectangular regions of the objects. There are a total of 4 sides, and any one of the 4 sides is selected as the target side. The target side includes a first vertex and a second vertex. The connection line between the first vertex and the second vertex forms the target side. Usually, the first vertex is the top-leftmost vertex of the circumscribed rectangular region of the object.

[0113] In step 502, the target angle indicates the angle between the target side and the horizontal line. If the horizontal line passes through the first vertex, it means that the first vertex is the intersection point of the target side and the horizontal line.

[0114] In one embodiment, referring to Figure 6 , step 502 includes:

[0115] Step 601, map the second vertex to the horizontal line to obtain the target mapping point; wherein, the first vertex and the target mapping point form a horizontal side;

[0116] Step 602, obtain the coordinates of the first vertex to get the first vertex coordinates, obtain the coordinates of the second vertex to get the second vertex coordinates, and obtain the coordinates of the target mapping point to get the target mapping point coordinates;

[0117] Step 603, calculate the angle between the horizontal side and the target side based on the first vertex coordinates, the second vertex coordinates, and the target mapping point coordinates to obtain the target angle.

[0118] In step 601, mapping the second vertex to the horizontal line can be mapping the target side onto the horizontal line to obtain the horizontal side, and extracting the mapping point corresponding to the second vertex from the horizontal side to obtain the target mapping point. It can also be drawing a vertical line from the second vertex to the horizontal line, and the intersection point of the horizontal line and the vertical line is used as the target mapping point.

[0119] In step 602, the coordinates of the first vertex, the second vertex, and the target mapping point can be obtained on the established rectangular coordinate system. Among them, the first vertex coordinates include the first vertex abscissa and the first vertex ordinate. The second vertex coordinates include the second vertex abscissa and the second vertex ordinate. The target mapping point coordinates include the mapping point abscissa and the mapping point ordinate. The mapping point abscissa is the same as the second vertex abscissa, and the mapping point ordinate is the same as the first vertex ordinate.

[0120] In step 603, the first vertex, the second vertex, and the target mapping point essentially indicate the three vertices of the right triangle formed between the target side and the horizontal line. The first vertex and the target mapping point form the horizontal side, the second vertex and the target mapping point form the vertical side, and the target side is equivalent to the hypotenuse. Therefore, using trigonometric function knowledge, based on the first vertex coordinates, the second vertex coordinates, and the target mapping point coordinates, the angle between the horizontal side and the target side can be calculated to obtain the target angle.

[0121] In one embodiment, step 603 includes:

[0122] Determine the length of the target edge according to the first vertex coordinate and the second vertex coordinate to obtain a first length;

[0123] Determine the length of the horizontal edge according to the first vertex coordinate and the target mapping point coordinate to obtain a second length;

[0124] Determine the length of the vertical edge according to the target mapping point coordinate and the second vertex coordinate to obtain a third length;

[0125] Calculate the angle between the horizontal edge and the target edge according to the first length, the second length, and the third length to obtain a target angle.

[0126] It should be noted that, based on trigonometric function knowledge, such as the Pythagorean theorem formula, the first length, the second length, and the third length can be calculated. Then, based on the cosine theorem formula, the angle between the horizontal edge and the target edge can be calculated to obtain the target angle. The specific calculation process is not described in detail in this embodiment.

[0127] Steps 601 to 603 shown in the embodiments of the present application adopt a method of mapping the second vertex to the horizontal line, thereby determining the target mapping point, and then calculating the target angle, which improves the calculation efficiency while ensuring the calculation accuracy.

[0128] In step 503, taking the first vertex as the rotation center point, and rotating the second region image of the object according to the target angle to obtain an object rotation region image; wherein, the target edge of the object rotation region image coincides with the horizontal line.

[0129] Specifically, taking the first vertex as the rotation center point is equivalent to keeping the first vertex stationary and rotating the four edges of the second region image of the object to obtain an object rotation region image.

[0130] The above rotation can be counterclockwise rotation or clockwise rotation, but the target edge needs to be rotated to coincide with the horizontal line.

[0131] After obtaining the object rotation region image, in step 504, the object rotation rectangular region image is used as the second region image of the object.

[0132] Such as Figure 4As shown, for the circumscribed rectangle region of an object, it is often neither parallel nor perpendicular to the horizontal line. However, it is actually found that the target package mostly contains box structures, and when placing the object, it is more likely to be placed based on the structure of the box. In other words, the object is likely to be parallel or perpendicular to the horizontal line. Therefore, in this embodiment, the second region image of the object is rotated based on the target angle, and the target side of the rotated object region image coincides with the horizontal line, that is, it is parallel to the horizontal line. After using the rotated object region image as the second region image of the object, when subsequently using the object type detection model to detect the second region image of the object, higher detection accuracy can be achieved.

[0133] Steps 501 to 504 shown in the embodiments of the present application can maximize the restoration of the actual situation of placing the object in the package by rotating the image, and help improve the accuracy of security inspection.

[0134] In steps 104 to 105 of some embodiments, the object type detection model is a deep learning network model for classifying images. For example, the object type detection model can be a CNN model, a VIT model (Vision Transformer, VIT), etc. The same object type detection model is used to detect the object in the first region image and the second region image respectively to obtain the first object type and the second object type. The first object type is used to represent the object type of the original object, and the second object type is also used to represent the object type of the original object. It is equivalent to performing a double type detection on the original object in the target security inspection image.

[0135] In step 106 of some embodiments, if at least one of the first object type and the second object type is the preset target object type, it is determined that the target package is an abnormal package.

[0136] Referring to the above, the original objects in the target package can include clothes, shoes, documents, water bottles, cosmetics, teaching aids, sticks, etc. For example, after detecting the object in package b1, the first object type obtained includes clothes, shoes, and documents, and the second object type obtained includes clothes, shoes, and documents. Since these object types do not belong to the target object type, it is determined that package b1 is a normal package. Another example is that after detecting the object in package b2, the first object type obtained includes documents and water bottles, and the second object type obtained includes documents, water bottles, and cosmetics. Since the water bottle and cosmetics belong to the target object type, it is determined that package b2 is an abnormal package. Another example is that after detecting the object in package b3, the first object type obtained includes sticks, and the second object type obtained includes teaching aids and sticks. Since the stick and teaching aid belong to the target object type, it is determined that package b3 is an abnormal package.

[0137] In one embodiment, after step 106, referring to Figure 7 , the security inspection method based on image recognition provided in this embodiment further includes:

[0138] Step 701, if the first object type is the target object type, add the original object to a preset first object list as the first candidate object;

[0139] Step 702, if the second object type is the target object type, add the original object to a preset second object list as the second candidate object;

[0140] Step 703, perform a first list merge based on the first object list and the second object list to obtain a target object security inspection list;

[0141] Step 704, determine object information based on the target object security inspection list to obtain the object security inspection information of the abnormal package.

[0142] In an example, based on the above, if the first object type of a stick belongs to the target object type, then add the stick as the first candidate object W 11 to the first object list. The first object list is {the first candidate object W 11}. If the second object type of teaching aids belongs to the target object type, add the teaching aids as the second candidate object W 21 to the second object list. Similarly, add the stick as the second candidate object W 22 to the second object list. The second object list is {the second candidate object W 21 , the second candidate object W 22}. Perform a first list merge on the first object list and the second object list to obtain the target object security inspection list as {the first candidate object W 11 , the second candidate object W 21 , the second candidate object W 22}. Subsequently, based on the target object security inspection list {the first candidate object W 11 , the second candidate object W 21 , the second candidate object W 22} perform object information determination, and the obtained object security inspection information can be "prohibited items include sticks, teaching aids, sticks".

[0143] Steps 701 to 704 illustrated in the embodiments of the present application, based on merging two lists to obtain the final target object security inspection list, greatly improve the detection accuracy compared with the prior art. In addition, through experiments, the recall rate of object detection in the embodiments of the present application can rise from about 82% of the prior art to 95%, and the effect is very obvious.

[0144] It should be noted that since the embodiments of the present application perform double detection on the same original object, when both the first object type and the second object type are target types, the target object security inspection list will include duplicate objects. For example, in the above example, the target object security inspection information includes two sticks. However, in fact, the occurrence of duplicate objects may also be due to the presence of more than two identical objects in the package, so object filtering cannot be simply performed. Therefore, in one embodiment, when merging the first object list and the second object list, it is necessary to effectively identify the same object to optimize the target security inspection list.

[0145] In the specific implementation of this embodiment, referring to Figure 8 , step 703 includes:

[0146] Step 801, perform a first traversal on the first object list to obtain first candidate objects, and perform a second traversal on the second object list to obtain second candidate objects;

[0147] Step 802, obtain the outer border of the object first region image of the first candidate object to obtain a first outer border, and obtain the outer border of the object second region image of the second candidate object to obtain a second outer border;

[0148] Step 803, calculate the correlation based on the first outer border and the second outer border to obtain target correlation data; wherein, the target correlation data represents the correlation between the first candidate object and the second candidate object;

[0149] Step 804, if the target correlation data is greater than a preset correlation threshold, and if the first object type is the same as the second object type, then delete the second candidate object from the second object list to obtain a third object list;

[0150] Step 805, perform a second list merge based on the first object list and the third object list to obtain a target object security inspection list.

[0151] Specifically, take out one first candidate object from the first object list in sequence, and then traverse each second candidate object in the second object list and compare it with the first candidate object respectively. When the correlation data between the two objects is greater than the correlation threshold, and the first object type is the same as the second object type (for example, both the first object type is a stick and the second object type is also a stick), then delete the second candidate object from the second object list to obtain a third object list. For example, delete the second candidate object W22 from the second object list, and the third object list is {second candidate object W 21}. Perform a second list merge on the first object list and the third object list to obtain a target object security inspection list as {first candidate object W 11 , second candidate object W 21}, Subsequently, according to the security inspection list of the target object for the {first candidate object W 11 , the second candidate object W 21} to determine the object information, and the obtained object security inspection information can be "prohibited items include sticks and teaching aids".

[0152] It should be noted that the above calculation of the correlation degree based on the first outer frame and the second outer frame can be to calculate the intersection ratio (IOU) between the first outer frame and the second outer frame to obtain the correlation degree data. The full name of IOU is Intersection over Union.

[0153] The above correlation degree threshold can be 0.4. The specific value can be set according to actual needs, and this embodiment does not make specific limitations on this.

[0154] Steps 801 to 805 shown in the embodiments of the present application can accurately and efficiently merge the first object list and the second object list, while ensuring the accuracy of object detection, reducing the duplication of the same objects in the list.

[0155] In one embodiment, obtaining the outer frame of the object first region image of the first candidate object in step 802 to obtain the first outer frame includes: obtaining the coordinates of the object first region image to obtain the object first region image coordinates; performing coordinate inverse calculation according to the object first region image coordinates to obtain the coordinates of the object contour rectangular region, where the coordinates of the object contour rectangular region indicate the coordinates of the first candidate object in the target security inspection image; generating the first outer frame according to the coordinates of the object contour rectangular region.

[0156] In this embodiment, the object first region image is obtained by region extraction of the target security inspection image based on the object contour rectangular region. Therefore, there is a specific corresponding relationship between the object first region image and the object contour rectangular region in terms of coordinates. After performing coordinate inverse calculation, the first outer frame is generated based on the coordinates of the object contour matrix region.

[0157] The advantage of this embodiment is that while being able to generate the first outer frame, it also improves the efficiency of generating the first outer frame.

[0158] In one embodiment, obtaining the outer frame of the object second region image of the second candidate object in step 802 to obtain the second outer frame includes:

[0159] Obtaining the coordinates of the object second region image to obtain the object second region image coordinates;

[0160] Inverse calculate the coordinates of the second region image of the object based on the first vertex coordinates and the target angle to obtain the coordinates of the circumscribed rectangle region of the object; wherein, the coordinates of the circumscribed rectangle region of the object indicate the coordinates of the second candidate object in the target security inspection image.

[0161] Generate a second outer border based on the coordinates of the circumscribed rectangle region of the object.

[0162] Different from generating the first outer border, when generating the second outer border in the embodiments of the present application, the first vertex coordinates and the target angle also need to be considered. This is because when generating the second region image of the object, after extracting the region of the target security inspection image using the circumscribed rectangle region of the object, the image is rotated based on the first vertex and the target angle. Therefore, in this embodiment, it is necessary to restore the coordinates of the second region image of the object before rotation based on the first vertex coordinates and the target angle, and then determine the coordinates of the circumscribed rectangle region of the object based on the coordinate correspondence with the circumscribed rectangle region of the object. Finally, generate a second outer border based on the coordinates of the circumscribed rectangle region of the object.

[0163] The advantage of this embodiment is that when generating the second outer border, the parameters generated during the previous image rotation are fully utilized, which can greatly improve the efficiency of generating the second outer border while being able to generate the second outer border.

[0164] Please refer to Figure 9 , the embodiments of the present application also provide a security inspection device based on image recognition, which can implement the above-mentioned security inspection method based on image recognition. Figure 9It is a block diagram of the module structure of the security inspection device based on image recognition provided by the embodiments of the present application. The device includes: an image acquisition module 901, a rectangle generation module 902, a region extraction module 903, a first detection module 904, a second detection module 905, and an anomaly determination module 906. Among them, the image acquisition module 901 is used to acquire the security inspection imaging image of the target package to obtain the target security inspection image of the target package; wherein, there is an original object in the target package; the rectangle generation module 902 is used to perform the first rectangle generation on the target security inspection image to obtain the object contour rectangle region, and perform the second rectangle generation on the target security inspection image to obtain the object circumscribed rectangle region; the region extraction module 903 is used to perform the first region extraction on the target security inspection image according to the object contour rectangle region to obtain the object first region image, and perform the second region extraction on the target security inspection image according to the object circumscribed rectangle region to obtain the object second region image; the first detection module 904 is used to perform the first object detection on the object first region image through a preset object type detection model to obtain the first object type; wherein, the first object type is used to characterize the object type of the original object; the second detection module 905 is used to perform the second object detection on the object second region image through the object type detection model to obtain the second object type; wherein, the second object type is used to characterize the object type of the original object; the anomaly determination module 906 is used to determine that the target package is an abnormal package if at least one of the first object type and the second object type is a preset target object type.

[0165] In one embodiment, after performing the second region extraction on the target security inspection image according to the object circumscribed rectangle region to obtain the object second region image, the region extraction module 903 is further used to: obtain any side of the object second region image to obtain the target side; wherein, the target side includes the first vertex; calculate the angle between the target side and a preset horizontal line to obtain the target angle; wherein, the horizontal line passes through the first vertex; use the first vertex as the rotation center point, and rotate the object second region image according to the target angle to obtain the object rotated region image; wherein, at least one side of the object rotated rectangle region coincides with the horizontal line; use the object rotated region image as the object second region image.

[0166] In one embodiment, after determining that the target package is an abnormal package, the security inspection device based on image recognition further includes an information extraction module, which is used to: if the first object type is the target object type, add the original object as the first candidate object to a preset first object list; if the second object type is the target object type, add the original object as the second candidate object to a preset second object list; perform the first list merging according to the first object list and the second object list to obtain the target object security inspection list; determine the object security inspection information of the abnormal package according to the target object security inspection list.

[0167] It should be noted that the specific implementation of the security inspection device based on image recognition is basically the same as the specific embodiments of the above-mentioned security inspection method based on image recognition, and will not be elaborated here.

[0168] The embodiments of the present application also provide an electronic device, which includes: a memory, a processor, a program stored on the memory and executable on the processor, and a data bus for realizing the connection and communication between the processor and the memory. When the program is executed by the processor, it realizes the above-mentioned security inspection method based on image recognition. The electronic device can be any intelligent terminal including a tablet computer, an in-vehicle computer, etc.

[0169] Please refer to Figure 10 , Figure 10 which schematically shows the hardware structure of an electronic device in another embodiment. The electronic device includes:

[0170] A processor 1001, which can be implemented in ways such as a general-purpose CPU (Central Processing Unit), a microprocessor, an Application Specific Integrated Circuit (ASIC), or one or more integrated circuits, and is used to execute relevant programs to implement the technical solutions provided by the embodiments of the present application;

[0171] A memory 1002, which can be implemented in forms such as a Read Only Memory (ROM), a static storage device, a dynamic storage device, or a Random Access Memory (RAM). The memory 1002 can store an operating system and other application programs. When implementing the technical solutions provided by the embodiments of this specification through software or firmware, the relevant program codes are stored in the memory 1002 and are called by the processor 1001 to execute the security inspection method based on image recognition of the embodiments of the present application;

[0172] An input / output interface 1003, which is used to realize information input and output;

[0173] A communication interface 1004, which is used to realize the communication interaction between this device and other devices, and can communicate through wired means (such as USB, network cable, etc.) or wireless means (such as mobile network, WIFI, Bluetooth, etc.);

[0174] A bus 1005, which transmits information between various components of the device (such as the processor 1001, the memory 1002, the input / output interface 1003, and the communication interface 1004);

[0175] Among them, the processor 1001, the memory 1002, the input / output interface 1003, and the communication interface 1004 are communicatively connected to each other inside the device through the bus 1005.

[0176] The embodiments of the present application also provide a storage medium, which is a computer-readable storage medium for computer-readable storage. The storage medium stores one or more programs, and the one or more programs can be executed by one or more processors to implement the above-mentioned security inspection method based on image recognition.

[0177] As a non-transitory computer-readable storage medium, the memory can be used to store non-transitory software programs and non-transitory computer-executable programs. In addition, the memory can include high-speed random access memory, and can also include non-transitory memory, such as at least one magnetic disk storage device, a flash memory device, or other non-transitory solid-state storage devices. In some embodiments, the memory may optionally include a memory remotely located relative to the processor, and these remote memories can be connected to the processor through a network. Examples of the above-mentioned network include but are not limited to the Internet, an enterprise intranet, a local area network, a mobile communication network, and combinations thereof.

[0178] The embodiments described in the embodiments of the present application are for more clearly illustrating the technical solutions of the embodiments of the present application, and do not constitute a limitation to the technical solutions provided by the embodiments of the present application. Those skilled in the art will know that with the evolution of technology and the emergence of new application scenarios, the technical solutions provided by the embodiments of the present application are equally applicable to similar technical problems.

[0179] Those skilled in the art can understand that the technical solutions shown in the figures do not constitute a limitation to the embodiments of the present application, and may include more or fewer steps than those shown in the figures, or combine certain steps, or different steps.

[0180] The device embodiments described above are merely illustrative. The units described as separate components may or may not be physically separated, that is, they may be located in one place, or may be distributed to multiple network units. Some or all of the modules can be selected according to actual needs to achieve the purpose of the solution of this embodiment.

[0181] Those of ordinary skill in the art can understand that all or some of the steps in the methods disclosed above, and the functional modules / units in the systems and devices can be implemented as software, firmware, hardware, and appropriate combinations thereof.

[0182] In the description of this application and the above-mentioned drawings, terms such as "first", "second", "third", "fourth", etc. (if any) are used to distinguish similar objects and do not necessarily describe a specific order or sequence. It should be understood that the data used in this way can be interchanged under appropriate circumstances so that the embodiments of this application described here can be implemented in an order different from those illustrated or described here. In addition, the terms "comprising" and "having" and any variations thereof are intended to cover non-exclusive inclusion. For example, a process, method, system, product, or device that comprises a series of steps or units does not necessarily have to be limited to those steps or units clearly listed, but may include other steps or units not clearly listed or inherent to these processes, methods, products, or devices.

[0183] It should be understood that in this application, "at least one (item)" means one or more, and "a plurality" means two or more. "And / or" is used to describe the association relationship of associated objects and indicates that there can be three relationships. For example, "A and / or B" can mean: only A exists, only B exists, and both A and B exist at the same time. Here, A and B can be singular or plural. The character " / " generally indicates that the associated objects before and after are in an "or" relationship. "At least one (one) of the following" or its similar expression refers to any combination of these items, including any combination of single items (ones) or plural items (ones). For example, at least one (one) of a, b, or c can mean: a, b, c, "a and b", "a and c", "b and c", or "a and b and c", where a, b, and c can be single or multiple.

[0184] In several embodiments provided in this application, it should be understood that the disclosed devices and methods can be implemented in other ways. For example, the device embodiments described above are merely illustrative. For example, the division of the units is only a logical function division, and there can be other division methods in actual implementation. For example, multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. The displayed or discussed couplings or direct couplings or communication connections to each other can be through some interfaces. The indirect couplings or communication connections of devices or units can be in electrical, mechanical, or other forms.

[0185] The units described as separate components may or may not be physically separated. The components shown as units may or may not be physical units, that is, they can be located in one place or distributed to multiple network units. Some or all of the units can be selected according to actual needs to achieve the purpose of the solution of this embodiment.

[0186] In addition, in each embodiment of the present application, each functional unit may be integrated into one processing unit, or each unit may exist physically alone, or two or more units may be integrated into one unit. The above-mentioned integrated unit may be implemented in the form of hardware or in the form of a software functional unit.

[0187] If the above-mentioned integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on such an understanding, the technical solution of the present application, in essence, or the part that contributes to the prior art, or all or part of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes multiple instructions for causing an electronic device (which may be a personal computer, a server, or a network device, etc.) to execute all or part of the steps of the methods described in each embodiment of the present application. The foregoing storage medium includes: various media that can store programs such as USB flash drives, mobile hard disks, read-only memories (ROM), random access memories (RAM), magnetic disks, or optical discs.

[0188] The preferred embodiments of the embodiments of the present application have been described above with reference to the accompanying drawings, but this does not limit the scope of the rights of the embodiments of the present application. Any modification, equivalent replacement, and improvement made by those skilled in the art without departing from the scope and essence of the embodiments of the present application shall be within the scope of the rights of the embodiments of the present application.

Claims

1. An image recognition-based security inspection method, characterized in that, The security inspection method includes: Obtaining a security inspection imaging image of a target package to obtain a target security inspection image of the target package; wherein, the target package contains an original object; Performing first rectangle generation on the target security inspection image to obtain an object contour rectangle region, and performing second rectangle generation on the target security inspection image to obtain an object circumscribed rectangle region; Performing first region extraction on the target security inspection image according to the object contour rectangle region to obtain an object first region image, and performing second region extraction on the target security inspection image according to the object circumscribed rectangle region to obtain an object second region image; Performing first object detection on the object first region image through a preset object type detection model to obtain a first object type; wherein, the first object type is used to characterize the object type of the original object; Performing second object detection on the object second region image through the object type detection model to obtain a second object type; wherein, the second object type is used to characterize the object type of the original object; If at least one of the first object type and the second object type is a preset target object type, determining that the target package is an abnormal package.

2. The security inspection method according to claim 1, wherein After performing second region extraction on the target security inspection image according to the object circumscribed rectangle region to obtain an object second region image, the security inspection method further includes: Obtaining any side of the object second region image to obtain a target side; wherein, the target side includes a first vertex; Calculating an angle between the target side and a preset horizontal line to obtain a target angle; wherein, the horizontal line passes through the first vertex; Taking the first vertex as a rotation center point, and rotating the object second region image according to the target angle to obtain an object rotated region image; wherein, the target side of the object rotated region image coincides with the horizontal line; Taking the object rotated region image as the object second region image.

3. The security inspection method according to claim 2, characterized in that, The target side further includes a second vertex; the calculating an angle between the target side and a preset horizontal line to obtain a target angle includes: Mapping the second vertex to the horizontal line to obtain a target mapping point; wherein, the first vertex and the target mapping point form a horizontal side; Obtaining the coordinates of the first vertex to obtain first vertex coordinates, obtaining the coordinates of the second vertex to obtain second vertex coordinates, and obtaining the coordinates of the target mapping point to obtain target mapping point coordinates; Calculating an angle between the horizontal side and the target side according to the first vertex coordinates, the second vertex coordinates, and the target mapping point coordinates to obtain the target angle.

4. The security inspection method according to claim 3, wherein After if at least one of the first object type and the second object type is a preset target object type, determining that the target package is an abnormal package, the security inspection method further includes: If the first object type is the target object type, adding the original object to a preset first object list as a first candidate object; If the second object type is the target object type, add the original object as a second candidate object to a preset second object list; Perform a first list merge based on the first object list and the second object list to obtain a target object security inspection list; Determine object information based on the target object security inspection list to obtain the object security inspection information of the abnormal package.

5. The security inspection method according to claim 4, wherein The performing a first list merge based on the first object list and the second object list to obtain a target object security inspection list includes: Perform a first traversal of the first object list to obtain the first candidate object, and perform a second traversal of the second object list to obtain the second candidate object; Obtain the outer border of the object first region image of the first candidate object to obtain a first outer border, and obtain the outer border of the object second region image of the second candidate object to obtain a second outer border; Calculate the relevance based on the first outer border and the second outer border to obtain target relevance data; wherein, the target relevance data represents the relevance between the first candidate object and the second candidate object; If the target relevance data is greater than a preset relevance threshold, and if the first object type is the same as the second object type, delete the second candidate object from the second object list to obtain a third object list; Perform a second list merge based on the first object list and the third object list to obtain the target object security inspection list.

6. The security inspection method according to claim 5, characterized in that, The obtaining the outer border of the object second region image of the second candidate object to obtain a second outer border includes: Obtain the coordinates of the object second region image to obtain object second region image coordinates; Perform coordinate inverse calculation on the object second region image coordinates according to the first vertex coordinates and the target angle to obtain the coordinates of the object circumscribed rectangle region; wherein, the coordinates of the object circumscribed rectangle region indicate the coordinates of the second candidate object in the target security inspection image; Generate an outer border according to the coordinates of the object circumscribed rectangle region to obtain the second outer border.

7. The security inspection method according to any one of claims 1 to 6, characterized in that The obtaining the security inspection imaging image of the target package to obtain the target security inspection image of the target package includes: Extract pixel values from the security inspection imaging image to obtain initial pixel values; Map the initial pixel values to a preset color space to obtain target color values; Perform threshold segmentation on the security inspection imaging image according to the target color values and a preset color threshold to obtain the target security inspection image.

8. An image recognition-based security inspection device, characterized in that, The security inspection device includes: An image acquisition module, configured to acquire a security inspection imaging image of a target package to obtain a target security inspection image of the target package; wherein, the target package contains an original object; A rectangle generation module, configured to perform a first rectangle generation on the target security inspection image to obtain an object contour rectangle region, and perform a second rectangle generation on the target security inspection image to obtain an object circumscribed rectangle region; The region extraction module is used to perform a first region extraction on the target security inspection image according to the rectangular region of the object contour to obtain the first region image of the object, and perform a second region extraction on the target security inspection image according to the circumscribed rectangle region of the object to obtain the second region image of the object; The first detection module is used to perform a first object detection on the first region image of the object through a preset object type detection model to obtain a first object type; wherein, the first object type is used to characterize the object type of the original object; The second detection module is used to perform a second object detection on the second region image of the object through the object type detection model to obtain a second object type; wherein, the second object type is used to characterize the object type of the original object; The anomaly determination module is used to determine that the target package is an abnormal package if at least one of the first object type and the second object type is a preset target object type.

9. An electronic device, characterized in that, The electronic device includes a memory and a processor, the memory stores a computer program, and when the processor executes the computer program, it implements the image recognition-based security inspection method according to any one of claims 1 to 7.

10. A computer-readable storage medium storing a computer program, characterized in that, When the computer program is executed by the processor, it implements the image recognition-based security inspection method according to any one of claims 1 to 7.