[go: up one dir, main page]

CN116310568A - Image anomaly identification method, device, computer readable storage medium and equipment - Google Patents

Image anomaly identification method, device, computer readable storage medium and equipment Download PDF

Info

Publication number
CN116310568A
CN116310568A CN202310293306.XA CN202310293306A CN116310568A CN 116310568 A CN116310568 A CN 116310568A CN 202310293306 A CN202310293306 A CN 202310293306A CN 116310568 A CN116310568 A CN 116310568A
Authority
CN
China
Prior art keywords
abnormal
features
region
image
feature
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.)
Pending
Application number
CN202310293306.XA
Other languages
Chinese (zh)
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.)
Guangdong Oppo Mobile Telecommunications Corp Ltd
Original Assignee
Guangdong Oppo Mobile Telecommunications Corp Ltd
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 Guangdong Oppo Mobile Telecommunications Corp Ltd filed Critical Guangdong Oppo Mobile Telecommunications Corp Ltd
Priority to CN202310293306.XA priority Critical patent/CN116310568A/en
Publication of CN116310568A publication Critical patent/CN116310568A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06VIMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
    • G06V10/00Arrangements for image or video recognition or understanding
    • G06V10/70Arrangements for image or video recognition or understanding using pattern recognition or machine learning
    • G06V10/764Arrangements for image or video recognition or understanding using pattern recognition or machine learning using classification, e.g. of video objects
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06VIMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
    • G06V10/00Arrangements for image or video recognition or understanding
    • G06V10/70Arrangements for image or video recognition or understanding using pattern recognition or machine learning
    • G06V10/77Processing image or video features in feature spaces; using data integration or data reduction, e.g. principal component analysis [PCA] or independent component analysis [ICA] or self-organising maps [SOM]; Blind source separation
    • G06V10/80Fusion, i.e. combining data from various sources at the sensor level, preprocessing level, feature extraction level or classification level
    • G06V10/806Fusion, i.e. combining data from various sources at the sensor level, preprocessing level, feature extraction level or classification level of extracted features

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Computer Vision & Pattern Recognition (AREA)
  • Evolutionary Computation (AREA)
  • Computing Systems (AREA)
  • Databases & Information Systems (AREA)
  • Health & Medical Sciences (AREA)
  • General Health & Medical Sciences (AREA)
  • Medical Informatics (AREA)
  • Software Systems (AREA)
  • Artificial Intelligence (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Multimedia (AREA)
  • Image Analysis (AREA)

Abstract

The application provides an image anomaly identification method, an image anomaly identification device, a computer-readable storage medium and electronic equipment, and relates to the technical field of machine learning.

Description

图像异常的识别方法、装置、计算机可读存储介质及设备Image abnormality recognition method, device, computer-readable storage medium and equipment

技术领域technical field

本申请涉及机器学习技术领域,具体而言,涉及一种图像异常的识别方法、装置、计算机可读存储介质及设备。The present application relates to the technical field of machine learning, and in particular, to a method, device, computer-readable storage medium and equipment for identifying abnormal images.

背景技术Background technique

随着机器学习技术的不断发展,神经网络可以实现的技术目的越来越多,例如,图像检测、语义识别等。在图像检测的细分领域中,神经网络可以识别图像中的异常区域(如,撕裂异常区域),从而有利于相关人员可以调整设备参数,以规避图像出现异常区域。With the continuous development of machine learning technology, neural networks can achieve more and more technical purposes, such as image detection, semantic recognition, etc. In the segmented field of image detection, the neural network can identify abnormal areas in the image (such as tearing abnormal areas), so that relevant personnel can adjust equipment parameters to avoid abnormal areas in the image.

在相关技术中,通常会将存在异常区域的图像输入给神经网络,以使得神经网络提取图像特征,并基于该图像特征识别其中的异常区域以及异常区域所属的异常类型。但是,这种方式会存在识别精度不高的问题。In related technologies, an image with an abnormal area is usually input to a neural network, so that the neural network extracts image features, and identifies the abnormal area and the abnormal type to which the abnormal area belongs based on the image features. However, this method has the problem of low recognition accuracy.

需要说明的是,在上述背景技术部分公开的信息仅用于加强对本申请的背景的理解,因此可以包括不构成对本领域普通技术人员已知的相关技术的信息。It should be noted that the information disclosed in the above background technology section is only used to enhance the understanding of the background of the application, and therefore may include information that does not constitute the relevant technology known to those of ordinary skill in the art.

发明内容Contents of the invention

本申请的目的在于提供一种图像异常的识别方法、装置、计算机可读存储介质及电子设备,可以先识别出待处理图像中的异常区域,再提取异常区域的频谱特征、边缘特征、统计特征,即提取到可以更全面表征异常区域的多维特征,进而基于频谱特征、边缘特征、统计特征可以更准确地确定异常区域的异常类型,相较于相关技术而言,本申请可以针对异常区域提取多维特征并基于多维特征进行异常类型识别,而不是基于单一的图像特征进行异常类型识别,因此可以提升对于异常类型的识别精度。The purpose of this application is to provide a method, device, computer-readable storage medium, and electronic device for identifying abnormal images, which can first identify the abnormal areas in the image to be processed, and then extract the spectral features, edge features, and statistical features of the abnormal areas. , that is to extract multi-dimensional features that can more comprehensively characterize abnormal areas, and then based on spectral features, edge features, and statistical features, the abnormal type of abnormal areas can be more accurately determined. Compared with related technologies, this application can extract abnormal areas Multi-dimensional features and abnormal type identification based on multi-dimensional features, instead of abnormal type identification based on a single image feature, so the identification accuracy of abnormal types can be improved.

本申请的其他特性和优点将通过下面的详细描述变得显然,或部分地通过本申请的实践而习得。Other features and advantages of the present application will become apparent from the following detailed description, or in part, be learned by practice of the present application.

根据本申请的一方面,提供一种图像异常的识别方法,该方法包括:According to one aspect of the present application, a method for identifying abnormal images is provided, the method comprising:

识别待处理图像中的异常区域;Identify abnormal regions in the image to be processed;

提取异常区域的频谱特征、边缘特征、统计特征;Extract spectral features, edge features, and statistical features of abnormal regions;

基于频谱特征、边缘特征、统计特征确定异常区域的异常类型。Determine the abnormal type of the abnormal region based on the spectral characteristics, edge characteristics, and statistical characteristics.

根据本申请的一方面,提供一种图像异常的识别装置,该装置包括:According to one aspect of the present application, a device for identifying an abnormal image is provided, the device comprising:

异常区域识别单元,用于识别待处理图像中的异常区域;An abnormal area identification unit, configured to identify an abnormal area in the image to be processed;

多维度特征提取单元,用于提取异常区域的频谱特征、边缘特征、统计特征;A multi-dimensional feature extraction unit is used to extract spectral features, edge features, and statistical features of abnormal regions;

异常类型判定单元,用于基于频谱特征、边缘特征、统计特征确定异常区域的异常类型。An anomaly type determining unit, configured to determine an anomaly type of an abnormal area based on frequency spectrum features, edge features, and statistical features.

根据本申请的一方面,提供一种计算机程序产品或计算机程序,该计算机程序产品或计算机程序包括计算机指令,该计算机指令存储在计算机可读存储介质中。计算机设备的处理器从计算机可读存储介质读取该计算机指令,处理器执行该计算机指令,使得该计算机设备执行上述的各种可选实现方式中提供的方法。According to an aspect of the present application, there is provided a computer program product or computer program comprising computer instructions stored in a computer readable storage medium. The processor of the computer device reads the computer instruction from the computer-readable storage medium, and the processor executes the computer instruction, so that the computer device executes the methods provided in the various optional implementation manners above.

根据本申请的一方面,提供一种计算机可读存储介质,其上存储有计算机程序,计算机程序被处理器执行时实现上述任意一项的方法。According to one aspect of the present application, a computer-readable storage medium is provided, on which a computer program is stored, and when the computer program is executed by a processor, any one of the above-mentioned methods is implemented.

根据本申请的一方面,提供一种电子设备,包括:处理器;以及存储器,用于存储处理器的可执行指令;其中,处理器配置为经由执行可执行指令来执行上述任意一项的方法。According to an aspect of the present application, there is provided an electronic device, including: a processor; and a memory for storing executable instructions of the processor; wherein, the processor is configured to perform any one of the above-mentioned methods by executing the executable instructions .

本申请示例性实施例可以具有以下部分或全部有益效果:Exemplary embodiments of the present application may have some or all of the following beneficial effects:

在本申请的一示例实施方式所提供的图像异常的识别方法中,可以先识别出待处理图像中的异常区域,再提取异常区域的频谱特征、边缘特征、统计特征,即提取到可以更全面表征异常区域的多维特征,进而基于频谱特征、边缘特征、统计特征可以更准确地确定异常区域的异常类型,相较于相关技术而言,本申请可以针对异常区域提取多维特征并基于多维特征进行异常类型识别,而不是基于单一的图像特征进行异常类型识别,因此可以提升对于异常类型的识别精度。此外,由于本申请细分了异常区域的识别过程和异常类型识别过程,并基于此只针对异常区域进行多为特征提取,相较于相关技术直接通过神经网络在一次识别过程中同时完成异常区域识别和异常类型识别,本申请可以进一步提升对于异常类型的识别精度。In the image abnormality recognition method provided in an exemplary embodiment of the present application, the abnormal region in the image to be processed can be identified first, and then the spectral features, edge features, and statistical features of the abnormal region can be extracted, that is, the extraction can be more comprehensive. Characterize the multi-dimensional features of abnormal areas, and then based on spectral features, edge features, and statistical features, the abnormal type of abnormal areas can be more accurately determined. Compared with related technologies, this application can extract multi-dimensional features for abnormal areas and perform Abnormal type identification, instead of abnormal type identification based on a single image feature, can improve the identification accuracy of abnormal types. In addition, since this application subdivides the identification process of abnormal areas and the identification process of abnormal types, and based on this, it only performs feature extraction for abnormal areas. Identification and abnormal type identification, the present application can further improve the identification accuracy of abnormal types.

应当理解的是,以上的一般描述和后文的细节描述仅是示例性和解释性的,并不能限制本申请。It is to be understood that both the foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive of the application.

附图说明Description of drawings

此处的附图被并入说明书中并构成本说明书的一部分,示出了符合本申请的实施例,并与说明书一起用于解释本申请的原理。显而易见地,下面描述中的附图仅仅是本申请的一些实施例,对于本领域普通技术人员来讲,在不付出创造性劳动的前提下,还可以根据这些附图获得其他的附图。The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the application and together with the description serve to explain the principles of the application. Apparently, the drawings in the following description are only some embodiments of the present application, and those skilled in the art can obtain other drawings according to these drawings without creative efforts.

图1示意性示出了根据本申请的一个实施例的图像异常的识别方法的流程图;FIG. 1 schematically shows a flow chart of a method for identifying abnormal images according to an embodiment of the present application;

图2示意性示出了根据本申请的一个实施例的特征金字塔结构的示意图;Fig. 2 schematically shows a schematic diagram of a feature pyramid structure according to an embodiment of the present application;

图3示意性示出了根据本申请的一个实施例的图像切片示意图;Fig. 3 schematically shows a schematic diagram of image slices according to an embodiment of the present application;

图4示意性示出了根据本申请的另一个实施例的图像异常的识别方法的流程图;FIG. 4 schematically shows a flow chart of a method for identifying an image abnormality according to another embodiment of the present application;

图5示意性示出了根据本申请的一个实施例的图像异常的识别装置的结构示意图;Fig. 5 schematically shows a schematic structural view of an image abnormality identification device according to an embodiment of the present application;

图6示意性示出了适于用来实现本申请实施例的电子设备的计算机系统的结构示意图。Fig. 6 schematically shows a structural diagram of a computer system suitable for implementing the electronic device of the embodiment of the present application.

具体实施方式Detailed ways

现在将参考附图更全面地描述示例实施方式。然而,示例实施方式能够以多种形式实施,且不应被理解为限于在此阐述的范例;相反,提供这些实施方式使得本申请将更加全面和完整,并将示例实施方式的构思全面地传达给本领域的技术人员。所描述的特征、结构或特性可以以任何合适的方式结合在一个或更多实施方式中。在下面的描述中,提供许多具体细节从而给出对本申请的实施方式的充分理解。然而,本领域技术人员将意识到,可以实践本申请的技术方案而省略所述特定细节中的一个或更多,或者可以采用其它的方法、组元、装置、步骤等。在其它情况下,不详细示出或描述公知技术方案以避免喧宾夺主而使得本申请的各方面变得模糊。Example embodiments will now be described more fully with reference to the accompanying drawings. Example embodiments may, however, be embodied in many forms and should not be construed as limited to the examples set forth herein; rather, these embodiments are provided so that this application will be thorough and complete, and will fully convey the concepts of example embodiments to those skilled in the art. The described features, structures, or characteristics may be combined in any suitable manner in one or more embodiments. In the following description, numerous specific details are provided in order to give a thorough understanding of embodiments of the present application. However, those skilled in the art will appreciate that the technical solutions of the present application can be practiced without one or more of the specific details, or other methods, components, devices, steps, etc. can be used. In other instances, well-known technical solutions have not been shown or described in detail to avoid obscuring aspects of the application.

请参阅图1,图1示意性示出了根据本申请的一个实施例的图像异常的识别方法的流程图。如图1所示,该方法包括如下步骤。Please refer to FIG. 1 , which schematically shows a flow chart of a method for identifying an image abnormality according to an embodiment of the present application. As shown in Figure 1, the method includes the following steps.

步骤S110:识别待处理图像中的异常区域。Step S110: Identify abnormal regions in the image to be processed.

步骤S120:提取异常区域的频谱特征、边缘特征、统计特征。Step S120: Extracting spectral features, edge features, and statistical features of the abnormal region.

步骤S130:基于频谱特征、边缘特征、统计特征确定异常区域的异常类型。Step S130: Determine the abnormal type of the abnormal region based on the spectral features, edge features, and statistical features.

实施图1所示的方法,可以先识别出待处理图像中的异常区域,再提取异常区域的频谱特征、边缘特征、统计特征,即提取到可以更全面表征异常区域的多维特征,进而基于频谱特征、边缘特征、统计特征可以更准确地确定异常区域的异常类型,相较于相关技术而言,本申请可以针对异常区域提取多维特征并基于多维特征进行异常类型识别,而不是基于单一的图像特征进行异常类型识别,因此可以提升对于异常类型的识别精度。此外,由于本申请细分了异常区域的识别过程和异常类型识别过程,并基于此只针对异常区域进行多为特征提取,相较于相关技术直接通过神经网络在一次识别过程中同时完成异常区域识别和异常类型识别,本申请可以进一步提升对于异常类型的识别精度。By implementing the method shown in Figure 1, the abnormal area in the image to be processed can be identified first, and then the spectral features, edge features, and statistical features of the abnormal area can be extracted, that is, multi-dimensional features that can more comprehensively characterize the abnormal area can be extracted, and then based on the spectrum Features, edge features, and statistical features can more accurately determine the abnormal type of abnormal areas. Compared with related technologies, this application can extract multi-dimensional features for abnormal areas and identify abnormal types based on multi-dimensional features instead of based on a single image The features are used to identify abnormal types, so the recognition accuracy for abnormal types can be improved. In addition, since this application subdivides the identification process of abnormal areas and the identification process of abnormal types, and based on this, it only performs feature extraction for abnormal areas. Identification and abnormal type identification, the present application can further improve the identification accuracy of abnormal types.

下面,对于本示例实施方式的上述步骤进行更加详细的说明。Next, the above-mentioned steps of this exemplary embodiment will be described in more detail.

在步骤S110中,识别待处理图像中的异常区域。In step S110, abnormal regions in the image to be processed are identified.

具体地,终端设备(如,手机、平板电脑等)拍摄的图像有时会出现异常的情况,例如,色块异常、异色异常、错位异常、花屏异常、条纹异常、撕裂异常等,这些异常情况会影响图像的质量。出现这些异常的原因有可能在于终端设备内置的摄像模组参数异常、摄像模组硬件异常,抑或是终端设备的屏幕质量不佳、终端设备的拍摄算法不佳等。为了解决这个问题,需要对需要调试的设备拍摄的图像进行异常识别,进而可以基于异常识别的结果调试上述原因,以修正异常问题。Specifically, images captured by terminal devices (such as mobile phones, tablet computers, etc.) sometimes have abnormal conditions, such as abnormal color blocks, abnormal colors, dislocation abnormalities, blurred screen abnormalities, stripe abnormalities, tearing abnormalities, etc. These abnormalities conditions can affect the quality of the image. The reason for these abnormalities may be that the built-in camera module parameters of the terminal device are abnormal, the camera module hardware is abnormal, or the screen quality of the terminal device is not good, or the shooting algorithm of the terminal device is not good. In order to solve this problem, it is necessary to identify the abnormality of the image taken by the device that needs to be debugged, and then the above-mentioned reasons can be debugged based on the result of the abnormality identification to correct the abnormality.

但是,在相关技术中,通常是通过存在异常区域的图像训练神经网络,以使得神经网路学习到这些异常区域。在神经网络的训练过程中,通常是先提取图像特征,再基于该图像特征同时识别出异常区域和该异常区域的异常类型,但是,这样处理后的结果通常会存在精度不高的问题,如,未识别出异常区域、异常类型识别错误等。However, in related technologies, the neural network is usually trained through images with abnormal regions, so that the neural network can learn these abnormal regions. In the training process of the neural network, the image features are usually extracted first, and then the abnormal area and the abnormal type of the abnormal area are identified at the same time based on the image features. , the abnormal area was not identified, the abnormal type was identified incorrectly, etc.

本申请认为,上述过程存在优化空间,即,一方面可以将异常区域识别过程和异常类型识别过程划分开,避免识别异常类型时基于的是针对全图的特征提取结果。考虑到这一点只是将相关技术的步骤进行分割,为了更进一步地提升识别精度,另一方面可以基于识别出的异常区域进行多维特征提取,通过多维特征可以更精准地识别出异常区域的异常类型。基于此,本申请将上述的色块异常、异色异常、错位异常、花屏异常、条纹异常、撕裂异常等作为异常类型,训练神经网络。The present application believes that there is room for optimization in the above process, that is, on the one hand, the abnormal area identification process and the abnormal type identification process can be divided to avoid identifying the abnormal type based on the feature extraction results for the whole image. Considering this, it is only to divide the steps of related technologies. In order to further improve the recognition accuracy, on the other hand, multi-dimensional feature extraction can be performed based on the identified abnormal area. The abnormal type of the abnormal area can be more accurately identified through multi-dimensional features. . Based on this, the present application takes the above-mentioned color block abnormalities, heterochromatic abnormalities, dislocation abnormalities, blurred screen abnormalities, stripe abnormalities, tearing abnormalities, etc. as abnormal types to train the neural network.

首先,本申请可以基于检测网络(如,YoloV7网络)来识别待处理图像中的异常区域;其中,检测网络可以基于实际需要设置相应的特征提取层,本申请实施例不作限定。此外,待处理图像可以为JPEG、GIF、PNG、BMP等格式,待处理图像中的异常区域数量可以为一个或多个,并且,同一待处理图像中的异常区域尺寸可以相同也可以不相同。First, the application can identify abnormal regions in the image to be processed based on a detection network (eg, YoloV7 network); wherein, the detection network can set a corresponding feature extraction layer based on actual needs, which is not limited in the embodiment of the application. In addition, the image to be processed can be in the format of JPEG, GIF, PNG, BMP, etc., and the number of abnormal regions in the image to be processed can be one or more, and the sizes of the abnormal regions in the same image to be processed can be the same or different.

在步骤S120中,提取异常区域的频谱特征、边缘特征、统计特征。In step S120, spectral features, edge features, and statistical features of the abnormal region are extracted.

具体地,频谱特征可以用于表征灰度变化的剧烈程度,以示意图像纹理;边缘特征可以用于表征明显区别于正常图像的边缘信息;统计特征可以用于表征统计学上的特征汇总情况。Specifically, spectral features can be used to characterize the intensity of grayscale changes to illustrate image textures; edge features can be used to represent edge information that is clearly different from normal images; statistical features can be used to characterize statistical feature summaries.

作为一种可选的实施例,提取异常区域的频谱特征,包括:对异常区域进行区域分割,得到子区域集合;对异常区域和子区域集合进行傅里叶变换,得到频谱图像集合;基于频谱图像集合确定异常区域的频谱特征。这样可以基于傅里叶变换得到异常区域的频谱特征,频谱特征可以从频域描述异常区域,将频谱特征作为异常类型的识别条件,可以提升异常类型的识别精度。As an optional embodiment, extracting the spectral features of the abnormal region includes: performing region segmentation on the abnormal region to obtain a set of sub-regions; performing Fourier transform on the abnormal region and the set of sub-regions to obtain a set of spectral images; The collection determines the spectral signature of the anomalous region. In this way, the spectral features of the abnormal area can be obtained based on Fourier transform. The spectral features can describe the abnormal area from the frequency domain. Using the spectral feature as the identification condition of the abnormal type can improve the identification accuracy of the abnormal type.

具体地,对于识别出的待处理图像中的各异常区域,均可以通过上述步骤来获取对应的频谱特征。Specifically, for each identified abnormal region in the image to be processed, the corresponding spectral features can be obtained through the above steps.

其中,对异常区域进行区域分割,得到子区域集合,包括:根据预设划分规则(例如,生成出4份/16份)对异常区域进行区域分割处理,以得到子区域集合,子区域集合中各子区域均来自于异常区域。Wherein, performing region segmentation on the abnormal region to obtain a set of subregions includes: performing region segmentation processing on the abnormal region according to a preset division rule (for example, generating 4 parts/16 parts) to obtain a set of subregions, and in the set of subregions Each sub-region is derived from the anomalous region.

进而,可以对异常区域和子区域集合中各子区域均进行傅里叶变换,从而可以得到频谱图像集合,频谱图像集合中不仅包含各子区域的频谱图像还包含了异常区域的频谱图像;其中,每个频谱图像记载的频谱特征可以是不同的。Furthermore, the Fourier transform can be performed on the abnormal region and each subregion in the subregion set, so as to obtain a spectrum image set, which not only includes the spectrum images of each subregion but also includes the spectrum image of the abnormal region; wherein, The spectral features recorded by each spectral image may be different.

进而,可以触发图像滤波器对频谱图像集合中各频谱图像进行频谱特征提取;进而,可以将各频谱图像的频谱特征拼接为异常区域的频谱图像,或者,将各频谱图像的频谱特征融合为异常区域的频谱图像,频谱特征是一种高维向量;其中,图像滤波器可以视作由从中间到四周的正方形环构成(例如,滤波器长宽皆为a,则图像滤波器由a/2个环构成),每个环共享权重以减少滤波器参数。Furthermore, the image filter can be triggered to extract the spectral features of each spectral image in the spectral image set; furthermore, the spectral features of each spectral image can be spliced into a spectral image of an abnormal region, or the spectral features of each spectral image can be fused into an abnormal region. The spectral image of the region, the spectral feature is a high-dimensional vector; wherein, the image filter can be regarded as a square ring from the middle to the surrounding (for example, the filter length and width are both a, and the image filter is composed of a/2 rings), and each ring shares weights to reduce filter parameters.

作为一种可选的实施例,提取异常区域的边缘特征,包括:获取异常区域的深度特征;对异常区域进行边缘检测得到参考边缘特征;基于深度特征和参考边缘特征确定异常区域的边缘特征。这样可以基于边缘检测得到异常区域的边缘特征,边缘特征可以突出描述异常区域的边缘,将频谱特征作为异常类型的识别条件,可以提升异常类型的识别精度。As an optional embodiment, extracting edge features of the abnormal region includes: acquiring depth features of the abnormal region; performing edge detection on the abnormal region to obtain reference edge features; and determining edge features of the abnormal region based on the depth features and the reference edge features. In this way, the edge features of the abnormal area can be obtained based on edge detection. The edge features can highlight and describe the edge of the abnormal area. Using the spectral feature as the identification condition of the abnormal type can improve the identification accuracy of the abnormal type.

具体地,由于存在异常区域的图像边缘存在明显区别于正常图像的信息,因此,可以获取异常区域的深度特征(R,G,B),获取异常区域的深度特征的方式在于对异常区域进行一系列处理,从而使得处理结果中包含深度特征。其中,一系列处理方式在于:通过高斯滤波器对异常区域进行滤波,以平滑纹理较弱的非边缘区域,有利于得到更准确的边缘特征;进而,可以通过边缘检测算子计算异常区域中每个像素点的水平梯度Gx和垂直梯度Gy后,基于水平梯度Gx和垂直梯度Gy可以计算得到每个像素点的幅度G和方向θ;进而,可以遍历异常区域中各像素点,以抑制每个预定范围(如,3*3的像素范围)内正/负梯度方向上的局部最大值的像素点;进而,可以基于指定梯度幅度阈值G1和G2,将大于G1的幅度为G的边缘设置为强边缘、将小于G1且大于G2的幅度为G的边缘设置为虚边缘、抑制小于G2的幅度为G的边缘;其中,G1大于G2。进而,可以遍历各虚边缘,以抑制未与强边缘相连的虚边缘。Specifically, since the edge of the image with the abnormal area has information that is obviously different from the normal image, the depth features (R, G, B) of the abnormal area can be obtained. The way to obtain the depth feature of the abnormal area is to perform a A series of processing, so that the processing results contain deep features. Among them, a series of processing methods are as follows: filter the abnormal area through Gaussian filter to smooth the non-edge area with weak texture, which is beneficial to obtain more accurate edge features; After the horizontal gradient G x and vertical gradient G y of pixels, the magnitude G and direction θ of each pixel can be calculated based on the horizontal gradient G x and vertical gradient G y ; furthermore, each pixel in the abnormal area can be traversed, In order to suppress the pixels of the local maximum in the positive/negative gradient direction within each predetermined range (eg, 3*3 pixel range); furthermore, based on the specified gradient magnitude thresholds G 1 and G 2 , the values larger than G 1 can be The edge with amplitude G is set as a strong edge, the edge with amplitude G that is smaller than G 1 and greater than G 2 is set as a virtual edge, and the edge with amplitude G that is smaller than G 2 is suppressed; where G 1 is greater than G 2 . Furthermore, virtual edges can be traversed to suppress virtual edges that are not connected with strong edges.

作为一种可选的实施例,对异常区域进行边缘检测得到参考边缘特征,包括:确定异常区域的最大边缘幅度值和最小边缘幅度值;基于最大边缘幅度值和最小边缘幅度值,将异常区域中各边缘幅度值更新为参考边缘特征。这样可以基于最大边缘幅度值和最小边缘幅度值对各边缘幅度值进行更新,从而得到参考边缘特征,可以提升最终确定出的异常区域的边缘特征的表征准确性。As an optional embodiment, performing edge detection on the abnormal region to obtain reference edge features includes: determining the maximum and minimum edge magnitude values of the abnormal region; based on the maximum and minimum edge magnitude values, dividing the abnormal region Each edge amplitude value in is updated as the reference edge feature. In this way, each edge amplitude value can be updated based on the maximum edge amplitude value and the minimum edge amplitude value, so as to obtain a reference edge feature, which can improve the characterization accuracy of the finally determined edge feature of the abnormal region.

具体地,可以统计异常区域各边缘的幅度G,以确定出最大边缘幅度值Gmin和最小边缘幅度值Gmax。基于此,基于最大边缘幅度值和最小边缘幅度值,将异常区域中各边缘幅度值更新为参考边缘特征,包括:通过线性差值的方式,将所有幅度G依据最大边缘幅度值Gmin和最小边缘幅度值Gmax变换为区间[0,255]上的整数值,即,参考边缘特征GnewSpecifically, the amplitude G of each edge of the abnormal area can be counted to determine the maximum edge amplitude value G min and the minimum edge amplitude value G max . Based on this, based on the maximum edge amplitude value and the minimum edge amplitude value, each edge amplitude value in the abnormal area is updated to the reference edge feature, including: through the linear difference method, all the amplitudes G are based on the maximum edge amplitude value G min and the minimum edge amplitude value The edge magnitude value G max is transformed into an integer value on the interval [0,255], ie the reference edge feature G new .

基于此,基于深度特征和参考边缘特征确定异常区域的边缘特征,包括:基于深度特征(R,G,B)和参考边缘特征Gnew可以将异常区域中各像素点表示为(R,G,B,Gnew);进而,基于特征金字塔结构(FPN,Feature Pyramid Network)提取表示为(R,G,B,Gnew)的异常区域的边缘特征。Based on this, the edge features of the abnormal area are determined based on the depth feature and the reference edge feature, including: based on the depth feature (R, G, B) and the reference edge feature G new , each pixel in the abnormal area can be expressed as (R, G, B, G new ); furthermore, based on the feature pyramid structure (FPN, Feature Pyramid Network), the edge features of the abnormal region expressed as (R, G, B, G new ) are extracted.

其中,FPN的结构可以参阅图2,如图2所示,可以向FPN输入图片(即,异常区域),从而基于残差神经网络(ResNet)中各特征提取层执行特征提取操作,在ResNet中,可以通过多次特征提取得到对应于不同深度的特征C1、C2、C3、C4、C5,对C5进行1×1的卷积后得到的P5后,可以生成P5上采样结果;对C4进行1×1的卷积后得到的P5后,可以基于P5上采样结果生成P4上采样结果;对C3进行1×1的卷积后得到的P4后,可以基于P4上采样结果生成P3上采样结果;对C2进行1×1的卷积后得到的P3后,可以基于P3上采样结果生成P2上采样结果。进而,可以对各上采样结果进行3×3的卷积,以消除上采样过程带来的重叠效应,进而可以基于各3×3的卷积结果生成异常区域的多尺度的边缘特征。Among them, the structure of FPN can refer to Figure 2, as shown in Figure 2, you can input pictures (that is, abnormal regions) to FPN, so as to perform feature extraction operations based on each feature extraction layer in the residual neural network (ResNet), in ResNet , features C1, C2, C3, C4, and C5 corresponding to different depths can be obtained through multiple feature extractions. After performing 1×1 convolution on C5 to obtain P5, the upsampling result of P5 can be generated; After the P5 obtained after the convolution of ×1, the P4 upsampling result can be generated based on the P5 upsampling result; after the P4 obtained after the 1×1 convolution of C3, the P3 upsampling result can be generated based on the P4 upsampling result; After performing 1×1 convolution on C2 to obtain P3, the P2 upsampling result can be generated based on the P3 upsampling result. Furthermore, a 3×3 convolution can be performed on each upsampling result to eliminate the overlap effect caused by the upsampling process, and then the multi-scale edge features of the abnormal region can be generated based on each 3×3 convolution result.

作为一种可选的实施例,提取异常区域的统计特征,包括:对异常区域中各特征点进行特征提取,得到特征点向量集合;对特征点向量集合进行混合高斯分布计算,得到分布函数;基于分布函数表示似然函数,并计算似然函数的权重偏导、均值偏导、方差偏导;将权重偏导、均值偏导、方差偏导融合为异常区域的统计特征。这样可以基于高斯分布、似然函数、偏导等方式确定出异常区域的统计特征,统计特征可以从统计学维度描述异常区域,将统计特征作为异常类型的识别条件,可以提升异常类型的识别精度。As an optional embodiment, extracting the statistical features of the abnormal area includes: performing feature extraction on each feature point in the abnormal area to obtain a feature point vector set; performing mixed Gaussian distribution calculation on the feature point vector set to obtain a distribution function; The likelihood function is expressed based on the distribution function, and the weight partial derivative, mean partial derivative, and variance partial derivative of the likelihood function are calculated; the weight partial derivative, mean partial derivative, and variance partial derivative are fused into the statistical characteristics of the abnormal area. In this way, the statistical characteristics of the abnormal area can be determined based on Gaussian distribution, likelihood function, partial derivative, etc. The statistical characteristics can describe the abnormal area from the statistical dimension, and the statistical characteristics can be used as the identification condition of the abnormal type, which can improve the identification accuracy of the abnormal type .

具体地,可以对异常区域中各特征点进行特征提取,得到特征点向量集合X={xt,t=1,…,T},其中,异常区域中的特征点指的是图像灰度值发生剧烈变化的点或者在图像边缘上曲率较大的点(即,两个边缘的交点),T表示了特征点,xt表示了第t个特征点的特征点向量(SIFT)。进而,可以基于X={xt,t=1,…,T}计算混合高斯分布中的参数

Figure BDA0004143883030000081
以得到分布函数p(x);其中,N(x|μk,∑k)表示高斯分布的概率密度函数,K表示高斯模型的个数,πk、μk、∑k分别表示第k个高斯模型的权重、均值和方差。进而,基于分布函数p(x)可以表示似然函数/>
Figure BDA0004143883030000082
其中,λ={πkk,∑k,k=1,…,K}。进而,可以对似然函数求权重偏导、均值偏导、方差偏导,并将权重偏导、均值偏导、方差偏导归一化后拼接为定长的特征向量,作为异常区域的统计特征。Specifically, feature extraction can be performed on each feature point in the abnormal area to obtain a feature point vector set X={x t ,t=1,...,T}, where the feature point in the abnormal area refers to the gray value of the image A point that changes drastically or a point with a large curvature on the edge of the image (ie, the intersection of two edges), T represents the feature point, and x t represents the feature point vector (SIFT) of the t-th feature point. Furthermore, the parameters in the mixed Gaussian distribution can be calculated based on X={x t ,t=1,...,T}
Figure BDA0004143883030000081
To get the distribution function p(x); among them, N(x|μ k ,∑ k ) represents the probability density function of Gaussian distribution, K represents the number of Gaussian models, π k , μ k , ∑ k represent the kth Gaussian model weights, mean and variance. Furthermore, the likelihood function can be expressed based on the distribution function p(x) />
Figure BDA0004143883030000082
Wherein, λ={π k , μ k , ∑ k , k=1, . . . , K}. Furthermore, weight partial derivatives, mean partial derivatives, and variance partial derivatives can be calculated for the likelihood function, and the weight partial derivatives, mean partial derivatives, and variance partial derivatives can be normalized and spliced into fixed-length feature vectors as the statistics of abnormal regions feature.

作为一种可选的实施例,识别待处理图像中的异常区域,包括:获取样本数据集和增强数据集;基于样本数据集和增强数据集训练检测网络;基于训练后的检测网络识别待处理图像中的异常区域。这样可以通过样本数据集和增强数据集对分类网络进行大样本训练,可以提升检测网络对于异常区域的检测精度,相关技术中的样本数量不足,本申请相较于相关技术可以增大样本量,提升检测网络的训练强度。As an optional embodiment, identifying the abnormal region in the image to be processed includes: obtaining a sample data set and an enhanced data set; training a detection network based on the sample data set and the enhanced data set; identifying the image to be processed based on the trained detection network Anomalies in the image. In this way, the classification network can be trained with a large sample through the sample data set and the enhanced data set, which can improve the detection accuracy of the detection network for abnormal areas. The number of samples in the related technology is insufficient. Compared with the related technology, this application can increase the sample size. Increase the training intensity of the detection network.

具体地,样本数据集中的样本数据即为包含异常区域的图像,这类图像可以是终端设备拍摄得到的,也可以是终端显示内容时从外部拍摄终端设备得到的,抑或是其他方式,本申请实施例不作限定。此外,增强数据集中的增强数据可以是基于样本数据生成得到的,也可以是基于其他包含异常区域的图像生成得到的,抑或是其他方式,本申请实施例不作限定。基于样本数据集和增强数据集训练检测网络,可以使得检测网络在检测异常区域时获得精度更高的检测结果。Specifically, the sample data in the sample data set is the image containing the abnormal area. This type of image can be captured by the terminal device, or it can be obtained from an external shooting terminal device when the terminal displays content, or in other ways. This application Examples are not limited. In addition, the enhanced data in the enhanced data set may be generated based on sample data, or generated based on other images containing abnormal regions, or in other ways, which are not limited in this embodiment of the present application. Training the detection network based on the sample data set and the enhanced data set can enable the detection network to obtain detection results with higher accuracy when detecting abnormal regions.

作为一种可选的实施例,获取增强数据集,包括:通过对抗网络生成一类增强数据;通过区域变换方式生成二类增强数据;通过图像切片方式获取三类增强数据;基于一类增强数据、二类增强数据、三类增强数据中至少一种确定增强数据集。这样可以通过多种方式获取多种增强数据,以丰富样本类型,基于多样化的增强数据,可以有利于提升分类网络的精度。As an optional embodiment, obtaining an enhanced data set includes: generating one type of enhanced data through an adversarial network; generating two types of enhanced data through region transformation; obtaining three types of enhanced data through image slices; At least one of the second type of enhanced data and the third type of enhanced data is used to determine the enhanced data set. In this way, a variety of enhanced data can be obtained in various ways to enrich the sample types, and based on the diversified enhanced data, it can help improve the accuracy of the classification network.

具体地,对抗网络可以包括生成器和判别器,生成器用于生成异常图像,判别器用于判别接收到的图像,是真图像还是生成器生成的假图像。区域变换方式用于通过多样化的图像处理方式将模拟包含异常区域的图像。图像切片方式用于从包含异常区域的图像中裁切出多个子图像,可选的,图像切片方式可以实现为切片辅助超推理算法(SlicingAided Hyper Inference,SAHI)或者其他算法,本申请实施例不作限定。Specifically, the confrontation network may include a generator and a discriminator. The generator is used to generate abnormal images, and the discriminator is used to distinguish whether the received image is a real image or a fake image generated by the generator. The region transformation method is used to simulate an image containing an abnormal region through a variety of image processing methods. The image slicing method is used to cut out multiple sub-images from the image containing the abnormal region. Optionally, the image slicing method can be implemented as a slice-assisted hyper-inference algorithm (SlicingAided Hyper Inference, SAHI) or other algorithms. limited.

作为一种可选的实施例,通过对抗网络生成一类增强数据,包括:通过一类指定图像集训练对抗网络;通过训练后的对抗网络中的生成器生成一类增强数据。这样可以训练出用于生成包含异常区域的图像的对抗网络,利用对抗网络可以生成增强数据来训练分类网络,可以提升针对分类网络的训练强度。As an optional embodiment, generating a type of enhanced data through an adversarial network includes: training the adversarial network through a type of specified image set; generating a type of enhanced data through a generator in the trained adversarial network. In this way, an adversarial network for generating images containing abnormal regions can be trained, and the adversarial network can be used to generate enhanced data to train the classification network, which can increase the training intensity for the classification network.

具体地,一类指定图像集中可以包含多个具备异常区域的图像。Specifically, a class of designated image sets may contain multiple images with abnormal regions.

对抗网络中的生成器包括多个特征提取层,各特征提取层的卷积核大小、步长等参数可以依据实际需求进行任意设置。举例来说,在第一特征提取层中,卷积核大小为4,步长为1,不进行填充(padding);在第二特征提取层至第四特征提取层中,卷积核大小为4,步长为2,填充为1;第四特征提取层之后包含标准化层和线性整流层(ReLU)以及双曲正切函数层(Tanh)。对于生成器来说,可以获取一高维随机向量,并通过逆卷积操作得到可被卷积运算处理的特征图表示,即,三通道的彩色图像。The generator in the confrontation network includes multiple feature extraction layers, and the parameters such as the convolution kernel size and step size of each feature extraction layer can be set arbitrarily according to actual needs. For example, in the first feature extraction layer, the convolution kernel size is 4, the step size is 1, and no padding is performed; in the second feature extraction layer to the fourth feature extraction layer, the convolution kernel size is 4, the step size is 2, and the filling is 1; after the fourth feature extraction layer, it includes a normalization layer, a linear rectification layer (ReLU) and a hyperbolic tangent function layer (Tanh). For the generator, a high-dimensional random vector can be obtained, and the feature map representation that can be processed by the convolution operation can be obtained through the deconvolution operation, that is, a three-channel color image.

进而,对抗网络中的判别器可以判别三通道的彩色图像是否为生成器生成的假图像,判别器如果无法正确判别真图像和假图像,则对判别器进行调参,直到判别器可以正确判别真图像和假图像。其中,判别器可以包括多个特征提取层,各特征提取层的卷积核大小、步长等参数可以依据实际需求进行任意设置。举例来说,在第一特征提取层中,卷积核大小为4,步长为2,填充为1;在第二特征提取层至第四特征提取层中,卷积核大小为4,步长为1,不进行填充;第四特征提取层之后包含标准化层和线性整流层(ReLU)、带泄露线性整流函数层(Leaky ReLU)、S型函数层(Sigmoid)。Furthermore, the discriminator in the adversarial network can judge whether the three-channel color image is a fake image generated by the generator. If the discriminator cannot correctly distinguish the real image from the fake image, then adjust the parameters of the discriminator until the discriminator can correctly distinguish real and fake images. Wherein, the discriminator may include multiple feature extraction layers, and parameters such as convolution kernel size and step size of each feature extraction layer may be set arbitrarily according to actual needs. For example, in the first feature extraction layer, the convolution kernel size is 4, the stride is 2, and the padding is 1; in the second to fourth feature extraction layers, the convolution kernel size is 4, and the stride is 1. The length is 1, no padding is performed; after the fourth feature extraction layer, it includes a normalization layer and a linear rectification layer (ReLU), a leaky linear rectification function layer (Leaky ReLU), and a S-type function layer (Sigmoid).

作为一种可选的实施例,通过一类指定图像集训练对抗网络,包括:将一类指定图像集处理为对抗训练样本;触发对抗网络中的生成器生成参考训练样本;通过参考训练样本和对抗训练样本训练对抗网络中的判别器;基于判别器的判别结果训练生成器。这样可以实现基于一类指定图像集的对抗网络训练,以使得对抗网络中的生成器可以生成拟真的异常图像用作检测网络的训练。As an optional embodiment, training the adversarial network through a class of specified image sets includes: processing a class of specified image sets as adversarial training samples; triggering the generator in the adversarial network to generate reference training samples; The discriminator in the confrontation network is trained against the training samples; the generator is trained based on the discriminant result of the discriminator. In this way, the adversarial network training based on a specified image set can be realized, so that the generator in the adversarial network can generate realistic abnormal images for the training of the detection network.

具体地,生成器可以基于高维随机向量生成参考训练样本,进而,可以将参考训练样本输入判别器,判别器应当判别参考训练样本为假图像,否则对其进行调参。并且,也需要将一类指定图像集中的图像输入判别器,判别器应当判别一类指定图像集中的图像为真图像,否则对其进行调参。Specifically, the generator can generate reference training samples based on high-dimensional random vectors, and then, the reference training samples can be input into the discriminator, and the discriminator should judge that the reference training samples are fake images, otherwise adjust parameters. In addition, it is also necessary to input the images in a specified image set into the discriminator, and the discriminator should determine that the images in a specified image set are real images, otherwise adjust the parameters.

作为一种可选的实施例,将一类指定图像集处理为对抗训练样本,包括:对一类指定图像集中各图像进行异常区域裁剪;若异常区域的尺寸大于预设尺寸,则基于预设尺寸将异常区域裁剪为多个子图,若异常区域的尺寸小于等于预设尺寸,则对异常区域进行尺度变换,得到异常子图;将多个子图和异常子图中至少一种,确定为对抗训练样本。这样可以将一类指定图像集中各图像进行调整,以使得各图像满足样本要求,进而,基于调整后的各图像训练对抗网络,可以提升训练效率。As an optional embodiment, processing a class of specified image sets as adversarial training samples includes: cropping abnormal regions for each image in a class of specified image sets; if the size of the abnormal region is larger than the preset size, then The size cuts the abnormal region into multiple subgraphs. If the size of the abnormal region is smaller than or equal to the preset size, the abnormal region is scaled to obtain the abnormal subgraph; at least one of the multiple subgraphs and the abnormal subgraph is determined as an adversarial Training samples. In this way, each image in a specified image set can be adjusted so that each image meets the sample requirements, and then, training the adversarial network based on each adjusted image can improve training efficiency.

具体地,当异常区域的尺寸大于预设尺寸(如,256*256)时,则可以按照预设尺寸将异常区域裁剪为多个满足预设尺寸的子图,在得到多个子图之后,还可以基于预设尺寸对异常区域进行尺度变换,进而将尺度变换后的异常区域也确定为对抗训练样本。当异常区域的尺寸小于等于预设尺寸时,除了对异常区域进行尺度变换,也可以按照预设分割数量(如,16)将异常区域裁剪为多个参考子图,由于原异常区域不满足预设尺寸,因此多个参考子图必然不满足预设尺寸,此时,可以基于预设尺寸对多个参考子图进行尺度变换,从而将尺度变换后的多个参考子图也确定为对抗训练样本,这样可以丰富对抗训练的样本量。Specifically, when the size of the abnormal area is larger than the preset size (eg, 256*256), the abnormal area can be cut into multiple sub-images satisfying the preset size according to the preset size, and after obtaining the multiple sub-images, further The abnormal region can be scale-transformed based on a preset size, and then the scale-transformed abnormal region is also determined as an adversarial training sample. When the size of the abnormal region is smaller than or equal to the preset size, in addition to performing scale transformation on the abnormal region, the abnormal region can also be cut into multiple reference subimages according to the preset number of divisions (for example, 16). Since the original abnormal region does not meet the predetermined The size is set, so multiple reference subgraphs must not meet the preset size. At this time, multiple reference subgraphs can be scaled based on the preset size, so that multiple reference subgraphs after scale transformation are also determined as confrontation training. samples, which can enrich the sample size for adversarial training.

作为一种可选的实施例,区域变换方式包括马赛克处理方式和/或随机色彩变化处理方式,通过区域变换方式生成二类增强数据,包括:对二类指定图像集中的图像进行区域选取,得到待处理区域;通过马赛克处理方式和/或随机色彩变化处理方式,对待处理区域进行区域变换,得到区域变换结果;将各待处理区域替换为相应的区域变换结果,得到二类增强数据。这样可以通过区域变换方式丰富增强数据的类型,规避异常类型之间数据量差异大的问题,进而,如果基于多样化的增强数据训练检测网络,可以提升检测网络的可靠性和鲁棒性。As an optional embodiment, the region transformation method includes a mosaic processing method and/or a random color change processing method, and generating the second type of enhanced data through the region transformation method includes: performing region selection on the images in the second type of designated image set to obtain The area to be processed; through the mosaic processing method and/or the random color change processing method, perform area transformation on the area to be processed to obtain the area transformation result; replace each area to be processed with the corresponding area transformation result to obtain the second type of enhanced data. In this way, the types of enhanced data can be enriched by region transformation, and the problem of large data volume differences between abnormal types can be avoided. Furthermore, if the detection network is trained based on diversified enhanced data, the reliability and robustness of the detection network can be improved.

具体地,区域变换方式还可以包括其他处理方式,如,背景虚化等,本申请实施例不作限定。此外,二类指定图像集中的图像可以是正常区域(即,不包含异常区域的图像)也可以是存在异常区域的图像,本申请实施例不作限定。Specifically, the region transformation manner may also include other processing manners, such as background blurring, which is not limited in this embodiment of the present application. In addition, the images in the second-type specified image set may be normal regions (ie, images not containing abnormal regions) or images with abnormal regions, which is not limited in this embodiment of the present application.

其中,对二类指定图像集中的图像进行区域选取,得到待处理区域,包括:基于预设尺寸(如,128*128)对二类指定图像集中的图像进行区域随机选取,得到待处理区域;其中,针对同一图像的区域选取次数可以为一次或多次,若为多次,针对同一图像选取的多个区域之间可以存在内容重叠也可以不存在内容重叠。Wherein, area selection is carried out to the images in the second class designated image set to obtain the area to be processed, including: randomly selecting the area based on the preset size (eg, 128*128) to the images in the second class designated image set to obtain the area to be processed; Wherein, the region selection times for the same image may be one or more times, and if it is multiple times, there may or may not be content overlap among the multiple regions selected for the same image.

此外,通过马赛克处理方式和/或随机色彩变化处理方式,对待处理区域进行区域变换,得到区域变换结果,包括:通过马赛克处理方式对待处理区域进行区域变换,得到区域变换结果;或者,通过随机色彩变化处理方式,对待处理区域进行区域变换,得到区域变换结果;或者,通过马赛克处理方式和随机色彩变化处理方式,对待处理区域进行区域变换,得到区域变换结果。In addition, performing area transformation on the area to be processed by mosaic processing and/or random color change processing to obtain the area transformation result, including: performing area transformation on the area to be processed by mosaic processing to obtain the area transformation result; or, using random color The processing method is changed, and the region to be processed is transformed to obtain a region transformation result; or, the region to be processed is transformed to obtain a region transformation result through the mosaic processing method and the random color change processing method.

其中,可选的,通过马赛克处理方式对待处理区域进行区域变换,得到区域变换结果,包括:通过线性插值方式将待处理区域的尺度缩小为预设的像素大小,并通过最近邻插值方式将待处理区域利用变换尺寸放大为原始区域大小,得到区域变换结果。Among them, optionally, the area to be processed is transformed by mosaic processing to obtain the result of the area transformation, including: reducing the scale of the area to be processed to a preset pixel size by linear interpolation, and converting the area to be processed to a preset pixel size by nearest neighbor interpolation. The processing area is enlarged to the size of the original area by transforming the size, and the result of the area transformation is obtained.

其中,可选的,通过随机色彩变化处理方式,对待处理区域进行区域变换,得到区域变换结果,包括:确定待处理区域的高(height)和随机数x;将(x·height+1)~height的像素位置上的像素值,与0~x·height的像素位置上的像素值进行互换,得到区域变换结果;其中,随机数x属于[0,1]。Wherein, optionally, through the random color change processing method, the region to be processed is transformed to obtain the region transformation result, including: determining the height (height) of the region to be processed and the random number x; The pixel value at the pixel position of height is exchanged with the pixel value at the pixel position of 0~x·height to obtain the area transformation result; wherein, the random number x belongs to [0,1].

进而,可以将区域变换结果覆盖至原有的待处理区域上,得到新的图像作为二类增强数据。Furthermore, the result of the region transformation can be overlaid on the original region to be processed to obtain a new image as the second type of enhanced data.

作为一种可选的实施例,通过图像切片方式获取三类增强数据,包括:对三类指定图像集中各图像进行异常区域尺度变换,得到待处理区域;通过预设滑动窗口对待处理区域进行滑动切片,得到图像切片;将各图像切片确定为三类增强数据。这样可以基于图像切片方式解决了异常区域过小时训练样本的像素细节缺乏的问题,通过预设滑动窗口对待处理区域进行滑动切片,可以丰富增强数据中针对尺寸小的异常区域的样本量,从而有利于提升检测网络对于尺寸小的异常区域的检测精度。As an optional embodiment, the three types of enhanced data are obtained by means of image slices, including: performing abnormal area scale transformation on each image in the three types of specified image sets to obtain the area to be processed; sliding the area to be processed through a preset sliding window Slice to obtain image slices; determine each image slice as three types of enhanced data. In this way, based on the image slicing method, the problem of lack of pixel details of the training samples in the abnormal area is too small, and the sliding slice of the area to be processed by the preset sliding window can enrich and enhance the sample size of the small abnormal area in the data, thereby effectively It is beneficial to improve the detection accuracy of the detection network for small-sized abnormal regions.

具体地,可以将三类指定图像集中各图像的异常区域,尺度变换为预设尺寸(如,480*480),以得到待处理区域。进而,可以通过预设滑动窗口对待处理区域进行滑动切片,得到图像切片,具体请参阅图3,图3示意性示出了根据本申请的一个实施例的图像切片示意。如图3所示,经过对待处理区域300进行基于预设滑动窗口的滑动切片后可以得到图像切片310和图像切片320,此处的图像切片310和图像切片320仅作示意,实际应用过程中,可以获取任意数量的图像切片。预设滑动窗口的尺寸(如,256*256)可以根据实际需求进行任意设置,此处不作限定。Specifically, the abnormal region of each image in the three types of designated image sets may be scale-transformed to a preset size (eg, 480*480), so as to obtain the region to be processed. Furthermore, the area to be processed can be slided and sliced through a preset sliding window to obtain an image slice. Please refer to FIG. 3 for details. FIG. 3 schematically shows an image slice according to an embodiment of the present application. As shown in FIG. 3 , the image slice 310 and the image slice 320 can be obtained after the area to be processed 300 is slidingly sliced based on the preset sliding window. The image slice 310 and the image slice 320 here are only for illustration. In the actual application process, Any number of image slices can be fetched. The size of the preset sliding window (for example, 256*256) can be set arbitrarily according to actual needs, and is not limited here.

此外,一类指定图像集、二类指定图像集、三类指定图像集之间,可以存在图像交集,也可以无图像交集。In addition, there may or may not be an image intersection among the designated image sets of the first class, the designated image sets of the second class, and the designated image sets of the third class.

在步骤S130中,基于频谱特征、边缘特征、统计特征确定异常区域的异常类型。In step S130, the abnormal type of the abnormal region is determined based on the spectral features, edge features, and statistical features.

具体地,一个异常区域的异常类型通常为一个,可选的,一个异常区域的异常类型也可以为多个,也就是说,同一个异常区域可能存在多种异常类型。Specifically, there is usually one abnormal type in an abnormal area, and optionally, there may be multiple abnormal types in an abnormal area, that is, there may be multiple abnormal types in the same abnormal area.

作为一种可选的实施例,基于频谱特征、边缘特征、统计特征确定异常区域的异常类型,包括:将频谱特征、边缘特征、统计特征融合为目标融合特征;基于目标融合特征确定异常区域的异常类型。这样可以基于融合多维度特征的结果进行异常类型的识别,可以提升异常类型的识别精度。As an optional embodiment, determining the abnormal type of the abnormal region based on spectral features, edge features, and statistical features includes: fusing spectral features, edge features, and statistical features into target fusion features; determining the abnormal area based on target fusion features exception type. In this way, abnormal types can be identified based on the result of fusing multi-dimensional features, and the accuracy of identifying abnormal types can be improved.

具体地,将频谱特征、边缘特征、统计特征融合为目标融合特征,包括:将频谱特征(v1)、边缘特征(v2)、统计特征(v3)进行拼接,得到长度为d的向量t=[v1,v2,v3]T,将向量t确定为目标融合特征;或者,也可以将频谱特征(v1)、边缘特征(v2)、统计特征(v3)进行加权和处理,得到目标融合特征。Specifically, the fusion of spectral features, edge features, and statistical features into target fusion features includes: splicing spectral features (v 1 ), edge features (v 2 ), and statistical features (v 3 ) to obtain a vector of length d t=[v 1 ,v 2 ,v 3 ] T , determine the vector t as the target fusion feature; or, weight the spectral feature (v 1 ), edge feature (v 2 ), statistical feature (v 3 ) and processing to obtain the target fusion features.

作为一种可选的实施例,基于目标融合特征确定异常区域的异常类型,包括:获取对应于各待处理图像的目标特征;其中,各目标特征中包括目标融合特征;基于各目标特征确定异常区域的异常类型。这样可以基于多个待处理图像的目标特征确定当前的待处理图像的异常区域的异常类型,提升对于异常类型的识别精度。As an optional embodiment, determining the abnormality type of the abnormal region based on the target fusion features includes: acquiring target features corresponding to each image to be processed; wherein each target feature includes the target fusion feature; determining the abnormality based on each target feature The exception type for the zone. In this way, the abnormal type of the abnormal area of the current image to be processed can be determined based on the target features of the multiple images to be processed, and the recognition accuracy for the abnormal type can be improved.

具体地,可以对应于各待处理图像[I1,……,IN]的目标特征[t1,……,tN];其中,此处的N可以表示为各待处理图像的数量。进而,可以基于[t1,……,tN]确定出当前待处理图像的异常区域的异常类型。Specifically, it may correspond to the target features [t 1 , ..., t N ] of each image to be processed [I 1 , ..., I N ]; wherein, N here may represent the number of images to be processed. Furthermore, the abnormal type of the abnormal region of the current image to be processed can be determined based on [t 1 , . . . , t N ].

作为一种可选的实施例,基于各目标特征确定异常区域的异常类型,包括:根据各目标特征的特征均值构造特征数据矩阵;基于特征数据矩阵计算协方差矩阵,并提取协方差矩阵中的多个特征向量;基于多个特征向量构造的投影矩阵和特征数据矩阵生成目标矩阵;根据目标矩阵确定异常区域的异常类型。这样可以将各目标特征融合为特征数据矩阵,并基于特征数据矩阵以及其对应的协方差矩阵生成用于识别异常类型的目标矩阵,有利于提升其他图像的目标特征对于当前图像的异常类型判定的作用,以提升对于异常类型的识别精度。As an optional embodiment, determining the abnormal type of the abnormal region based on each target feature includes: constructing a feature data matrix according to the feature mean value of each target feature; calculating the covariance matrix based on the feature data matrix, and extracting the A plurality of eigenvectors; a target matrix is generated based on a projection matrix and a feature data matrix constructed by the plurality of eigenvectors; and an abnormal type of the abnormal region is determined according to the target matrix. In this way, each target feature can be fused into a feature data matrix, and based on the feature data matrix and its corresponding covariance matrix, a target matrix for identifying abnormal types can be generated, which is conducive to improving the target features of other images for the abnormal type judgment of the current image. function to improve the recognition accuracy for abnormal types.

具体地,可以根据各目标特征[t1,……,tN]的特征均值δ构造特征数据矩阵D=[t1-δ,…,tN-δ]。进而,可以基于特征数据矩阵D计算协方差矩C=1/dDDT,并对协方差矩阵C中的特征向量进行由大到小/由小到大的排序,提取前k(k>d)个特征向量,并基于前k个特征向量构造的投影矩阵P,通过矩阵乘法计算PD,得到目标矩阵。进而,还可以对目标矩阵进行降维处理,向分类网络输入降维处理后的数据矩阵,得到分类网络输出的异常区域的异常类型,根据分类网络输出的异常类型和作为标签的异常类型可以生成损失函数,以实现基于损失函数的分类网络训练,从而使得分类网络具备确定异常区域的异常类型的能力。Specifically, the feature data matrix D=[t 1 -δ, ...,t N -δ ] can be constructed according to the feature mean δ of each target feature [t 1 ,...,t N ]. Furthermore, the covariance moment C=1/dDD T can be calculated based on the characteristic data matrix D, and the eigenvectors in the covariance matrix C can be sorted from large to small/small to large, and the top k (k>d) can be extracted eigenvectors, and based on the projection matrix P constructed by the first k eigenvectors, the PD is calculated by matrix multiplication to obtain the target matrix. Furthermore, it is also possible to perform dimension reduction processing on the target matrix, input the data matrix after dimension reduction processing to the classification network, and obtain the abnormal type of the abnormal area output by the classification network, and generate The loss function is used to realize the training of the classification network based on the loss function, so that the classification network has the ability to determine the abnormal type of the abnormal region.

请参阅图4,图4示意性示出了根据本申请的另一个实施例的图像异常的识别方法的流程图。如图4所示,该图像异常的识别方法包括:步骤S400~步骤S416。Referring to FIG. 4 , FIG. 4 schematically shows a flowchart of a method for identifying an image abnormality according to another embodiment of the present application. As shown in FIG. 4 , the method for identifying abnormal images includes: step S400 to step S416 .

步骤S400:对一类指定图像集中各图像进行异常区域裁剪,若异常区域的尺寸大于预设尺寸,则基于预设尺寸将异常区域裁剪为多个子图,若异常区域的尺寸小于等于预设尺寸,则对异常区域进行尺度变换,得到异常子图。进而,可以将多个子图和异常子图中至少一种,确定为对抗训练样本,触发对抗网络中的生成器生成参考训练样本,并通过参考训练样本和对抗训练样本训练对抗网络中的判别器,以及,基于判别器的判别结果训练生成器。进而,通过训练后的对抗网络中的生成器生成一类增强数据。Step S400: Crop the abnormal region for each image in a specified image set. If the size of the abnormal region is larger than the preset size, then crop the abnormal region into multiple sub-images based on the preset size. If the size of the abnormal region is smaller than or equal to the preset size , then perform scale transformation on the abnormal region to obtain the abnormal submap. Furthermore, at least one of multiple subgraphs and abnormal subgraphs can be determined as an adversarial training sample, triggering the generator in the adversarial network to generate a reference training sample, and training the discriminator in the adversarial network through the reference training sample and the adversarial training sample , and the generator is trained based on the discriminative results of the discriminator. Furthermore, a class of augmented data is generated by the generator in the trained adversarial network.

步骤S402:对二类指定图像集中的图像进行区域选取,得到待处理区域,并通过马赛克处理方式和/或随机色彩变化处理方式,对待处理区域进行区域变换,得到区域变换结果,以及,将各待处理区域替换为相应的区域变换结果,得到二类增强数据。Step S402: Select the region of the images in the second type of designated image set to obtain the region to be processed, and perform region transformation on the region to be processed by mosaic processing and/or random color change processing to obtain a region transformation result, and convert each The area to be processed is replaced by the corresponding area transformation result, and the second type of enhanced data is obtained.

步骤S404:对三类指定图像集中各图像进行异常区域尺度变换,得到待处理区域,并通过预设滑动窗口对待处理区域进行滑动切片,得到图像切片,将各图像切片确定为三类增强数据。Step S404: Scale-transform the abnormal region of each image in the three designated image sets to obtain the region to be processed, and perform sliding slices on the region to be processed through the preset sliding window to obtain image slices, and determine each image slice as the three types of enhanced data.

步骤S406:基于一类增强数据、二类增强数据、三类增强数据中至少一种确定增强数据集,获取样本数据集并基于样本数据集和增强数据集训练检测网络。Step S406: Determine an enhanced data set based on at least one of the first type of enhanced data, the second type of enhanced data, and the third type of enhanced data, acquire a sample data set, and train a detection network based on the sample data set and the enhanced data set.

步骤S408:基于训练后的检测网络识别待处理图像中的异常区域。Step S408: Identify abnormal regions in the image to be processed based on the trained detection network.

步骤S410:对异常区域进行区域分割,得到子区域集合,并对异常区域和子区域集合进行傅里叶变换,得到频谱图像集合,进而基于频谱图像集合确定异常区域的频谱特征。Step S410: Segment the abnormal area to obtain a set of sub-areas, perform Fourier transform on the abnormal area and the set of sub-areas to obtain a set of spectral images, and then determine the spectral features of the abnormal area based on the set of spectral images.

步骤S412:获取异常区域的深度特征,确定异常区域的最大边缘幅度值和最小边缘幅度值,进而基于最大边缘幅度值和最小边缘幅度值,将异常区域中各边缘幅度值更新为参考边缘特征,基于深度特征和参考边缘特征确定异常区域的边缘特征。Step S412: Obtain the depth feature of the abnormal area, determine the maximum and minimum edge amplitude values of the abnormal area, and then update each edge amplitude value in the abnormal area to the reference edge feature based on the maximum and minimum edge amplitude values, The edge features of abnormal regions are determined based on depth features and reference edge features.

步骤S414:对异常区域中各特征点进行特征提取,得到特征点向量集合,对特征点向量集合进行混合高斯分布计算,得到分布函数,进而基于分布函数表示似然函数,并计算似然函数的权重偏导、均值偏导、方差偏导,将权重偏导、均值偏导、方差偏导融合为异常区域的统计特征。Step S414: Perform feature extraction on each feature point in the abnormal area to obtain a feature point vector set, perform mixed Gaussian distribution calculation on the feature point vector set to obtain a distribution function, and then express the likelihood function based on the distribution function, and calculate the likelihood function Weight partial derivation, mean partial derivation, and variance partial derivation, fused weight partial derivation, mean partial derivation, and variance partial derivation into the statistical characteristics of the abnormal area.

步骤S416:将频谱特征、边缘特征、统计特征融合为目标融合特征;获取对应于各待处理图像的目标特征;其中,各目标特征中包括目标融合特征。进而,根据各目标特征的特征均值构造特征数据矩阵,基于特征数据矩阵计算协方差矩阵,并提取协方差矩阵中的多个特征向量。以及,基于多个特征向量构造的投影矩阵和特征数据矩阵生成目标矩阵,根据目标矩阵确定异常区域的异常类型。Step S416: Fuse the spectral features, edge features, and statistical features into target fusion features; acquire target features corresponding to each image to be processed; wherein, each target feature includes target fusion features. Furthermore, a feature data matrix is constructed according to the feature mean value of each target feature, a covariance matrix is calculated based on the feature data matrix, and multiple feature vectors in the covariance matrix are extracted. And, a target matrix is generated based on the projection matrix constructed by multiple feature vectors and the feature data matrix, and the abnormal type of the abnormal region is determined according to the target matrix.

需要说明的是,步骤S400~步骤S416与图1所示的各步骤及其实施例相对应,针对步骤S400~步骤S416的具体实施方式,请参阅图1所示的各步骤及其实施例,此处不再赘述。It should be noted that steps S400 to S416 correspond to the steps and their embodiments shown in FIG. 1 . For the specific implementation of steps S400 to S416, please refer to the steps and their embodiments shown in FIG. 1 . I won't repeat them here.

可见,实施图4所示的方法,可以先识别出待处理图像中的异常区域,再提取异常区域的频谱特征、边缘特征、统计特征,即提取到可以更全面表征异常区域的多维特征,进而基于频谱特征、边缘特征、统计特征可以更准确地确定异常区域的异常类型,相较于相关技术而言,本申请可以针对异常区域提取多维特征并基于多维特征进行异常类型识别,而不是基于单一的图像特征进行异常类型识别,因此可以提升对于异常类型的识别精度。此外,由于本申请细分了异常区域的识别过程和异常类型识别过程,并基于此只针对异常区域进行多为特征提取,相较于相关技术直接通过神经网络在一次识别过程中同时完成异常区域识别和异常类型识别,本申请可以进一步提升对于异常类型的识别精度。It can be seen that by implementing the method shown in Figure 4, the abnormal area in the image to be processed can be identified first, and then the spectral features, edge features, and statistical features of the abnormal area can be extracted, that is, multi-dimensional features that can more comprehensively characterize the abnormal area can be extracted, and then Based on spectral features, edge features, and statistical features, the abnormal type of abnormal areas can be more accurately determined. Compared with related technologies, this application can extract multi-dimensional features for abnormal areas and identify abnormal types based on multi-dimensional features, rather than based on a single The image features of the image are used to identify abnormal types, so the recognition accuracy of abnormal types can be improved. In addition, since this application subdivides the identification process of abnormal areas and the identification process of abnormal types, and based on this, it only performs feature extraction for abnormal areas. Identification and abnormal type identification, the present application can further improve the identification accuracy of abnormal types.

请参阅图5,图5示意性示出了根据本申请的一个实施例中的图像异常的识别装置的结构框图。如图5所示,该图像异常的识别装置500可以包括如下单元。Please refer to FIG. 5 , which schematically shows a structural block diagram of an apparatus for identifying abnormal images according to an embodiment of the present application. As shown in FIG. 5 , the apparatus 500 for identifying abnormal images may include the following units.

异常区域识别单元501,用于识别待处理图像中的异常区域;An abnormal area identification unit 501, configured to identify an abnormal area in the image to be processed;

多维度特征提取单元502,用于提取异常区域的频谱特征、边缘特征、统计特征;A multi-dimensional feature extraction unit 502, used to extract spectral features, edge features, and statistical features of abnormal regions;

异常类型判定单元503,用于基于频谱特征、边缘特征、统计特征确定异常区域的异常类型。An abnormality type determining unit 503, configured to determine the abnormality type of the abnormal area based on spectral features, edge features, and statistical features.

其中,异常类型包括:色块异常、异色异常、错位异常、花屏异常、条纹异常、撕裂异常。Among them, the abnormal types include: color block abnormality, heterochromatic abnormality, dislocation abnormality, blurred screen abnormality, stripe abnormality, and tearing abnormality.

可见,实施图5所示的装置,可以先识别出待处理图像中的异常区域,再提取异常区域的频谱特征、边缘特征、统计特征,即提取到可以更全面表征异常区域的多维特征,进而基于频谱特征、边缘特征、统计特征可以更准确地确定异常区域的异常类型,相较于相关技术而言,本申请可以针对异常区域提取多维特征并基于多维特征进行异常类型识别,而不是基于单一的图像特征进行异常类型识别,因此可以提升对于异常类型的识别精度。此外,由于本申请细分了异常区域的识别过程和异常类型识别过程,并基于此只针对异常区域进行多为特征提取,相较于相关技术直接通过神经网络在一次识别过程中同时完成异常区域识别和异常类型识别,本申请可以进一步提升对于异常类型的识别精度。It can be seen that the implementation of the device shown in Figure 5 can first identify the abnormal area in the image to be processed, and then extract the spectral features, edge features, and statistical features of the abnormal area, that is, extract the multi-dimensional features that can more comprehensively characterize the abnormal area, and then Based on spectral features, edge features, and statistical features, the abnormal type of abnormal areas can be more accurately determined. Compared with related technologies, this application can extract multi-dimensional features for abnormal areas and identify abnormal types based on multi-dimensional features, rather than based on a single The image features of the image are used to identify abnormal types, so the recognition accuracy of abnormal types can be improved. In addition, since this application subdivides the identification process of abnormal areas and the identification process of abnormal types, and based on this, it only performs feature extraction for abnormal areas. Identification and abnormal type identification, the present application can further improve the identification accuracy of abnormal types.

作为一种可选的实施例,多维度特征提取单元502提取异常区域的频谱特征,包括:As an optional embodiment, the multi-dimensional feature extraction unit 502 extracts the spectral features of the abnormal region, including:

对异常区域进行区域分割,得到子区域集合;Segment the abnormal region to obtain a set of sub-regions;

对异常区域和子区域集合进行傅里叶变换,得到频谱图像集合;Perform Fourier transform on the abnormal area and the sub-area set to obtain the spectrum image set;

基于频谱图像集合确定异常区域的频谱特征。Spectral features of abnormal regions are determined based on a set of spectral images.

可见,实施该可选的实施例,可以基于傅里叶变换得到异常区域的频谱特征,频谱特征可以从频域描述异常区域,将频谱特征作为异常类型的识别条件,可以提升异常类型的识别精度。It can be seen that the implementation of this optional embodiment can obtain the spectral features of the abnormal area based on Fourier transform, and the spectral features can describe the abnormal area from the frequency domain, and the spectral feature can be used as the identification condition of the abnormal type, which can improve the identification accuracy of the abnormal type .

作为一种可选的实施例,多维度特征提取单元502提取异常区域的边缘特征,包括:As an optional embodiment, the multi-dimensional feature extraction unit 502 extracts edge features of the abnormal region, including:

获取异常区域的深度特征;Obtain the depth features of the abnormal region;

对异常区域进行边缘检测得到参考边缘特征;Perform edge detection on abnormal areas to obtain reference edge features;

基于深度特征和参考边缘特征确定异常区域的边缘特征。The edge features of abnormal regions are determined based on depth features and reference edge features.

可见,实施该可选的实施例,可以基于边缘检测得到异常区域的边缘特征,边缘特征可以突出描述异常区域的边缘,将频谱特征作为异常类型的识别条件,可以提升异常类型的识别精度。It can be seen that by implementing this optional embodiment, the edge features of the abnormal area can be obtained based on edge detection. The edge features can highlight and describe the edge of the abnormal area. Using the spectral feature as the identification condition of the abnormal type can improve the identification accuracy of the abnormal type.

作为一种可选的实施例,多维度特征提取单元502对异常区域进行边缘检测得到参考边缘特征,包括:As an optional embodiment, the multi-dimensional feature extraction unit 502 performs edge detection on the abnormal region to obtain reference edge features, including:

确定异常区域的最大边缘幅度值和最小边缘幅度值;Determining the maximum and minimum edge amplitude values of the abnormal region;

基于最大边缘幅度值和最小边缘幅度值,将异常区域中各边缘幅度值更新为参考边缘特征。Based on the maximum edge amplitude value and the minimum edge amplitude value, each edge amplitude value in the abnormal area is updated as a reference edge feature.

可见,实施该可选的实施例,可以基于最大边缘幅度值和最小边缘幅度值对各边缘幅度值进行更新,从而得到参考边缘特征,可以提升最终确定出的异常区域的边缘特征的表征准确性。It can be seen that, implementing this optional embodiment, each edge amplitude value can be updated based on the maximum edge amplitude value and the minimum edge amplitude value, so as to obtain the reference edge feature, which can improve the characterization accuracy of the edge feature of the finally determined abnormal region .

作为一种可选的实施例,多维度特征提取单元502提取异常区域的统计特征,包括:As an optional embodiment, the multi-dimensional feature extraction unit 502 extracts statistical features of abnormal regions, including:

对异常区域中各特征点进行特征提取,得到特征点向量集合;Perform feature extraction on each feature point in the abnormal area to obtain a set of feature point vectors;

对特征点向量集合进行混合高斯分布计算,得到分布函数;Perform mixed Gaussian distribution calculation on the feature point vector set to obtain the distribution function;

基于分布函数表示似然函数,并计算似然函数的权重偏导、均值偏导、方差偏导;Express the likelihood function based on the distribution function, and calculate the weight partial derivative, mean partial derivative, and variance partial derivative of the likelihood function;

将权重偏导、均值偏导、方差偏导融合为异常区域的统计特征。The weight partial derivative, mean partial derivative, and variance partial derivative are fused into the statistical characteristics of abnormal regions.

可见,实施该可选的实施例,可以基于高斯分布、似然函数、偏导等方式确定出异常区域的统计特征,统计特征可以从统计学维度描述异常区域,将统计特征作为异常类型的识别条件,可以提升异常类型的识别精度。It can be seen that, implementing this optional embodiment, the statistical characteristics of the abnormal region can be determined based on Gaussian distribution, likelihood function, partial derivative, etc. The statistical characteristics can describe the abnormal region from the statistical dimension, and the statistical characteristics can be used as the identification of the abnormal type Conditions can improve the recognition accuracy of abnormal types.

作为一种可选的实施例,异常区域识别单元501识别待处理图像中的异常区域,包括:As an optional embodiment, the abnormal region identifying unit 501 identifies the abnormal region in the image to be processed, including:

获取样本数据集和增强数据集;Get sample dataset and augmented dataset;

基于样本数据集和增强数据集训练检测网络;Train the detection network based on the sample data set and the enhanced data set;

基于训练后的检测网络识别待处理图像中的异常区域。Identify abnormal regions in the image to be processed based on the trained detection network.

可见,实施该可选的实施例,可以通过样本数据集和增强数据集对分类网络进行大样本训练,可以提升检测网络对于异常区域的检测精度,相关技术中的样本数量不足,本申请相较于相关技术可以增大样本量,提升检测网络的训练强度。It can be seen that, implementing this optional embodiment, the classification network can be trained with a large sample through the sample data set and the enhanced data set, and the detection accuracy of the detection network for abnormal areas can be improved. The number of samples in the related art is insufficient. Because of related technologies, the sample size can be increased and the training intensity of the detection network can be improved.

作为一种可选的实施例,多维度特征提取单元502获取增强数据集,包括:As an optional embodiment, the multi-dimensional feature extraction unit 502 acquires an enhanced data set, including:

通过对抗网络生成一类增强数据;Generating a class of augmented data via an adversarial network;

通过区域变换方式生成二类增强数据;Generate the second type of enhanced data by means of area transformation;

通过图像切片方式获取三类增强数据;Obtain three types of enhanced data through image slicing;

基于一类增强数据、二类增强数据、三类增强数据中至少一种确定增强数据集。The enhanced data set is determined based on at least one of the first type of enhanced data, the second type of enhanced data, and the third type of enhanced data.

可见,实施该可选的实施例,可以通过多种方式获取多种增强数据,以丰富样本类型,基于多样化的增强数据,可以有利于提升分类网络的精度。It can be seen that, implementing this optional embodiment, various enhanced data can be obtained in various ways to enrich sample types, and based on the diversified enhanced data, it can be beneficial to improve the accuracy of the classification network.

作为一种可选的实施例,多维度特征提取单元502通过对抗网络生成一类增强数据,包括:As an optional embodiment, the multi-dimensional feature extraction unit 502 generates a type of enhanced data through an adversarial network, including:

通过一类指定图像集训练对抗网络;Train the adversarial network through a class of specified image sets;

通过训练后的对抗网络中的生成器生成一类增强数据。A class of augmented data is generated by a generator in a trained adversarial network.

可见,实施该可选的实施例,可以训练出用于生成包含异常区域的图像的对抗网络,利用对抗网络可以生成增强数据来训练分类网络,可以提升针对分类网络的训练强度。It can be seen that by implementing this optional embodiment, an adversarial network for generating images containing abnormal regions can be trained, and the adversarial network can be used to generate enhanced data to train the classification network, which can increase the training intensity for the classification network.

作为一种可选的实施例,多维度特征提取单元502通过一类指定图像集训练对抗网络,包括:As an optional embodiment, the multi-dimensional feature extraction unit 502 trains the confrontation network through a class of specified image sets, including:

将一类指定图像集处理为对抗训练样本;Process a class of specified image sets as adversarial training samples;

触发对抗网络中的生成器生成参考训练样本;Trigger the generator in the adversarial network to generate reference training samples;

通过参考训练样本和对抗训练样本训练对抗网络中的判别器;Train the discriminator in the adversarial network by referring to training samples and adversarial training samples;

基于判别器的判别结果训练生成器。The generator is trained based on the discriminative results of the discriminator.

可见,实施该可选的实施例,可以实现基于一类指定图像集的对抗网络训练,以使得对抗网络中的生成器可以生成拟真的异常图像用作检测网络的训练。It can be seen that implementing this optional embodiment can realize adversarial network training based on a specified image set, so that the generator in the adversarial network can generate realistic abnormal images for training of the detection network.

作为一种可选的实施例,多维度特征提取单元502将一类指定图像集处理为对抗训练样本,包括:As an optional embodiment, the multi-dimensional feature extraction unit 502 processes a class of designated image sets as confrontation training samples, including:

对一类指定图像集中各图像进行异常区域裁剪;Perform abnormal region cropping on each image in a specified image set;

若异常区域的尺寸大于预设尺寸,则基于预设尺寸将异常区域裁剪为多个子图,若异常区域的尺寸小于等于预设尺寸,则对异常区域进行尺度变换,得到异常子图;If the size of the abnormal area is larger than the preset size, the abnormal area is cut into multiple sub-images based on the preset size, and if the size of the abnormal area is smaller than or equal to the preset size, the abnormal area is scale-transformed to obtain the abnormal sub-image;

将多个子图和异常子图中至少一种,确定为对抗训练样本。Determining at least one of multiple subgraphs and abnormal subgraphs as adversarial training samples.

可见,实施该可选的实施例,可以将一类指定图像集中各图像进行调整,以使得各图像满足样本要求,进而,基于调整后的各图像训练对抗网络,可以提升训练效率。It can be seen that, implementing this optional embodiment, each image in a specified image set of a class can be adjusted so that each image meets the sample requirements, and then training an adversarial network based on each adjusted image can improve training efficiency.

作为一种可选的实施例,区域变换方式包括马赛克处理方式和/或随机色彩变化处理方式,多维度特征提取单元502通过区域变换方式生成二类增强数据,包括:As an optional embodiment, the region transformation method includes a mosaic processing method and/or a random color change processing method, and the multi-dimensional feature extraction unit 502 generates the second type of enhanced data through the region transformation method, including:

对二类指定图像集中的图像进行区域选取,得到待处理区域;Perform region selection on the images in the second type of specified image set to obtain the region to be processed;

通过马赛克处理方式和/或随机色彩变化处理方式,对待处理区域进行区域变换,得到区域变换结果;By means of mosaic processing and/or random color change processing, the area to be processed is transformed to obtain the result of the region transformation;

将各待处理区域替换为相应的区域变换结果,得到二类增强数据。Each area to be processed is replaced by the corresponding area transformation result to obtain the second type of enhanced data.

可见,实施该可选的实施例,可以通过区域变换方式丰富增强数据的类型,规避异常类型之间数据量差异大的问题,进而,如果基于多样化的增强数据训练检测网络,可以提升检测网络的可靠性和鲁棒性。It can be seen that the implementation of this optional embodiment can enrich the types of enhanced data through region transformation, avoiding the problem of large data volume differences between abnormal types, and furthermore, if the detection network is trained based on diversified enhanced data, the detection network can be improved. reliability and robustness.

作为一种可选的实施例,多维度特征提取单元502通过图像切片方式获取三类增强数据,包括:As an optional embodiment, the multi-dimensional feature extraction unit 502 obtains three types of enhanced data through image slices, including:

对三类指定图像集中各图像进行异常区域尺度变换,得到待处理区域;Scale transformation of the abnormal region is performed on each image in the three specified image sets to obtain the region to be processed;

通过预设滑动窗口对待处理区域进行滑动切片,得到图像切片;Slide and slice the area to be processed through the preset sliding window to obtain image slices;

将各图像切片确定为三类增强数据。Each image slice is identified as three types of augmented data.

可见,实施该可选的实施例,可以基于图像切片方式解决了异常区域过小时训练样本的像素细节缺乏的问题,通过预设滑动窗口对待处理区域进行滑动切片,可以丰富增强数据中针对尺寸小的异常区域的样本量,从而有利于提升检测网络对于尺寸小的异常区域的检测精度。It can be seen that the implementation of this optional embodiment can solve the problem of lack of pixel details in training samples with too small anomaly regions based on the image slicing method. Sliding and slicing the region to be processed through the preset sliding window can enrich and enhance data for small size The sample size of the abnormal region is beneficial to improve the detection accuracy of the detection network for small abnormal regions.

作为一种可选的实施例,异常类型判定单元503基于频谱特征、边缘特征、统计特征确定异常区域的异常类型,包括:As an optional embodiment, the abnormal type determining unit 503 determines the abnormal type of the abnormal region based on spectral features, edge features, and statistical features, including:

将频谱特征、边缘特征、统计特征融合为目标融合特征;Combine spectral features, edge features, and statistical features into target fusion features;

基于目标融合特征确定异常区域的异常类型。The abnormal type of the abnormal region is determined based on the target fusion features.

可见,实施该可选的实施例,可以基于融合多维度特征的结果进行异常类型的识别,可以提升异常类型的识别精度。It can be seen that, implementing this optional embodiment, the abnormal type can be identified based on the result of fusing multi-dimensional features, and the identification accuracy of the abnormal type can be improved.

作为一种可选的实施例,异常类型判定单元503基于目标融合特征确定异常区域的异常类型,包括:As an optional embodiment, the abnormal type determination unit 503 determines the abnormal type of the abnormal region based on the target fusion feature, including:

获取对应于各待处理图像的目标特征;其中,各目标特征中包括目标融合特征;Acquiring target features corresponding to each image to be processed; wherein, each target feature includes a target fusion feature;

基于各目标特征确定异常区域的异常类型。The abnormal type of the abnormal region is determined based on each target feature.

可见,实施该可选的实施例,可以基于多个待处理图像的目标特征确定当前的待处理图像的异常区域的异常类型,提升对于异常类型的识别精度。It can be seen that by implementing this optional embodiment, the abnormal type of the abnormal area of the current image to be processed can be determined based on the target features of multiple images to be processed, and the recognition accuracy of the abnormal type can be improved.

作为一种可选的实施例,异常类型判定单元503基于各目标特征确定异常区域的异常类型,包括:As an optional embodiment, the abnormal type determining unit 503 determines the abnormal type of the abnormal region based on each target feature, including:

根据各目标特征的特征均值构造特征数据矩阵;Construct a feature data matrix according to the feature mean of each target feature;

基于特征数据矩阵计算协方差矩阵,并提取协方差矩阵中的多个特征向量;Calculate the covariance matrix based on the characteristic data matrix, and extract multiple eigenvectors in the covariance matrix;

基于多个特征向量构造的投影矩阵和特征数据矩阵生成目标矩阵;Generate a target matrix based on a projection matrix constructed from multiple eigenvectors and a feature data matrix;

根据目标矩阵确定异常区域的异常类型。The abnormal type of the abnormal region is determined according to the target matrix.

可见,实施该可选的实施例,可以将各目标特征融合为特征数据矩阵,并基于特征数据矩阵以及其对应的协方差矩阵生成用于识别异常类型的目标矩阵,有利于提升其他图像的目标特征对于当前图像的异常类型判定的作用,以提升对于异常类型的识别精度。It can be seen that, implementing this optional embodiment, each target feature can be fused into a feature data matrix, and a target matrix for identifying abnormal types can be generated based on the feature data matrix and its corresponding covariance matrix, which is conducive to improving the target of other images. The role of features in determining the abnormal type of the current image to improve the recognition accuracy of abnormal types.

应当注意,尽管在上文详细描述中提及了用于动作执行的设备的若干模块或者单元,但是这种划分并非强制性的。实际上,根据本申请的实施方式,上文描述的两个或更多模块或者单元的特征和功能可以在一个模块或者单元中具体化。反之,上文描述的一个模块或者单元的特征和功能可以进一步划分为由多个模块或者单元来具体化。It should be noted that although several modules or units of the device for action execution are mentioned in the above detailed description, this division is not mandatory. Actually, according to the embodiment of the present application, the features and functions of two or more modules or units described above may be embodied in one module or unit. Conversely, the features and functions of one module or unit described above can be further divided to be embodied by a plurality of modules or units.

由于本申请的示例实施例的图像异常的识别装置的各个功能模块与上述图像异常的识别装置的示例实施例的步骤对应,因此对于本申请装置实施例中未披露的细节,请参照本申请上述的图像异常的识别装置的实施例。Since each functional module of the image anomaly recognition device of the example embodiment of the present application corresponds to the steps of the above-mentioned example embodiment of the image anomaly recognition device, for details not disclosed in the device embodiment of the present application, please refer to the above-mentioned An embodiment of an image abnormality recognition device.

请参阅图6,图6示出了适于用来实现本申请实施例的电子设备的计算机系统的结构示意图。Please refer to FIG. 6 . FIG. 6 shows a schematic structural diagram of a computer system suitable for implementing an electronic device according to an embodiment of the present application.

需要说明的是,图6示出的电子设备的计算机系统600仅是一个示例,不应对本申请实施例的功能和使用范围带来任何限制。It should be noted that the computer system 600 of the electronic device shown in FIG. 6 is only an example, and should not limit the functions and scope of use of this embodiment of the present application.

如图6所示,计算机系统600包括中央处理单元(CPU)601,其可以根据存储在只读存储器(ROM)602中的程序或者从储存部分608加载到随机访问存储器(RAM)603中的程序而执行各种适当的动作和处理。在RAM 603中,还存储有系统操作所需的各种程序和数据。CPU601、ROM 602以及RAM 603通过总线604彼此相连。输入/输出(I/O)接口605也连接至总线604。As shown in FIG. 6 , a computer system 600 includes a central processing unit (CPU) 601 that can execute programs according to programs stored in a read-only memory (ROM) 602 or loaded from a storage section 608 into a random-access memory (RAM) 603 Instead, various appropriate actions and processes are performed. In the RAM 603, various programs and data necessary for system operation are also stored. The CPU 601 , ROM 602 , and RAM 603 are connected to each other via a bus 604 . An input/output (I/O) interface 605 is also connected to the bus 604 .

以下部件连接至I/O接口605:包括键盘、鼠标等的输入部分606;包括诸如阴极射线管(CRT)、液晶显示器(LCD)等以及扬声器等的输出部分607;包括硬盘等的储存部分608;以及包括诸如LAN卡、调制解调器等的网络接口卡的通信部分609。通信部分609经由诸如因特网的网络执行通信处理。驱动器610也根据需要连接至I/O接口605。可拆卸介质611,诸如磁盘、光盘、磁光盘、半导体存储器等等,根据需要安装在驱动器610上,以便于从其上读出的计算机程序根据需要被安装入储存部分608。The following components are connected to the I/O interface 605: an input section 606 including a keyboard, a mouse, etc.; an output section 607 including a cathode ray tube (CRT), a liquid crystal display (LCD), etc., and a speaker; a storage section 608 including a hard disk, etc. and a communication section 609 including a network interface card such as a LAN card, a modem, or the like. The communication section 609 performs communication processing via a network such as the Internet. A drive 610 is also connected to the I/O interface 605 as needed. A removable medium 611, such as a magnetic disk, optical disk, magneto-optical disk, semiconductor memory, etc., is mounted on the drive 610 as necessary so that a computer program read therefrom is installed into the storage section 608 as necessary.

特别地,根据本申请的实施例,下文参考流程图描述的过程可以被实现为计算机软件程序。例如,本申请的实施例包括一种计算机程序产品,其包括承载在计算机可读介质上的计算机程序,该计算机程序包含用于执行流程图所示的方法的程序代码。在这样的实施例中,该计算机程序可以通过通信部分609从网络上被下载和安装,和/或从可拆卸介质611被安装。在该计算机程序被中央处理单元(CPU)601执行时,执行本申请的方法和装置中限定的各种功能。In particular, according to the embodiments of the present application, the processes described below with reference to the flowcharts can be implemented as computer software programs. For example, the embodiments of the present application include a computer program product, which includes a computer program carried on a computer-readable medium, where the computer program includes program codes for executing the methods shown in the flowcharts. In such an embodiment, the computer program may be downloaded and installed from a network via communication portion 609 and/or installed from removable media 611 . When the computer program is executed by a central processing unit (CPU) 601, various functions defined in the method and apparatus of the present application are performed.

作为另一方面,本申请还提供了一种计算机可读介质,该计算机可读介质可以是上述实施例中描述的电子设备中所包含的;也可以是单独存在,而未装配入该电子设备中。上述计算机可读介质承载有一个或者多个程序,当上述一个或者多个程序被一个该电子设备执行时,使得该电子设备实现上述实施例中的方法。As another aspect, the present application also provides a computer-readable medium. The computer-readable medium may be included in the electronic device described in the above embodiments; it may also exist independently without being assembled into the electronic device. middle. The above-mentioned computer-readable medium carries one or more programs, and when the above-mentioned one or more programs are executed by an electronic device, the electronic device is made to implement the methods in the above-mentioned embodiments.

需要说明的是,本申请所示的计算机可读介质可以是计算机可读信号介质或者计算机可读存储介质或者是上述两者的任意组合。计算机可读存储介质例如可以是——但不限于——电、磁、光、电磁、红外线、或半导体的系统、装置或器件,或者任意以上的组合。计算机可读存储介质的更具体的例子可以包括但不限于:具有一个或多个导线的电连接、便携式计算机磁盘、硬盘、随机访问存储器(RAM)、只读存储器(ROM)、可擦式可编程只读存储器(EPROM或闪存)、光纤、便携式紧凑磁盘只读存储器(CD-ROM)、光存储器件、磁存储器件、或者上述的任意合适的组合。在本申请中,计算机可读存储介质可以是任何包含或存储程序的有形介质,该程序可以被指令执行系统、装置或者器件使用或者与其结合使用。而在本申请中,计算机可读的信号介质可以包括在基带中或者作为载波一部分传播的数据信号,其中承载了计算机可读的程序代码。这种传播的数据信号可以采用多种形式,包括但不限于电磁信号、光信号或上述的任意合适的组合。计算机可读的信号介质还可以是计算机可读存储介质以外的任何计算机可读介质,该计算机可读介质可以发送、传播或者传输用于由指令执行系统、装置或者器件使用或者与其结合使用的程序。计算机可读介质上包含的程序代码可以用任何适当的介质传输,包括但不限于:无线、电线、光缆、RF等等,或者上述的任意合适的组合。It should be noted that the computer-readable medium shown in this application may be a computer-readable signal medium or a computer-readable storage medium or any combination of the above two. A computer readable storage medium may be, for example, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, device, or device, or any combination thereof. More specific examples of computer-readable storage media may include, but are not limited to, electrical connections with one or more wires, portable computer diskettes, hard disks, random access memory (RAM), read-only memory (ROM), erasable Programmable read-only memory (EPROM or flash memory), optical fiber, portable compact disk read-only memory (CD-ROM), optical storage device, magnetic storage device, or any suitable combination of the above. In this application, a computer-readable storage medium may be any tangible medium that contains or stores a program that can be used by or in conjunction with an instruction execution system, apparatus, or device. In this application, however, a computer-readable signal medium may include a data signal propagated in baseband or as part of a carrier wave, in which computer-readable program codes are carried. Such propagated data signals may take many forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination of the foregoing. A computer-readable signal medium may also be any computer-readable medium other than a computer-readable storage medium, which can send, propagate, or transmit a program for use by or in conjunction with an instruction execution system, apparatus, or device. . Program code embodied on a computer readable medium may be transmitted using any appropriate medium, including but not limited to wireless, wireline, optical fiber cable, RF, etc., or any suitable combination of the foregoing.

附图中的流程图和框图,图示了按照本申请各种实施例的系统、方法和计算机程序产品的可能实现的体系架构、功能和操作。在这点上,流程图或框图中的每个方框可以代表一个模块、程序段、或代码的一部分,上述模块、程序段、或代码的一部分包含一个或多个用于实现规定的逻辑功能的可执行指令。也应当注意,在有些作为替换的实现中,方框中所标注的功能也可以以不同于附图中所标注的顺序发生。例如,两个接连地表示的方框实际上可以基本并行地执行,它们有时也可以按相反的顺序执行,这依所涉及的功能而定。也要注意的是,框图或流程图中的每个方框、以及框图或流程图中的方框的组合,可以用执行规定的功能或操作的专用的基于硬件的系统来实现,或者可以用专用硬件与计算机指令的组合来实现。The flowchart and block diagrams in the Figures illustrate the architecture, functionality, and operation of possible implementations of systems, methods and computer program products according to various embodiments of the present application. In this regard, each block in a flowchart or block diagram may represent a module, program segment, or portion of code that includes one or more logical functions for implementing specified executable instructions. It should also be noted that, in some alternative implementations, the functions noted in the block may occur out of the order noted in the figures. For example, two blocks shown in succession may, in fact, be executed substantially concurrently, or they may sometimes be executed in the reverse order, depending upon the functionality involved. It should also be noted that each block in the block diagrams or flowchart illustrations, and combinations of blocks in the block diagrams or flowchart illustrations, can be implemented by a dedicated hardware-based system that performs the specified function or operation, or can be implemented by a A combination of dedicated hardware and computer instructions.

描述于本申请实施例中所涉及到的单元可以通过软件的方式实现,也可以通过硬件的方式来实现,所描述的单元也可以设置在处理器中。其中,这些单元的名称在某种情况下并不构成对该单元本身的限定。The units described in the embodiments of the present application may be implemented by software or by hardware, and the described units may also be set in a processor. Wherein, the names of these units do not constitute a limitation of the unit itself under certain circumstances.

本领域技术人员在考虑说明书及实践这里公开的发明后,将容易想到本申请的其它实施方案。本申请旨在涵盖本申请的任何变型、用途或者适应性变化,这些变型、用途或者适应性变化遵循本申请的一般性原理并包括本申请未公开的本领域中的公知常识或惯用技术手段。说明书和实施例仅被视为示例性的,本申请的真正范围和精神由权利要求指出。Other embodiments of the present application will be readily apparent to those skilled in the art from consideration of the specification and practice of the invention disclosed herein. This application is intended to cover any modification, use or adaptation of the application, which follow the general principles of the application and include common knowledge or conventional technical means in the field not disclosed in the application. The specification and examples are to be considered exemplary only, with a true scope and spirit of the application indicated by the appended claims.

Claims (19)

1.一种图像异常的识别方法,其特征在于,包括:1. A method for identifying abnormal images, comprising: 识别待处理图像中的异常区域;Identify abnormal regions in the image to be processed; 提取所述异常区域的频谱特征、边缘特征、统计特征;extracting spectral features, edge features, and statistical features of the abnormal region; 基于所述频谱特征、所述边缘特征、所述统计特征确定所述异常区域的异常类型。An abnormal type of the abnormal area is determined based on the frequency spectrum feature, the edge feature, and the statistical feature. 2.根据权利要求1所述的方法,其特征在于,提取所述异常区域的频谱特征,包括:2. The method according to claim 1, wherein extracting the spectral features of the abnormal region comprises: 对所述异常区域进行区域分割,得到子区域集合;Performing region segmentation on the abnormal region to obtain a set of sub-regions; 对所述异常区域和所述子区域集合进行傅里叶变换,得到频谱图像集合;Performing Fourier transform on the abnormal area and the set of sub-areas to obtain a set of spectrum images; 基于所述频谱图像集合确定所述异常区域的频谱特征。Spectral features of the abnormal region are determined based on the set of spectral images. 3.根据权利要求1所述的方法,其特征在于,提取所述异常区域的边缘特征,包括:3. The method according to claim 1, wherein extracting the edge features of the abnormal region comprises: 获取所述异常区域的深度特征;Obtaining the depth features of the abnormal region; 对所述异常区域进行边缘检测得到参考边缘特征;performing edge detection on the abnormal region to obtain reference edge features; 基于所述深度特征和所述参考边缘特征确定所述异常区域的边缘特征。Edge features of the abnormal region are determined based on the depth features and the reference edge features. 4.根据权利要求3所述的方法,其特征在于,对所述异常区域进行边缘检测得到参考边缘特征,包括:4. The method according to claim 3, wherein performing edge detection on the abnormal region to obtain reference edge features comprises: 确定所述异常区域的最大边缘幅度值和最小边缘幅度值;determining a maximum edge amplitude value and a minimum edge amplitude value for the abnormal region; 基于所述最大边缘幅度值和所述最小边缘幅度值,将所述异常区域中各边缘幅度值更新为参考边缘特征。Based on the maximum edge magnitude value and the minimum edge magnitude value, each edge magnitude value in the abnormal area is updated as a reference edge feature. 5.根据权利要求1所述的方法,其特征在于,提取所述异常区域的统计特征,包括:5. The method according to claim 1, wherein extracting the statistical features of the abnormal region comprises: 对所述异常区域中各特征点进行特征提取,得到特征点向量集合;performing feature extraction on each feature point in the abnormal region to obtain a set of feature point vectors; 对特征点向量集合进行混合高斯分布计算,得到分布函数;Perform mixed Gaussian distribution calculation on the feature point vector set to obtain the distribution function; 基于所述分布函数表示似然函数,并计算所述似然函数的权重偏导、均值偏导、方差偏导;Expressing a likelihood function based on the distribution function, and calculating weight partial derivatives, mean partial derivatives, and variance partial derivatives of the likelihood function; 将所述权重偏导、所述均值偏导、所述方差偏导融合为所述异常区域的统计特征。The weight partial derivative, the mean partial derivative, and the variance partial derivative are fused into statistical features of the abnormal region. 6.根据权利要求1所述的方法,其特征在于,基于所述频谱特征、所述边缘特征、所述统计特征确定所述异常区域的异常类型,包括:6. The method according to claim 1, wherein determining the abnormal type of the abnormal region based on the spectral features, the edge features, and the statistical features comprises: 将所述频谱特征、所述边缘特征、所述统计特征融合为目标融合特征;Fusing the spectral features, the edge features, and the statistical features into target fusion features; 基于所述目标融合特征确定所述异常区域的异常类型。The abnormal type of the abnormal region is determined based on the target fusion feature. 7.根据权利要求6所述的方法,其特征在于,基于所述目标融合特征确定所述异常区域的异常类型,包括:7. The method according to claim 6, wherein determining the abnormal type of the abnormal region based on the target fusion feature comprises: 获取对应于各待处理图像的目标特征;其中,各目标特征中包括所述目标融合特征;Acquiring target features corresponding to each image to be processed; wherein, each target feature includes the target fusion feature; 基于所述各目标特征确定所述异常区域的异常类型。The abnormal type of the abnormal area is determined based on the respective target features. 8.根据权利要求7所述的方法,其特征在于,基于所述各目标特征确定所述异常区域的异常类型,包括:8. The method according to claim 7, wherein determining the abnormal type of the abnormal region based on the characteristics of each target comprises: 根据所述各目标特征的特征均值构造特征数据矩阵;Constructing a feature data matrix according to the feature mean value of each target feature; 基于所述特征数据矩阵计算协方差矩阵,并提取所述协方差矩阵中的多个特征向量;calculating a covariance matrix based on the characteristic data matrix, and extracting a plurality of eigenvectors in the covariance matrix; 基于所述多个特征向量构造的投影矩阵和所述特征数据矩阵生成目标矩阵;generating a target matrix based on the projection matrix constructed from the plurality of eigenvectors and the feature data matrix; 根据所述目标矩阵确定所述异常区域的异常类型。An abnormality type of the abnormal area is determined according to the target matrix. 9.根据权利要求1所述的方法,其特征在于,识别待处理图像中的异常区域,包括:9. The method according to claim 1, wherein identifying the abnormal region in the image to be processed comprises: 获取样本数据集和增强数据集;Get sample dataset and augmented dataset; 基于所述样本数据集和所述增强数据集训练检测网络;training a detection network based on the sample data set and the enhanced data set; 基于训练后的检测网络识别待处理图像中的异常区域。Identify abnormal regions in the image to be processed based on the trained detection network. 10.根据权利要求9所述的方法,其特征在于,获取增强数据集,包括:10. The method according to claim 9, wherein obtaining an enhanced data set comprises: 通过对抗网络生成一类增强数据;Generating a class of augmented data via an adversarial network; 通过区域变换方式生成二类增强数据;Generate the second type of enhanced data by means of area transformation; 通过图像切片方式获取三类增强数据;Obtain three types of enhanced data through image slicing; 基于所述一类增强数据、所述二类增强数据、所述三类增强数据中至少一种确定增强数据集。An enhanced data set is determined based on at least one of the first type of enhanced data, the second type of enhanced data, and the third type of enhanced data. 11.根据权利要求10所述的方法,其特征在于,通过对抗网络生成一类增强数据,包括:11. The method according to claim 10, wherein generating a class of enhanced data through an adversarial network comprises: 通过一类指定图像集训练对抗网络;Train the adversarial network through a class of specified image sets; 通过训练后的对抗网络中的生成器生成一类增强数据。A class of augmented data is generated by a generator in a trained adversarial network. 12.根据权利要求11所述的方法,其特征在于,通过一类指定图像集训练对抗网络,包括:12. The method according to claim 11, wherein training the confrontation network through a class of designated image sets includes: 将一类指定图像集处理为对抗训练样本;Process a class of specified image sets as adversarial training samples; 触发对抗网络中的生成器生成参考训练样本;Trigger the generator in the adversarial network to generate reference training samples; 通过所述参考训练样本和所述对抗训练样本训练对抗网络中的判别器;training a discriminator in an adversarial network through the reference training samples and the adversarial training samples; 基于所述判别器的判别结果训练所述生成器。The generator is trained based on the discriminative results of the discriminator. 13.根据权利要求12所述的方法,其特征在于,将一类指定图像集处理为对抗训练样本,包括:13. The method according to claim 12, wherein processing a class of specified image sets as an adversarial training sample includes: 对一类指定图像集中各图像进行异常区域裁剪;Perform abnormal region cropping on each image in a specified image set; 若所述异常区域的尺寸大于预设尺寸,则基于所述预设尺寸将所述异常区域裁剪为多个子图,若所述异常区域的尺寸小于等于所述预设尺寸,则对所述异常区域进行尺度变换,得到异常子图;If the size of the abnormal area is larger than the preset size, then crop the abnormal area into multiple sub-pictures based on the preset size, and if the size of the abnormal area is smaller than or equal to the preset size, then Scale transformation is performed on the region to obtain an abnormal submap; 将所述多个子图和所述异常子图中至少一种,确定为对抗训练样本。At least one of the plurality of subgraphs and the abnormal subgraph is determined as an adversarial training sample. 14.根据权利要求10所述的方法,其特征在于,所述区域变换方式包括马赛克处理方式和/或随机色彩变化处理方式,通过区域变换方式生成二类增强数据,包括:14. The method according to claim 10, characterized in that, the region transformation method includes a mosaic processing method and/or a random color change processing method, and the second type of enhanced data is generated through the region transformation method, including: 对二类指定图像集中的图像进行区域选取,得到待处理区域;Perform region selection on the images in the second type of specified image set to obtain the region to be processed; 通过所述马赛克处理方式和/或所述随机色彩变化处理方式,对所述待处理区域进行区域变换,得到区域变换结果;Using the mosaic processing method and/or the random color change processing method, performing region transformation on the region to be processed to obtain a region transformation result; 将各待处理区域替换为相应的区域变换结果,得到二类增强数据。Each area to be processed is replaced by the corresponding area transformation result to obtain the second type of enhanced data. 15.根据权利要求10所述的方法,其特征在于,通过图像切片方式获取三类增强数据,包括:15. The method according to claim 10, wherein the three types of enhanced data are obtained through image slices, including: 对三类指定图像集中各图像进行异常区域尺度变换,得到待处理区域;Scale transformation of the abnormal region is performed on each image in the three specified image sets to obtain the region to be processed; 通过预设滑动窗口对所述待处理区域进行滑动切片,得到图像切片;Sliding and slicing the area to be processed through a preset sliding window to obtain image slices; 将各所述图像切片确定为三类增强数据。Each of the image slices is determined as three types of enhanced data. 16.根据权利要求1~15中任一项所述的方法,其特征在于,所述异常类型包括:色块异常、异色异常、错位异常、花屏异常、条纹异常、撕裂异常。16. The method according to any one of claims 1-15, wherein the abnormality types include: abnormal color block, abnormal color, abnormal dislocation, abnormal blurring, abnormal stripes, and abnormal tearing. 17.一种图像异常的识别装置,其特征在于,包括:17. A device for identifying abnormal images, comprising: 异常区域识别单元,用于识别待处理图像中的异常区域;An abnormal area identification unit, configured to identify an abnormal area in the image to be processed; 多维度特征提取单元,用于提取所述异常区域的频谱特征、边缘特征、统计特征;A multi-dimensional feature extraction unit for extracting spectral features, edge features, and statistical features of the abnormal region; 异常类型判定单元,用于基于所述频谱特征、所述边缘特征、所述统计特征确定所述异常区域的异常类型。An abnormality type determining unit, configured to determine the abnormality type of the abnormal region based on the frequency spectrum feature, the edge feature, and the statistical feature. 18.一种计算机可读存储介质,其上存储有计算机程序,其特征在于,所述计算机程序被处理器执行时实现权利要求1-16任一项所述的方法。18. A computer-readable storage medium, on which a computer program is stored, wherein the computer program implements the method according to any one of claims 1-16 when executed by a processor. 19.一种电子设备,其特征在于,包括:19. An electronic device, comprising: 处理器;以及processor; and 存储器,用于存储所述处理器的可执行指令;a memory for storing executable instructions of the processor; 其中,所述处理器配置为经由执行所述可执行指令来执行权利要求1-16任一项所述的方法。Wherein, the processor is configured to execute the method according to any one of claims 1-16 by executing the executable instructions.
CN202310293306.XA 2023-03-23 2023-03-23 Image anomaly identification method, device, computer readable storage medium and equipment Pending CN116310568A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202310293306.XA CN116310568A (en) 2023-03-23 2023-03-23 Image anomaly identification method, device, computer readable storage medium and equipment

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202310293306.XA CN116310568A (en) 2023-03-23 2023-03-23 Image anomaly identification method, device, computer readable storage medium and equipment

Publications (1)

Publication Number Publication Date
CN116310568A true CN116310568A (en) 2023-06-23

Family

ID=86816538

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202310293306.XA Pending CN116310568A (en) 2023-03-23 2023-03-23 Image anomaly identification method, device, computer readable storage medium and equipment

Country Status (1)

Country Link
CN (1) CN116310568A (en)

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN116766191A (en) * 2023-06-28 2023-09-19 北京极智嘉科技股份有限公司 Robot motion control method, device, computing device and storage medium
CN117173172A (en) * 2023-11-02 2023-12-05 深圳市富邦新材科技有限公司 Machine vision-based silica gel molding effect detection method and system
CN117542083A (en) * 2023-12-01 2024-02-09 中南大学湘雅医院 Bone image recognition method and system based on ultrasonic waves

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN116766191A (en) * 2023-06-28 2023-09-19 北京极智嘉科技股份有限公司 Robot motion control method, device, computing device and storage medium
CN117173172A (en) * 2023-11-02 2023-12-05 深圳市富邦新材科技有限公司 Machine vision-based silica gel molding effect detection method and system
CN117173172B (en) * 2023-11-02 2024-01-26 深圳市富邦新材科技有限公司 Machine vision-based silica gel molding effect detection method and system
CN117542083A (en) * 2023-12-01 2024-02-09 中南大学湘雅医院 Bone image recognition method and system based on ultrasonic waves

Similar Documents

Publication Publication Date Title
JP7490141B2 (en) IMAGE DETECTION METHOD, MODEL TRAINING METHOD, IMAGE DETECTION APPARATUS, TRAINING APPARATUS, DEVICE, AND PROGRAM
EP3916627A1 (en) Living body detection method based on facial recognition, and electronic device and storage medium
US8692830B2 (en) Automatic avatar creation
CN116310568A (en) Image anomaly identification method, device, computer readable storage medium and equipment
EP2905722B1 (en) Method and apparatus for detecting salient region of image
CN103514432B (en) Face feature extraction method, device and computer program product
CN102360421B (en) Face identification method and system based on video streaming
CA3100642A1 (en) Multi-sample whole slide image processing in digital pathology via multi-resolution registration and machine learning
CN110222787A (en) Multiscale target detection method, device, computer equipment and storage medium
JP7241598B2 (en) Image processing method, image processing apparatus and image processing system
US11816946B2 (en) Image based novelty detection of material samples
JP2005284348A (en) Information processor and information processing method, recording medium, and program
WO2019071976A1 (en) Panoramic image saliency detection method based on regional growth and eye movement model
WO2022152009A1 (en) Target detection method and apparatus, and device and storage medium
JP2020160543A (en) Information processing system and information processing method
CN113870196A (en) Image processing method, device, equipment and medium based on anchor point cutting graph
CN111598144A (en) Training method and device of image recognition model
CN117975577A (en) A deep fake detection method and system based on facial dynamic integration
CN119206349A (en) A real-time detection method for laparoscopic instruments
Chen et al. Visual saliency detection: from space to frequency
CN111723612A (en) Face recognition and face recognition network training method and device, and storage medium
CN116959125A (en) Data processing method and related device
CN113158838B (en) Face Representation Attack Detection Method Based on Full-Size Depth Map Supervision
CN112329606B (en) Living body detection method, living body detection device, electronic equipment and readable storage medium
USRE49044E1 (en) Automatic avatar creation

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