布料识别的方法、设备、电子设备及储存介质Method, device, electronic device and storage medium for fabric identification
相关申请的交叉引用Cross-reference to related applications
本公开要求于2017年07月14日提交中国专利局的申请号为201710577160.6名称为“一种布料识别的方法和设备”的中国专利申请的优先权,其全部内容通过引用结合在本申请中。The present disclosure claims priority to Chinese Patent Application No. JP-A No. No. No. No. No. No No No No No No No No No No No No No No No No No No No No No No No No No No No No No No No No No No No No No No No No No No No No No No
技术领域Technical field
本公开涉及图像识别以及数据处理领域,特别涉及一种布料识别的方法和、设备、电子设备及储存介质。The present disclosure relates to the field of image recognition and data processing, and in particular, to a method and device for fabric identification, an electronic device, and a storage medium.
背景技术Background technique
随着社会经济的发展,布料的种类越来越丰富,而目前对布料的识别方式都是基于人工的方式来进行的,但这种方式费时费力,效率低下。更由于目前人工成本也越来越高,布料的种类也越来越多,人工的方式完全没法应对这种数量级别的识别需要,因此目前已有的布料识别方式特别不适用于目前社会经济的发展需要。With the development of social economy, the types of fabrics are becoming more and more abundant. At present, the identification of fabrics is based on manual methods, but this method is time-consuming and laborious and inefficient. Moreover, due to the increasing labor costs and the increasing variety of fabrics, the manual method can't cope with this quantitative level of identification needs. Therefore, the existing cloth identification methods are not suitable for the current social economy. Development needs.
发明内容Summary of the invention
针对现有技术中的缺陷,本公开提出了一种布料识别的方法和、设备、电子设备及储存介质,通过专用的布料识别神经网络来对待识别布料进行识别,有效提高了识别效率。In view of the defects in the prior art, the present disclosure proposes a method and device for fabric identification, an apparatus, an electronic device and a storage medium, which are identified by a special cloth recognition neural network to effectively identify the cloth, thereby effectively improving the recognition efficiency.
具体的,本公开提出了以下具体的实施例:Specifically, the present disclosure proposes the following specific embodiments:
本公开实施例提出了一种布料识别的方法,包括:The embodiment of the present disclosure provides a method for fabric identification, including:
获取待识别布料的图像;Obtaining an image of the fabric to be identified;
提取所述图像中对应所述待识别布料的布料特征;Extracting a cloth feature corresponding to the cloth to be identified in the image;
基于通过预先生成的布料识别神经网络对所述布料特征进行识别,生成对应所述待识别布料的识别结果。The recognition result of the cloth to be identified is generated based on the fabric feature identified by the pre-generated cloth identification neural network.
在一个具体的实施例中,所述布料特征包括:布料的颜色、和/或布料的图案、和/或布料的纹理;其中所述图案与纹理是通过对所述图像进行轮廓识别得到的。In a specific embodiment, the fabric features include: a color of the cloth, and/or a pattern of the cloth, and/or a texture of the cloth; wherein the pattern and texture are obtained by contouring the image.
在一个具体的实施例中,所述“基于通过预先生成的布料识别神经网络对所述布料特征进行识别,生成对应所述待识别布料的识别结果”包括:In a specific embodiment, the “recognizing the cloth feature based on the pre-generated cloth identification neural network to generate the recognition result corresponding to the cloth to be identified” includes:
确定预先生成的布料识别神经网络所对应的数据格式;Determining a data format corresponding to the pre-generated cloth identification neural network;
若所述数据格式中包括二进制数据格式,将所述布料特征转换为二进制数据格式后输入所述布料识别神经网络,以生成对应所述待识别布料的识别结果。If the data format includes a binary data format, the cloth feature is converted into a binary data format and then input into the cloth recognition neural network to generate a recognition result corresponding to the cloth to be identified.
在一个具体的实施例中,所述布料识别神经网络是通过数量超过一定阈值的布料标本数据进行训练得到的;其中,所述布料标本数据中包括布料特征与识别结果。In a specific embodiment, the cloth identification neural network is trained by the cloth specimen data exceeding a certain threshold; wherein the cloth specimen data includes a cloth feature and a recognition result.
在一个具体的实施例中,所述布料标本数据包括三元组数据;其中,所述三元组数据包括:源数据、与所述源数据属于同一类的正向数据、以及与所述源数据分属不同类的反向数据;In a specific embodiment, the cloth specimen data includes triple data; wherein the triple data includes: source data, forward data belonging to the same class as the source data, and the source The data belongs to different types of reverse data;
其中,所述源数据为从所述布料样本数据中随机获取到的数据;The source data is data randomly acquired from the cloth sample data;
所述正向数据为在所述布料样本数据中随机获取的与所述源数据的识别结果一致的数据;The forward data is data that is randomly acquired in the cloth sample data and is consistent with the recognition result of the source data;
所述反向数据为在所述布料样本数据中随机获取的与所述源数据的识别结果不一致的数据。The reverse data is data that is randomly acquired in the cloth sample data and is inconsistent with the recognition result of the source data.
本公开实施例还提出了一种布料识别的设备,包括:An embodiment of the present disclosure further provides a device for fabric identification, including:
获取模块,配置成获取待识别布料的图像;Obtaining a module configured to obtain an image of the fabric to be identified;
提取模块,配置成提取所述图像中对应所述待识别布料的布料特征;An extraction module configured to extract a cloth feature corresponding to the fabric to be identified in the image;
识别模块,配置成基于通过预先生成的布料识别神经网络对所述布料特征进行识别,生成对应所述待识别布料的识别结果。The identification module is configured to generate a recognition result corresponding to the cloth to be identified based on identifying the cloth feature by a pre-generated cloth identification neural network.
在一个具体的实施例中,所述布料特征包括:布料的颜色、和/或布料的图案、和/或布料的纹理;其中所述图案与纹理是通过对所述图像进行轮廓识别得到的。In a specific embodiment, the fabric features include: a color of the cloth, and/or a pattern of the cloth, and/or a texture of the cloth; wherein the pattern and texture are obtained by contouring the image.
在一个具体的实施例中,所述识别模块,配置成:In a specific embodiment, the identification module is configured to:
确定预先生成的布料识别神经网络所对应的数据格式;Determining a data format corresponding to the pre-generated cloth identification neural network;
若所述数据格式中包括二进制数据格式,将所述布料特征转换为二进制数据格式后输入所述布料识别神经网络,以生成对应所述待识别布料的识别结果。If the data format includes a binary data format, the cloth feature is converted into a binary data format and then input into the cloth recognition neural network to generate a recognition result corresponding to the cloth to be identified.
在一个具体的实施例中,所述布料识别神经网络是通过数量超过一定阈值的布料标本数据进行训练得到的;其中,所述布料标本数据中包括布料特征与识别结果。In a specific embodiment, the cloth identification neural network is trained by the cloth specimen data exceeding a certain threshold; wherein the cloth specimen data includes a cloth feature and a recognition result.
在一个具体的实施例中,所述布料标本数据包括三元组数据;其中,所述三元组数据包括:源数据、与所述源数据属于同一类的正向数据、以及与所述源数据分属不同类的反向数据;In a specific embodiment, the cloth specimen data includes triple data; wherein the triple data includes: source data, forward data belonging to the same class as the source data, and the source The data belongs to different types of reverse data;
其中,所述源数据为从所述布料样本数据中随机获取到的数据;The source data is data randomly acquired from the cloth sample data;
所述正向数据为在所述布料样本数据中随机获取的与所述源数据的识别结果一致的数据;The forward data is data that is randomly acquired in the cloth sample data and is consistent with the recognition result of the source data;
所述反向数据为在所述布料样本数据中随机获取的与所述源数据的识别结果不一致的数据。The reverse data is data that is randomly acquired in the cloth sample data and is inconsistent with the recognition result of the source data.
以此,本公开实施例提出了一种布料识别的方法和、设备、电子设备及储存介质,其中该方法包括:获取待识别布料的图像;提取所述图像中对应所述待识别布料的布料特征;基于通过预先生成的布料识别神经网络对所述布料特征进行识别,生成对应所述待识别布 料的识别结果。以此本公开实施例通过自动化的方式实现了对布料的识别,极大的降低了人工成本。由于在识别过程中通过专用的布料识别神经网络来进行,不仅能够对种类繁多的大量布料进行识别,且在提高识别效率的同时,还能够有效保证了识别的准确性。Therefore, the embodiment of the present disclosure provides a method and device for fabric identification, an apparatus, an electronic device, and a storage medium, wherein the method includes: acquiring an image of the cloth to be identified; and extracting a cloth corresponding to the cloth to be identified in the image. a feature; identifying the cloth feature based on the pre-generated cloth recognition neural network, and generating a recognition result corresponding to the cloth to be identified. With the embodiment of the present disclosure, the identification of the cloth is realized in an automated manner, which greatly reduces the labor cost. Since the neural network is identified by a dedicated cloth during the recognition process, it is possible to recognize not only a large variety of fabrics, but also to improve the recognition efficiency while ensuring the accuracy of recognition.
附图说明DRAWINGS
为了更清楚地说明本公开实施例的技术方案,下面将对实施例中所需要使用的附图作简单地介绍,应当理解,以下附图仅示出了本公开的某些实施例,因此不应被看作是对范围的限定,对于本领域普通技术人员来讲,在不付出创造性劳动的前提下,还可以根据这些附图获得其他相关的附图。In order to more clearly illustrate the technical solutions of the embodiments of the present disclosure, the drawings to be used in the embodiments will be briefly described below. It should be understood that the following drawings show only certain embodiments of the present disclosure, and thus It should be seen as a limitation on the scope, and those skilled in the art can obtain other related drawings according to these drawings without any creative work.
图1为本公开实施例提供的数据处理设备的示意图;FIG. 1 is a schematic diagram of a data processing device according to an embodiment of the present disclosure;
图2为本公开实施例提供的恶意用户识别方法的流程示意图;2 is a schematic flowchart of a malicious user identification method according to an embodiment of the present disclosure;
图3为本公开实施例提供的恶意用户识别方法中步骤S120的子步骤示意图;FIG. 3 is a schematic diagram of sub-steps of step S120 in the malicious user identification method according to an embodiment of the present disclosure;
图4为本公开实施例提供的恶意用户识别装置的示意图。FIG. 4 is a schematic diagram of a malicious user identification apparatus according to an embodiment of the present disclosure.
图标:100-数据处理设备;110-恶意用户识别装置;111-特征获取模块;112-相似度计算模块;113-初始化模块;114-迭代计算模块;115-识别模块;120-存储器;130-处理器。Icon: 100-data processing device; 110-malicious user identification device; 111-feature acquisition module; 112-similarity calculation module; 113-initialization module; 114-iteration calculation module; 115-identification module; 120-memory; processor.
具体实施方式Detailed ways
在下文中,将更全面地描述本公开的各种实施例。本公开可具有各种实施例,并且可在其中做出调整和改变。然而,应理解:不存在将本公开的各种实施例限于在此公开的特定实施例的意图,而是应将本公开理解为涵盖落入本公开的各种实施例的精神和范围内的所有调整、等同物和/或可选方案。In the following, various embodiments of the present disclosure will be described more fully. The present disclosure can have various embodiments, and adjustments and changes can be made therein. It should be understood, however, that the present invention is not limited to the specific embodiments disclosed herein, but the invention is to be construed as being included within the spirit and scope of the various embodiments of the present disclosure. All adjustments, equivalents and/or alternatives.
在下文中,可在本公开的各种实施例中使用的术语“包括”或“可包括”指示所公开的功能、操作或元件的存在,并且不限制一个或更多个功能、操作或元件的增加。此外,如在本公开的各种实施例中所使用,术语“包括”、“具有”及其同源词仅意在表示特定特征、数字、步骤、操作、元件、组件或前述项的组合,并且不应被理解为首先排除一个或更多个其它特征、数字、步骤、操作、元件、组件或前述项的组合的存在或增加一个或更多个特征、数字、步骤、操作、元件、组件或前述项的组合的可能性。In the following, the term "comprising" or "including" may be used in the various embodiments of the present disclosure to indicate the existence of the disclosed function, operation or element, and does not limit one or more functions, operations or elements. increase. In addition, the terms "comprising," "having," "," It should not be understood that the existence or addition of one or more features, numbers, steps, operations, components or components of one or more other features, numbers, steps, operations, components, components or combinations of the foregoing are excluded. Or the possibility of a combination of the foregoing.
在本公开的各种实施例中,表述“或”或“A或/和B中的至少一个”包括同时列出的文字的任何组合或所有组合。例如,表述“A或B”或“A或/和B中的至少一个”可包括A、可包括B或可包括A和B二者。In various embodiments of the present disclosure, the expression "or" or "at least one of A or / and B" includes any or all combinations of the simultaneously listed characters. For example, the expression "A or B" or "at least one of A or / and B" may include A, may include B, or may include both A and B.
在本公开的各种实施例中使用的表述(诸如“第一”、“第二”等)可修饰在各种实施例中的各种组成元件,不过可不限制相应组成元件。例如,以上表述并不限制所述元件的顺序和/或重要性。以上表述仅配置成将一个元件与其它元件区别开的目的。例如,第一用户装置和第二用户装置指示不同用户装置,尽管二者都是用户装置。例如,在不脱离本公 开的各种实施例的范围的情况下,第一元件可被称为第二元件,同样地,第二元件也可被称为第一元件。Expressions used in various embodiments of the present disclosure (such as "first", "second", etc.) may modify various constituent elements in various embodiments, but the corresponding constituent elements may not be limited. For example, the above statements do not limit the order and/or importance of the elements. The above statements are only configured to distinguish one element from another. For example, the first user device and the second user device indicate different user devices, although both are user devices. For example, a first element could be termed a second element, and a second element could be termed a first element, without departing from the scope of the various embodiments disclosed herein.
应注意到:如果描述将一个组成元件“连接”到另一组成元件,则可将第一组成元件直接连接到第二组成元件,并且可在第一组成元件和第二组成元件之间“连接”第三组成元件。相反地,当将一个组成元件“直接连接”到另一组成元件时,可理解为在第一组成元件和第二组成元件之间不存在第三组成元件。It should be noted that if the description "connects" one constituent element to another constituent element, the first constituent element can be directly connected to the second constituent element and can be "connected" between the first constituent element and the second constituent element. "The third component. On the contrary, when a constituent element is "directly connected" to another constituent element, it is understood that there is no third constituent element between the first constituent element and the second constituent element.
在本公开的各种实施例中使用的术语“用户”可指示使用电子装置的人或使用电子装置的装置(例如,人工智能电子装置)。The term "user" as used in various embodiments of the present disclosure may indicate a person using an electronic device or a device using an electronic device (eg, an artificial intelligence electronic device).
在本公开的各种实施例中使用的术语仅配置成描述特定实施例的目的并且并非意在限制本公开的各种实施例。如在此所使用,单数形式意在也包括复数形式,除非上下文清楚地另有指示。除非另有限定,否则在这里使用的所有术语(包括技术术语和科学术语)具有与本公开的各种实施例所属领域普通技术人员通常理解的含义相同的含义。所述术语(诸如在一般使用的词典中限定的术语)将被解释为具有与在相关技术领域中的语境含义相同的含义并且将不被解释为具有理想化的含义或过于正式的含义,除非在本公开的各种实施例中被清楚地限定。The terms used in the various embodiments of the present disclosure are only intended to describe the specific embodiments and are not intended to limit the various embodiments of the present disclosure. As used herein, the singular forms " All terms (including technical and scientific terms) used herein have the same meaning as commonly understood by one of ordinary skill in the art to which the various embodiments of the present disclosure pertain, unless otherwise defined. The term (such as a term defined in a commonly used dictionary) will be interpreted as having the same meaning as the contextual meaning in the related art and will not be interpreted as having an idealized meaning or an overly formal meaning, Unless clearly defined in the various embodiments of the present disclosure.
实施例1Example 1
本公开实施例1公开了一种布料识别的方法,如图1所示,包括以下步骤:Embodiment 1 of the present disclosure discloses a method for fabric identification, as shown in FIG. 1, comprising the following steps:
步骤101、获取待识别布料的图像;Step 101: Acquire an image of the cloth to be identified;
具体的,可以从网络获取已有的待识别布料的图像,也可以在看到某布料之后,想进行识别是什么布料,因而进行拍摄来获取到拍摄的图像,还可以为获取到其他设备上所存储的包含有布料的图片,具体的只要获取到对应待识别布料的图像即可,并不限于以上的几种具体的获取方式。Specifically, an image of the existing fabric to be identified may be obtained from the network, or after a certain fabric is seen, it is desired to identify the fabric, and thus the image is captured to obtain the captured image, and may be acquired on other devices. The stored image containing the cloth may be obtained by simply obtaining the image corresponding to the cloth to be identified, and is not limited to the above specific acquisition methods.
步骤102、提取所述图像中对应所述待识别布料的布料特征;Step 102: Extract a cloth feature corresponding to the fabric to be identified in the image;
在一个具体的实施例中,所述布料特征包括:布料的颜色、和/或布料的图案、和/或布料的纹理;其中所述图案与纹理是通过对所述图像进行轮廓识别得到的。In a specific embodiment, the fabric features include: a color of the cloth, and/or a pattern of the cloth, and/or a texture of the cloth; wherein the pattern and texture are obtained by contouring the image.
具体的,除了颜色,图案,纹理等特征以外,还可以根据需要以及布料本身的特征,选取其他的特征来作为布料特征,例如还可以包括反光度等等,具体的只要是可以反映布料的图像特征即可。Specifically, in addition to features such as color, pattern, texture, etc., other features may be selected as the cloth features according to the needs and characteristics of the cloth itself, for example, may also include shininess, etc., as long as the image can reflect the cloth. Features can be.
至于获取各特征的方式,以图案或纹理为例,可以对图像进行二值化处理,通过二值化后获得带灰度值的图像,以及根据该带灰度值的图像的轮廓来确定图案以及纹理,具体的是基于带灰度值的图像的各像素点的灰度值对比来确定出图像轮廓,并进一步基于后续识别出的图像轮廓对图案以及纹理进行提取而获得该待识别布料的布料特征。而除了基于 灰度的二值化处理方式以外,还可以利用二值化神经网络的方式来进行图像识别,以获取图像中到所需要的该待识别布料的布料特征。As for the manner of obtaining each feature, taking a pattern or a texture as an example, the image may be binarized, the image with the gray value is obtained by binarization, and the pattern is determined according to the contour of the image with the gray value. And the texture, specifically, determining the image contour based on the gray value comparison of each pixel of the image with the gray value, and further extracting the pattern and the texture based on the subsequently recognized image contour to obtain the fabric to be identified Cloth features. In addition to the gray-based binarization processing method, the image recognition can be performed by means of a binarized neural network to obtain the desired cloth feature of the fabric to be identified in the image.
另外,布料的颜色例如可以分为红,黄,蓝,绿等各种颜色,具体的颜色还可以进一步细分,按照色相,明度,和饱和度等的不同来进行进一步的区分,具体的对颜色的区分越细,后续的识别过程越准确。In addition, the color of the cloth can be divided into various colors such as red, yellow, blue, and green. The specific color can be further subdivided, and further differentiated according to the difference in hue, brightness, and saturation. The finer the color distinction, the more accurate the subsequent recognition process.
与之对应的是其他的布料特征,例如图案以及纹理等也都是细致越清晰,后续的识别越准;此外,布料的特征越多,相应的后续的识别效果也越好。具体的特征的数量以及特征的准确程度可以根据实际的需要以及布料的应用场景来进行灵活的调整。Corresponding to other fabric features, such as patterns and textures, are also more detailed and more clear, the subsequent recognition is more accurate; in addition, the more features of the fabric, the corresponding subsequent recognition effect is better. The number of specific features and the accuracy of the features can be flexibly adjusted according to actual needs and the application scenarios of the fabric.
在一个具体的实施例中,还可以根据特征的不同,设置各自独立的权重系数,在后续的识别过程中,若无法完全满足各特征,还可以基于权重系统选择一个匹配程度最高的识别结果作为识别结果;当然也可以是各个特征的权重系数为一样,具体的可以根据需要进行灵活的设置。In a specific embodiment, the independent weighting coefficients may also be set according to different features. In the subsequent identification process, if the features are not fully satisfied, the weighting system may select a matching result with the highest matching degree as the matching result. The result of the recognition; of course, the weight coefficient of each feature is the same, and the specific can be flexibly set as needed.
步骤103、基于通过预先生成的布料识别神经网络对所述布料特征进行识别,生成对应所述待识别布料的识别结果。Step 103: Generate a recognition result corresponding to the cloth to be identified based on identifying the cloth feature by using a pre-generated cloth identification neural network.
在一个具体的实施例中,步骤103中的所述“基于通过预先生成的布料识别神经网络对所述布料特征进行识别,生成对应所述待识别布料的识别结果”,如图2所示,包括:In a specific embodiment, the “recognizing the cloth feature by using a pre-generated cloth identifying neural network to generate a recognition result corresponding to the cloth to be identified” in step 103, as shown in FIG. 2 include:
步骤1031、确定预先生成的布料识别神经网络所对应的数据格式;Step 1031: Determine a data format corresponding to the pre-generated cloth identification neural network;
步骤1032、若所述数据格式中包括二进制数据格式,将所述布料特征转换为二进制数据格式后输入所述布料识别神经网络,以生成对应所述待识别布料的识别结果。Step 1032: If the data format includes a binary data format, convert the cloth feature into a binary data format, and then input the cloth recognition neural network to generate a recognition result corresponding to the cloth to be identified.
具体的,若是布料识别神经网络可支持二进制的数据格式,则将不良特征进行转换,具体的装换为二进制的数据格式,在输入到不了识别神经网络中进行识别,由于机器语言为二进制,因此通过二进制的数据格式,可以加快识别的过程,在进行识别时,不需要再额外进行数据的转换,因此可以有效提高识别的效率。Specifically, if the cloth recognition neural network can support the binary data format, the bad features are converted, and the specific data is replaced by a binary data format, which is recognized in the input neural network, since the machine language is binary, Through the binary data format, the recognition process can be speeded up, and no additional data conversion is required when the identification is performed, so that the recognition efficiency can be effectively improved.
在一个具体的实施例中,所述布料识别神经网络是通过数量超过一定阈值的布料标本数据进行训练得到的;其中,所述布料标本数据中包括布料特征与识别结果。In a specific embodiment, the cloth identification neural network is trained by the cloth specimen data exceeding a certain threshold; wherein the cloth specimen data includes a cloth feature and a recognition result.
具体的,基于已知识别结果的布料标本数据来进行训练,以配置成进行布料识别的布料识别神经网络,具体的布料标本数据的数量越多越好,数据越多,训练生成的布料识别神经网络的识别能力越强,具体的布料标本数据可以为人工标记的布料的数据,也可以为该布料识别神经网络自身进行识别后的数据,具体的,例如布料识别神经网络识别某识别布料为涤纶,后续反馈给布料专业用户,在获取到布料专业用户的反馈之后,该数据即可以作为布料标本数据。Specifically, the cloth specimen data based on the known recognition result is trained to configure the cloth identification neural network for fabric identification. The more the cloth specimen data is, the better the data is. The more the data, the cloth-recognition nerve generated by the training. The stronger the recognition ability of the network, the specific cloth specimen data can be the data of the artificially labeled fabric, and the data of the cloth identification neural network itself can be identified. Specifically, for example, the cloth identification neural network identifies a certain identification fabric as polyester. The follow-up feedback is given to the professional users of the fabric. After obtaining the feedback from the professional users of the fabric, the data can be used as the cloth specimen data.
具体的,布料标本数据中包括布料特征以及对应该布料特征的识别结果,该识别结果 可以为正确的识别结果,也可以为错误的识别结果,若为正确的识别结果,则还会将识别结果标记为正确;至于错误的识别结果,则标记为错误。Specifically, the cloth specimen data includes a cloth feature and a recognition result corresponding to the cloth feature, and the recognition result may be a correct recognition result or an incorrect recognition result, and if it is a correct recognition result, the recognition result is also obtained. Marked as correct; as for the wrong recognition result, it is marked as an error.
以此在一个具体的实施例中,如图3所示,所述布料标本数据包括三元组数据;其中,所述三元组数据包括:源数据、与所述源数据属于同一类的正向数据、以及与所述源数据分属不同类的反向数据;In a specific embodiment, as shown in FIG. 3, the cloth specimen data includes triple data; wherein the triple data includes: source data, and the same type as the source data Reverse data to data, and to different classes from the source data;
其中,所述源数据为从所述布料样本数据中随机获取到的数据;The source data is data randomly acquired from the cloth sample data;
所述正向数据为在所述布料样本数据中随机获取的与所述源数据的识别结果一致的数据;The forward data is data that is randomly acquired in the cloth sample data and is consistent with the recognition result of the source data;
所述反向数据为在所述布料样本数据中随机获取的与所述源数据的识别结果不一致的数据。The reverse data is data that is randomly acquired in the cloth sample data and is inconsistent with the recognition result of the source data.
在此,以一个具体的实施例来进行说明,三元组数据例如分别为:布料样本数据中专业摄影人员所拍摄的涤纶的第一图片、布料样本数据中非专业人员所拍摄的涤纶的第二图片、以及布料样本数据中所存储的拍摄的非涤纶(例如为丝绸)的第三图片,具体的第一图片为匹配程度最高的源数据,第二图片,由于是非专业人员所拍摄,在清晰度,分辨率等方面与第一图片存在有差距,但是仍还是涤纶的图片,是正向数据;至于第三图片,则是在训练时进行反向对比的反向数据,以此通过正反对比,更有效训练了布料识别神经网络的识别准确性。Here, the description will be made in a specific embodiment, for example, the first picture of the polyester photographed by the professional photographer in the cloth sample data, and the polyester photographed by the non-professionals in the cloth sample data. a second picture of the non-polyester (for example, silk) photographed in the second picture and the cloth sample data, the specific first picture is the source data with the highest matching degree, and the second picture is taken by a non-professional There is a gap between the definition and resolution of the first picture, but it is still a picture of polyester, which is forward data; as for the third picture, it is reverse data of reverse contrast during training, so as to pass the positive and negative In contrast, the recognition accuracy of the cloth recognition neural network is more effectively trained.
实施例2Example 2
本公开实施例2还公开一种布料识别的设备,如图4所示,包括:Embodiment 2 of the present disclosure further discloses a device for fabric identification, as shown in FIG. 4, comprising:
获取模块201,配置成获取待识别布料的图像;The obtaining module 201 is configured to obtain an image of the cloth to be identified;
提取模块202,配置成提取所述图像中对应所述待识别布料的布料特征;The extracting module 202 is configured to extract a cloth feature corresponding to the cloth to be identified in the image;
识别模块203,配置成基于通过预先生成的布料识别神经网络对所述布料特征进行识别,生成对应所述待识别布料的识别结果。The identification module 203 is configured to generate a recognition result corresponding to the cloth to be identified based on identifying the cloth feature by a cloth recognition neural network generated in advance.
在一个具体的实施例中,所述布料特征包括:布料的颜色、和/或布料的图案、和/或布料的纹理;其中所述图案与纹理是通过对所述图像进行轮廓识别得到的。In a specific embodiment, the fabric features include: a color of the cloth, and/or a pattern of the cloth, and/or a texture of the cloth; wherein the pattern and texture are obtained by contouring the image.
在一个具体的实施例中,所述识别模块203,配置成:In a specific embodiment, the identification module 203 is configured to:
确定预先生成的布料识别神经网络所对应的数据格式;Determining a data format corresponding to the pre-generated cloth identification neural network;
若所述数据格式中包括二进制数据格式,将所述布料特征转换为二进制数据格式后输入所述布料识别神经网络,以生成对应所述待识别布料的识别结果。If the data format includes a binary data format, the cloth feature is converted into a binary data format and then input into the cloth recognition neural network to generate a recognition result corresponding to the cloth to be identified.
在一个具体的实施例中,所述布料识别神经网络是通过数量超过一定阈值的布料标本数据进行训练得到的;其中,所述布料标本数据中包括布料特征与识别结果。In a specific embodiment, the cloth identification neural network is trained by the cloth specimen data exceeding a certain threshold; wherein the cloth specimen data includes a cloth feature and a recognition result.
在一个具体的实施例中,所述布料标本数据包括三元组数据;其中,所述三元组数据包括:源数据、与所述源数据属于同一类的正向数据、以及与所述源数据分属不同类的反向数据;In a specific embodiment, the cloth specimen data includes triple data; wherein the triple data includes: source data, forward data belonging to the same class as the source data, and the source The data belongs to different types of reverse data;
其中,所述源数据为从所述布料样本数据中随机获取到的数据;The source data is data randomly acquired from the cloth sample data;
所述正向数据为在所述布料样本数据中随机获取的与所述源数据的识别结果一致的数据;The forward data is data that is randomly acquired in the cloth sample data and is consistent with the recognition result of the source data;
所述反向数据为在所述布料样本数据中随机获取的与所述源数据的识别结果不一致的数据。The reverse data is data that is randomly acquired in the cloth sample data and is inconsistent with the recognition result of the source data.
以此,本公开实施例提出了一种布料识别的方法和、设备、电子设备及储存介质,其中该方法包括:获取待识别布料的图像;提取所述图像中对应所述待识别布料的布料特征;基于通过预先生成的布料识别神经网络对所述布料特征进行识别,生成对应所述待识别布料的识别结果。以此本公开实施例通过自动化的方式实现了对布料的识别,极大的降低了人工成本。由于在识别过程中通过专用的布料识别神经网络来进行,不仅能够对种类繁多的大量布料进行识别,且在提高识别效率的同时,还能够有效保证了识别的准确性。Therefore, the embodiment of the present disclosure provides a method and device for fabric identification, an apparatus, an electronic device, and a storage medium, wherein the method includes: acquiring an image of the cloth to be identified; and extracting a cloth corresponding to the cloth to be identified in the image. a feature; identifying the cloth feature based on the pre-generated cloth recognition neural network, and generating a recognition result corresponding to the cloth to be identified. With the embodiment of the present disclosure, the identification of the cloth is realized in an automated manner, which greatly reduces the labor cost. Since the neural network is identified by a dedicated cloth during the recognition process, it is possible to recognize not only a large variety of fabrics, but also to improve the recognition efficiency while ensuring the accuracy of recognition.
本领域技术人员可以理解附图只是一个优选实施场景的示意图,附图中的模块或流程并不一定是实施本公开所必须的。A person skilled in the art can understand that the drawings are only a schematic diagram of a preferred implementation scenario, and the modules or processes in the drawings are not necessarily required to implement the disclosure.
本领域技术人员可以理解实施场景中的装置中的模块可以按照实施场景描述进行分布于实施场景的装置中,也可以进行相应变化位于不同于本实施场景的一个或多个装置中。上述实施场景的模块可以合并为一个模块,也可以进一步拆分成多个子模块。A person skilled in the art may understand that the modules in the apparatus in the implementation scenario may be distributed in the apparatus for implementing the scenario according to the implementation scenario description, or may be correspondingly changed in one or more devices different from the implementation scenario. The modules of the above implementation scenarios may be combined into one module, or may be further split into multiple sub-modules.
上述本公开序号仅仅为了描述,不代表实施场景的优劣。The above-mentioned serial numbers are only for the description, and do not represent the advantages and disadvantages of the implementation scenario.
以上公开的仅为本公开的几个具体实施场景,但是,本公开并非局限于此,任何本领域的技术人员能思之的变化都应落入本公开的保护范围。The above disclosure is only a few specific implementation scenarios of the present disclosure, but the disclosure is not limited thereto, and any changes that can be made by those skilled in the art should fall within the protection scope of the present disclosure.
工业实用性Industrial applicability
本公开实施例提供的布料识别的方法和、设备、电子设备及储存介质,基于通过预先生成的布料识别神经网络对所述布料特征进行识别,生成对应所述待识别布料的识别结果。以此本发明公开实施例通过自动化的方式实现了对布料的识别,极大的降低了人工成本。且由于在识别过程中通过专用的布料识别神经网络来进行,不仅能够对种类繁多的大量布料进行识别,且在提高识别效率的同时,还能够有效保证了识别的准确性。The method and device for fabric identification provided by the embodiment of the present disclosure, based on the pre-generated cloth identification neural network, identify the cloth feature, and generate a recognition result corresponding to the cloth to be identified. Thus, the disclosed embodiment realizes the identification of the cloth in an automated manner, which greatly reduces the labor cost. Moreover, since the neural network is identified by a dedicated cloth in the recognition process, not only a large variety of fabrics can be identified, but also the recognition efficiency can be improved while the accuracy of the recognition can be effectively ensured.