CN111597857A - Logistics package detection method, device and equipment and readable storage medium - Google Patents

Logistics package detection method, device and equipment and readable storage medium Download PDF

Info

Publication number
CN111597857A
CN111597857A CN201910126340.1A CN201910126340A CN111597857A CN 111597857 A CN111597857 A CN 111597857A CN 201910126340 A CN201910126340 A CN 201910126340A CN 111597857 A CN111597857 A CN 111597857A
Authority
CN
China
Prior art keywords
image
information
target
detection
package
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Granted
Application number
CN201910126340.1A
Other languages
Chinese (zh)
Other versions
CN111597857B (en
Inventor
任子辉
许绍云
李功燕
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Zhongke Weizhi Intelligent Manufacturing Technology Jiangsu Co ltd
Original Assignee
Institute of Microelectronics of CAS
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Institute of Microelectronics of CAS filed Critical Institute of Microelectronics of CAS
Priority to CN201910126340.1A priority Critical patent/CN111597857B/en
Publication of CN111597857A publication Critical patent/CN111597857A/en
Application granted granted Critical
Publication of CN111597857B publication Critical patent/CN111597857B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06VIMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
    • G06V20/00Scenes; Scene-specific elements
    • G06V20/10Terrestrial scenes
    • BPERFORMING OPERATIONS; TRANSPORTING
    • B07SEPARATING SOLIDS FROM SOLIDS; SORTING
    • B07CPOSTAL SORTING; SORTING INDIVIDUAL ARTICLES, OR BULK MATERIAL FIT TO BE SORTED PIECE-MEAL, e.g. BY PICKING
    • B07C5/00Sorting according to a characteristic or feature of the articles or material being sorted, e.g. by control effected by devices which detect or measure such characteristic or feature; Sorting by manually actuated devices, e.g. switches
    • B07C5/34Sorting according to other particular properties
    • B07C5/342Sorting according to other particular properties according to optical properties, e.g. colour
    • B07C5/3422Sorting according to other particular properties according to optical properties, e.g. colour using video scanning devices, e.g. TV-cameras
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06NCOMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
    • G06N3/00Computing arrangements based on biological models
    • G06N3/02Neural networks
    • G06N3/04Architecture, e.g. interconnection topology
    • G06N3/045Combinations of networks
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06QINFORMATION AND COMMUNICATION TECHNOLOGY [ICT] SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES; SYSTEMS OR METHODS SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES, NOT OTHERWISE PROVIDED FOR
    • G06Q10/00Administration; Management
    • G06Q10/08Logistics, e.g. warehousing, loading or distribution; Inventory or stock management
    • G06Q10/083Shipping
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06VIMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
    • G06V10/00Arrangements for image or video recognition or understanding
    • G06V10/40Extraction of image or video features
    • G06V10/44Local feature extraction by analysis of parts of the pattern, e.g. by detecting edges, contours, loops, corners, strokes or intersections; Connectivity analysis, e.g. of connected components
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06VIMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
    • G06V2201/00Indexing scheme relating to image or video recognition or understanding
    • G06V2201/06Recognition of objects for industrial automation

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Business, Economics & Management (AREA)
  • Multimedia (AREA)
  • Economics (AREA)
  • Software Systems (AREA)
  • Life Sciences & Earth Sciences (AREA)
  • Evolutionary Computation (AREA)
  • General Health & Medical Sciences (AREA)
  • Molecular Biology (AREA)
  • Computing Systems (AREA)
  • General Engineering & Computer Science (AREA)
  • Computational Linguistics (AREA)
  • Mathematical Physics (AREA)
  • Biophysics (AREA)
  • Biomedical Technology (AREA)
  • Artificial Intelligence (AREA)
  • Computer Vision & Pattern Recognition (AREA)
  • Data Mining & Analysis (AREA)
  • Development Economics (AREA)
  • Health & Medical Sciences (AREA)
  • Entrepreneurship & Innovation (AREA)
  • Human Resources & Organizations (AREA)
  • Marketing (AREA)
  • Operations Research (AREA)
  • Quality & Reliability (AREA)
  • Strategic Management (AREA)
  • Tourism & Hospitality (AREA)
  • General Business, Economics & Management (AREA)
  • Image Analysis (AREA)

Abstract

本发明公开了一种物流包裹检测方法,包括:采集位于分拣传送带上的包裹的图像;将图像中的每个坐标的X坐标值构成的第一数据矩阵和Y坐标值构成的第二数据矩阵,以及图像的灰度值融合为图像的图像信息;通过预设的检测模型对图像信息进行处理,获得图像信息中包含的目标的类别,以及覆盖每个目标的边界框的位置信息;图像信息中包含的目标至少包括包裹和风琴板。该方法可以确定图像中覆盖每个目标的边界框的位置信息,也就是每个目标的位置信息,且检测过程中添加了图像的坐标信息,从而提高了物流包裹在分拣传送带上的位置的检测精度和包裹分拣的准确率。本发明公开的一种物流包裹检测装置、设备及可读存储介质,也同样具有上述技术效果。

Figure 201910126340

The invention discloses a method for detecting a logistics package, comprising: collecting an image of a package located on a sorting conveyor; a first data matrix consisting of X coordinate values of each coordinate in the image and second data consisting of Y coordinate values The matrix, and the gray value of the image are fused into the image information of the image; the image information is processed by a preset detection model to obtain the category of the target contained in the image information, and the position information of the bounding box covering each target; the image Targets included in the information include at least packages and organ boards. The method can determine the position information of the bounding box covering each target in the image, that is, the position information of each target, and the coordinate information of the image is added in the detection process, thereby improving the position of the logistics package on the sorting conveyor belt. Detection accuracy and package sorting accuracy. The logistics package detection device, equipment and readable storage medium disclosed by the present invention also have the above technical effects.

Figure 201910126340

Description

一种物流包裹检测方法、装置、设备及可读存储介质A kind of logistics package detection method, device, equipment and readable storage medium

技术领域technical field

本发明涉及图像识别技术领域,更具体地说,涉及一种物流包裹检测方 法、装置、设备及可读存储介质。The present invention relates to the technical field of image recognition, and more particularly, to a logistics package detection method, device, equipment and readable storage medium.

背景技术Background technique

近年来,随着电子商务和人工智能技术的飞速发展,物流产业迎来了爆 发式增长。由此催生出众多应用于物流场景的自动化、智能化系统。物流包 裹自动分拣系统以分拣作业基本流程为基础,集成图像识别、自动控制、数 据通信等物联网核心技术,实现了快递包裹的规范化、标准化、智能化分拣。 有效提升了快递分拣效率和质量,推动了物流供应链智慧化升级。In recent years, with the rapid development of e-commerce and artificial intelligence technology, the logistics industry has ushered in explosive growth. As a result, many automated and intelligent systems used in logistics scenarios have been born. The logistics package automatic sorting system is based on the basic process of sorting operations, and integrates the core technologies of the Internet of Things such as image recognition, automatic control, and data communication, and realizes the standardized, standardized and intelligent sorting of express packages. It effectively improves the efficiency and quality of express sorting, and promotes the intelligent upgrade of the logistics supply chain.

图1为一种物流包裹分拣系统,包括:供包台、包裹检测相机、条码识 别相机、多个分拣口和分拣传送带;其中分拣传送带由台车和风琴板连接构 成,每两个台车通过风琴板相连。该物流包裹分拣系统的工作流程为:工作 人员整理好包裹,使其面单朝上放置,送上供包台,当有空的台车时,将供 包台上的包裹送上分拣传送带,面单即包含物流信息和识别条码的物流单。 当包裹被分拣传送带运送至包裹检测相机位置时,包裹检测相机检测包裹在 分拣传送带上的位置,以便确定包裹所处的位置是否便于条码识别相机扫描; 当包裹被分拣传送带运送至条码识别相机位置时,条码识别相机扫描包裹的 条码,以确定当前包裹被运送至哪个分拣口。Figure 1 shows a logistics package sorting system, including: a package supply table, a package detection camera, a barcode identification camera, a plurality of sorting ports and a sorting conveyor belt; the sorting conveyor belt is composed of a trolley and an organ board connected, and every two The trolleys are connected by an organ board. The workflow of the logistics parcel sorting system is as follows: the staff arranges the parcels, puts them face-up, and sends them to the packaging supply table. When there is an empty trolley, the packages on the packaging supply table are sent to the sorting table. Conveyor belt, face sheet is a logistics sheet containing logistics information and identification barcode. When the package is transported by the sorting conveyor to the position of the package detection camera, the package detection camera detects the position of the package on the sorting conveyor, so as to determine whether the position of the package is convenient for the barcode recognition camera to scan; When the package is transported by the sorting conveyor to the barcode When identifying the location of the camera, the barcode recognition camera scans the barcode of the package to determine which sorting port the current package is being delivered to.

可见,包裹检测相机的主要作用为:确定包裹在分拣传送带上的位置, 以便确定包裹所处的位置是否需要调整。在现有的包裹检测相机中,一般采 用传统的目标检测算法来确定包裹的位置,然而由于传统的目标检测算法依 赖于人工设计的图像特征(灰度、色彩、纹理等),导致其对于图像特征的 表达能力有所欠缺;同时,传统的目标检测算法仅以图像的灰度值作为图像 的图像信息,欠缺对于图像的位置信息的表达能力,导致传统目标检测算法 的检测精度和准确度有所降低。因此若将传统目标检测算法应用于包裹检测 相机,那么包裹检测相机检测到的包裹的位置信息的准确度将不足,如此便 可能导致包裹被运送至错误的分拣口。It can be seen that the main function of the package detection camera is to determine the position of the package on the sorting conveyor, so as to determine whether the position of the package needs to be adjusted. In the existing package detection cameras, the traditional object detection algorithm is generally used to determine the position of the package. However, because the traditional object detection algorithm relies on artificially designed image features (grayscale, color, texture, etc.) The ability to express features is lacking; at the same time, the traditional target detection algorithm only uses the gray value of the image as the image information of the image, and lacks the ability to express the position information of the image, resulting in the detection accuracy and accuracy of the traditional target detection algorithm. reduced. Therefore, if the traditional object detection algorithm is applied to the package detection camera, the accuracy of the location information of the package detected by the package detection camera will be insufficient, which may lead to the package being delivered to the wrong sorting port.

因此,如何提高物流包裹在分拣传送带上的位置检测精度,是本领域技 术人员需要解决的问题。Therefore, how to improve the position detection accuracy of the logistics package on the sorting conveyor is a problem that needs to be solved by those skilled in the art.

发明内容SUMMARY OF THE INVENTION

本发明的目的在于提供一种物流包裹检测方法、装置、设备及可读存储 介质,以提高物流包裹在分拣传送带上的位置检测精度。The purpose of the present invention is to provide a logistics package detection method, device, equipment and readable storage medium, so as to improve the position detection accuracy of the logistics package on the sorting conveyor belt.

为实现上述目的,本发明实施例提供了如下技术方案:To achieve the above purpose, the embodiments of the present invention provide the following technical solutions:

一种物流包裹检测方法,包括:A logistics package detection method, comprising:

采集位于分拣传送带上的包裹的图像;Capture images of packages located on sorting conveyors;

将所述图像中的每个坐标的X坐标值构成的第一数据矩阵和Y坐标值构 成的第二数据矩阵,以及所述图像的灰度值融合为所述图像的图像信息;The first data matrix formed by the X coordinate value of each coordinate in the image and the second data matrix formed by the Y coordinate value, and the grayscale value of the image are merged into the image information of the image;

通过预设的检测模型对所述图像信息进行处理,获得所述图像信息中包 含的目标的类别,以及覆盖每个目标的边界框的位置信息;其中,所述图像 信息中包含的目标至少包括:包裹和风琴板。The image information is processed through a preset detection model to obtain the category of the object contained in the image information, and the position information of the bounding box covering each object; wherein, the objects contained in the image information at least include : Wrap and Organ Board.

其中,所述检测模型的训练步骤包括:Wherein, the training steps of the detection model include:

获取训练图像,并通过卷积层和残差网络层提取所述训练图像的两个尺 度的特征;Acquire a training image, and extract the features of two scales of the training image through a convolutional layer and a residual network layer;

通过特征处理层融合提取到的特征并解析,得到解析结果;The extracted features are fused and analyzed by the feature processing layer to obtain the analysis results;

根据所述解析结果确定所述训练图像的检测结果,所述检测结果为:所 述训练图像中包含的目标的检测类别,以及覆盖每个目标的边界框的检测位 置信息;Determine the detection result of the training image according to the analysis result, and the detection result is: the detection category of the target contained in the training image, and the detection position information of the bounding box covering each target;

通过预设的损失函数判断所述检测结果和所述训练图像的标注信息的差 异是否符合预设的条件,所述标注信息为所述训练图像包含的每个目标的真 实类别和覆盖每个目标的边界框的真实位置信息;Determine whether the difference between the detection result and the labeling information of the training image conforms to a preset condition by using a preset loss function, and the labeling information is the true category of each target included in the training image and the coverage of each target. The true location information of the bounding box;

若是,则所述检测模型训练完成;If so, the detection model training is completed;

其中,所述残差网络层由不同尺度的多个网络子层按照尺度大小从大到 小排列组成,所述残差网络层中的最后两个网络子层分别输出所述训练图像 的两个尺度的特征。Wherein, the residual network layer is composed of multiple network sub-layers of different scales arranged in descending order of scale, and the last two network sub-layers in the residual network layer output two images of the training image respectively. scale features.

其中,所述通过特征处理层融合提取到的特征并解析,得到解析结果, 包括:Wherein, the features extracted by the feature processing layer are fused and analyzed to obtain analysis results, including:

对所述残差网络层中的倒数第一个网络子层输出的第一特征进行卷积并 上采样,得到与所述残差网络层中的倒数第二个网络子层输出的第二特征尺 度相同的目标特征;Convolving and upsampling the first feature output by the penultimate network sublayer in the residual network layer to obtain the second feature output by the penultimate network sublayer in the residual network layer target features of the same scale;

对所述目标特征和所述第二特征进行连接并卷积,得到第一向量;Connect and convolve the target feature and the second feature to obtain a first vector;

对所述第一特征进行卷积,并用向量表示卷积结果,得到第二向量;Convolving the first feature, and using a vector to represent the convolution result to obtain a second vector;

解析所述第一向量和所述第二向量,得到所述解析结果。Parse the first vector and the second vector to obtain the parsing result.

其中,还包括:Among them, it also includes:

根据所述检测结果和所述标注信息的差异预设所述损失函数,所述检测 结果和所述标注信息的差异至少包括:覆盖同一目标的边界框的位置误差, 覆盖同一目标的边界框中有无目标的置信度误差,以及同一目标的类别误差。The loss function is preset according to the difference between the detection result and the annotation information, and the difference between the detection result and the annotation information at least includes: the position error of the bounding box covering the same target, and the bounding box covering the same target. Confidence error with or without target, and class error for the same target.

其中,所述获取训练图像之后,还包括:Wherein, after the acquisition of the training image, the method further includes:

利用xml文件记录所述训练图像的标注信息。An xml file is used to record the annotation information of the training image.

其中,所述将所述图像中的每个坐标的X坐标值构成的第一数据矩阵和 Y坐标值构成的第二数据矩阵,以及所述图像的灰度值融合为所述图像的图 像信息之前,还包括:Wherein, the first data matrix formed by the X coordinate value of each coordinate in the image and the second data matrix formed by the Y coordinate value, and the gray value of the image are fused into the image information of the image Before, also included:

对所述图像进行预处理,并将预处理后的图像转换为灰度图像。The image is preprocessed, and the preprocessed image is converted into a grayscale image.

其中,所述通过预设的检测模型对所述图像信息进行处理,获得所述图 像信息中包含的目标的类别,以及覆盖每个目标的边界框的位置信息之后, 还包括:Wherein, the described image information is processed by the preset detection model, and the category of the target contained in the image information is obtained, and after covering the position information of the bounding box of each target, it also includes:

根据所述图像中覆盖包裹的边界框的位置信息确定是否需要调整包裹的 位置。Whether the position of the package needs to be adjusted is determined according to the position information of the bounding box covering the package in the image.

一种物流包裹检测装置,包括:A logistics parcel detection device, comprising:

采集模块,用于采集位于包裹分拣传送带上的包裹的图像;an acquisition module for acquiring images of packages located on the parcel sorting conveyor;

融合模块,用于将所述图像中的每个坐标的X坐标值构成的第一数据矩 阵和Y坐标值构成的第二数据矩阵,以及所述图像的灰度值融合为所述图像 的图像信息;A fusion module, configured to fuse the first data matrix formed by the X coordinate value of each coordinate in the image, the second data matrix formed by the Y coordinate value, and the gray value of the image into an image of the image information;

检测模块,用于通过预设的检测模型对所述图像信息进行处理,获得所 述图像信息中包含的目标的类别,以及覆盖每个目标的边界框的位置信息; 其中,所述图像信息中包含的目标至少包括:包裹和风琴板。A detection module, configured to process the image information through a preset detection model, to obtain the category of the target contained in the image information, and the position information of the bounding box covering each target; wherein, in the image information Included targets include at least: wrap and organ board.

一种物流包裹检测设备,包括:A logistics parcel detection equipment, comprising:

存储器,用于存储计算机程序;memory for storing computer programs;

处理器,用于执行所述计算机程序时实现上述任意一项所述的物流包裹 检测方法的步骤。The processor is configured to implement the steps of the logistics package detection method described in any one of the above when executing the computer program.

一种可读存储介质,所述可读存储介质上存储有计算机程序,所述计算 机程序被处理器执行时实现上述任意一项所述的物流包裹检测方法的步骤。A readable storage medium, a computer program is stored on the readable storage medium, and when the computer program is executed by a processor, the steps of the logistics package detection method described in any one of the above are realized.

通过以上方案可知,本发明实施例提供的一种物流包裹检测方法,包括: 采集位于分拣传送带上的包裹的图像;将所述图像中的每个坐标的X坐标值 构成的第一数据矩阵和Y坐标值构成的第二数据矩阵,以及所述图像的灰度 值融合为所述图像的图像信息;通过预设的检测模型对所述图像信息进行处 理,获得所述图像信息中包含的目标的类别,以及覆盖每个目标的边界框的 位置信息;其中,所述图像信息中包含的目标至少包括:包裹和风琴板。It can be seen from the above solutions that a method for detecting a logistics package provided by an embodiment of the present invention includes: collecting an image of a package located on a sorting conveyor belt; a first data matrix composed of X coordinate values of each coordinate in the image The second data matrix formed with the Y coordinate value, and the gray value of the image are fused into the image information of the image; the image information is processed by a preset detection model, and the information contained in the image information is obtained. The category of the object, and the position information of the bounding box covering each object; wherein, the objects contained in the image information at least include: a package and an organ board.

可见,所述方法对于采集到的位于分拣传送带上的包裹的图像,首先将 图像中的每个坐标的X坐标值构成的第一数据矩阵和Y坐标值构成的第二数 据矩阵,以及图像的灰度值融合为图像的图像信息,即:将图像的位置信息 嵌入图像信息,以便于确定图像中目标的位置信息。进一步地,通过预设的 检测模型对包含坐标信息的图像信息进行处理,获得图像信息中包含的目标 的类别,以及覆盖每个目标的边界框的位置信息;其中,图像信息中包含的 目标至少包括:包裹和风琴板。如此便可以确定出图像中的每个目标的边界框的位置信息,也就是每个目标的位置信息,即检测得到了物流包裹在分拣 传送带上的位置信息,而由于检测过程中添加了图像的坐标信息,因此提高 了物流包裹在分拣传送带上的位置的检测精度,能够提高包裹分拣的准确率。It can be seen that, for the collected image of the package located on the sorting conveyor, the method firstly combines the first data matrix formed by the X coordinate value of each coordinate in the image and the second data matrix formed by the Y coordinate value, and the image The gray value of the image is fused into the image information of the image, that is, the position information of the image is embedded in the image information, so as to determine the position information of the target in the image. Further, the image information containing the coordinate information is processed by the preset detection model to obtain the category of the target contained in the image information, and the position information of the bounding box covering each target; wherein, the target contained in the image information is at least Includes: Wrap and Organ Board. In this way, the position information of the bounding box of each target in the image can be determined, that is, the position information of each target, that is, the position information of the logistics package on the sorting conveyor belt can be detected. Therefore, the detection accuracy of the position of the logistics package on the sorting conveyor belt is improved, and the accuracy of the package sorting can be improved.

相应地,本发明实施例提供的一种物流包裹检测装置、设备及可读存储 介质,也同样具有上述技术效果。Correspondingly, a logistics package detection device, equipment, and readable storage medium provided by the embodiments of the present invention also have the above-mentioned technical effects.

附图说明Description of drawings

为了更清楚地说明本发明实施例或现有技术中的技术方案,下面将对实 施例或现有技术描述中所需要使用的附图作简单地介绍,显而易见地,下面 描述中的附图仅仅是本发明的一些实施例,对于本领域普通技术人员来讲, 在不付出创造性劳动的前提下,还可以根据这些附图获得其他的附图。In order to explain the embodiments of the present invention or the technical solutions in the prior art more clearly, the following briefly introduces the accompanying drawings that need to be used in the description of the embodiments or the prior art. Obviously, the accompanying drawings in the following description are only These are some embodiments of the present invention. For those of ordinary skill in the art, other drawings can also be obtained according to these drawings without creative efforts.

图1为本发明实施例公开的一种物流包裹分拣系统示意图;1 is a schematic diagram of a logistics parcel sorting system disclosed in an embodiment of the present invention;

图2为本发明实施例公开的一种物流包裹检测方法流程图;2 is a flowchart of a method for detecting a logistics package disclosed in an embodiment of the present invention;

图3为本发明实施例公开的一种检测模型训练方法流程图;3 is a flowchart of a detection model training method disclosed in an embodiment of the present invention;

图4为本发明实施例公开的一种物流包裹检测装置示意图;4 is a schematic diagram of a logistics package detection device disclosed in an embodiment of the present invention;

图5为本发明实施例公开的一种物流包裹检测设备示意图;5 is a schematic diagram of a logistics package detection device disclosed in an embodiment of the present invention;

图6为本发明实施例公开的一种物流包裹检测模型示意图;6 is a schematic diagram of a logistics package detection model disclosed in an embodiment of the present invention;

图7为本发明实施例公开的一种物流包裹解析结果示意图;7 is a schematic diagram of a logistics package analysis result disclosed in an embodiment of the present invention;

图8为本发明实施例公开的一种物流包裹图像信息示意图;8 is a schematic diagram of a logistics package image information disclosed in an embodiment of the present invention;

图9为本发明实施例公开的一种图像中覆盖目标的边界框的位置信息误 差示意图;9 is a schematic diagram of the position information error of a bounding box covering a target in an image disclosed in an embodiment of the present invention;

图10为本发明实施例公开的一种生产测试效果图。FIG. 10 is an effect diagram of a production test disclosed in an embodiment of the present invention.

具体实施方式Detailed ways

下面将结合本发明实施例中的附图,对本发明实施例中的技术方案进行 清楚、完整地描述,显然,所描述的实施例仅仅是本发明一部分实施例,而 不是全部的实施例。基于本发明中的实施例,本领域普通技术人员在没有做 出创造性劳动前提下所获得的所有其他实施例,都属于本发明保护的范围。The technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings in the embodiments of the present invention. Obviously, the described embodiments are only a part of the embodiments of the present invention, rather than all the embodiments. Based on the embodiments in the present invention, all other embodiments obtained by those of ordinary skill in the art without creative work, all belong to the protection scope of the present invention.

本发明实施例公开了一种物流包裹检测方法、装置、设备及可读存储介 质,以提高物流包裹在分拣传送带上的位置检测精度。The embodiments of the present invention disclose a method, device, equipment and readable storage medium for detecting a logistics package, so as to improve the position detection accuracy of the logistics package on the sorting conveyor belt.

参见图2,本发明实施例提供的一种物流包裹检测方法,包括:Referring to FIG. 2, a method for detecting a logistics package provided by an embodiment of the present invention includes:

S201、采集位于分拣传送带上的包裹的图像;S201, collecting images of packages located on the sorting conveyor;

S202、将图像中的每个坐标的X坐标值构成的第一数据矩阵和Y坐标值 构成的第二数据矩阵,以及图像的灰度值融合为图像的图像信息;S202, the first data matrix that the X coordinate value of each coordinate in the image is formed of and the second data matrix that the Y coordinate value is formed of, and the grayscale value of the image is merged into the image information of the image;

其中,将图像中的每个坐标的X坐标值构成的第一数据矩阵和Y坐标值 构成的第二数据矩阵,以及图像的灰度值融合为图像的图像信息之前,还包 括:对图像进行预处理,并将预处理后的图像转换为灰度图像。Wherein, before the first data matrix formed by the X coordinate value of each coordinate in the image, the second data matrix formed by the Y coordinate value, and the gray value of the image are fused into the image information of the image, the method further includes: performing the image processing on the image. Preprocess and convert the preprocessed image to a grayscale image.

S203、通过预设的检测模型对图像信息进行处理,获得图像信息中包含 的目标的类别,以及覆盖每个目标的边界框的位置信息。S203, processing the image information through a preset detection model to obtain the category of the target contained in the image information, and the position information of the bounding box covering each target.

其中,图像信息中包含的目标至少包括:包裹和风琴板。边界框的位置 信息包括:边界框的长、宽以及中心点坐标,或者边界框的四个顶点的坐标。Among them, the objects included in the image information at least include: a package and an organ board. The location information of the bounding box includes: the length, width and coordinates of the center point of the bounding box, or the coordinates of the four vertices of the bounding box.

基于本发明的应用场景可知,本发明只需检测出包裹所处的位置是否便 于条码相机的扫描即可。当包裹位于台车中央时,该位置为理想位置,扫描 角度最佳;当包裹的位置偏离台车中央,但仍然位置台车上时,包裹分拣系 统可以控制台车滚动,以使包裹位于台车中央;而当包裹位于风琴板或分拣 传送带的边缘时,就无法调整包裹的位置,从而会使包裹掉入错误的分拣口, 或需要人工调整包裹的位置。Based on the application scenario of the present invention, the present invention only needs to detect whether the location of the package is convenient for scanning by the barcode camera. When the package is in the center of the trolley, this position is ideal, and the scanning angle is the best; when the package is positioned off the center of the trolley, but still on the trolley, the package sorting system can control the trolley to roll so that the package is in the center of the trolley The center of the trolley; and when the package is on the edge of the accordion board or the sorting conveyor, the position of the package cannot be adjusted, which can cause the package to fall into the wrong sorting port or need to manually adjust the position of the package.

因此在本实施例中,当确定图像中包含的目标类别和覆盖每个目标的边 界框的位置信息后,就可以确定当前图像中包含的各个包裹的数量和位置、 风琴板的数量和位置。根据得到的位置信息就可以确定是否需要调整包裹的 位置以及如何调整包裹的位置。Therefore, in this embodiment, after determining the target category contained in the image and the position information of the bounding box covering each target, the number and position of each package and the number and position of the organ boards contained in the current image can be determined. According to the obtained position information, it can be determined whether the position of the package needs to be adjusted and how to adjust the position of the package.

其中,通过预设的检测模型对图像信息进行处理,获得图像信息中包含 的目标的类别,以及覆盖每个目标的边界框的位置信息之后,还包括:根据 图像中覆盖包裹的边界框的位置信息确定是否需要调整包裹的位置。The image information is processed by a preset detection model to obtain the category of the target contained in the image information and the position information of the bounding box covering each target, and further includes: according to the position of the bounding box covering the package in the image information to determine if the package's position needs to be adjusted.

具体的,根据图像中覆盖包裹的边界框的位置信息确定是否需要调整包 裹的位置,包括:计算图像中覆盖每个目标的边界框的面积;并判断包裹的 一部分是否位于分拣传送带外界。Specifically, determining whether the position of the package needs to be adjusted according to the position information of the bounding box covering the package in the image includes: calculating the area of the bounding box covering each target in the image; and judging whether a part of the package is located outside the sorting conveyor belt.

当包裹一部分未位于分拣传送带外界时,针对一个包裹,判断覆盖当前 包裹的边界框与覆盖风琴板的边界框是否存在重叠区域;When a part of the package is not located outside the sorting conveyor, for a package, determine whether there is an overlapping area between the bounding box covering the current package and the bounding box covering the organ board;

若是,则计算覆盖当前包裹的边界框与覆盖风琴板的边界框的重叠面积 M,和覆盖当前包裹的边界框的面积与覆盖风琴板的边界框的面积之和N;并 计算M和N-M的比值,当此比值大于预设的阈值时,认为当前包裹的位置需 要调整,此时可以生成相应的调整信息并发送至管理终端进行显示,以便工 作人员进行人工干预。其中,N-M表示N与M的差值。If so, calculate the overlapping area M of the bounding box covering the current package and the bounding box covering the organ board, and the sum N of the area covering the bounding box of the current package and the area of the bounding box covering the organ board; and calculate M and N-M When the ratio is greater than the preset threshold, it is considered that the current position of the package needs to be adjusted. At this time, the corresponding adjustment information can be generated and sent to the management terminal for display, so that the staff can manually intervene. Among them, N-M represents the difference between N and M.

同样的,当包裹一部分位于分拣传送带外界时,针对一个包裹,判断覆 盖当前包裹的边界框与覆盖分拣传送带外界的边界框是否存在重叠区域;Similarly, when a part of the package is located outside the sorting conveyor, for a package, determine whether there is an overlapping area between the bounding box covering the current package and the bounding box covering the outside of the sorting conveyor;

若是,则计算覆盖当前包裹的边界框与覆盖分拣传送带外界的边界框的 重叠面积M,和覆盖当前包裹的边界框的面积与覆盖分拣传送带外界的边界 框的面积之和N;并计算M和N-M的比值,当此比值大于预设的阈值时,认 为当前包裹的位置需要调整,此时则控制分拣传送带的台车滚动,以使当前 包裹位于台车上。其中,分拣传送带外界即分拣传送带的两侧位置。If so, calculate the overlapping area M of the bounding box covering the current package and the bounding box covering the outside of the sorting conveyor belt, and the sum N of the area of the bounding box covering the current package and the area of the bounding box covering the outside of the sorting conveyor belt; and calculate The ratio of M and N-M, when the ratio is greater than the preset threshold, it is considered that the position of the current package needs to be adjusted. At this time, the trolley of the sorting conveyor is controlled to roll so that the current package is located on the trolley. Among them, the outside of the sorting conveyor belt is the position on both sides of the sorting conveyor belt.

可见,本实施例提供了一种物流包裹检测方法,所述方法对于采集到的 位于分拣传送带上的包裹的图像,首先将图像中的每个坐标的X坐标值构成 的第一数据矩阵和Y坐标值构成的第二数据矩阵,以及图像的灰度值融合为 图像的图像信息,即:将图像的位置信息嵌入图像信息,以便于确定图像中 目标的位置信息。进一步地,通过预设的检测模型对包含坐标信息的图像信 息进行处理,获得图像信息中包含的目标的类别,以及覆盖每个目标的边界 框的位置信息;其中,图像信息中包含的目标至少包括:包裹和风琴板。如 此便可以确定出图像中的每个目标的边界框的位置信息,也就是每个目标的 位置信息,即检测得到了物流包裹在分拣传送带上的位置信息,而由于检测 过程中添加了图像的坐标信息,因此提高了物流包裹在分拣传送带上的位置 的检测精度,能够提高包裹分拣的准确率。It can be seen that this embodiment provides a logistics package detection method. For the collected image of the package located on the sorting conveyor belt, the method firstly combines the first data matrix composed of the X coordinate value of each coordinate in the image and the The second data matrix formed by the Y coordinate value and the gray value of the image are fused into the image information of the image, that is, the position information of the image is embedded in the image information, so as to determine the position information of the target in the image. Further, the image information containing the coordinate information is processed by the preset detection model to obtain the category of the target contained in the image information, and the position information of the bounding box covering each target; wherein, the target contained in the image information is at least Includes: Wrap and Organ Board. In this way, the position information of the bounding box of each target in the image can be determined, that is, the position information of each target, that is, the position information of the logistics package on the sorting conveyor belt can be detected. Therefore, the detection accuracy of the position of the logistics package on the sorting conveyor belt is improved, and the accuracy of the package sorting can be improved.

请参见图3,检测模型的训练步骤包括:Referring to Figure 3, the training steps of the detection model include:

S301、获取训练图像,并通过卷积层和残差网络层提取训练图像的两个 尺度的特征;S301. Obtain a training image, and extract features of two scales of the training image through a convolution layer and a residual network layer;

S302、通过特征处理层融合提取到的特征并解析,得到解析结果;S302, fuse the extracted features through the feature processing layer and analyze them to obtain an analysis result;

S303、根据解析结果确定训练图像的检测结果;S303, determining the detection result of the training image according to the analysis result;

其中,检测结果为:训练图像中包含的目标的检测类别,以及覆盖每个 目标的边界框的检测位置信息;Among them, the detection result is: the detection category of the target contained in the training image, and the detection position information of the bounding box covering each target;

S304、通过预设的损失函数判断检测结果和训练图像的标注信息的差异 是否符合预设的条件;若是,则执行S305;若否,则执行S306;S304, judge whether the difference between the detection result and the labeling information of the training image by the preset loss function meets the preset condition; if so, execute S305; if not, execute S306;

其中,标注信息为训练图像包含的每个目标的真实类别和覆盖每个目标 的边界框的真实位置信息;Among them, the annotation information is the real category of each target contained in the training image and the real position information of the bounding box covering each target;

S305、检测模型训练完成;S305, the detection model training is completed;

S306、通过随机梯度下降法更新检测模型的参数,并执行S301。S306 , update the parameters of the detection model through the stochastic gradient descent method, and execute S301 .

其中,残差网络层由不同尺度的多个网络子层按照尺度大小从大到小排 列组成,残差网络层中的最后两个网络子层分别输出训练图像的两个尺度的 特征。Among them, the residual network layer is composed of multiple network sub-layers of different scales arranged from large to small, and the last two network sub-layers in the residual network layer respectively output the features of the two scales of the training image.

其中,通过特征处理层融合提取到的特征并解析,得到解析结果,包括:Among them, the extracted features are fused and analyzed by the feature processing layer, and the analysis results are obtained, including:

对残差网络层中的倒数第一个网络子层输出的第一特征进行卷积并上采 样,得到与残差网络层中的倒数第二个网络子层输出的第二特征尺度相同的 目标特征;Convolve and upsample the first feature output by the penultimate network sublayer in the residual network layer to obtain a target with the same scale as the second feature output by the penultimate network sublayer in the residual network layer feature;

对目标特征和第二特征进行连接并卷积,得到第一向量;Connect and convolve the target feature and the second feature to obtain the first vector;

对第一特征进行卷积,并用向量表示卷积结果,得到第二向量;Convolve the first feature, and use a vector to represent the convolution result to obtain a second vector;

解析第一向量和第二向量,得到解析结果。Parse the first vector and the second vector to get the parsing result.

其中,还包括:Among them, it also includes:

根据检测结果和标注信息的差异预设损失函数,检测结果和标注信息的 差异至少包括:覆盖同一目标的边界框的位置误差,覆盖同一目标的边界框 中有无目标的置信度误差,以及同一目标的类别误差。The loss function is preset according to the difference between the detection result and the annotation information. The difference between the detection result and the annotation information includes at least: the position error of the bounding box covering the same target, the confidence error of whether there is a target in the bounding box covering the same target, and the same The class error of the target.

其中,获取训练图像之后,还包括:利用xml文件记录训练图像的标注 信息。即:记录图像中每个目标的真实类别和覆盖每个目标的边界框的真实 位置信息。Wherein, after acquiring the training image, the method further includes: recording the annotation information of the training image by using an xml file. That is: record the true category of each object in the image and the true location information of the bounding box covering each object.

下面对本发明实施例提供的一种物流包裹检测装置进行介绍,下文描述 的一种物流包裹检测装置与上文描述的一种物流包裹检测方法可以相互参 照。The following describes a logistics package detection device provided by the embodiments of the present invention. The logistics package detection device described below and the logistics package detection method described above can be referred to each other.

参见图4,本发明实施例提供的一种物流包裹检测装置,包括:Referring to FIG. 4 , a logistics package detection device provided by an embodiment of the present invention includes:

采集模块401,用于采集位于包裹分拣传送带上的包裹的图像;The collection module 401 is used to collect the image of the package located on the package sorting conveyor;

融合模块402,用于将所述图像中的每个坐标的X坐标值构成的第一数 据矩阵和Y坐标值构成的第二数据矩阵,以及所述图像的灰度值融合为所述 图像的图像信息;The fusion module 402 is used to fuse the first data matrix formed by the X coordinate value of each coordinate in the image, the second data matrix formed by the Y coordinate value, and the gray value of the image into the image of the image. image information;

检测模块403,用于通过预设的检测模型对所述图像信息进行处理,获得 所述图像信息中包含的目标的类别,以及覆盖每个目标的边界框的位置信息; 其中,所述图像信息中包含的目标至少包括:包裹和风琴板。The detection module 403 is configured to process the image information through a preset detection model to obtain the category of the target contained in the image information, and the position information of the bounding box covering each target; wherein, the image information Included targets include at least: Wraps and Organ Boards.

其中,还包括:训练模块,用于训练所述检测模型,包括:Among them, it also includes: a training module for training the detection model, including:

获取单元,用于获取训练图像,并通过卷积层和残差网络层提取所述训 练图像的两个尺度的特征;an acquisition unit for acquiring a training image, and extracting features of two scales of the training image through a convolutional layer and a residual network layer;

解析单元,用于通过特征处理层融合提取到的特征并解析,得到解析结 果;The parsing unit is used to fuse and parse the extracted features through the feature processing layer to obtain parsing results;

确定单元,用于根据所述解析结果确定所述训练图像的检测结果,所述 检测结果为:所述训练图像中包含的目标的检测类别,以及覆盖每个目标的 边界框的检测位置信息;A determination unit, for determining the detection result of the training image according to the analysis result, the detection result is: the detection category of the target included in the training image, and the detection position information of the bounding box covering each target;

判断单元,用于通过预设的损失函数判断所述检测结果和所述训练图像 的标注信息的差异是否符合预设的条件,所述标注信息为所述训练图像包含 的每个目标的真实类别和覆盖每个目标的边界框的真实位置信息;A judging unit, configured to judge whether the difference between the detection result and the labeling information of the training image conforms to a preset condition through a preset loss function, where the labeling information is the true category of each target included in the training image and the ground-truth location information of the bounding box covering each object;

完成单元,用于当所述检测结果和所述训练图像的标注信息的差异符合 预设的条件时,所述检测模型训练完成;Completion unit, when the difference between the labeling information of the detection result and the training image meets a preset condition, the training of the detection model is completed;

其中,所述残差网络层由不同尺度的多个网络子层按照尺度大小从大到 小排列组成,所述残差网络层中的最后两个网络子层分别输出所述训练图像 的两个尺度的特征。Wherein, the residual network layer is composed of multiple network sub-layers of different scales arranged in descending order of scale, and the last two network sub-layers in the residual network layer output two images of the training image respectively. scale features.

其中,所述解析单元,包括:Wherein, the parsing unit includes:

采样子单元,用于对所述残差网络层中的倒数第一个网络子层输出的第 一特征进行卷积并上采样,得到与所述残差网络层中的倒数第二个网络子层 输出的第二特征尺度相同的目标特征;The sampling subunit is used to convolve and upsample the first feature output by the penultimate network sublayer in the residual network layer to obtain the same value as the penultimate network sublayer in the residual network layer. The second feature output of the layer has the same target feature scale;

第一卷积子单元,用于对所述目标特征和所述第二特征进行连接并卷积, 得到第一向量;a first convolution subunit, configured to connect and convolve the target feature and the second feature to obtain a first vector;

第二卷积子单元,用于对所述第一特征进行卷积,并用向量表示卷积结 果,得到第二向量;The second convolution subunit is used to convolve the first feature, and represents the convolution result with a vector to obtain a second vector;

解析子单元,用于解析所述第一向量和所述第二向量,得到所述解析结 果。A parsing subunit, configured to parse the first vector and the second vector to obtain the parsing result.

其中,所述训练模块还包括:Wherein, the training module also includes:

预设单元,用于根据所述检测结果和所述标注信息的差异预设所述损失 函数,所述检测结果和所述标注信息的差异至少包括:覆盖同一目标的边界 框的位置误差,覆盖同一目标的边界框中有无目标的置信度误差,以及同一 目标的类别误差。A preset unit, configured to preset the loss function according to the difference between the detection result and the annotation information, where the difference between the detection result and the annotation information at least includes: covering the position error of the bounding box of the same target, covering The confidence error of whether there is a target in the bounding box of the same target, and the class error of the same target.

其中,所述训练模块还包括:Wherein, the training module also includes:

记录单元,用于利用xml文件记录所述训练图像的标注信息。The recording unit is used for recording the annotation information of the training image by using the xml file.

其中,还包括:Among them, it also includes:

预处理单元,用于对所述图像进行预处理,并将预处理后的图像转换为 灰度图像。The preprocessing unit is used to preprocess the image and convert the preprocessed image into a grayscale image.

其中,还包括:Among them, it also includes:

确定模块,用于根据所述图像中覆盖包裹的边界框的位置信息确定是否 需要调整包裹的位置。A determining module, configured to determine whether the position of the package needs to be adjusted according to the position information of the bounding box covering the package in the image.

可见,本实施例提供了一种物流包裹检测装置,包括:采集模块、融合 模块以及检测模块。首先由采集模块采集位于包裹分拣传送带上的包裹的图 像;然后融合模块将所述图像中的每个坐标的X坐标值构成的第一数据矩阵 和Y坐标值构成的第二数据矩阵,以及所述图像的灰度值融合为所述图像的 图像信息;最后检测模块通过预设的检测模型对所述图像信息进行处理,获 得所述图像信息中包含的目标的类别,以及覆盖每个目标的边界框的位置信 息;其中,所述图像信息中包含的目标至少包括:包裹和风琴板。如此各个 模块之间分工合作,各司其职,从而提高了物流包裹在分拣传送带上的位置 的检测精度和包裹分拣的准确率。It can be seen that this embodiment provides a logistics package detection device, including: a collection module, a fusion module and a detection module. First, the acquisition module collects the image of the package located on the package sorting conveyor; then the fusion module combines the first data matrix formed by the X coordinate value of each coordinate in the image and the second data matrix formed by the Y coordinate value, and The gray value of the image is fused into the image information of the image; finally, the detection module processes the image information through a preset detection model, obtains the category of the target contained in the image information, and covers each target. The location information of the bounding box; wherein, the objects contained in the image information at least include: a package and an organ board. In this way, the various modules work in division of labor and perform their own duties, thereby improving the detection accuracy of the location of the logistics package on the sorting conveyor belt and the accuracy of package sorting.

下面对本发明实施例提供的一种物流包裹检测设备进行介绍,下文描述 的一种物流包裹检测设备与上文描述的一种物流包裹检测方法及装置可以相 互参照。A kind of logistics parcel detection equipment provided by the embodiment of the present invention is introduced below, a kind of logistics parcel detection equipment described below and a kind of logistics parcel detection method and device described above can be referred to each other.

参见图5,本发明实施例提供的一种物流包裹检测设备,包括:Referring to FIG. 5 , a logistics package detection device provided by an embodiment of the present invention includes:

存储器501,用于存储计算机程序;a memory 501 for storing computer programs;

处理器502,用于执行所述计算机程序时实现上述任意实施例所述的物流 包裹检测方法的步骤。The processor 502 is configured to implement the steps of the logistics package detection method described in any of the above embodiments when executing the computer program.

下面对本发明实施例提供的一种可读存储介质进行介绍,下文描述的一 种可读存储介质与上文描述的一种物流包裹检测方法、装置及设备可以相互 参照。A readable storage medium provided by an embodiment of the present invention will be introduced below. A readable storage medium described below and a logistics package detection method, device, and device described above can be referred to each other.

一种可读存储介质,所述可读存储介质上存储有计算机程序,所述计算 机程序被处理器执行时实现如上述任意实施例所述的物流包裹检测方法的步 骤。A readable storage medium on which a computer program is stored, and when the computer program is executed by a processor, implements the steps of the method for detecting a logistics package as described in any of the foregoing embodiments.

基于本发明提供的检测模型训练步骤可设计如下检测模型,请参见图6。 图6所示的检测模型包括:特征提取模块、特征融合模块和解析模块,其中:Based on the detection model training steps provided by the present invention, the following detection models can be designed, please refer to FIG. 6 . The detection model shown in Figure 6 includes: a feature extraction module, a feature fusion module and a parsing module, wherein:

特征提取模块包括一个卷积层和五个残差网络块,各个残差网络块提取 的特征尺度不同;The feature extraction module includes a convolution layer and five residual network blocks, and the feature scales extracted by each residual network block are different;

特征融合模块,用于将最后一个残差网络块输出的特征进行卷积后,将 其上采样,得到尺度为“26*26*256”的特征,将此特征与倒数第二个残差网 络块输出的特征进行连接,得到尺度为“26*26*768”的特征,对尺度为 “26*26*768”的特征进行卷积,得到尺度为“13*13*1024”的特征;The feature fusion module is used to convolve the features output by the last residual network block, and then upsample it to obtain a feature with a scale of "26*26*256", which is combined with the penultimate residual network. The features of the block output are connected to obtain features with a scale of "26*26*768", and the features with a scale of "26*26*768" are convolved to obtain a feature with a scale of "13*13*1024";

特征解析模块,用于分别对两个尺度为“13*13*1024”的特征进行卷积, 并对得到的两个卷积结果进行解析,从而输出数据块。The feature parsing module is used to convolve two features with a scale of "13*13*1024" respectively, and parse the two convolution results obtained, thereby outputting a data block.

其中,对得到的两个卷积结果进行解析,即:确定当前图像中包含的目 标的个数和类别,覆盖每个目标的边界框的位置信息等。Among them, the two convolution results obtained are analyzed, that is, to determine the number and category of objects contained in the current image, and to cover the position information of the bounding box of each object, etc.

其中,特征提取模块最后输出的特征尺寸为“13*13*1024”,上一层输 出的尺寸为“26*26*512”,将这两个特征输入特征融合模块。其中, “13*13*1024”的特征分为两路,一路经过3x3卷积加1x1卷积得到 “13*13*21”;另一路经过上采样层将数据块扩展成“26*26*256”,再与倒 数第二个特征26*26*512融合,得到“26*26*768”,并将上采样结果与 “26*26*512”连接,得到“26*26*768”,对“26*26*768”的特征进行卷积, 得到尺度为“13*13*1024”的特征,“13*13*1024”的特征经过3x3卷积加 1x1卷积,得到“26*26*21”。如此这般,最后得到两个结果:“26*26*21” 和“13*13*21”。Among them, the feature size of the final output of the feature extraction module is "13*13*1024", and the size of the output of the previous layer is "26*26*512", and these two features are input into the feature fusion module. Among them, the features of "13*13*1024" are divided into two paths. One path goes through 3x3 convolution and 1x1 convolution to get "13*13*21"; the other path goes through the upsampling layer to expand the data block into "26*26*" 256", then fuse with the penultimate feature 26*26*512 to get "26*26*768", and connect the upsampling result with "26*26*512" to get "26*26*768", Convolve the feature of "26*26*768" to get the feature with the scale of "13*13*1024", and the feature of "13*13*1024" will undergo 3x3 convolution and 1x1 convolution to get "26*26" *twenty one". In this way, we finally get two results: "26*26*21" and "13*13*21".

需要说明的是,由于小包裹和大包裹的尺寸相差比较大,并且风琴板尺 寸远大于一般的包裹,所以将特征提取模块存在两个尺度的输出,分别为13x13尺度和26x26尺度。其中,13x13尺度用于检测大包裹和风琴板,26x26 尺度用于检测小包裹。It should be noted that since the size of the small package and the large package is quite different, and the size of the organ board is much larger than that of the general package, the feature extraction module has two output scales, 13x13 and 26x26 respectively. Among them, the 13x13 scale is used to detect large packages and organ boards, and the 26x26 scale is used to detect small packages.

“26*26*21”和“13*13*21”这两个特征经过特征解析模块,特征解析 模块将从数据块中抽取出类别信息,坐标信息和边界框内存在目标的概率。 例如:预测得到三个边界框,分别为box1、box2和box3,每个边界框包含的信 息分别为:x和y分别表示边界框的中心位置的横坐标和纵坐标,w和h分别 表示边界框的长和宽,p表示该边界框内存在目标的概率,class1和class2表示 该位置目标的类别。解析结果请参见图7。The two features "26*26*21" and "13*13*21" go through the feature analysis module, and the feature analysis module will extract the category information, coordinate information and the probability of the existence of the target in the bounding box from the data block. For example: three bounding boxes are predicted, namely box1, box2 and box3, and the information contained in each bounding box is: x and y represent the abscissa and ordinate of the center position of the bounding box, respectively, w and h represent the boundary The length and width of the box, p represents the probability of the existence of the target in the bounding box, and class1 and class2 represent the category of the target at this location. The analysis results are shown in Figure 7.

需要说明的是,在图像输入特征提取模块之前,将图像中的每个坐标的X 坐标值构成的第一数据矩阵和Y坐标值构成的第二数据矩阵,以及图像的灰 度值融合为图像的图像信息,以在图像信息中嵌入位置信息。图像信息具体 请参见图8。It should be noted that, before the image is input into the feature extraction module, the first data matrix composed of the X coordinate value of each coordinate in the image, the second data matrix composed of the Y coordinate value, and the gray value of the image are fused into the image. image information to embed location information in the image information. Please refer to Figure 8 for specific image information.

为了衡量输出数据块包含的检测结果与真实结果之间的误差,即:检测 结果中覆盖目标A的边界框的位置信息,与真实结果中覆盖目标A的边界框 的位置信息的误差;检测结果中覆盖目标A的边界框中有无目标的置信度, 与真实结果中覆盖目标A的边界框中有无目标的置信度的误差;检测结果中 确定的目标A的类别,与真实结果中目标A的类别的误差。本发明按照上述 三方面的差异预设损失函数,具体为:In order to measure the error between the detection result contained in the output data block and the real result, that is: the error between the position information of the bounding box covering target A in the detection result and the position information of the bounding box covering target A in the real result; the detection result The error between the confidence of whether there is a target in the bounding box covering target A, and the confidence of whether there is a target in the bounding box covering target A in the real result; the category of target A determined in the detection result is different from the target in the real result. A's class of error. The present invention presets the loss function according to the differences in the above three aspects, specifically:

1、通过公式(1)表示边界框的位置信息的误差:1. The error of the position information of the bounding box is represented by formula (1):

Figure BDA0001973719580000121
Figure BDA0001973719580000121

其中,S表示在图像中划分的网格数,B表示预测的边界框数,

Figure BDA0001973719580000122
表示 第i个网格中的第j个边界框是否覆盖当前目标,其中,与当前目标的真实边 界框的Iou最大的边界框为覆盖当前目标的预测边界框,请参见图9,其中 B=3,预测位置即为检测结果中覆盖目标A的边界框的位置信息,x’和y’为边 界框的中心点坐标,w’为边界框的长,h’为边界框的宽;真实位置即为标注信 息中覆盖目标A的边界框的位置信息,x和y为边界框的中心点坐标,w为 边界框的长,h为边界框的宽。where S represents the number of grids divided in the image, B represents the number of predicted bounding boxes,
Figure BDA0001973719580000122
Indicates whether the jth bounding box in the ith grid covers the current target, wherein the bounding box with the largest Iou of the true bounding box of the current target is the predicted bounding box covering the current target, see Figure 9, where B= 3. The predicted position is the position information of the bounding box covering the target A in the detection result, x' and y' are the coordinates of the center point of the bounding box, w' is the length of the bounding box, and h' is the width of the bounding box; the real position That is, the position information of the bounding box covering the target A in the annotation information, x and y are the coordinates of the center point of the bounding box, w is the length of the bounding box, and h is the width of the bounding box.

2、通过公式(2)表示置信度的误差:2. The error of confidence is expressed by formula (2):

Figure BDA0001973719580000131
Figure BDA0001973719580000131

其中,

Figure BDA0001973719580000132
in,
Figure BDA0001973719580000132

3、通过公式(3)表示类别的误差,类别为两类:包裹和风琴板:3. The error of the category is represented by formula (3), and the categories are two types: package and organ board:

Figure BDA0001973719580000133
Figure BDA0001973719580000133

综合1、2和3,得到的损失函数即为公式(4):Combining 1, 2 and 3, the resulting loss function is formula (4):

Loss=Losscoord+Lossconf+Lossclass (4)Loss=Loss coord +Loss conf +Loss class (4)

为了证明本发明的优越性,采用不同检测方法对同一批数据进行检测, 检测结果如表1所示。In order to prove the superiority of the present invention, different detection methods are used to detect the same batch of data, and the detection results are shown in Table 1.

表1Table 1

Figure BDA0001973719580000134
Figure BDA0001973719580000134

从表1可以看出,Faster R-CNN的准确率较高,但处理速度较慢;SSD、 Yolo v3和tiny Yolo的准确率稍低,但是处理速度较快。本发明的准确率最接 近Faster R-CNN,同时处理速度最快,可见本发明在保证准确率的同时,还 提高了处理效率。As can be seen from Table 1, Faster R-CNN has higher accuracy but slower processing speed; SSD, Yolo v3 and tiny Yolo have slightly lower accuracy but faster processing speed. The accuracy rate of the present invention is the closest to Faster R-CNN, and the processing speed is the fastest at the same time. It can be seen that the present invention not only ensures the accuracy rate, but also improves the processing efficiency.

本发明在实际生产环境中也进行了测试。从一个月内采集的所有检测结 果图中随机选取了28209张,通过人工查看,只有3张结果图中漏检了一个 包裹。也就是说,本发明的误检率仅为万分之一。生产测试的部分效果图如 图10所示,这些图片分别来自三条不同的分拣流水线。The invention has also been tested in an actual production environment. 28,209 sheets were randomly selected from all the test result graphs collected within one month. Through manual inspection, only 3 result graphs missed a package. That is to say, the false detection rate of the present invention is only one in ten thousand. Some renderings of the production test are shown in Figure 10, and these images are from three different sorting lines.

本说明书中各个实施例采用递进的方式描述,每个实施例重点说明的都 是与其他实施例的不同之处,各个实施例之间相同相似部分互相参见即可。The various embodiments in this specification are described in a progressive manner, and each embodiment focuses on the differences from other embodiments, and the same and similar parts between the various embodiments can be referred to each other.

对所公开的实施例的上述说明,使本领域专业技术人员能够实现或使用 本发明。对这些实施例的多种修改对本领域的专业技术人员来说将是显而易 见的,本文中所定义的一般原理可以在不脱离本发明的精神或范围的情况下, 在其它实施例中实现。因此,本发明将不会被限制于本文所示的这些实施例, 而是要符合与本文所公开的原理和新颖特点相一致的最宽的范围。The above description of the disclosed embodiments enables any person skilled in the art to make or use the present invention. Various modifications to these embodiments will be readily apparent to those skilled in the art, and the generic principles defined herein may be implemented in other embodiments without departing from the spirit or scope of the invention. Thus, the present invention is not intended to be limited to the embodiments shown herein, but is to be accorded the widest scope consistent with the principles and novel features disclosed herein.

Claims (10)

1.一种物流包裹检测方法,其特征在于,包括:1. a logistics parcel detection method, is characterized in that, comprises: 采集位于分拣传送带上的包裹的图像;Capture images of packages located on sorting conveyors; 将所述图像中的每个坐标的X坐标值构成的第一数据矩阵和Y坐标值构成的第二数据矩阵,以及所述图像的灰度值融合为所述图像的图像信息;The first data matrix formed by the X coordinate value of each coordinate in the image and the second data matrix formed by the Y coordinate value, and the gray value of the image are merged into the image information of the image; 通过预设的检测模型对所述图像信息进行处理,获得所述图像信息中包含的目标的类别,以及覆盖每个目标的边界框的位置信息;其中,所述图像信息中包含的目标至少包括:包裹和风琴板。The image information is processed through a preset detection model to obtain the category of the object contained in the image information, and the position information of the bounding box covering each object; wherein, the objects contained in the image information at least include : Wrap and Organ Board. 2.根据权利要求1所述的物流包裹检测方法,其特征在于,所述检测模型的训练步骤包括:2. The logistics package detection method according to claim 1, wherein the training step of the detection model comprises: 获取训练图像,并通过卷积层和残差网络层提取所述训练图像的两个尺度的特征;Acquire a training image, and extract features of two scales of the training image through a convolutional layer and a residual network layer; 通过特征处理层融合提取到的特征并解析,得到解析结果;The extracted features are fused and analyzed by the feature processing layer to obtain the analysis results; 根据所述解析结果确定所述训练图像的检测结果,所述检测结果为:所述训练图像中包含的目标的检测类别,以及覆盖每个目标的边界框的检测位置信息;The detection result of the training image is determined according to the analysis result, and the detection result is: the detection category of the target contained in the training image, and the detection position information of the bounding box covering each target; 通过预设的损失函数判断所述检测结果和所述训练图像的标注信息的差异是否符合预设的条件,所述标注信息为所述训练图像包含的每个目标的真实类别和覆盖每个目标的边界框的真实位置信息;Determine whether the difference between the detection result and the labeling information of the training image conforms to a preset condition by using a preset loss function, and the labeling information is the true category of each target included in the training image and the coverage of each target. The true location information of the bounding box; 若是,则所述检测模型训练完成;If so, the detection model training is completed; 其中,所述残差网络层由不同尺度的多个网络子层按照尺度大小从大到小排列组成,所述残差网络层中的最后两个网络子层分别输出所述训练图像的两个尺度的特征。Wherein, the residual network layer is composed of multiple network sub-layers of different scales arranged in descending order of scale, and the last two network sub-layers in the residual network layer output two images of the training image respectively. scale features. 3.根据权利要求2所述的物流包裹检测方法,其特征在于,所述通过特征处理层融合提取到的特征并解析,得到解析结果,包括:3. The logistics package detection method according to claim 2, wherein the features extracted by the feature processing layer are fused and analyzed to obtain analysis results, comprising: 对所述残差网络层中的倒数第一个网络子层输出的第一特征进行卷积并上采样,得到与所述残差网络层中的倒数第二个网络子层输出的第二特征尺度相同的目标特征;Convolving and upsampling the first feature output by the penultimate network sublayer in the residual network layer to obtain the second feature output by the penultimate network sublayer in the residual network layer target features of the same scale; 对所述目标特征和所述第二特征进行连接并卷积,得到第一向量;Connect and convolve the target feature and the second feature to obtain a first vector; 对所述第一特征进行卷积,并用向量表示卷积结果,得到第二向量;Convolving the first feature, and using a vector to represent the convolution result to obtain a second vector; 解析所述第一向量和所述第二向量,得到所述解析结果。Parse the first vector and the second vector to obtain the parsing result. 4.根据权利要求3所述的物流包裹检测方法,其特征在于,还包括:4. logistics parcel detection method according to claim 3, is characterized in that, also comprises: 根据所述检测结果和所述标注信息的差异预设所述损失函数,所述检测结果和所述标注信息的差异至少包括:覆盖同一目标的边界框的位置误差,覆盖同一目标的边界框中有无目标的置信度误差,以及同一目标的类别误差。The loss function is preset according to the difference between the detection result and the annotation information, and the difference between the detection result and the annotation information at least includes: the position error of the bounding box covering the same target, and the bounding box covering the same target. Confidence error with or without target, and class error for the same target. 5.根据权利要求4所述的物流包裹检测方法,其特征在于,所述获取训练图像之后,还包括:5. The logistics package detection method according to claim 4, characterized in that, after the acquisition of the training image, further comprising: 利用xml文件记录所述训练图像的标注信息。An xml file is used to record the annotation information of the training image. 6.根据权利要求1-5任意一项所述的物流包裹检测方法,其特征在于,所述将所述图像中的每个坐标的X坐标值构成的第一数据矩阵和Y坐标值构成的第二数据矩阵,以及所述图像的灰度值融合为所述图像的图像信息之前,还包括:6. The logistics package detection method according to any one of claims 1-5, wherein the first data matrix formed by the X coordinate value of each coordinate in the image and the Y coordinate value are formed by The second data matrix, and before the gray value of the image is fused into the image information of the image, further includes: 对所述图像进行预处理,并将预处理后的图像转换为灰度图像。The image is preprocessed, and the preprocessed image is converted into a grayscale image. 7.根据权利要求1-5任意一项所述的物流包裹检测方法,其特征在于,所述通过预设的检测模型对所述图像信息进行处理,获得所述图像信息中包含的目标的类别,以及覆盖每个目标的边界框的位置信息之后,还包括:7. The logistics package detection method according to any one of claims 1-5, wherein the image information is processed through a preset detection model to obtain the category of the target contained in the image information , and after the location information of the bounding box covering each target, it also includes: 根据所述图像中覆盖包裹的边界框的位置信息确定是否需要调整包裹的位置。Whether the position of the package needs to be adjusted is determined according to the position information of the bounding box covering the package in the image. 8.一种物流包裹检测装置,其特征在于,包括:8. A logistics parcel detection device, characterized in that, comprising: 采集模块,用于采集位于包裹分拣传送带上的包裹的图像;an acquisition module for acquiring images of packages located on the parcel sorting conveyor; 融合模块,用于将所述图像中的每个坐标的X坐标值构成的第一数据矩阵和Y坐标值构成的第二数据矩阵,以及所述图像的灰度值融合为所述图像的图像信息;A fusion module, configured to fuse the first data matrix formed by the X coordinate value of each coordinate in the image, the second data matrix formed by the Y coordinate value, and the gray value of the image into an image of the image information; 检测模块,用于通过预设的检测模型对所述图像信息进行处理,获得所述图像信息中包含的目标的类别,以及覆盖每个目标的边界框的位置信息;其中,所述图像信息中包含的目标至少包括:包裹和风琴板。a detection module, configured to process the image information through a preset detection model to obtain the category of the target contained in the image information, and the position information of the bounding box covering each target; wherein, the image information contains Included targets include at least: wrap and organ board. 9.一种物流包裹检测设备,其特征在于,包括:9. A logistics parcel detection device, characterized in that, comprising: 存储器,用于存储计算机程序;memory for storing computer programs; 处理器,用于执行所述计算机程序时实现如权利要求1-7任意一项所述的物流包裹检测方法的步骤。The processor is configured to implement the steps of the logistics package detection method according to any one of claims 1-7 when executing the computer program. 10.一种可读存储介质,其特征在于,所述可读存储介质上存储有计算机程序,所述计算机程序被处理器执行时实现如权利要求1-7任意一项所述的物流包裹检测方法的步骤。10. A readable storage medium, characterized in that, a computer program is stored on the readable storage medium, and when the computer program is executed by a processor, the logistics package detection according to any one of claims 1-7 is realized steps of the method.
CN201910126340.1A 2019-02-20 2019-02-20 Logistics package detection method, device, equipment and readable storage medium Active CN111597857B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201910126340.1A CN111597857B (en) 2019-02-20 2019-02-20 Logistics package detection method, device, equipment and readable storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201910126340.1A CN111597857B (en) 2019-02-20 2019-02-20 Logistics package detection method, device, equipment and readable storage medium

Publications (2)

Publication Number Publication Date
CN111597857A true CN111597857A (en) 2020-08-28
CN111597857B CN111597857B (en) 2023-09-26

Family

ID=72188560

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201910126340.1A Active CN111597857B (en) 2019-02-20 2019-02-20 Logistics package detection method, device, equipment and readable storage medium

Country Status (1)

Country Link
CN (1) CN111597857B (en)

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112934758A (en) * 2020-12-14 2021-06-11 中科院计算所西部高等技术研究院 Coal sorting hand-dialing control method based on image recognition
CN113554706A (en) * 2021-07-29 2021-10-26 中科微至智能制造科技江苏股份有限公司 Trolley package position detection method based on deep learning
CN115035192A (en) * 2022-06-21 2022-09-09 北京远舢智能科技有限公司 Method and device for determining positions of tobacco leaf distributing vehicle and conveying belt
CN115496914A (en) * 2022-08-18 2022-12-20 成都智元汇信息技术股份有限公司 Maximum outline package extraction method and device based on column data

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN108171748A (en) * 2018-01-23 2018-06-15 哈工大机器人(合肥)国际创新研究院 A kind of visual identity of object manipulator intelligent grabbing application and localization method
CN108876765A (en) * 2018-05-22 2018-11-23 塞伯睿机器人技术(长沙)有限公司 The target locating set and method of industrial sorting machine people
CN109344821A (en) * 2018-08-30 2019-02-15 西安电子科技大学 Small target detection method based on feature fusion and deep learning

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN108171748A (en) * 2018-01-23 2018-06-15 哈工大机器人(合肥)国际创新研究院 A kind of visual identity of object manipulator intelligent grabbing application and localization method
CN108876765A (en) * 2018-05-22 2018-11-23 塞伯睿机器人技术(长沙)有限公司 The target locating set and method of industrial sorting machine people
CN109344821A (en) * 2018-08-30 2019-02-15 西安电子科技大学 Small target detection method based on feature fusion and deep learning

Cited By (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112934758A (en) * 2020-12-14 2021-06-11 中科院计算所西部高等技术研究院 Coal sorting hand-dialing control method based on image recognition
CN113554706A (en) * 2021-07-29 2021-10-26 中科微至智能制造科技江苏股份有限公司 Trolley package position detection method based on deep learning
CN113554706B (en) * 2021-07-29 2024-02-27 中科微至科技股份有限公司 Trolley parcel position detection method based on deep learning
CN115035192A (en) * 2022-06-21 2022-09-09 北京远舢智能科技有限公司 Method and device for determining positions of tobacco leaf distributing vehicle and conveying belt
CN115035192B (en) * 2022-06-21 2023-04-14 北京远舢智能科技有限公司 Method and device for determining positions of tobacco leaf distributing vehicle and conveying belt
CN115496914A (en) * 2022-08-18 2022-12-20 成都智元汇信息技术股份有限公司 Maximum outline package extraction method and device based on column data
CN115496914B (en) * 2022-08-18 2023-05-02 成都智元汇信息技术股份有限公司 Method and device for extracting package of maximum outline based on column data

Also Published As

Publication number Publication date
CN111597857B (en) 2023-09-26

Similar Documents

Publication Publication Date Title
CN111597857A (en) Logistics package detection method, device and equipment and readable storage medium
CN110705405B (en) Target labeling method and device
CN107179324A (en) Method, device and system for detecting product package
KR20180104609A (en) Method, system, apparatus and readable storage medium for realizing insurance claims fraud prevention based on a plurality of image correspondence
CN109583535A (en) A kind of logistics bar code detection method, the computer program of view-based access control model
CN111461133B (en) Express delivery surface single item name identification method, device, equipment and storage medium
CN109598298B (en) Image object recognition method and system
CN111310826A (en) Method and device for detecting labeling abnormity of sample set and electronic equipment
CN109389105A (en) A kind of iris detection and viewpoint classification method based on multitask
CN117274843B (en) UAV front-end defect recognition method and system based on lightweight edge computing
CN111062252A (en) Real-time dangerous article semantic segmentation method and device and storage device
CN109145752A (en) For assessing the method, apparatus, equipment and medium of object detection and track algorithm
CN115438945A (en) Risk identification method, device, equipment and medium based on power equipment inspection
CN118411576B (en) A carton classification method and device based on data processing
CN115546845A (en) Multi-view cow face identification method and device, computer equipment and storage medium
CN112150398A (en) Image synthesis method, device and equipment
CN113191469A (en) Logistics management method, system, server and storage medium based on two-dimension code
CN118247546A (en) Method, device, equipment and storage medium for identifying non-standard operation of sorting personnel
CN116843645A (en) Method and device for defect detection of product outer packaging polypropylene film
CN117788444A (en) SMT patch offset detection method, SMT patch offset detection device and SMT patch offset detection system
CN115565171A (en) Method and device for associated labeling of security inspection images
CN115512283A (en) Parcel image processing method and device, computer equipment and storage medium
CN118868787B (en) Photovoltaic defect remote monitoring method based on wireless communication transmission
CN114529733A (en) Package damage detection method and device, electronic equipment and storage medium
CN117635619B (en) Log volume detection method and system based on machine vision

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
CB02 Change of applicant information

Address after: 214105 No. 299 Dacheng Road, Xishan District, Jiangsu, Wuxi

Applicant after: Zhongke Weizhi intelligent manufacturing technology Jiangsu Co.,Ltd.

Address before: 214105 No. 299 Dacheng Road, Xishan District, Jiangsu, Wuxi

Applicant before: ZHONGKE WEIZHI INTELLIGENT MANUFACTURING TECHNOLOGY JIANGSU Co.,Ltd.

CB02 Change of applicant information
TA01 Transfer of patent application right

Effective date of registration: 20200915

Address after: 214105 No. 299 Dacheng Road, Xishan District, Jiangsu, Wuxi

Applicant after: ZHONGKE WEIZHI INTELLIGENT MANUFACTURING TECHNOLOGY JIANGSU Co.,Ltd.

Address before: Zuchongzhi road Kunshan city 215347 Suzhou City, Jiangsu province No. 1699 building 7 floor

Applicant before: KUNSHAN BRANCH, INSTITUTE OF MICROELECTRONICS OF CHINESE ACADEMY OF SCIENCES

TA01 Transfer of patent application right
CB02 Change of applicant information

Address after: 214105 No. 979, Antai Third Road, Xishan District, Wuxi City, Jiangsu Province

Applicant after: Zhongke Weizhi Technology Co.,Ltd.

Address before: No. 299, Dacheng Road, Xishan District, Wuxi City, Jiangsu Province

Applicant before: Zhongke Weizhi intelligent manufacturing technology Jiangsu Co.,Ltd.

CB02 Change of applicant information
GR01 Patent grant
GR01 Patent grant