


技术领域technical field
本发明涉及图像分割技术领域,具体而言,涉及一种基于稀疏表示的图像分割方法、装置、设备及存储介质。The present invention relates to the technical field of image segmentation, and in particular, to an image segmentation method, apparatus, device and storage medium based on sparse representation.
背景技术Background technique
基于狄利克雷的图像分割算法是一种常用的图像分割算法,其主要是基于像素点进行计算分割。原始基于狄利克雷混合模型的图像分割算法,目前其中几个重要参数主要依靠人工经验和实际测试去做调整和优化,无法自动预测最优参数,由于其重要参数在不同图像的分割中存在显著的差异,使得不同图像使用相同参数可能取得完全不一样的分割效果,甚至有的会造成分割的失败。针对不同图像,狄利克雷混合模型重要参数的调整优化是繁琐耗时和难以把控与评价的。Dirichlet-based image segmentation algorithm is a commonly used image segmentation algorithm, which is mainly based on pixel points for computational segmentation. The original image segmentation algorithm based on the Dirichlet mixture model, at present, several important parameters are mainly adjusted and optimized by manual experience and actual testing, and the optimal parameters cannot be automatically predicted, because their important parameters have significant differences in the segmentation of different images The difference of , makes different images use the same parameters to achieve completely different segmentation effects, and some even cause segmentation failure. For different images, the adjustment and optimization of important parameters of the Dirichlet mixture model is tedious and time-consuming, and it is difficult to control and evaluate.
发明内容SUMMARY OF THE INVENTION
本发明的目的在于提供一种基于稀疏表示的图像分割方法、装置、设备及存储介质用以解决无法自动预测最优参数导致耗时的问题。The purpose of the present invention is to provide an image segmentation method, device, device and storage medium based on sparse representation to solve the problem of time-consuming caused by the inability to automatically predict optimal parameters.
为实现上述目的,本发明实施例提供一种基于稀疏表示的图像分割方法,包括以下步骤:To achieve the above purpose, an embodiment of the present invention provides an image segmentation method based on sparse representation, including the following steps:
收集一定数量的图像及其分割标记;Collect a certain number of images and their segmentation markers;
基于所述分割标记,用狄利克雷混合模型对收集的图像进行无监督分割,并调整狄利克雷混合模型的参数,获得使每张图像的分割结果接近最优的最优参数;Based on the segmentation marks, unsupervised segmentation is performed on the collected images by using the Dirichlet mixture model, and the parameters of the Dirichlet mixture model are adjusted to obtain optimal parameters that make the segmentation result of each image close to the optimal;
记录每张图像的最优参数,组成最优参数列表;Record the optimal parameters of each image to form an optimal parameter list;
将每张图像转换为灰度图,并提取它们的灰度直方图特征;Convert each image to grayscale and extract their grayscale histogram features;
将从每张图像提取的灰度直方图特征组成一个字典,训练生成一个稀疏表示字典;The grayscale histogram features extracted from each image are composed of a dictionary, and a sparse representation dictionary is generated by training;
提取待分割的图像的灰度直方图特征,利用该灰度直方图特征,计算其在所训练的稀疏表示字典中的稀疏系数;Extract the grayscale histogram feature of the image to be segmented, and use the grayscale histogram feature to calculate its sparse coefficient in the trained sparse representation dictionary;
根据计算得到的所述稀疏系数,从所述稀疏表示字典获取与其最接近的近似图像;Obtain the closest approximate image from the sparse representation dictionary according to the calculated sparse coefficient;
从所述最优参数列表中获取所述近似图像的最优参数,并采用所述最优参数对狄利克雷混合模型的参数进行赋值;Obtain the optimal parameters of the approximate image from the optimal parameter list, and use the optimal parameters to assign values to the parameters of the Dirichlet mixture model;
利用赋值好参数的狄利克雷混合模型对待分割图像进行无监督图像分割,得到分割结果。The unsupervised image segmentation is performed on the image to be segmented by using the Dirichlet mixture model with assigned parameters, and the segmentation result is obtained.
优选的,所述图像在灰度直方图的分布上具有差异性以及多的分布类型。Preferably, the image has differences in the distribution of grayscale histograms and multiple distribution types.
优选的的,在获得所述最优参数的过程中,结合分割结果与对应分割标记的精度,判断参数是否达到最优。Preferably, in the process of obtaining the optimal parameters, it is determined whether the parameters are optimal by combining the segmentation results and the accuracy of the corresponding segmentation markers.
优选的的,所述灰度直方图特征包括256维度的特征。Preferably, the grayscale histogram features include 256-dimensional features.
本发明还提供了一种基于稀疏表示的图像分割装置,包括:The present invention also provides an image segmentation device based on sparse representation, comprising:
收集模块,用于收集一定数量的图像及其分割标记;A collection module for collecting a certain number of images and their segmentation markers;
第一分割模块,用于基于所述分割标记,用狄利克雷混合模型对收集的图像进行无监督分割,并调整狄利克雷混合模型的参数,获得使每张图像的分割结果接近最优的最优参数;The first segmentation module is used to perform unsupervised segmentation on the collected images with the Dirichlet mixture model based on the segmentation mark, and adjust the parameters of the Dirichlet mixture model to obtain a segmentation result that makes each image close to the optimal optimal parameters;
记录模块,用于记录每张图像的最优参数,组成最优参数列表;The recording module is used to record the optimal parameters of each image and form the optimal parameter list;
提取模块,用于将每张图像转换为灰度图,并提取它们的灰度直方图特征;Extraction module for converting each image to grayscale and extracting their grayscale histogram features;
训练模块,用于将从每张图像提取的灰度直方图特征组成一个字典,训练生成一个稀疏表示字典;The training module is used to form a dictionary from the grayscale histogram features extracted from each image, and train to generate a sparse representation dictionary;
计算模块,用于提取待分割的图像的灰度直方图特征,利用该灰度直方图特征,计算其在所训练的稀疏表示字典中的稀疏系数;a calculation module, used to extract the grayscale histogram feature of the image to be segmented, and use the grayscale histogram feature to calculate its sparse coefficient in the trained sparse representation dictionary;
获取模块,用于根据计算得到的所述稀疏系数,从所述稀疏表示字典获取与其最接近的近似图像;an obtaining module, configured to obtain the closest approximate image from the sparse representation dictionary according to the calculated sparse coefficient;
赋值模块,用于从所述最优参数列表中获取所述近似图像的最优参数,并采用所述最优参数对狄利克雷混合模型的参数进行赋值;an assignment module, configured to obtain the optimal parameters of the approximate image from the optimal parameter list, and use the optimal parameters to assign values to the parameters of the Dirichlet mixture model;
第二分割模块,用于利用赋值好参数的狄利克雷混合模型对待分割图像进行无监督图像分割,得到分割结果。The second segmentation module is used to perform unsupervised image segmentation on the image to be segmented by using the Dirichlet mixture model with assigned parameters to obtain segmentation results.
本发明还提供了一种存储介质,所述存储介质用于存储至少一个程序,至少一个指令,所述至少一个程序、指令被执行以实现一种基于稀疏表示的参数优化狄利克雷混合模型图像分割的方法。The present invention also provides a storage medium for storing at least one program, at least one instruction, and the at least one program and instruction are executed to realize a sparse representation-based parameter optimization Dirichlet mixture model image method of segmentation.
优选的,所述图像在灰度直方图的分布上具有差异性以及多的分布类型。Preferably, the image has differences in the distribution of grayscale histograms and multiple distribution types.
优选的的,在获得所述最优参数的过程中,结合分割结果与对应分割标记的精度,判断参数是否达到最优。Preferably, in the process of obtaining the optimal parameters, it is determined whether the parameters are optimal by combining the segmentation results and the accuracy of the corresponding segmentation markers.
优选的的,所述灰度直方图特征包括256维度的特征。Preferably, the grayscale histogram features include 256-dimensional features.
本发明还提供了一种基于稀疏表示的图像分割设备,包括存储器以及处理器,所述存储器内存储有计算机程序,所述处理器用于运行所述计算机程序以实现所述一种基于稀疏表示的图像分割方法。The present invention also provides an image segmentation device based on sparse representation, comprising a memory and a processor, wherein a computer program is stored in the memory, and the processor is configured to run the computer program to implement the sparse representation-based image segmentation device. Image segmentation method.
本发明还提供一种存储介质,所述存储介质存储有计算机程序,所述计算机程序能够被所述存储介质所在设备的处理器执行,以实现所述的一种基于稀疏表示的图像分割方法。The present invention also provides a storage medium, where the storage medium stores a computer program, and the computer program can be executed by a processor of a device where the storage medium is located, so as to implement the image segmentation method based on sparse representation.
本发明的有益技术效果:Beneficial technical effects of the present invention:
本发明通过收集大量的图像及其分割标记,然后利用狄利克雷混合模型对所收集的图像进行无监督分割,分割过程中,通过人工调整和优化狄利克雷参数,确保每张图像的分割结果精度相对较高,并对每张图像的狄利克雷混合模型参数记录下来,下一步,将从每张图像提取的灰度直方图特征组成一个字典,训练生成一个稀疏表示字典,最后,当要使用狄利克雷混合模型去分割一张图像时,先用所训练的稀疏表示字典对该图像进行识别,辨认其与字典中最像的图像,计算其在所训练的稀疏表示字典中的稀疏系数,并用最像图像对应的狄利克雷参数对本次分割中的狄利克雷参数进行赋值再进行无监督分割。本专利中狄利克雷混合模型的优化参数不需要人工调整,而是经过稀疏表示预测之后自动生成,节省时间。The invention collects a large number of images and their segmentation marks, and then uses the Dirichlet hybrid model to perform unsupervised segmentation on the collected images. During the segmentation process, the Dirichlet parameters are manually adjusted and optimized to ensure the segmentation result of each image. The accuracy is relatively high, and the parameters of the Dirichlet mixture model for each image are recorded. In the next step, the grayscale histogram features extracted from each image are formed into a dictionary, and a sparse representation dictionary is generated by training. When using the Dirichlet mixture model to segment an image, first use the trained sparse representation dictionary to identify the image, identify the image that is most similar to the dictionary, and calculate its sparse coefficient in the trained sparse representation dictionary. , and assign the Dirichlet parameters in this segmentation with the Dirichlet parameters corresponding to the most image-like images, and then perform unsupervised segmentation. The optimization parameters of the Dirichlet mixture model in this patent do not need to be manually adjusted, but are automatically generated after sparse representation prediction, which saves time.
附图说明Description of drawings
为了更清楚地说明本发明实施方式的技术方案,下面将对实施方式中所需要使用的附图作简单地介绍,应当理解,以下附图仅示出了本发明的某些实施例,因此不应被看作是对范围的限定,对于本领域普通技术人员来讲,在不付出创造性劳动的前提下,还可以根据这些附图获得其他相关的附图。In order to explain 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为本发明第一实施例提供的一种基于稀疏表示的图像分割方法的流程示意图。FIG. 1 is a schematic flowchart of an image segmentation method based on sparse representation provided by the first embodiment of the present invention.
图2为本发明第一实施例提供的一种基于稀疏表示的图像分割方法的流程示意图。FIG. 2 is a schematic flowchart of an image segmentation method based on sparse representation according to the first embodiment of the present invention.
图3为本发明第二实施例提供的一种基于稀疏表示的图像分割装置的流程示意图。FIG. 3 is a schematic flowchart of an apparatus for image segmentation based on sparse representation according to a second embodiment of the present invention.
具体实施方式Detailed ways
下面将结合本发明实施例中的附图,对本发明实施例中的技术方案进行清楚、完整地描述,显然,所描述的实施例仅仅是本发明一部分实施例,而不是全部的实施例。基于本发明中的实施例,本领域普通技术人员在没有做出创造性劳动前提下所获得的所有其他实施例,都属于本发明保护的范围。The technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings in the embodiments of the present invention. Obviously, the described embodiments are only a part of the embodiments of the present invention, but not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those of ordinary skill in the art without creative efforts shall fall within the protection scope of the present invention.
本发明的多个实施例提供了一种基于稀疏表示的图像分割方法、装置、设备及存储介质,其在基于原始狄利克雷混合模型的图像分割算法的基础上,经过稀疏表示预测之后狄利克雷混合模型的优化参数不需要人工调整,而是自动生成,节省时间。Various embodiments of the present invention provide an image segmentation method, device, device and storage medium based on sparse representation, which are based on the image segmentation algorithm based on the original Dirichlet mixture model, and after sparse representation prediction, Dirich The optimization parameters of the Lei mixture model do not need to be manually adjusted, but are automatically generated, saving time.
为便于对本发明的理解,以下先介绍基于狄利克雷混合模型的图像分割算法的算法原理。In order to facilitate the understanding of the present invention, the algorithm principle of the image segmentation algorithm based on the Dirichlet mixture model is first introduced below.
具体地,基于狄利克雷混合模型的图像分割算法,主要是利用有限狄利克雷混合模型结合像素空间约束,实现对目标图像的无监督分割。Specifically, the image segmentation algorithm based on the Dirichlet mixture model mainly uses the finite Dirichlet mixture model combined with the pixel space constraints to achieve unsupervised segmentation of the target image.
首先,给定一个D维的随机向量该向量满足:并且0<<Xd<<1。在随机向量上带有参数向量的狄利克雷分布可以定义为:First, given a D-dimensional random vector The vector satisfies: And 0<<Xd <<1. in random vector with a vector of parameters on The Dirichlet distribution can be defined as:
这里是一个定义为的gamma函数。狄利克雷分布的均值和方差分别为和here is a defined as gamma function. The mean and variance of the Dirichlet distribution are and
然后,一个包含K个组成部分的有限狄利克雷分布可以表示为:Then, a finite Dirichlet distribution with K components can be expressed as:
这里的代表一个混合比例集合,并且该混合比例集合满足:0<<πk<<1和假设有一个由狄利克雷分布生成的包含N个独立分布向量的集合则χ的密度函数为:here represents a set of mixing ratios, and the set of mixing ratios satisfies: 0<<πk <<1 and Suppose there is a set of N independent distribution vectors generated by the Dirichlet distribution Then the density function of χ is:
为了让狄利克雷混合模型能够用于图像分割,对狄利克雷混合模型的无监督分类加上了空间约束条件。假定图像中每个像素的分布满足空间约束的狄利克雷混合模型,那么像素点的密度分布函数可以表示为:To enable the Dirichlet mixture model to be used for image segmentation, spatial constraints are imposed on the unsupervised classification of the Dirichlet mixture model. Assuming that the distribution of each pixel in the image satisfies the spatially constrained Dirichlet mixture model, the density distribution function of the pixel can be expressed as:
这里的是上下文混合比例,ξik代表的是像素i属于第k个部分的概率,并且满足限制条件:ξik>0,here is the context mixing ratio, ξik represents the probability that pixel i belongs to the k-th part, and satisfies the constraints: ξik >0,
接下来,对于每个像素对它指定一个K维的二值随机向量Zik=(Zi1,…,ZiK)作为类别指示变量,其定义为:Next, for each pixel It is assigned a K-dimensional binary random vector Zik = (Zi1 ,...,ZiK ) as the category indicator variable, which is defined as:
对于集合中的每个类别指示变量满足以下限制条件:for collection each category indicator variable in The following constraints are met:
为了保证分割的平滑性,对于每个像素点用邻域均值来代替它本身的值,具体表示如下:In order to ensure the smoothness of the segmentation, the neighborhood mean is used to replace its own value for each pixel, which is specifically expressed as follows:
这里的Ωi表示第i个邻域像素,|Ωi|表示第i个像素的邻域像素个数,(t-1)表示上一次迭代计算。通常3×3的方形窗口被作为邻域区域。Here Ωi represents the ith neighborhood pixel, |Ωi | represents the number of neighborhood pixels of the ith pixel, and (t-1) represents the last iteration calculation. Usually a 3×3 square window is used as the neighborhood area.
的狄利克雷分布可以表示为: The Dirichlet distribution of can be expressed as:
这里的是狄利克雷参数。here is the Dirichlet parameter.
由于必须是正数,因此对它用Gamma分布对它进行先验概率分布赋值:because Must be positive, so assign it a prior probability distribution with a Gamma distribution:
这里的ukd和vkd是超参数。从而,用于图像无监督分割的空间约束狄利克雷混合模型的联合概率分布可以表示为:Here ukd and vkd are hyperparameters. Thus, the joint probability distribution of the spatially constrained Dirichlet mixture model for unsupervised segmentation of images can be expressed as:
对于上述模型的自主学习过程,采用了变分贝叶斯学习的方法。变分贝叶斯是一种用于最优化问题中后验概率分布计算的近似方法。通常使用变分分布q(Θ)来近似真正的后验概率分布p(Θ|χ),这里的表示隐藏随机变量。Kullback-Leibler(KL)差异被用来计算近似分布q(Θ)和真实分布p(Θ|χ)之间的差异:For the autonomous learning process of the above model, the variational Bayesian learning method is adopted. Variational Bayes is an approximation method for the computation of posterior probability distributions in optimization problems. The true posterior probability distribution p(Θ|χ) is usually approximated by a variational distribution q(Θ), where represents a hidden random variable. The Kullback-Leibler (KL) difference is used to calculate the difference between the approximate distribution q(Θ) and the true distribution p(Θ|χ):
这里的是证据下限,并定义如下:here is the lower limit of evidence and is defined as follows:
从而最小化KL(q||p)等同于最大化证据下限这里,全因子分解被用于限制q(Θ),具体表示如下:Thus minimizing KL(q||p) is equivalent to maximizing the lower bound of evidence Here, full factorization is used to limit q(Θ), which is expressed as follows:
为了最大化这里对其每个因子做变分优化:in order to maximize Here is a variational optimization for each of its factors:
这里的分布超参数由以下公式给定:The distribution hyperparameters here are given by:
这里的Ψ(.)表示digamma方程。上述方程的期望值可以用如下公式计算:Here Ψ(.) represents the digamma equation. The expected value of the above equation can be calculated using the following formula:
应用二阶泰勒展开式可以获得公式(10)中的下限近似值:Applying the second-order Taylor expansion to obtain Eq. (10) The lower bound approximation of :
在后验概率分布中上下文混合比例的期望值可以表示为:The expected value of the context mixing proportion in the posterior probability distribution can be expressed as:
在算法中,最佳的分割块数可以通过初始化一个比较大的分割块数K,然后通过迭代把冗余的分割块去除。上述变分更新方程可以通过类似EM算法的迭代过程最优化,具体算法如下:In the algorithm, the optimal number of partitions can be initialized by a relatively large number of partitions K, and then the redundant partitions are removed by iteration. The above variational update equation can be optimized through an iterative process similar to the EM algorithm. The specific algorithm is as follows:
选取初始化分割块数K=20Select the number of initialized partitions K=20
初始化超参数a=50,b=1.5,ukd=10,vkd=0.05.Initialize hyperparameters a = 50, b = 1.5, ukd = 10, vkd = 0.05.
通过K-means聚类算法初始化rikInitializerik via K-means clustering algorithm
重复:repeat:
用当前的模型参数值去评估分割块(公式22-26)Use the current model parameter values to evaluate the partitions (Equations 22-26)
使用公式14-16更新Update using Equations 14-16
直到达到收敛条件。until the convergence condition is reached.
以下详述本发明实施例的具体内容。The specific contents of the embodiments of the present invention are described in detail below.
如图1-2所示,本发明第一实施例提供了一种基于稀疏表示的图像分割方法,包括步骤:As shown in Figure 1-2, the first embodiment of the present invention provides an image segmentation method based on sparse representation, including the steps:
S11:收集一定数量的图像及其分割标记;S11: collect a certain number of images and their segmentation marks;
S12:基于所述分割标记,用狄利克雷混合模型对收集的图像进行无监督分割,并调整狄利克雷混合模型的参数,获得使每张图像的分割结果接近最优的最优参数;S12: based on the segmentation mark, use the Dirichlet mixture model to perform unsupervised segmentation on the collected images, and adjust the parameters of the Dirichlet mixture model to obtain optimal parameters that make the segmentation result of each image close to the optimal;
S13:记录每张图像的最优参数,组成最优参数列表;S13: record the optimal parameters of each image to form an optimal parameter list;
S14:将每张图像转换为灰度图,并提取它们的灰度直方图特征;S14: convert each image into a grayscale image, and extract their grayscale histogram features;
S15:将从每张图像提取的灰度直方图特征组成一个字典,训练生成一个稀疏表示字典;S15: form a dictionary from the grayscale histogram features extracted from each image, and train to generate a sparse representation dictionary;
S16:提取待分割的图像的灰度直方图特征,利用该灰度直方图特征,计算其在所训练的稀疏表示字典中的稀疏系数;S16: extract the grayscale histogram feature of the image to be segmented, and use the grayscale histogram feature to calculate its sparse coefficient in the trained sparse representation dictionary;
S17:根据计算得到的所述稀疏系数,从所述稀疏表示字典获取与其最接近的近似图像;S17: According to the calculated sparse coefficient, obtain the approximate image closest to it from the sparse representation dictionary;
S18:从所述最优参数列表中获取所述近似图像的最优参数,并采用所述最优参数对狄利克雷混合模型的参数进行赋值;S18: obtain the optimal parameters of the approximate image from the optimal parameter list, and use the optimal parameters to assign values to the parameters of the Dirichlet mixture model;
S19:利用赋值好参数的狄利克雷混合模型对待分割图像进行无监督图像分割,得到分割结果。S19: Use the Dirichlet mixture model with assigned parameters to perform unsupervised image segmentation on the image to be segmented to obtain a segmentation result.
在本实施例中,所述图像在灰度直方图的分布上选择具有差异性以及尽可能多的分布类型以增大样本量。In this embodiment, the distribution of the grayscale histogram of the image is different and as many distribution types as possible are selected to increase the sample size.
在本实施例中,在获得所述最优参数的过程中,通过人工判断分割结果,通过结合分割结果与对应分割标记的精度,判断参数是否达到最优,若不是最优,则继续修改参数直至分割结果最优。In this embodiment, in the process of obtaining the optimal parameters, the segmentation result is manually judged, and whether the parameters are optimal is determined by combining the segmentation results and the accuracy of the corresponding segmentation markers, and if not, the parameters are continued to be modified until the segmentation result is optimal.
在本实施例中,所述灰度直方图特征可选256维度的特征。In this embodiment, the grayscale histogram feature can be selected as a feature of 256 dimensions.
在本实施例中,所述稀疏字典不做缩减,每张图像都为一个类别。In this embodiment, the sparse dictionary is not reduced, and each image is a category.
本发明第二实施例提供一种基于稀疏表示的图像分割装置,如图3,包括:The second embodiment of the present invention provides an image segmentation device based on sparse representation, as shown in FIG. 3 , including:
110:收集模块,用于收集一定数量的图像及其分割标记;110: a collection module for collecting a certain number of images and their segmentation marks;
120:第一分割模块,用于基于所述分割标记,用狄利克雷混合模型对收集的图像进行无监督分割,并调整狄利克雷混合模型的参数,获得使每张图像的分割结果接近最优的最优参数;120: a first segmentation module, configured to perform unsupervised segmentation on the collected images by using the Dirichlet mixture model based on the segmentation mark, and adjust the parameters of the Dirichlet mixture model to obtain a segmentation result that makes each image close to the best possible segmentation result. optimal parameters;
130:记录模块,用于记录每张图像的最优参数,组成最优参数列表;130: a recording module for recording the optimal parameters of each image to form an optimal parameter list;
140:提取模块,用于将每张图像转换为灰度图,并提取它们的灰度直方图特征;140: an extraction module for converting each image into a grayscale image and extracting their grayscale histogram features;
150:训练模块,用于将从每张图像提取的灰度直方图特征组成一个字典,训练生成一个稀疏表示字典;150: a training module for forming a dictionary from the grayscale histogram features extracted from each image, and training to generate a sparse representation dictionary;
160:计算模块,用于提取待分割的图像的灰度直方图特征,利用该灰度直方图特征,计算其在所训练的稀疏表示字典中的稀疏系数;160: a calculation module for extracting the grayscale histogram feature of the image to be segmented, and using this grayscale histogram feature to calculate its sparse coefficient in the trained sparse representation dictionary;
170:获取模块,用于根据计算得到的所述稀疏系数,从所述稀疏表示字典获取与其最接近的近似图像;170: an acquisition module, configured to acquire the closest approximate image from the sparse representation dictionary according to the calculated sparse coefficients;
180:赋值模块,用于从所述最优参数列表中获取所述近似图像的最优参数,并采用所述最优参数对狄利克雷混合模型的参数进行赋值;180: an assignment module, for obtaining the optimal parameters of the approximate image from the optimal parameter list, and using the optimal parameters to assign values to the parameters of the Dirichlet mixture model;
190:第二分割模块,用于利用赋值好参数的狄利克雷混合模型对待分割图像进行无监督图像分割,得到分割结果。190: The second segmentation module is used to perform unsupervised image segmentation on the image to be segmented by using the Dirichlet mixture model with assigned parameters to obtain a segmentation result.
在本实施例中,所述图像在灰度直方图的分布上选择具有差异性以及尽可能多的分布类型以增大样本量。In this embodiment, the distribution of the grayscale histogram of the image is different and as many distribution types as possible are selected to increase the sample size.
在本实施例中,在获得所述最优参数的过程中,通过人工判断分割结果,通过结合分割结果与对应分割标记的精度,判断参数是否达到最优,若不是最优,则继续修改参数直至分割结果最优。In this embodiment, in the process of obtaining the optimal parameters, the segmentation result is manually judged, and whether the parameters are optimal is determined by combining the segmentation results and the accuracy of the corresponding segmentation markers, and if not, the parameters are continued to be modified until the segmentation result is optimal.
在本实施例中,所述灰度直方图特征可选256维度的特征。In this embodiment, the grayscale histogram feature can be selected as a feature of 256 dimensions.
在本实施例中,所述稀疏字典不做缩减,每张图像都为一个类别。In this embodiment, the sparse dictionary is not reduced, and each image is a category.
本发明第三实施例还提供了一种基于稀疏表示的图像分割设备,包括存储器以及处理器,所述存储器内存储有计算机程序,所述处理器用于运行所述计算机程序以实现所述一种基于稀疏表示的图像分割方法。The third embodiment of the present invention also provides an image segmentation device based on sparse representation, including a memory and a processor, where a computer program is stored in the memory, and the processor is configured to run the computer program to implement the one A sparse representation-based image segmentation method.
本发明第四实施例还提供一种存储介质,所述存储介质存储有计算机程序,所述计算机程序能够被所述存储介质所在设备的处理器执行,以实现所述的一种基于稀疏表示的图像分割方法。A fourth embodiment of the present invention further provides a storage medium, where the storage medium stores a computer program, and the computer program can be executed by a processor of a device where the storage medium is located, so as to implement the sparse representation-based Image segmentation method.
综上所述,本发明通过收集大量的图像及其分割标记,然后,利用狄利克雷混合模型对所收集的图像进行无监督分割,分割过程中,通过人工调整和优化狄利克雷参数,确保每张图像的分割结果都是精度相对较高,并把每张图像的狄利克雷混合模型参数记录下来,下一步,将所收集图像组成一个字典去训练一个稀疏表示字典;当要使用狄利克雷混合模型去分割一张图像时,先用所训练的稀疏表示字典对该图像进行识别,辨认其与字典中哪张图像最像,提取待分割的图像的灰度直方图特征,计算其在所训练的稀疏表示字典中的稀疏系数,并用最像的那张图像对应的狄利克雷参数对本次分割中的狄利克雷参数进行赋值,最后利用赋值好参数的狄利克雷混合模型对待分割图像进行无监督图像分割,得到分割结果。本发明中狄利克雷混合模型的优化参数不需要人工调整,而是经过稀疏表示预测之后自动生成。To sum up, the present invention collects a large number of images and their segmentation marks, and then uses the Dirichlet mixture model to perform unsupervised segmentation on the collected images. During the segmentation process, the Dirichlet parameters are manually adjusted and optimized to ensure that the The segmentation result of each image is relatively high-precision, and the Dirichlet mixture model parameters of each image are recorded. Next, the collected images are formed into a dictionary to train a sparse representation dictionary; when using Dirichlet When the Lei mixture model is used to segment an image, first use the trained sparse representation dictionary to identify the image, identify which image in the dictionary is most similar to it, extract the grayscale histogram feature of the image to be segmented, and calculate its value in the image. The trained sparseness represents the sparse coefficients in the dictionary, and assigns the Dirichlet parameters in this segmentation with the Dirichlet parameters corresponding to the most similar image, and finally uses the Dirichlet mixture model with the assigned parameters to be segmented. The image is subjected to unsupervised image segmentation to obtain the segmentation result. The optimization parameters of the Dirichlet mixture model in the present invention do not need to be adjusted manually, but are automatically generated after being predicted by sparse representation.
尽管结合优选实施方案具体展示和介绍了本发明,但所属领域的技术人员应该明白,在不脱离所附权利要求书所限定的本发明的精神和范围内,在形式上和细节上可以对本发明做出各种变化,均为本发明的保护范围。Although the present invention has been particularly shown and described in connection with preferred embodiments, it will be understood by those skilled in the art that changes in form and detail may be made to the present invention without departing from the spirit and scope of the invention as defined by the appended claims. Various changes are made within the protection scope of the present invention.
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| CN202010794337.XACN111860547B (en) | 2020-08-10 | 2020-08-10 | Image segmentation method, device and equipment based on sparse representation and storage medium |
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| CN202010794337.XACN111860547B (en) | 2020-08-10 | 2020-08-10 | Image segmentation method, device and equipment based on sparse representation and storage medium |
| Publication Number | Publication Date |
|---|---|
| CN111860547Atrue CN111860547A (en) | 2020-10-30 |
| CN111860547B CN111860547B (en) | 2023-04-18 |
| Application Number | Title | Priority Date | Filing Date |
|---|---|---|---|
| CN202010794337.XAActiveCN111860547B (en) | 2020-08-10 | 2020-08-10 | Image segmentation method, device and equipment based on sparse representation and storage medium |
| Country | Link |
|---|---|
| CN (1) | CN111860547B (en) |
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| US20070047789A1 (en)* | 2005-08-30 | 2007-03-01 | Agfa-Gevaert N.V. | Method of Constructing Gray Value or Geometric Models of Anatomic Entity in Medical Image |
| US20090208106A1 (en)* | 2008-02-15 | 2009-08-20 | Digitalsmiths Corporation | Systems and methods for semantically classifying shots in video |
| US20100081931A1 (en)* | 2007-03-15 | 2010-04-01 | Destrempes Francois | Image segmentation |
| CN102819747A (en)* | 2012-07-18 | 2012-12-12 | 浙江农林大学 | Method for automatically classifying forestry service images |
| CN105321178A (en)* | 2015-10-12 | 2016-02-10 | 武汉工程大学 | Image segmentation method and apparatus based on sparse principal component analysis |
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| US20070047789A1 (en)* | 2005-08-30 | 2007-03-01 | Agfa-Gevaert N.V. | Method of Constructing Gray Value or Geometric Models of Anatomic Entity in Medical Image |
| US20100081931A1 (en)* | 2007-03-15 | 2010-04-01 | Destrempes Francois | Image segmentation |
| US20090208106A1 (en)* | 2008-02-15 | 2009-08-20 | Digitalsmiths Corporation | Systems and methods for semantically classifying shots in video |
| CN102819747A (en)* | 2012-07-18 | 2012-12-12 | 浙江农林大学 | Method for automatically classifying forestry service images |
| CN105321178A (en)* | 2015-10-12 | 2016-02-10 | 武汉工程大学 | Image segmentation method and apparatus based on sparse principal component analysis |
| Title |
|---|
| LI SHEN 等: "A Semisupervised Latent Dirichlet Allocation Model for Object-Based Classification of VHR Panchromatic Satellite Images"* |
| ZIYI CHEN 等: "Corse-to-Fine Road Extraction Based on Local Dirichlet Mixture Models and Multiscale-High-Order Deep Learning"* |
| 李璐: "基于t混合模型的脑部核磁共振图像分割方法研究"* |
| Publication number | Publication date |
|---|---|
| CN111860547B (en) | 2023-04-18 |
| Publication | Publication Date | Title |
|---|---|---|
| CN108345911B (en) | Surface defect detection method of steel plate based on multi-level features of convolutional neural network | |
| CN112507901B (en) | Unsupervised pedestrian re-identification method based on pseudo tag self-correction | |
| CN113159048A (en) | Weak supervision semantic segmentation method based on deep learning | |
| CN117611932B (en) | Image classification method and system based on double pseudo tag refinement and sample re-weighting | |
| CN114155213A (en) | Chip defect detection method and device based on active learning | |
| CN111860596B (en) | Unsupervised road crack classification method and model establishment method based on deep learning | |
| CN108595558B (en) | Image annotation method based on data equalization strategy and multi-feature fusion | |
| CN113642655B (en) | Small sample image classification method based on support vector machine and convolutional neural network | |
| CN114998202B (en) | A Semi-Supervised Deep Learning Defect Detection Method | |
| CN106709421B (en) | Cell image identification and classification method based on transform domain features and CNN | |
| CN114492581A (en) | Method for classifying small sample pictures based on transfer learning and attention mechanism element learning application | |
| CN114202694A (en) | Small sample remote sensing scene image classification method based on manifold mixed interpolation and contrast learning | |
| CN119313928B (en) | Intelligent identification system and method for violations at new energy stations based on machine vision | |
| CN106157330A (en) | A kind of visual tracking method based on target associating display model | |
| CN114049541B (en) | Visual scene recognition method based on structured information feature decoupling and knowledge transfer | |
| CN111652265A (en) | A Robust Semi-Supervised Sparse Feature Selection Method Based on Self-Adjusting Graphs | |
| CN112734037A (en) | Memory-guidance-based weakly supervised learning method, computer device and storage medium | |
| CN117541562A (en) | Semi-supervised non-reference image quality evaluation method based on uncertainty estimation | |
| CN114187506A (en) | Remote sensing image scene classification method of viewpoint-aware dynamic routing capsule network | |
| CN119152502A (en) | Landscape plant image semantic segmentation method based on weak supervision | |
| CN118570447A (en) | Feature balance-based remote sensing image fine-grained target detection method and system | |
| CN116012903B (en) | A method and system for automatically labeling facial expressions | |
| CN114998585B (en) | Open-world semantic segmentation method and device based on region-aware metric learning | |
| CN115019183B (en) | Remote sensing image model migration method based on knowledge distillation and image reconstruction | |
| CN119049113B (en) | A facial expression recognition method integrating uncertainty estimation and active learning |
| 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 | ||
| GR01 | Patent grant | ||
| GR01 | Patent grant |