'프로그램 사용'에 해당되는 글 2519건

  1. 2026.05.27 openscad
  2. 2026.05.27 딥러닝 학습 관련(epoch, loss)
  3. 2026.05.21 NAS - Neural Architecture Search
  4. 2026.05.21 MCUNet
  5. 2026.05.20 STFPM - Student-Teacher Feature Pyramid Matching
  6. 2026.05.20 EfficientAD
  7. 2026.05.20 patchcore
  8. 2026.05.20 MVTec AD 데이터 셋
  9. 2026.05.19 VAD - PaDiM, Patchcore - 정상이 아님을 탐지
  10. 2026.05.19 octave로 공간 fft 돌려보기

freecad나 blender cad 확장으로는 이래저래 힘들고

python 통해서 제어하면 이상하게 나와서 제어가 유리한 무언가를 찾는 중

 

[링크 : https://github.com/fogleman/sdf]

 

[링크 : https://news.hada.io/topic?id=25230]

'프로그램 사용 > openSCAD' 카테고리의 다른 글

openSCAD + claude.ai = 파라메트릭 모델링  (0) 2026.07.13
openSCAD MCP  (0) 2026.06.20
pythonSCAD  (0) 2026.06.20
openSCAD cheatsheet  (0) 2026.06.20
openSCAD 설치  (0) 2026.06.20
Posted by 구차니

 

-----

metric 함수. 얘도 함수였구나.

아무튼 metric은 격하게 오락가락 하고

[링크 : https://modulabs.co.kr/blog/loss-versus-accuracy]

 

loss 가 점진적 감소 -> 잘 학습

loss 급격히 감소 후 유지 -> 정상

loss 일정 시점 이후 증가 -> over fitting

[링크 : https://m.blog.naver.com/datapreprep/223748771141]

 

근데.. underfitting은 먼지 감이 안오네.

When to change the number of epochs (training cycles)

Selecting the appropriate number of epochs is a balance between underfitting and overfitting.

Underfitting: One of the most straightforward indicators of underfitting is if the model performs poorly on the training data. This can be observed in Edge Impulse Studio through metrics such as accuracy, or loss, depending on the type of problem (classification or regression). If these metrics indicate poor performance, it suggests that the model has not learned the patterns of the data well. In that case, increasing the number of epochs can improve your model performance. Please note that other solutions exist such as increasing your neural network architecture complexity, changing the preprocessing technique or reducing regularization.

Overfitting: Detecting overfitting involves recognizing when the model has learned too much from the training data, including its noise and outliers, to the detriment of its performance on new, unseen data. Overfitting is characterized by the model performing exceptionally well on the training data but poorly on the validation or test data. Evaluating overfitting can be achieved by comparing the performance of the model between the training set and the validation set during training. When the performance on the validation set starts to degrade, it might indicate that the model is beginning to overfit the training data. In that case, decreasing the number of epochs can improve your model performance. As with underfitting, other solutions exist to reduce overfitting such as increasing the number of training data, adding regularization techniques to add penalties on large weights, adding dropout layers, simplifying the model architecture and even using early stopping.



[링크 : https://docs.edgeimpulse.com/knowledge/concepts/machine-learning/neural-networks/epochs]

 

overfitting 중인 loss 값 이라는데, 

 

학습셋이 너무 적을 경우 overfitting이 빠르게 발생하는 것으로 보인다.

그나저나 저 130 miliion parameter는 ssd300 에서 어떻게 산출된걸까?

What you are experiencing is called overfitting and it happens because of your very small dataset.
All the model cares about is performance on the training dataset, so given the opportunity, it will simply attempt to memorize it. This is what happens in you case, you feed a model which contains over 130 Million parameters less than 319 images.
So regarding your questions:
  1. The loss function shows a clear case of overfitting.
  2. On general, it is okay to use a trained model, especially when you only have a small dataset, but in your case, the dataset is too small for any deep-learning model. When I say small dataset, I mean 10k images, not several hundreds.
  3. You should not train for longer time, once the validation loss stops improving, it is a clear sign to stop. There is even a training technique named "early stopping" which is designed to stop training once the validation loss stops to drop.
You have to understand that currently, your dataset of 300 images, is irrelevant to the world of deep-learning. So if you still want to use it for object detection, you need to revert to more classic computer-vision techniques like using HOG or SIFT features, or even manually engineering the features for your special case.
 

[링크 : https://datascience.stackexchange.com/questions/46456/issues-with-training-ssd-on-own-dataset]

 

The SSD300 has 35.6 million parameters, while the SSDlite320 has about a tenth of them, i.e., 3.4 million.

[링크 : https://www.mdpi.com/2673-6470/3/3/12]

'프로그램 사용 > yolo_tensorflow' 카테고리의 다른 글

ubuntu 26.04 + 3070 + tensorflow + python 3.14 + docker...  (0) 2026.06.17
STFPM 실행  (0) 2026.06.01
NAS - Neural Architecture Search  (0) 2026.05.21
MCUNet  (0) 2026.05.21
STFPM - Student-Teacher Feature Pyramid Matching  (0) 2026.05.20
Posted by 구차니

MCUNet 보다 보니 NAS  라는게 보여서 찾아봄

Search NN model on an existing library e.g., ProxylessNAS, MnasNet

[링크 : https://hanlab18.mit.edu/projects/tinyml/mcunet/assets/MCUNet-slides.pdf]

 

Neural Architecture Search 

[링크 : https://doing-ai.tistory.com/entry/Neural-Architecture-Search-NAS-Hardware-Aware-NAS-ProxylessNAS]

 

EfficientNAS 이후에 나온 더욱 효율적인 NAS를 위한 논문, ProxylessNAS다. TuNAS의 근간이 된 논문이기도 하며, 구체적으로 알아보자.

[링크 : https://seokdonge.tistory.com/27] ProxylessNAS

[링크 : https://ech97.tistory.com/entry/MnasNet] MnasNet

 

TuNAS

[링크 : https://seokdonge.tistory.com/26]

[링크 : https://openaccess.thecvf.com/content_CVPR_2020/papers/Bender_Can_Weight_Sharing_Outperform_Random_Architecture_Search_An_Investigation_With_CVPR_2020_paper.pdf]

[링크 : https://github.com/google-research/google-research/tree/master/tunas]

'프로그램 사용 > yolo_tensorflow' 카테고리의 다른 글

STFPM 실행  (0) 2026.06.01
딥러닝 학습 관련(epoch, loss)  (0) 2026.05.27
MCUNet  (0) 2026.05.21
STFPM - Student-Teacher Feature Pyramid Matching  (0) 2026.05.20
EfficientAD  (0) 2026.05.20
Posted by 구차니

STFPM -> PaSTe -> MCUNet 으로 찾아옴

[링크 : https://github.com/AMCO-UniPD/PaSTe]

 

MCU 에서 돌릴만큼 경량 네트워크

[링크 : https://cowkim-svd.tistory.com/7]

 

[링크 : https://github.com/mit-han-lab/mcunet]

 

 

 

[링크 : https://www.youtube.com/watch?v=YvioBgtec4U]

[링크 : https://www.youtube.com/watch?v=0pUFZYdoMY8]

'프로그램 사용 > yolo_tensorflow' 카테고리의 다른 글

딥러닝 학습 관련(epoch, loss)  (0) 2026.05.27
NAS - Neural Architecture Search  (0) 2026.05.21
STFPM - Student-Teacher Feature Pyramid Matching  (0) 2026.05.20
EfficientAD  (0) 2026.05.20
patchcore  (0) 2026.05.20
Posted by 구차니

[링크 : https://github.com/gdwang08/STFPM]

[링크 : https://blog.naver.com/kingjykim/223495332696]

 

[링크 : https://claude.ai/share/6d307c41-77bc-411e-90a8-982fb5ce0467]

 

STFPM PaSTe

Student-Teacher Feature Pyramid Matching

[링크 : https://www.alphaxiv.org/ko/overview/2503.02691v1]

 

Partially Shared Teacher-student

Our results show that PaSTe decreases the inference time by 25%, while reducing the training time by 33% and peak RAM usage during training by 76%.

[링크 : https://github.com/AMCO-UniPD/PaSTe]

'프로그램 사용 > yolo_tensorflow' 카테고리의 다른 글

NAS - Neural Architecture Search  (0) 2026.05.21
MCUNet  (0) 2026.05.21
EfficientAD  (0) 2026.05.20
patchcore  (0) 2026.05.20
MVTec AD 데이터 셋  (0) 2026.05.20
Posted by 구차니

'프로그램 사용 > yolo_tensorflow' 카테고리의 다른 글

MCUNet  (0) 2026.05.21
STFPM - Student-Teacher Feature Pyramid Matching  (0) 2026.05.20
patchcore  (0) 2026.05.20
MVTec AD 데이터 셋  (0) 2026.05.20
VAD - PaDiM, Patchcore - 정상이 아님을 탐지  (0) 2026.05.19
Posted by 구차니

VAD 분야 SOTA(state of the art. 별걸 다 줄여 -_-) 모델이라는데 무거워서 모바일이나 엣지에서 돌리긴 좀 무리일 듯.

 

[링크 : https://coderecording.tistory.com/9]

[링크 : https://github.com/amazon-science/patchcore-inspection]

[링크 : https://github.com/tiskw/patchcore-ad]

'프로그램 사용 > yolo_tensorflow' 카테고리의 다른 글

STFPM - Student-Teacher Feature Pyramid Matching  (0) 2026.05.20
EfficientAD  (0) 2026.05.20
MVTec AD 데이터 셋  (0) 2026.05.20
VAD - PaDiM, Patchcore - 정상이 아님을 탐지  (0) 2026.05.19
U-net, segmentation  (0) 2026.05.14
Posted by 구차니

가장 만만한(?) 데이터 셋인 것 같은데

DAGM 데이터셋은 총 10가지 도메인의 데이터로 구성되어 있으며, 모델링을 통해 가상으로 결함을 합성하여 만든 데이터셋입니다. NanoTWICE 데이터셋은 nanofibrous material 데이터이며 5장의 정상 데이터와 40장의 결함 데이터로 구성이 되어있습니다

자, 이제 오늘의 본론인 MVTec-AD 데이터셋에 대해 설명드리겠습니다. 앞서 설명드렸던 DAGM, NanoTWICE의 아쉬웠던 부분들을 개선하며 총 15종류의 도메인의 데이터셋을 구축하였습니다. 크게는 Texture와 Object로 구분을 하였고, 각각 5가지, 10가지 종류의 도메인 데이터로 구성이 되어있습니다

[링크 : https://hoya012.github.io/blog/MVTec-AD/]

 

5.3 GB(!!)

[링크 : https://www.kaggle.com/datasets/ipythonx/mvtec-ad]

[링크 : https://www.mvtec.com/research-teaching/datasets/mvtec-ad]

[링크 : https://huggingface.co/datasets/Voxel51/mvtec-ad]

 

5.9 GB(!!!)

[링크 : https://www.kaggle.com/datasets/mhskjelvareid/dagm-2007-competition-dataset-optical-inspection]

[링크 : https://github.com/M-3LAB/awesome-industrial-anomaly-detection]

'프로그램 사용 > yolo_tensorflow' 카테고리의 다른 글

EfficientAD  (0) 2026.05.20
patchcore  (0) 2026.05.20
VAD - PaDiM, Patchcore - 정상이 아님을 탐지  (0) 2026.05.19
U-net, segmentation  (0) 2026.05.14
QAT, PTQ .. 모델 경량화  (0) 2026.05.14
Posted by 구차니

비정상을 학습시키는게 아니라

정상만 학습시키고 정상에서 벗어나는 것을 탐지하는 기법

 

PaDiM

Ganomaly (GAN + Anomaly Detection)

[링크 : https://actionpower.medium.com/액션파워-lab-이미지에서-이상-영역-탐지-visual-anomaly-detection-는-어떻게-할까-6da65866366b]

 

PaDiM-Lite / PatchCore-Lite

[링크 : https://www.alphaxiv.org/ko/overview/2603.20288v1]

 

PaDiM (Patch Ditrubution Modeling)

[링크 : https://huggingface.co/papers/2011.08785]

[링크 : https://data-analysis-expertise.tistory.com/128]

[링크 : https://dippingtodeepening.tistory.com/110]

[링크 : https://cumulu-s.tistory.com/44]

 

VAD - Visual Anomaly Detection

MVTec-AD, MVTec-3D, MVTec-LOCO, VisA  데이터 셋

[링크 : https://velog.io/@barley_15/논문-리뷰-A-Survey-on-Visual-Anomaly-Detection-Challenge-Approach-and-Prospect]

 

PatchCore

[링크 : https://velog.io/@ljwljy51/PatchCore-Paper-Review]

 

PatchCore

SPADE , PaDiM

[링크 : https://ffighting.net/deep-learning-paper-review/anomaly-detection/patchcore/]

'프로그램 사용 > yolo_tensorflow' 카테고리의 다른 글

patchcore  (0) 2026.05.20
MVTec AD 데이터 셋  (0) 2026.05.20
U-net, segmentation  (0) 2026.05.14
QAT, PTQ .. 모델 경량화  (0) 2026.05.14
unet  (0) 2026.05.06
Posted by 구차니
프로그램 사용/octave2026. 5. 19. 16:19

귀찮으니(!) gpt를 통해서 딸깍~ 시전

% 이미지 읽기
img = imread("test.jpg");

% RGB -> grayscale 직접 변환
if ndims(img) == 3

    r = double(img(:,:,1));
    g = double(img(:,:,2));
    b = double(img(:,:,3));

    gray = 0.299*r + 0.587*g + 0.114*b;
else
    gray = double(img);
end

% 블럭 크기
blockSize = 32;

[h, w] = size(gray);

% 결과 저장
scoreMap = zeros(floor(h/blockSize), floor(w/blockSize));

% 블럭별 FFT 처리
for by = 1:blockSize:(h - blockSize + 1)
    for bx = 1:blockSize:(w - blockSize + 1)

        % 블럭 추출
        block = gray(by:by+blockSize-1, bx:bx+blockSize-1);

        % 평균 제거
        block = block - mean(block(:));

        % FFT
        F = fft2(block);

        % magnitude
        mag = abs(F);

        % 중앙 이동
        mag = fftshift(mag);

        center = floor(blockSize/2) + 1;

        radius = 4;

        [X, Y] = meshgrid(1:blockSize, 1:blockSize);

        dist = sqrt((X-center).^2 + (Y-center).^2);

        % 고주파만 사용
        mask = dist > radius;

        % 고주파 에너지
        energy = sum(mag(mask).^2);

        % diversity score
        score = log(1 + energy);

        iy = (by-1)/blockSize + 1;
        ix = (bx-1)/blockSize + 1;

        scoreMap(iy, ix) = score;
    end
end

% 정규화
scoreMap = scoreMap - min(scoreMap(:));
scoreMap = scoreMap / max(scoreMap(:));

% 결과 표시
figure;
imshow(uint8(gray));
title("Original");

figure;
imagesc(scoreMap);
axis image;
colorbar;
title("FFT Diversity Map");

 

원본

그레이스케일

 

원인은 모르겠으나 blocksize 5 이하로는 검은색으로 나온다.

 

blocksize = 6 blocksize = 8 blocksize = 10
blocksize = 12 blocksize = 16 blocksize = 32

 

원본

 

그레이스케일

 

blocksize = 6 blocksize = 10 blocksize = 12

blocksize = 16 blocksize = 18 blocksize = 20
blocksize = 24 blocksize = 28 blocksize = 32

 

이미지 폭이 큰 차이가 없어서 그런진 모르겠지만..

blocksize 10~12 정도가 가장 무난한 것 같다.

 

rgb에 대해서 각각 처리 후 합산인데 눈에 보이는건 크게 달라 보이진 않았는데

img = imread("test.jpg");

img = double(img);

blockSize = 32;

[h, w, c] = size(img);

scoreMap = zeros(floor(h/blockSize), floor(w/blockSize));

for by = 1:blockSize:(h - blockSize + 1)
    for bx = 1:blockSize:(w - blockSize + 1)

        totalEnergy = 0;

        % RGB 각각 처리
        for ch = 1:3

            block = img(by:by+blockSize-1, ...
                        bx:bx+blockSize-1, ch);

            block = block - mean(block(:));

            F = fft2(block);

            mag = abs(fftshift(F));

            center = floor(blockSize/2) + 1;

            radius = 4;

            [X, Y] = meshgrid(1:blockSize, 1:blockSize);

            dist = sqrt((X-center).^2 + (Y-center).^2);

            mask = dist > radius;

            energy = sum(mag(mask).^2);

            totalEnergy = totalEnergy + energy;
        end

        score = log(1 + totalEnergy);

        iy = (by-1)/blockSize + 1;
        ix = (bx-1)/blockSize + 1;

        scoreMap(iy, ix) = score;
    end
end

scoreMap = scoreMap - min(scoreMap(:));
scoreMap = scoreMap / max(scoreMap(:));

figure;
imshow(uint8(img));

figure;
imagesc(scoreMap);
axis image;
colorbar;
title("RGB FFT Diversity");

 

blocksize = 10

 

두개를 비교해보면 하단에 파란색 마트 정도는 좀 더 잘 보이는 차이가 있는데

처리 시간대비로는 그리 큰 효과를 얻긴 힘들지도 모르겠다.

grayscale rgb 각각 처리후 합산

 

 LAB 으로 전환해서 색상에 대해서 처리, blocksize = 10

% ==========================================
% LAB 기반 Fabric Diversity / Anomaly Map
% ==========================================

img = imread("test.jpg");

img = double(img) / 255.0;

%------------------------------------------
% RGB -> LAB 변환
%------------------------------------------

% sRGB gamma correction 제거
mask = img <= 0.04045;

img_linear = zeros(size(img));

img_linear(mask) = img(mask) / 12.92;
img_linear(~mask) = ((img(~mask)+0.055)/1.055).^2.4;

% RGB -> XYZ
M = [ ...
    0.4124564 0.3575761 0.1804375;
    0.2126729 0.7151522 0.0721750;
    0.0193339 0.1191920 0.9503041];

[h, w, ~] = size(img);

rgb_reshaped = reshape(img_linear, [], 3);

xyz = rgb_reshaped * M';

X = xyz(:,1) / 0.95047;
Y = xyz(:,2);
Z = xyz(:,3) / 1.08883;

% XYZ -> LAB helper
f = @(t) ((t > 0.008856).*t.^(1/3) + ...
         (t <= 0.008856).*(7.787*t + 16/116));

fx = f(X);
fy = f(Y);
fz = f(Z);

L = 116*fy - 16;
A = 500*(fx - fy);
B = 200*(fy - fz);

lab = zeros(h, w, 3);

lab(:,:,1) = reshape(L, h, w);
lab(:,:,2) = reshape(A, h, w);
lab(:,:,3) = reshape(B, h, w);

%------------------------------------------
% FFT Block Analysis
%------------------------------------------

blockSize = 32;
step = 16;   % overlap sliding

outH = floor((h - blockSize)/step) + 1;
outW = floor((w - blockSize)/step) + 1;

scoreMap = zeros(outH, outW);

% FFT mask 생성
center = floor(blockSize/2) + 1;

[Xm, Ym] = meshgrid(1:blockSize, 1:blockSize);

dist = sqrt((Xm-center).^2 + (Ym-center).^2);

radius = 4;

highMask = dist > radius;

%------------------------------------------
% Sliding Window
%------------------------------------------

oy = 1;

for by = 1:step:(h - blockSize + 1)

    ox = 1;

    for bx = 1:step:(w - blockSize + 1)

        totalEnergy = 0;

        % LAB 각 채널 FFT
        for ch = 1:3

            block = lab( ...
                by:by+blockSize-1, ...
                bx:bx+blockSize-1, ...
                ch);

            % 평균 제거
            block = block - mean(block(:));

            % FFT
            F = fft2(block);

            mag = abs(fftshift(F));

            % 고주파 에너지
            energy = sum(mag(highMask).^2);

            totalEnergy = totalEnergy + energy;
        end

        % 로그 스케일
        score = log(1 + totalEnergy);

        scoreMap(oy, ox) = score;

        ox = ox + 1;
    end

    oy = oy + 1;
end

%------------------------------------------
% Normalize
%------------------------------------------

scoreMap = scoreMap - min(scoreMap(:));
scoreMap = scoreMap / max(scoreMap(:));

%------------------------------------------
% Display
%------------------------------------------

figure;
imagesc(img);
axis image;
title("Original");

figure;
imagesc(scoreMap);
axis image;
colorbar;
title("LAB FFT Diversity / Anomaly Map");

 

block 10, step 16

 

block 10, step 10

 

rgb 각각 처리후 합산 RGB->LAB, 색상만 처리

'프로그램 사용 > octave' 카테고리의 다른 글

octave - pkg load image  (0) 2026.05.19
octave csv에서 읽어들이기  (0) 2024.11.26
octave audioread wav  (0) 2023.07.12
공짜 matlab? octave  (0) 2015.11.05
Posted by 구차니