Borrar filtros
Borrar filtros

How to represent gray scale images as affine subspaces?

4 visualizaciones (últimos 30 días)
M
M el 23 de Oct. de 2023
Editada: M el 11 de Dic. de 2023
How to represent gray scale images as affine subspaces?
  4 comentarios
M
M el 24 de Oct. de 2023
Hi @Walter Roberson do you have any idea please?
Walter Roberson
Walter Roberson el 27 de Oct. de 2023
This is not a topic I know anything about.

Iniciar sesión para comentar.

Respuestas (4)

Image Analyst
Image Analyst el 23 de Oct. de 2023
I don't know what you mean. What's the context? What do you mean by "model"? What do you mean by "affine subspaces"? Do you just want to warp or spatially transform the image?
If you have any more questions, then attach your data and code to read it in with the paperclip icon after you read this:
  1 comentario
M
M el 23 de Oct. de 2023
Editada: M el 23 de Oct. de 2023
@Image Analyst @Matt J In the attached paper they represented the images in Affine subspaces, I am asking generally if there is a popular method/code of representing the image in affine space.
My data is huge attached is a sample.

Iniciar sesión para comentar.


Matt J
Matt J el 23 de Oct. de 2023
Editada: Matt J el 23 de Oct. de 2023
One way, I suppose would be to train an affine neural network with the Deep Learning Toolbox, e.g.,
layers=[imageinputLayer(120,160,1);
convolution2dLayer([120,160],N) )
regressionLayer];
XTrain=images;
YTrain=zeros(1,1,N,size(XTrain,4));
net=trainNetwork(XTrain, YTrain, layers,.... )
but you would need a truly huge number of images and good regularization for the training to be well-posed. You should probably look at augmentedImageDatastore.
  34 comentarios
M
M el 23 de Nov. de 2023
Hi @Matt J, I have a question please, Why did you decide her to use regressionLayer in your Network? And what is the advantage of using this layer? thanks
Matt J
Matt J el 23 de Nov. de 2023
As opposed to what? What else might we have used?

Iniciar sesión para comentar.


Matt J
Matt J el 27 de Oct. de 2023
Editada: Matt J el 27 de Oct. de 2023
Well, in general, we can write the estimation of A,b as the norm minimization problem,
If X can be fit in RAM, you could just use svd() to solve it
N=14;
X=images(:,:)';
vn=vecnorm(X,inf,1);
[~,~,V]=svd([X./vn, ones(height(X),1)] , 0);
Abt=V(:,end+1-N:end)./vn';
A=Abt(1:end-1,:)';
b=Abt(end,:)';
s=vecnorm(A,2,2);
[A,b]=deal(A./s, b./s);
  43 comentarios
Torsten
Torsten el 5 de Dic. de 2023
Editada: Torsten el 5 de Dic. de 2023
So you say you have 3 classes for your images that are known right from the beginning.
Say you determine the affine subspace for each 49000 images that best represents your image and you compute the mutual distance by SVD between these 49000 affine subspaces (which would give a 49000x49000 matrix). Now say you cluster your images according to this distance matrix into 3 (similar) clusters derived from the distance matrix.
The question you should ask yourself is: would these three clusters resemble the 3 classes that you think the images belong to right at the beginning ?
If the answer is no and if you consider the 3 classes from the beginning as fixed, then the distance measure via SVD is not adequate for your application.
M
M el 6 de Dic. de 2023
Editada: M el 6 de Dic. de 2023
@Matt J unfortunately the pre-normalization, and increasing the number of N didnt improve the performance.
I sure that the problem in the indicitor (norm), other indicators may provide better results as Grassman Kernel and distance. because that's proved in the literature. but still I am looking how can I apply them

Iniciar sesión para comentar.


Matt J
Matt J el 5 de Dic. de 2023
Editada: Matt J el 5 de Dic. de 2023
So how Can I get the direction and origins so I can compute the grassman distance?
Here is another variant that gives a Basis/Origin description of the subspace.
N=100; %estimated upper bound on subspace dimension
X=reshape(XTrain,[], size(XTrain,4)); %<----no tranpose
mu=mean(X,2);
X=X-mu;
[Q,~,~]=qr(X , 0);
Basis=Q(:,1:N); %Basis direction vectors
Origin=mu-Basis*(Basis.'*mu); %Orthogonalize
  18 comentarios
Matt J
Matt J el 7 de Dic. de 2023
Editada: Matt J el 7 de Dic. de 2023
is there here a criteria for selcting the N final V columns of its SVD as you suggested for N initial columns of Q?
The dimension of the subspace that you fit to X will be NumPixels-N, where NumPixels is the total number of pixels in one image.
Also, Regarding Basis/Origin description, can you give me an idea how do we usually use this information for classification?
No, pursuing it was your idea. You said it would help you compute the Grassman distance, whatever that is.
M
M el 11 de Dic. de 2023
Editada: M el 11 de Dic. de 2023
Dear @Matt J thank you for your suggestions and clarifications.
I reached to a conclusion that representing the images as it is as vectors in a subspace is not a good idea!
Especially if the test images are not typical for the training set.(stacking the images as vectors causes problems!)
I think I have to do some feature extractions of region of interest first then representing the features as subspaces.(whether as matrices or vectors) , Still I am thinking how to do that.

Iniciar sesión para comentar.

Categorías

Más información sobre Image Data Workflows en Help Center y File Exchange.

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by