[go: up one dir, main page]

CN111914920A - Sparse coding-based similarity image retrieval method and system - Google Patents

Sparse coding-based similarity image retrieval method and system Download PDF

Info

Publication number
CN111914920A
CN111914920A CN202010724862.4A CN202010724862A CN111914920A CN 111914920 A CN111914920 A CN 111914920A CN 202010724862 A CN202010724862 A CN 202010724862A CN 111914920 A CN111914920 A CN 111914920A
Authority
CN
China
Prior art keywords
image
sparse
similarity
characterization
result
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
CN202010724862.4A
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.)
Shandong Technology and Business University
Original Assignee
Shandong Technology and Business University
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 Shandong Technology and Business University filed Critical Shandong Technology and Business University
Priority to CN202010724862.4A priority Critical patent/CN111914920A/en
Publication of CN111914920A publication Critical patent/CN111914920A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F18/00Pattern recognition
    • G06F18/20Analysing
    • G06F18/22Matching criteria, e.g. proximity measures
    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F18/00Pattern recognition
    • G06F18/20Analysing
    • G06F18/21Design or setup of recognition systems or techniques; Extraction of features in feature space; Blind source separation
    • G06F18/214Generating training patterns; Bootstrap methods, e.g. bagging or boosting
    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06VIMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
    • G06V10/00Arrangements for image or video recognition or understanding
    • G06V10/40Extraction of image or video features
    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06VIMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
    • G06V10/00Arrangements for image or video recognition or understanding
    • G06V10/40Extraction of image or video features
    • G06V10/46Descriptors for shape, contour or point-related descriptors, e.g. scale invariant feature transform [SIFT] or bags of words [BoW]; Salient regional features
    • G06V10/462Salient features, e.g. scale invariant feature transforms [SIFT]
    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06VIMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
    • G06V10/00Arrangements for image or video recognition or understanding
    • G06V10/40Extraction of image or video features
    • G06V10/513Sparse representations

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Data Mining & Analysis (AREA)
  • General Physics & Mathematics (AREA)
  • Physics & Mathematics (AREA)
  • Computer Vision & Pattern Recognition (AREA)
  • Bioinformatics & Cheminformatics (AREA)
  • Evolutionary Biology (AREA)
  • Evolutionary Computation (AREA)
  • Bioinformatics & Computational Biology (AREA)
  • General Engineering & Computer Science (AREA)
  • Artificial Intelligence (AREA)
  • Life Sciences & Earth Sciences (AREA)
  • Multimedia (AREA)
  • Image Analysis (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

Abstract

本发明提出了一种基于稀疏编码的相似性图像检索方法及系统,涉及图像识别领域。一种基于稀疏编码的相似性图像检索方法,包括如下步骤:根据基准图像进行基向量表征获取第一稀疏表征结果;根据图像库中的图像进行基向量表征得到第二稀疏表征结果;计算第一稀疏表征结果与第二稀疏表征结果的相似度;判断相似度是否大于预设阈值,若是,则判定为是相似性图像,若不是,则判定为非相似性图像。其能够更加充分地提取图像特征信息,在相似度计算的过程中更加精准、有针对性。此外本发明还提出了一种基于稀疏编码的相似性图像检索系统,包括:第一获取模块、第二获取模块、计算模块以及判断模块。

Figure 202010724862

The invention proposes a method and system for retrieving similarity images based on sparse coding, and relates to the field of image recognition. A similarity image retrieval method based on sparse coding, comprising the steps of: performing basis vector characterization according to a reference image to obtain a first sparse characterization result; performing basis vector characterization according to an image in an image library to obtain a second sparse characterization result; calculating a first sparse representation result The similarity between the sparse representation result and the second sparse representation result; determine whether the similarity is greater than a preset threshold, if so, it is determined to be a similarity image, and if not, it is determined to be a non-similar image. It can more fully extract image feature information, and is more accurate and targeted in the process of similarity calculation. In addition, the present invention also provides a similarity image retrieval system based on sparse coding, which includes: a first acquisition module, a second acquisition module, a calculation module and a judgment module.

Figure 202010724862

Description

一种基于稀疏编码的相似性图像检索方法及系统A method and system for similarity image retrieval based on sparse coding

技术领域technical field

本发明涉及图像识别领域,具体而言,涉及一种基于稀疏编码的相似性图像检索方法及系统。The present invention relates to the field of image recognition, in particular, to a method and system for retrieving similarity images based on sparse coding.

背景技术Background technique

随着数字媒体时代的来临,海量的数字图像已经成为了我们生活中不可或缺的部分,在生命科学、教育、文化等多个领域也有非常广泛的应用。很多经典的机器学习方法,尤其深度学习方法能够从海量的图像库中检索出目标图像。如何利用单幅图像从海量的图像库中检索出语义相似的图像有非常好的实际应用价值。With the advent of the era of digital media, massive digital images have become an indispensable part of our lives, and are also widely used in life sciences, education, culture and other fields. Many classic machine learning methods, especially deep learning methods, can retrieve target images from massive image libraries. How to use a single image to retrieve semantically similar images from a massive image library has very good practical application value.

然而,传统的机器学习方法不能非常有效地应用于单幅相似图像的检索。当今主流的方法存在以下问题:However, traditional machine learning methods cannot be applied very efficiently to the retrieval of single similar images. The current mainstream approach suffers from the following problems:

1.特征提取方法并不非常有效,高度依赖于训练样本;1. Feature extraction methods are not very effective and are highly dependent on training samples;

2.相似度计算的过程中没有一个有针对性的衡量标准。2. There is no targeted measurement standard in the process of similarity calculation.

发明内容SUMMARY OF THE INVENTION

本发明的目的在于提供一种基于稀疏编码的相似性图像检索方法,其能够更加充分地提取图像特征信息,在相似度计算的过程中更加精准、有针对性。The purpose of the present invention is to provide a similarity image retrieval method based on sparse coding, which can more fully extract image feature information, and is more accurate and targeted in the process of similarity calculation.

本发明的另一目的在于提供一种基于稀疏编码的相似性图像检索系统,其能够运行一种基于稀疏编码的相似性图像检索方法。Another object of the present invention is to provide a similarity image retrieval system based on sparse coding, which can run a similarity image retrieval method based on sparse coding.

本发明的实施例是这样实现的:Embodiments of the present invention are implemented as follows:

第一方面,本申请实施例提供一种基于稀疏编码的相似性图像检索方法,其包括如下步骤根据基准图像进行基向量表征获取第一稀疏表征结果,根据图像库中的图像进行基向量表征得到第二稀疏表征结果,计算第一稀疏表征结果与第二稀疏表征结果的相似度,判断相似度是否大于预设阈值,若是,则判定为是相似性图像,若不是,则判定为非相似性图像。In a first aspect, an embodiment of the present application provides a method for retrieving similarity images based on sparse coding, which includes the following steps to obtain a first sparse characterization result by performing basis vector characterization according to a reference image, and obtaining a first sparse characterization result by performing basis vector characterization according to images in an image library. For the second sparse representation result, calculate the similarity between the first sparse representation result and the second sparse representation result, and determine whether the similarity is greater than a preset threshold. image.

在本发明的一些实施例中,上述根据基准图像进行基向量表征获取第一稀疏表征结果之前还包括利用图像库中的代表性图像对基向量进行训练。In some embodiments of the present invention, before obtaining the first sparse representation result by performing the basis vector characterization according to the reference image, the method further includes using representative images in the image library to train the basis vectors.

在本发明的一些实施例中,上述利用图像库中的代表性图像对基向量进行训练包括固定字典中的基向量,调整编码系数,使得目标函数最小。In some embodiments of the present invention, the above-mentioned training of the basis vectors using the representative images in the image library includes fixing the basis vectors in the dictionary, and adjusting the coding coefficients so that the objective function is minimized.

在本发明的一些实施例中,上述利用图像库中的代表性图像对基向量进行训练包括固定编码系数,调整字典中的基向量,使得目标函数最小。In some embodiments of the present invention, the above-mentioned training of the basis vectors using the representative images in the image library includes fixing coding coefficients, and adjusting the basis vectors in the dictionary so that the objective function is minimized.

在本发明的一些实施例中,上述利用图像库中的代表性图像对基向量进行训练包括通过不断迭代直至收敛,得到良好表达样本图像的一组基向量。In some embodiments of the present invention, the above-mentioned training of the basis vectors using the representative images in the image library includes obtaining a set of basis vectors that well express the sample images through continuous iteration until convergence.

在本发明的一些实施例中,上述根据基准图像进行基向量表征获取第一稀疏表征结果之前还包括根据交叉互验对基向量进行优化。In some embodiments of the present invention, before obtaining the first sparse representation result by performing the basis vector characterization according to the reference image, the method further includes optimizing the basis vectors according to cross-examination.

在本发明的一些实施例中,上述根据基准图像进行基向量表征获取第一稀疏表征结果之前还包括对表征不精准的图像进行优化表征。In some embodiments of the present invention, before obtaining the first sparse characterization result by performing the basis vector characterization according to the reference image, the method further includes optimizing the characterization of the image with inaccurate characterization.

在本发明的一些实施例中,上述根据基准图像进行基向量表征获取第一稀疏表征结果之前还包括对图像进行显著性检测。In some embodiments of the present invention, before obtaining the first sparse characterization result by performing the basis vector characterization according to the reference image, the method further includes performing saliency detection on the image.

第二方面,本申请实施例提供一种基于稀疏编码的相似性图像检索系统,其包括第一获取模块,用于根据基准图像进行基向量表征获取第一稀疏表征结果,第二获取模块,用于根据图像库中的图像进行基向量表征得到第二稀疏表征结果,计算模块,用于计算第一稀疏表征结果与第二稀疏表征结果的相似度,判断模块,用于判断相似度是否大于预设阈值,若是,则判定为是相似性图像,若不是,则判定为非相似性图像。In a second aspect, an embodiment of the present application provides a similarity image retrieval system based on sparse coding, which includes a first acquisition module for performing basis vector characterization according to a reference image to obtain a first sparse representation result, and a second acquisition module for using The second sparse representation result is obtained by performing the basis vector representation according to the images in the image library, the calculation module is used to calculate the similarity between the first sparse representation result and the second sparse representation result, and the judgment module is used to determine whether the similarity is greater than the pre-determined similarity. A threshold is set, if yes, it is determined to be a similar image, if not, it is determined to be a non-similar image.

在本发明的一些实施例中,上述还包括用于存储计算机指令的至少一个存储器,与存储器通讯的至少一个处理器,其中当至少一个处理器执行计算机指令时,至少一个处理器使系统执行:第一获取模块、第二获取模块、计算模块以及判断模块。In some embodiments of the invention, the above also includes at least one memory for storing computer instructions, and at least one processor in communication with the memory, wherein when the at least one processor executes the computer instructions, the at least one processor causes the system to perform: A first acquisition module, a second acquisition module, a calculation module and a judgment module.

相对于现有技术,本发明的实施例至少具有如下优点或有益效果:Compared with the prior art, the embodiments of the present invention have at least the following advantages or beneficial effects:

其能够更加充分地提取图像特征信息,在相似度计算的过程中更加精准、有针对性,通过发掘不同但相关领域间不变的特征和结构并充分利用已有资源,构建稀疏特征迁移模型,将其他相关任务中的知识迁移至标记样本稀少的目标任务,帮助提升目标任务的学习效率。迁移稀疏编码图像检索技术将稀疏编码与迁移学习技术相结合,是实现稀疏特征在不同领域间进行重复利用的新技术。It can more fully extract image feature information, and is more accurate and targeted in the process of similarity calculation. By exploring different but invariant features and structures between related fields and making full use of existing resources, a sparse feature transfer model is constructed. Transfer knowledge from other related tasks to target tasks with few labeled samples to help improve the learning efficiency of target tasks. Transfer sparse coding image retrieval technology combines sparse coding and transfer learning technology, which is a new technology to realize the reuse of sparse features in different fields.

附图说明Description of drawings

为了更清楚地说明本发明实施例的技术方案,下面将对实施例中所需要使用的附图作简单地介绍,应当理解,以下附图仅示出了本发明的某些实施例,因此不应被看作是对范围的限定,对于本领域普通技术人员来讲,在不付出创造性劳动的前提下,还可以根据这些附图获得其他相关的附图。In order to illustrate the technical solutions of the embodiments of the present invention more clearly, the following briefly introduces the accompanying drawings used in the embodiments. It should be understood that the following drawings only show some embodiments of the present invention, and therefore do not It should be regarded as a limitation of the scope, and for those of ordinary skill in the art, other related drawings can also be obtained according to these drawings without any creative effort.

图1为本发明实施例提供的一种基于稀疏编码的相似性图像检索方法步骤示意图;1 is a schematic diagram of steps of a method for retrieving similarity images based on sparse coding provided by an embodiment of the present invention;

图2为本发明实施例提供的一种基于稀疏编码的相似性图像检索方法详细步骤示意图;2 is a schematic diagram of detailed steps of a method for retrieving similarity images based on sparse coding provided by an embodiment of the present invention;

图3为本发明实施例提供的一种基于稀疏编码的相似性图像检索系统模块示意图。FIG. 3 is a schematic diagram of modules of a similarity image retrieval system based on sparse coding according to an embodiment of the present invention.

具体实施方式Detailed ways

为使本申请实施例的目的、技术方案和优点更加清楚,下面将结合本申请实施例中的附图,对本申请实施例中的技术方案进行清楚、完整地描述,显然,所描述的实施例是本申请一部分实施例,而不是全部的实施例。通常在此处附图中描述和示出的本申请实施例的组件可以以各种不同的配置来布置和设计。In order to make the purposes, technical solutions and advantages of the embodiments of the present application clearer, the technical solutions in the embodiments of the present application will be described clearly and completely below with reference to the drawings in the embodiments of the present application. Obviously, the described embodiments It is a part of the embodiments of the present application, but not all of the embodiments. The components of the embodiments of the present application generally described and illustrated in the drawings herein may be arranged and designed in a variety of different configurations.

因此,以下对在附图中提供的本申请的实施例的详细描述并非旨在限制要求保护的本申请的范围,而是仅仅表示本申请的选定实施例。基于本申请中的实施例,本领域普通技术人员在没有作出创造性劳动前提下所获得的所有其他实施例,都属于本申请保护的范围。Thus, the following detailed description of the embodiments of the application provided in the accompanying drawings is not intended to limit the scope of the application as claimed, but is merely representative of selected embodiments of the application. Based on the embodiments in the present application, all other embodiments obtained by those of ordinary skill in the art without creative work fall within the protection scope of the present application.

下面结合附图,对本申请的一些实施方式作详细说明。在不冲突的情况下,下述的各个实施例及实施例中的各个特征可以相互组合。Some embodiments of the present application will be described in detail below with reference to the accompanying drawings. The various embodiments described below and various features of the embodiments may be combined with each other without conflict.

实施例1Example 1

请参阅图1,图1为本发明实施例提供的一种基于稀疏编码的相似性图像检索方法步骤示意图,其包括如下步骤:Please refer to FIG. 1. FIG. 1 is a schematic diagram of steps of a sparse coding-based similarity image retrieval method provided by an embodiment of the present invention, which includes the following steps:

步骤S100,根据基准图像进行基向量表征获取第一稀疏表征结果;Step S100, performing basis vector characterization according to the reference image to obtain a first sparse characterization result;

具体的,基准图像为选定的待检索图像,基向量是向量空间里最基本的组成部分,因为基向量必定线性无关,由这部分可以表示该向量空间的每一个向量,将图像降维,得到第一稀疏表征结果。Specifically, the reference image is the selected image to be retrieved, and the basis vector is the most basic component in the vector space, because the basis vector must be linearly independent, this part can represent each vector in the vector space, and reduce the image dimension, Obtain the first sparse representation result.

在一些实施方式中,电子设备在各种场景下进行拍摄,例如夜景或者逆光环境等。在相同拍摄场景下,电子设备可以拍摄多帧图像,并对该多帧图像进行图像配准。在图像配准之后,电子设备可以对该多帧图像进行融合处理。然而,相关技术中,电子设备融合得到的图像的成像质量较差。比如,电子设备可以先获取多帧待处理图像。之后,电子设备可以从该多帧待处理图像中确定出一帧基准图像。例如,电子设备可以将清晰度最高的待处理图像确定为基准图像。那么,该多帧待处理图像中除基准图像之外的图像则为非基准图像。In some embodiments, the electronic device shoots in various scenarios, such as night scenes or backlit environments. Under the same shooting scene, the electronic device can shoot multiple frames of images, and perform image registration on the multiple frames of images. After image registration, the electronic device may perform fusion processing on the multiple frames of images. However, in the related art, the image quality of the image obtained by the fusion of the electronic device is poor. For example, the electronic device may first acquire multiple frames of images to be processed. Afterwards, the electronic device may determine a frame of reference image from the multiple frames of images to be processed. For example, the electronic device may determine the image to be processed with the highest definition as the reference image. Then, the images other than the reference image in the multi-frame to-be-processed images are non-reference images.

步骤S110,根据图像库中的图像进行基向量表征得到第二稀疏表征结果;Step S110, performing basis vector characterization according to the images in the image library to obtain a second sparse characterization result;

具体的,对图像库中每一张图像都进行基向量表征,从而得到第二稀疏表征结果。Specifically, the basis vector representation is performed on each image in the image library, so as to obtain the second sparse representation result.

在一些实施方式中,图像库中可以有A、B、C、D,4涨图像,分别对A、B、C、D,4张图像进行基向量表征,通过对图像降维,可以得到图像A的第二稀疏表征结果、图像B的第三稀疏表征结果、图像C的第四稀疏表征结果、图像D的第五稀疏表征结果。In some embodiments, there may be A, B, C, D, and 4 images in the image library, and the A, B, C, D, and 4 images are represented by basis vectors, and the image can be obtained by reducing the dimensionality of the images. The second sparse characterization result of A, the third sparse characterization result of image B, the fourth sparse characterization result of image C, and the fifth sparse characterization result of image D.

步骤S120,计算第一稀疏表征结果与第二稀疏表征结果的相似度;Step S120, calculating the similarity between the first sparse representation result and the second sparse representation result;

具体的,利用多权重的欧式距离计算计算第一稀疏表征结果与第二稀疏表征结果之间的相似度。Specifically, the multi-weight Euclidean distance calculation is used to calculate the similarity between the first sparse representation result and the second sparse representation result.

在一些实施方式中,可以采用多权重的欧式距离进行计算,欧氏距离是一种相似性度量方法,可求两个向量间的距离,取值范围为0至正无穷,如果两个向量间的距离较小,那么向量也肯定更为相似。由于图像中不同区域的重要程度不同,所以普通的欧式距离不能够精准地计算不同图像的相似度。除了对数据进行处理以外,还可以使用加权欧氏距离,根据区域显著性不同使用不同的权重,从而通过多权重的欧式距离计算计算第一稀疏表征结果与第二稀疏表征结果之间的相似度,也可以分别计算第一稀疏表征结果与其余一个或多个稀疏表征结果之间的相似度,例如通过多权重的欧式距离计算计算第一稀疏表征结果与第三稀疏表征结果之间的相似度,还可以通过多权重的欧式距离计算计算第一稀疏表征结果与第四稀疏表征结果之间的相似度,还可以通过多权重的欧式距离计算计算第一稀疏表征结果与第五稀疏表征结果之间的相似度。In some embodiments, multi-weight Euclidean distance can be used for calculation. Euclidean distance is a similarity measurement method. The distance between two vectors can be calculated. The value ranges from 0 to positive infinity. If the distance between two vectors is The smaller the distance, the more similar the vectors must be. Because the importance of different regions in the image is different, the ordinary Euclidean distance cannot accurately calculate the similarity of different images. In addition to data processing, weighted Euclidean distance can also be used, and different weights can be used according to different regional saliency, so as to calculate the similarity between the first sparse representation result and the second sparse representation result through multi-weight Euclidean distance calculation , the similarity between the first sparse representation result and the other one or more sparse representation results can also be calculated separately, for example, the similarity between the first sparse representation result and the third sparse representation result can be calculated by multi-weight Euclidean distance calculation , the similarity between the first sparse representation result and the fourth sparse representation result can also be calculated by multi-weight Euclidean distance calculation, and the difference between the first sparse representation result and the fifth sparse representation result can also be calculated by multi-weight Euclidean distance calculation similarity between.

步骤S130,判断相似度是否大于预设阈值;Step S130, judging whether the similarity is greater than a preset threshold;

具体的,判断相似度是否大于预设阈值,若相似度大于预设阈值,则进入步骤S140,若相似度小于等于预设阈值,则进入步骤S150。Specifically, it is determined whether the similarity is greater than the preset threshold, and if the similarity is greater than the preset threshold, the process proceeds to step S140, and if the similarity is less than or equal to the preset threshold, the process proceeds to step S150.

在一些实施方式中,预设阈值可以是根据图片不同而进行变化的,例如,假定一张图片共有n个像素,其中灰度值小于阈值的像素为n1个,大于等于阈值的像素为n2个(n1+n2=n)。w1和w2表示这两种像素各自的比重,而所有灰度值小于阈值的像素的平均值和方差分别为μ1和σ1,所有灰度值大于等于阈值的像素的平均值和方差分别为μ2和σ2,对图像求直方图,用一系列从小到大的阀值去取一下,分别代入BBS的算式。使得“类内差异最小”或“类间差异最大”的那个值,就是最终的阈值,例如,可以是0.4、0.5、0.6等。In some embodiments, the preset threshold may be changed according to different pictures. For example, it is assumed that a picture has a total of n pixels, wherein the number of pixels whose gray value is less than the threshold value is n1, and the number of pixels whose gray value is greater than or equal to the threshold value is n2 (n1+n2=n). w1 and w2 represent the respective proportions of these two types of pixels, and the average and variance of all pixels with gray values less than the threshold are μ1 and σ1, respectively, and the average and variance of all pixels with gray values greater than or equal to the threshold are μ2 and σ2, find the histogram of the image, use a series of thresholds from small to large to take them, and substitute them into the BBS formula. The value that makes "the smallest difference between classes" or "the largest difference between classes" is the final threshold, for example, it can be 0.4, 0.5, 0.6 and so on.

步骤S140,判定为是相似性图像;Step S140, it is determined that it is a similarity image;

具体的,将检索出的图片判定为相似图像。Specifically, the retrieved pictures are determined as similar images.

在一些实施方式中,第一稀疏表征结果与第四稀疏表征结果之间的相似度最高,所以判定基准图像与图像库中的C图像为相似性图像。In some embodiments, the similarity between the first sparse representation result and the fourth sparse representation result is the highest, so it is determined that the reference image and the C image in the image library are similar images.

步骤S150,判定为非相似性图像。Step S150, it is determined to be a dissimilar image.

实施例2Example 2

请参阅图2,图2为本发明实施例提供的一种基于稀疏编码的相似性图像检索方法详细步骤示意图,其包括如下步骤:Please refer to FIG. 2. FIG. 2 is a schematic diagram of detailed steps of a sparse coding-based similarity image retrieval method provided by an embodiment of the present invention, which includes the following steps:

步骤S200,固定字典中的基向量,调整编码系数,使得目标函数最小;Step S200, fixing the basis vector in the dictionary, and adjusting the coding coefficients so that the objective function is the smallest;

具体的,通过对字典中的基向量不变,编码系数进行改动,使目标函数最小,从而完成字典训练。Specifically, by keeping the base vector in the dictionary unchanged and changing the coding coefficients, the objective function is minimized, thereby completing the dictionary training.

步骤S210,固定编码系数,调整字典中的基向量,使得目标函数最小;Step S210, fixing the coding coefficients, and adjusting the basis vectors in the dictionary so that the objective function is the smallest;

具体的,通过对编码系数保持不变,字典中的基向量进行改动,使目标函数最小,从而完成字典训练。Specifically, by keeping the coding coefficient unchanged, the basis vector in the dictionary is changed to minimize the objective function, thereby completing the dictionary training.

步骤S220,通过不断迭代直至收敛,得到良好表达样本图像的一组基向量;Step S220, through continuous iteration until convergence, obtain a set of basis vectors that well express the sample image;

具体的,通过多次迭代直至模型收敛,从而可以获得一个良好表达样本图像的一组基向量。Specifically, through multiple iterations until the model converges, a set of basis vectors that well express the sample image can be obtained.

步骤S230,根据交叉互验对基向量进行优化;Step S230, optimize the basis vector according to the cross-check;

在一些实施方式中,利用基于不同图像库的多组实验得到多组基向量,我们仅保留和其它组基向量相似性最高的那一组核心基向量。In some embodiments, multiple sets of basis vectors are obtained by using multiple sets of experiments based on different image libraries, and we only retain the set of core basis vectors with the highest similarity with other sets of basis vectors.

步骤S240,对表征不精准的图像进行优化表征;Step S240, performing optimized characterization on the images with inaccurate characterization;

在一些实施方式中,对表征不精确的图像进行保真约束优化表征。每个图像块减去均值,字典表示图像的纹理,重建阶段将低分辨的均值直接作为高分辨图像的均值,在编码重建之后,利用梯度下降法继续优化。In some embodiments, the fidelity-constrained optimized characterization is performed on the imprecisely characterized images. The mean value is subtracted from each image block, and the dictionary represents the texture of the image. In the reconstruction stage, the mean value of the low-resolution image is directly used as the mean value of the high-resolution image. After the encoding reconstruction, the gradient descent method is used to continue the optimization.

步骤S250,对图像进行显著性检测;Step S250, performing saliency detection on the image;

在一些实施方式中,大脑获得图像后,可以迅速思考,找到其中的感兴趣的部分,并忽略其他的部分,这种机制使得人能够迅速对所看到的场景作出反应。随着计算机技术的发展,采用计算机对图像进行识别和处理成为一个重要的发展趋势。显著性检测的本质是特征提取。In some embodiments, the brain can think quickly after acquiring an image, find parts of interest and ignore others, a mechanism that enables a person to quickly react to what they see. With the development of computer technology, the use of computer to identify and process images has become an important development trend. The essence of saliency detection is feature extraction.

例如,对于300*400的输入图像,可以达到30FPS。在一些局部模块上进行了改变,一个方面是提出了global guidance module(GGM),这个模块目标时给不同scale的feature提供一些显著性物体的位置信息,另外还提出了feature aggregation module(FAM),用来对不同尺度的feature map进行融合。两个模块放在一起,可以让网络获得不同的感受野,从而提高对显著性物体检测性能。除此之外,添加了一个边缘检测分支,进行同步训练,这个边缘检测的分支也能够对提升显著性目标的检测性能。For example, for a 300*400 input image, 30FPS can be achieved. Some local modules have been changed. In one aspect, the global guidance module (GGM) is proposed, which provides the position information of some salient objects to the features of different scales, and the feature aggregation module (FAM) is also proposed. It is used to fuse feature maps of different scales. Putting the two modules together allows the network to obtain different receptive fields, thereby improving the detection performance of salient objects. In addition, an edge detection branch is added for synchronous training. This edge detection branch can also improve the detection performance of saliency targets.

步骤S260,根据基准图像进行基向量表征获取第一稀疏表征结果;Step S260, performing basis vector characterization according to the reference image to obtain a first sparse characterization result;

具体的,基准图像为选定的待检索图像,基向量是向量空间里最基本的组成部分,因为基向量必定线性无关,由这部分可以表示该向量空间的每一个向量,将图像降维,得到第一稀疏表征结果。可参照步骤S100的相关描述,这里不再赘述。Specifically, the reference image is the selected image to be retrieved, and the basis vector is the most basic component in the vector space, because the basis vector must be linearly independent, this part can represent each vector in the vector space, and reduce the image dimension, Obtain the first sparse representation result. Reference may be made to the relevant description of step S100, which will not be repeated here.

步骤S270,根据图像库中的图像进行基向量表征得到第二稀疏表征结果;Step S270, performing basis vector characterization according to the images in the image library to obtain a second sparse characterization result;

具体的,对图像库中每一张图像都进行基向量表征,从而得到第二稀疏表征结果。可参照步骤S110的相关描述,这里不再赘述。Specifically, the basis vector representation is performed on each image in the image library, so as to obtain the second sparse representation result. Reference may be made to the relevant description of step S110, which will not be repeated here.

步骤S280,计算第一稀疏表征结果与第二稀疏表征结果的相似度;Step S280, calculating the similarity between the first sparse representation result and the second sparse representation result;

具体的,利用多权重的欧式距离计算计算第一稀疏表征结果与第二稀疏表征结果之间的相似度。可参照步骤S120的相关描述,这里不再赘述。Specifically, the multi-weight Euclidean distance calculation is used to calculate the similarity between the first sparse representation result and the second sparse representation result. Reference may be made to the relevant description of step S120, which will not be repeated here.

步骤S290,判断相似度是否大于预设阈值;Step S290, judging whether the similarity is greater than a preset threshold;

具体的,判断相似度是否大于预设阈值,若相似度大于预设阈值,则进入步骤S3000,若相似度小于等于预设阈值,则进入步骤S310。Specifically, it is determined whether the similarity is greater than the preset threshold, and if the similarity is greater than the preset threshold, the process goes to step S3000, and if the similarity is less than or equal to the preset threshold, the process goes to step S310.

步骤S300,则判定为是相似性图像;Step S300, it is determined that it is a similarity image;

具体的,将检索出的图片判定为相似图像。Specifically, the retrieved pictures are determined as similar images.

在一些实施方式中,第一稀疏表征结果与第三稀疏表征结果之间的相似度最高,所以判定基准图像与图像库中的B图像为相似性图像。In some embodiments, the similarity between the first sparse representation result and the third sparse representation result is the highest, so it is determined that the reference image and the B image in the image library are similar images.

步骤S310,若不是,则判定为非相似性图像。Step S310, if not, it is determined as a dissimilar image.

实施例3Example 3

请参阅图3,图3为本发明实施例提供的一种基于稀疏编码的相似性图像检索系统模块示意图。一种基于稀疏编码的相似性图像检索系统,其包括第一获取模块,用于根据基准图像进行基向量表征获取第一稀疏表征结果,第二获取模块,用于根据图像库中的图像进行基向量表征得到第二稀疏表征结果,计算模块,用于计算第一稀疏表征结果与第二稀疏表征结果的相似度,判断模块,用于判断相似度是否大于预设阈值,若是,则判定为是相似性图像,若不是,则判定为非相似性图像。Please refer to FIG. 3 . FIG. 3 is a schematic diagram of modules of a similarity image retrieval system based on sparse coding according to an embodiment of the present invention. A similarity image retrieval system based on sparse coding, which includes a first acquisition module for performing basis vector characterization according to a reference image to acquire a first sparse representation result, and a second acquisition module for performing basis vector characterization according to images in an image library. The vector representation obtains the second sparse representation result, the calculation module is used to calculate the similarity between the first sparse representation result and the second sparse representation result, the judgment module is used to determine whether the similarity is greater than the preset threshold, and if so, it is determined as yes Similar images, if not, it is determined as a non-similar image.

还包括存储器、处理器和通信接口,该存储器、处理器和通信接口相互之间直接或间接地电性连接,以实现数据的传输或交互。例如,这些元件相互之间可通过一条或多条通讯总线或信号线实现电性连接。存储器可用于存储软件程序及模块,处理器通过执行存储在存储器内的软件程序及模块,从而执行各种功能应用以及数据处理。该通信接口可用于与其他节点设备进行信令或数据的通信。It also includes a memory, a processor and a communication interface, the memory, the processor and the communication interface are electrically connected to each other directly or indirectly to realize the transmission or interaction of data. For example, these elements may be electrically connected to each other through one or more communication buses or signal lines. The memory can be used to store software programs and modules, and the processor executes various functional applications and data processing by executing the software programs and modules stored in the memory. The communication interface can be used for signaling or data communication with other node devices.

其中,存储器可以是但不限于,随机存取存储器(Random Access Memory,RAM),只读存储器(Read Only Memory,ROM),可编程只读存储器(Programmable Read-OnlyMemory,PROM),可擦除只读存储器(Erasable Programmable Read-Only Memory,EPROM),电可擦除只读存储器(Electric Erasable Programmable Read-Only Memory,EEPROM)等。Wherein, the memory may be, but not limited to, random access memory (Random Access Memory, RAM), read only memory (Read Only Memory, ROM), programmable read only memory (Programmable Read-Only Memory, PROM), erasable only memory Read memory (Erasable Programmable Read-Only Memory, EPROM), Electric Erasable Programmable Read-Only Memory (Electric Erasable Programmable Read-Only Memory, EEPROM), etc.

处理器可以是一种集成电路芯片,具有信号处理能力。该处理器102可以是通用处理器,包括中央处理器(Central Processing Unit,CPU)、网络处理器(NetworkProcessor,NP)等;还可以是数字信号处理器(Digital Signal Processing,DSP)、专用集成电路(Application Specific Integrated Circuit,ASIC)、现场可编程门阵列(Field-Programmable Gate Array,FPGA)或者其他可编程逻辑器件、分立门或者晶体管逻辑器件、分立硬件组件。The processor may be an integrated circuit chip with signal processing capabilities. The processor 102 may be a general-purpose processor, including a central processing unit (Central Processing Unit, CPU), a network processor (Network Processor, NP), etc.; it may also be a digital signal processor (Digital Signal Processing, DSP), an application-specific integrated circuit (Application Specific Integrated Circuit, ASIC), Field-Programmable Gate Array (Field-Programmable Gate Array, FPGA) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components.

在本申请所提供的实施例中,应该理解到,所揭露的装置和方法,也可以通过其它的方式实现。以上所描述的装置实施例仅仅是示意性的,例如,附图中的流程图和框图显示了根据本申请的多个实施例的装置、方法和计算机程序产品的可能实现的体系架构、功能和操作。在这点上,流程图或框图中的每个方框可以代表一个模块、程序段或代码的一部分,所述模块、程序段或代码的一部分包含一个或多个用于实现规定的逻辑功能的可执行指令。也应当注意,在有些作为替换的实现方式中,方框中所标注的功能也可以以不同于附图中所标注的顺序发生。例如,两个连续的方框实际上可以基本并行地执行,它们有时也可以按相反的顺序执行,这依所涉及的功能而定。也要注意的是,框图和/或流程图中的每个方框、以及框图和/或流程图中的方框的组合,可以用执行规定的功能或动作的专用的基于硬件的系统来实现,或者可以用专用硬件与计算机指令的组合来实现。In the embodiments provided in this application, it should be understood that the disclosed apparatus and method may also be implemented in other manners. The apparatus embodiments described above are merely illustrative, for example, the flowcharts and block diagrams in the accompanying drawings illustrate the architectures, functions and possible implementations of apparatuses, methods and computer program products according to various embodiments of the present application. operate. In this regard, each block in the flowchart or block diagrams may represent a module, segment, or portion of code that contains one or more functions for implementing the specified logical function(s) 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 in succession may, in fact, be executed substantially concurrently, or the blocks may sometimes be executed in the reverse order, depending upon the functionality involved. It is also noted that each block of the block diagrams and/or flowchart illustrations, and combinations of blocks in the block diagrams and/or flowchart illustrations, can be implemented in dedicated hardware-based systems that perform the specified functions or actions , or can be implemented in a combination of dedicated hardware and computer instructions.

另外,在本申请各个实施例中的各功能模块可以集成在一起形成一个独立的部分,也可以是各个模块单独存在,也可以两个或两个以上模块集成形成一个独立的部分。In addition, each functional module in each embodiment of the present application may be integrated together to form an independent part, or each module may exist independently, or two or more modules may be integrated to form an independent part.

所述功能如果以软件功能模块的形式实现并作为独立的产品销售或使用时,可以存储在一个计算机可读取存储介质中。基于这样的理解,本申请的技术方案本质上或者说对现有技术做出贡献的部分或者该技术方案的部分可以以软件产品的形式体现出来,该计算机软件产品存储在一个存储介质中,包括若干指令用以使得一台计算机设备(可以是个人计算机,服务器,或者网络设备等)执行本申请各个实施例所述方法的全部或部分步骤。而前述的存储介质包括:U盘、移动硬盘、只读存储器(ROM,Read-Only Memory)、随机存取存储器(RAM,Random Access Memory)、磁碟或者光盘等各种可以存储程序代码的介质。If the functions are implemented in the form of software function modules and sold or used as independent products, they can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present application can be embodied in the form of a software product in essence, or the part that contributes to the prior art or the part of the technical solution. The computer software product is stored in a storage medium, including Several instructions are used to cause a computer device (which may be a personal computer, a server, or a network device, etc.) to execute all or part of the steps of the methods described in the various embodiments of the present application. The aforementioned storage medium includes: U disk, mobile hard disk, Read-Only Memory (ROM, Read-Only Memory), Random Access Memory (RAM, Random Access Memory), magnetic disk or optical disk and other media that can store program codes .

综上所述,本申请实施例提供的一种基于稀疏编码的相似性图像检索方法及系统,其能够更加充分地提取图像特征信息,在相似度计算的过程中更加精准、有针对性,通过发掘不同但相关领域间不变的特征和结构并充分利用已有资源,构建稀疏特征迁移模型,将其他相关任务中的知识迁移至标记样本稀少的目标任务,帮助提升目标任务的学习效率。迁移稀疏编码图像检索技术将稀疏编码与迁移学习技术相结合,是实现稀疏特征在不同领域间进行重复利用的新技术。To sum up, the method and system for similarity image retrieval based on sparse coding provided by the embodiments of the present application can more fully extract image feature information, and the process of similarity calculation is more accurate and targeted. Explore different but invariant features and structures between related fields, make full use of existing resources, build a sparse feature transfer model, transfer knowledge from other related tasks to target tasks with few labeled samples, and help improve the learning efficiency of target tasks. Transfer sparse coding image retrieval technology combines sparse coding and transfer learning technology, which is a new technology to realize the reuse of sparse features in different fields.

以上所述仅为本申请的优选实施例而已,并不用于限制本申请,对于本领域的技术人员来说,本申请可以有各种更改和变化。凡在本申请的精神和原则之内,所作的任何修改、等同替换、改进等,均应包含在本申请的保护范围之内。The above descriptions are only preferred embodiments of the present application, and are not intended to limit the present application. For those skilled in the art, the present application may have various modifications and changes. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of this application shall be included within the protection scope of this application.

对于本领域技术人员而言,显然本申请不限于上述示范性实施例的细节,而且在不背离本申请的精神或基本特征的情况下,能够以其它的具体形式实现本申请。因此,无论从哪一点来看,均应将实施例看作是示范性的,而且是非限制性的,本申请的范围由所附权利要求而不是上述说明限定,因此旨在将落在权利要求的等同要件的含义和范围内的所有变化囊括在本申请内。不应将权利要求中的任何附图标记视为限制所涉及的权利要求。It will be apparent to those skilled in the art that the present application is not limited to the details of the above-described exemplary embodiments, but that the present application can be implemented in other specific forms without departing from the spirit or essential characteristics of the present application. Accordingly, the embodiments are to be regarded in all respects as illustrative and not restrictive, and the scope of the application is to be defined by the appended claims rather than the foregoing description, which is therefore intended to fall within the scope of the claims. All changes that come within the meaning and scope of equivalents to are included in this application. Any reference signs in the claims shall not be construed as limiting the involved claim.

Claims (10)

1. A similarity image retrieval method based on sparse coding is characterized by comprising the following steps:
performing base vector characterization according to the reference image to obtain a first sparse characterization result;
performing base vector characterization according to the images in the image library to obtain a second sparse characterization result;
calculating the similarity of the first sparse representation result and the second sparse representation result;
and judging whether the similarity is greater than a preset threshold value, if so, judging the image to be a similar image, and if not, judging the image to be a non-similar image.
2. The sparse coding-based similarity image retrieval method as claimed in claim 1, wherein before the performing base vector characterization on the basis of the reference image to obtain the first sparse characterization result, further comprises:
the basis vectors are trained using representative images in the image library.
3. The sparse coding-based similarity image retrieval method as claimed in claim 2, wherein the training of the basis vectors by using the representative images in the image library comprises:
and fixing the base vectors in the dictionary, and adjusting the coding coefficients to minimize the target function.
4. The sparse coding-based similarity image retrieval method as claimed in claim 2, wherein the training of the basis vectors by using the representative images in the image library comprises:
and fixing the encoding coefficient, and adjusting the base vector in the dictionary to minimize the target function.
5. The sparse coding-based similarity image retrieval method as claimed in claim 2, wherein the training of the basis vectors by using the representative images in the image library comprises:
and obtaining a group of base vectors of the well-expressed sample image by continuously iterating until convergence.
6. The sparse coding-based similarity image retrieval method as claimed in claim 1, wherein before the performing base vector characterization on the basis of the reference image to obtain the first sparse characterization result, further comprises:
and optimizing the basis vectors according to cross mutual experiments.
7. The sparse coding-based similarity image retrieval method as claimed in claim 1, wherein before the performing base vector characterization on the basis of the reference image to obtain the first sparse characterization result, further comprises:
and performing optimized characterization on the images with inaccurate characterization.
8. The sparse coding-based similarity image retrieval method as claimed in claim 1, wherein before the performing base vector characterization on the basis of the reference image to obtain the first sparse characterization result, further comprises:
and carrying out significance detection on the image.
9. A sparse coding-based similarity image retrieval system, comprising:
the first acquisition module is used for performing base vector representation according to the reference image to acquire a first sparse representation result;
the second acquisition module is used for performing base vector characterization according to the images in the image library to obtain a second sparse characterization result;
the calculation module is used for calculating the similarity between the first sparse representation result and the second sparse representation result;
and the judging module is used for judging whether the similarity is greater than a preset threshold value, if so, judging the image to be a similar image, and if not, judging the image to be a non-similar image.
10. The sparse coding-based similarity image retrieval system of claim 9, further comprising:
at least one memory for storing computer instructions;
at least one processor in communication with the memory, wherein the at least one processor, when executing the computer instructions, causes the system to perform: the device comprises a first acquisition module, a second acquisition module, a calculation module and a judgment module.
CN202010724862.4A 2020-07-24 2020-07-24 Sparse coding-based similarity image retrieval method and system Pending CN111914920A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202010724862.4A CN111914920A (en) 2020-07-24 2020-07-24 Sparse coding-based similarity image retrieval method and system

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202010724862.4A CN111914920A (en) 2020-07-24 2020-07-24 Sparse coding-based similarity image retrieval method and system

Publications (1)

Publication Number Publication Date
CN111914920A true CN111914920A (en) 2020-11-10

Family

ID=73280813

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202010724862.4A Pending CN111914920A (en) 2020-07-24 2020-07-24 Sparse coding-based similarity image retrieval method and system

Country Status (1)

Country Link
CN (1) CN111914920A (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114825636A (en) * 2022-05-26 2022-07-29 深圳博浩远科技有限公司 Health state monitoring and warning system and method for photovoltaic inverter
CN118069870A (en) * 2024-01-25 2024-05-24 飞虎互动科技(北京)有限公司 Method, system and device for establishing environmental information archive based on information fusion characteristics

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103020265A (en) * 2012-12-25 2013-04-03 深圳先进技术研究院 Image retrieval method and system
CN104142978A (en) * 2014-07-14 2014-11-12 重庆邮电大学 An image retrieval system and method based on multi-features and sparse representation
CN106991426A (en) * 2016-09-23 2017-07-28 天津大学 Remote sensing images sparse coding dictionary learning method based on DSP embedded
CN110930301A (en) * 2019-12-09 2020-03-27 Oppo广东移动通信有限公司 Image processing method, image processing device, storage medium and electronic equipment

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103020265A (en) * 2012-12-25 2013-04-03 深圳先进技术研究院 Image retrieval method and system
CN104142978A (en) * 2014-07-14 2014-11-12 重庆邮电大学 An image retrieval system and method based on multi-features and sparse representation
CN106991426A (en) * 2016-09-23 2017-07-28 天津大学 Remote sensing images sparse coding dictionary learning method based on DSP embedded
CN110930301A (en) * 2019-12-09 2020-03-27 Oppo广东移动通信有限公司 Image processing method, image processing device, storage medium and electronic equipment

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
吴潇.: "基于形状的商标图像检索技术研究", 《中国优秀硕士学位论文全文数据库 信息科技辑》, no. 05, pages 138 - 1254 *

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114825636A (en) * 2022-05-26 2022-07-29 深圳博浩远科技有限公司 Health state monitoring and warning system and method for photovoltaic inverter
CN118069870A (en) * 2024-01-25 2024-05-24 飞虎互动科技(北京)有限公司 Method, system and device for establishing environmental information archive based on information fusion characteristics
CN118069870B (en) * 2024-01-25 2024-07-23 飞虎互动科技(北京)有限公司 Method, system and equipment for establishing environment information file based on information fusion characteristics

Similar Documents

Publication Publication Date Title
US12400302B2 (en) Image processing method, image processing apparatus, electronic device and computer-readable storage medium
CN114612832B (en) Real-time gesture detection method and device
CN110096938B (en) Method and device for processing action behaviors in video
CN114155388B (en) Image recognition method and device, computer equipment and storage medium
CN115937742B (en) Video scene segmentation, visual task processing method, device, equipment and medium
CN111027412B (en) Human body key point identification method and device and electronic equipment
CN112966754B (en) Sample screening method, sample screening device and terminal equipment
CN112597918A (en) Text detection method and device, electronic equipment and storage medium
CN114238692A (en) Network live broadcast-oriented video big data accurate retrieval method and system
CN110135428B (en) Image segmentation processing method and device
CN111046847A (en) Video processing method and device, electronic equipment and medium
CN111914920A (en) Sparse coding-based similarity image retrieval method and system
CN113947154A (en) Target detection method, system, electronic equipment and storage medium
CN116342955B (en) A target detection method and system based on an improved feature pyramid network
CN113140012A (en) Image processing method, image processing apparatus, image processing medium, and electronic device
CN117372817A (en) Training method and device of face recognition model and face recognition method and device
CN114548194A (en) Classification model training method, using method, electronic equipment and storage medium
CN112257726B (en) Target detection training method, system, electronic equipment and computer readable storage medium
CN113569684A (en) Short video scene classification method and system, electronic equipment and storage medium
WO2024260417A1 (en) Image quality assessment method, and device and storage medium
CN116645513B (en) Watermark extraction methods, model training methods, devices, electronic equipment and media
CN111950517A (en) A target detection method, model training method, electronic device and storage medium
CN111815638A (en) Training method of video segmentation network model, video segmentation method and related equipment
CN114972775B (en) Feature processing methods, devices, products, media and equipment
CN117746162A (en) Target identification method and device for low-resolution small sample

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
RJ01 Rejection of invention patent application after publication

Application publication date: 20201110

RJ01 Rejection of invention patent application after publication