Machine Learning/Deep Learning for Vision Systems
-
[DL for VS #8] 배치 정규화Machine Learning/Deep Learning for Vision Systems 2023. 4. 17. 03:31
4.9 배치 정규화 입력층에 이미지를 입력하기 위한 데이터의 전처리에서 정규화를 사용했었다.(아래 요약 참고) 4.3.2 데이터 전처리(신경망에 입력되기 전에 이루어지는 것들) 회색조 이미지 변환 – 계산 복잡도를 경감시킬 수 있다. 이미지 크기 조절 – 신경망의 한계점 중 하나는 입력되는 모든 이미지의 크기가 같아야 한다. 데이터 정규화 – 데이터에 포함된 입력 특징(이미지의 경우 픽셀값)의 배율을 조정해서 비슷한 분포를 갖게 함. 데이터 강화 – 데이터 강화를 데이터 전처리로도 활용할 수 있다. 이미 추출된 특징을 정규화하면 은닉층도 마찬가지로 정규화의 도움을 받을 수 있다. '추출된 특징'은 변화가 심하므로 정규화를 통해 신경망의 학습 속도와 유연성을 더욱 개선할 수 있다. 이런 기법을 배치 정규화..
-
[DL for VS #7] 신경망 하이퍼파라미터 튜닝Machine Learning/Deep Learning for Vision Systems 2023. 4. 13. 23:02
4.5.1 데이터 추가 수집 또는 하이퍼파라미터 튜닝 훈련 데이터에 대한 기존 성능이 납득할만한 수준인지 확인한다. 훈련 데이터 정확도(train_acc)와 검증 데이터 정확도(val_acc) 이렇게 두 가지 지표를 시각화해서 관찰한다. 훈련 데이터에 대한 성능이 낮다면 과소적합의 가능성이 있다. 과소적합은 기존 데이터도 충분히 활용하지 못하는 상황이므로 데이터를 추가 수집할 필요가 없다. 하이퍼파라미터를 조정하거나 기존 훈련 데이터를 클린징(정화)해야 한다. 훈련 데이터에 대한 성능은 괜찮은데 테스트 데이터에 대한 성능이 떨어진다면 일반화 성능이 떨어지는 과적합의 가능성이 있다. 데이터 추가 수집이 유효한 경우다. 데이터 레이블링이 수동작업으로 이루어짐.이미지 한 장 한 장 사람이 직접 보고 레이블링 ..
-
[DL for VS #6] 성능 지표 - 정확도, 혼동 행렬, 정밀도, 재현율, F-점수, 시각화 예제Machine Learning/Deep Learning for Vision Systems 2023. 4. 12. 16:50
4. 딥러닝 프로젝트 시동 걸기와 하이퍼파라미터 튜닝 머신러닝 시스템의 성능 지표 정의하기 베이스라인 모델 설정하기 학습 데이터 준비하기 모델을 평가하고 성능 지표 해석하기 신경망을 개선하고 하이퍼파라미터 튜닝하기 4.1 성능 지표란 모델의 성능을 평가하는 지표에는 정확도, 정밀도, 재현율, F-점수 등이 있다. 4.1.1 정확도 정확도 = 정답을 맞힌 횟수 / 전체 표본 수 희귀질환 양성/음성 판정 시스템 예시에서, 정확도는 이 모델의 성능 평가하기 적합한 지표가 아니다. 전체 1백만 명 중 1명꼴로 발병한다면, 음성 예측 시스템은 99.999%의 정확도를 갖는다.(정확도 지표가 의미가 없음) 4.1.2 혼동 행렬 또 다른 지표를 정의하기 앞서 혼동 행렬(confusion mamtrix)를 알아야 함...
-
[DL for VS #5] 컬러 이미지 합성곱 연산 실습Machine Learning/Deep Learning for Vision Systems 2023. 4. 12. 16:40
3.6 컬리 이미지의 합성곱 연산(3D 이미지) 컬러이미지는 R, G, B채널을 포함하기 때문에 28x28 크기의 이미지를 컴퓨터는 28x28x3크기의 행렬로 다룬다. 3.6.1 컬러 이미지를 대상으로 합성곱 연산하기 합성곱 커널을 입력 이미지 위로 이동시키며 특징 맵을 계산하면 되는데, 이제 커널도 채널이 추가되어 3차원이 되었다. *훈련데이터 : 모델을 학습하는데 사용하는 데이터 *검증 데이터 : 하이퍼파라미터를 튜닝할 때 훈련 데이터에 치우치지 않도록 하기 위한 별도의 데이터. 검증 데이터에서 학습한 내용이 모델 설정에 끼어들면 모델 평가가 편향된다. *테스트 데이터 : 모델의 성능을 최종 판단하기 위해 사용하는 데이터 *레이블 행렬 원-핫 인코딩을 적용해서 (1,n) 모양의 레이블 벡터를 (10,..
-
[DL for VS #4] CONV kernel, stride, padding, pooling, dropoutMachine Learning/Deep Learning for Vision Systems 2023. 4. 12. 16:33
3.1 다층 퍼셉트론을 이용한 이미지 분류 MNIST 예제를 이용할 것임. MNIST(Modified National Institute of Standards and Technology database) 손글씨 숫자들로 이루어진 대형 데이터베이스MNIST 데이터셋이 깔끔하고 완벽하게 전처리된 상태이기 때문에 MLP 성능(96%)과 CNN 성능(99%)이 비슷하다. 3.1.1 입력층 3.1.2 은닉층 전결합층(fully connected layer, FC = 밀집층, dense layer) 이전 층의 모든 노드가 각기 다음 층의 모든 노드와 연결된 것. 이런 신경망을 전결합 신경망(fully connected network)이라고 함. 노드와 노드를 연결하는 에지(edge)는 해당 노드의 출력에 대한 중요..
-
[DL for VS #3] 최적화 알고리즘-(배치, 확률적, 미니배치)경사하강법, 역전파 알고리즘Machine Learning/Deep Learning for Vision Systems 2023. 4. 8. 23:30
2.6.2 배치 경사 하강법(batch gradient descent, BGD) 1.경사 (경사=미분=기울기 ) 가장 가파른 방향을 찾는다. 3차원으로 생각해보면 여러 편미분값 중 가장 가파른(가장 큰 편미분값) 방향을 선정하는 것. 2.보폭(학습률 α) 학습률(learning rate)은 경사하강법 수행 중 가중치를 수정할 때 이동할 보폭에 해당. 가장 중요한 하이퍼파라미터 중 하나. 학습률 크면 신경망 학습 빠르게 진행(오차 함수의 언덕을 큰 보폭으로 내려가므로) 학습률이 너무 크면 보폭 사이에 골이 존재할 경우 오찻값이 진동(oscillating)하기만 할 뿐 감소하지 않는다. 학습률이 너무 작으면 학습 시간이 오래 걸림. 학습률은 0.1 또는 0.01을 초깃값으로 설정한 다음 추후 조정. 3.방향..
-
[DL for VS #2] 순방향 계산 과정, 오차함수-평균제곱오차(MSE), 교차엔트로피, 오차와 가중치 관계(최적화 문제)Machine Learning/Deep Learning for Vision Systems 2023. 4. 7. 21:38
2.4.1 순방향 계산 과정 2.5 오차함수 비용함수(cost function) 또는 손실 함수(loss function)라고 불림. 신경망의 예측 결과가 바람직한 출력과 비교해서 얼마나 ‘동떨어졌는지’ 측정하는 수단. 손실값 크면 모델의 정확도가 낮다는 뜻. 2.5.2. 오차함수 필요성 최적화 문제와 관계됨. 최적화 문제는 오차 함수를 정의하고 파라미터(가중치)를 조정해서 오차 함수가 계산하는 오차를 최소가 되도록 하는 문제. 오차를 최소로 만드는 과정을 오차 함수 최적화(error function optimization)라고 함. 오차의 값은 항상 양수. 목표치에서 얼마나 떨어졌는지가 중요. 2.5.4 평균제곱오차(Mean Squared Error,MSE) 출력값이 실수인 회귀 문제에서 널리 사용하는..
-
[DL for VS #1] 활성화 함수 : sigmoid, softmax, tanh, ReLU, Leaky ReLUMachine Learning/Deep Learning for Vision Systems 2023. 4. 7. 20:59
컴퓨터 비전을 독학하고자 책을 찾던 중 괜찮은 책을 발견했다. 목차를 보면 많은 내용을 꽤나 자세하게 다루는 것을 알 수 있다. 내용을 자세한 수학 수식과 함께 그림으로 설명하고 있어서 컴퓨터 CV(computer vision)를 처음 접하는 비전공자(me)에게 적합한 것 같다. 해당 책은 케라스(keras) 라이브러리를 이용하여 딥러닝을 구현한다. * ANN (Artificial Neural Network, 인공신경망) * Deep Learning(딥러닝) * CNN(Convolutional Neural Network, 합성곱 신경망) : 이미지 처리 및 분류에서 활용 * DNN(Deep Neural Network, 심층 신경망) : 은닉층이 2개 이상인 신경망 * RNN(Recurrent Neural..