진단 기준: GAGS 점수 1-18점, T존 중심, 비염증성+경미한 염증성 병변
1단계: 각질 관리 (주 2-3회)
2단계: 수분 공급
3단계: 염증 진정
경제형 (2-3만원대)
중급형 (5-7만원대)
프리미엄 (10만원 이상)
진단 기준: GAGS 점수 19-30점, 전면부 분포, 염증성 병변 우세
1단계: 활성 성분 도입 (점진적)
2단계: 염증 집중 관리
3단계: 장벽 복구
액티브 케어 라인
데일리 케어 라인
1-2주차: 적응기
3-4주차: 안정기
5-8주차: 강화기
진단 기준: GAGS 점수 31점 이상, 결절성/낭종성 병변, 흉터 위험 높음
1단계: 즉시 피부과 진료 필수
2단계: 가정 관리 (의료진 지도하에)
3단계: 흉터 예방 집중
초순한 클렌징
집중 진정
자외선차단
즉시 병원 방문 신호
진단 기준: 헤어라인/목뒤 집중, 심한 가려움, 균일한 구진, 항생제 무반응
1단계: 진균 박멸 (2-4주)
2단계: 환경 개선
3단계: 재발 방지
항진균 치료
FA-Safe 스킨케어
사용 가능 성분
피해야 할 성분
진단 기준: 모공 중심 농포, 포도상구균 감염, 국소적 집중
1단계: 급성기 항균 치료 (1-2주)
2단계: 염증 진정 (2-3주)
3단계: 예방 관리
항균 치료
진정 관리
진단 기준: U존 집중, 생리 주기 연관, 성인 여성, 깊은 낭종성
1단계: 호르몬 안정화
2단계: 국소 치료
3단계: 장기 관리
집중 치료
데일리 케어
월경 전기 (3주차): 집중 케어
월경기 (4주차): 진정 관리
증식기 (1-2주차): 유지 관리
진단 기준: 여러 유형 혼재, 부위별 다른 양상, 복잡한 병력
1단계: 부위별 진단
2단계: 우선순위 설정
3단계: 통합 관리
올인원 솔루션
포인트 케어
월요일: T존 BHA + U존 레티놀 화요일: 전체 진정 케어 수요일: T존 BHA + 몸통 항균 목요일: 전체 수분 집중 금요일: 복합 케어 (부위별) 주말: 마스크팩 + 특별 관리
// 주요 분기점 설정
function primaryClassification(responses) {
const Q1 = responses.question1; // 주요 피부 고민
const Q2 = responses.question2; // 발생 부위
const Q3 = responses.question3; // 트러블 형태
const Q5 = responses.question5; // 환경 변화
const Q7 = responses.question7; // 가려움 정도
// 진균성 모낭염 우선 판별
if (Q2 === 'C' && Q7 >= 'C' && (Q5 === 'A' || Q5 === 'B')) {
return 'FUNGAL_FOLLICULITIS';
}
// 세균성 모낭염 판별
if (Q3 === 'C' && Q7 >= 'C' && Q5 === 'C') {
return 'BACTERIAL_FOLLICULITIS';
}
// 중증 낭종성 여드름 판별
if (Q1 === 'D' || Q3 === 'D') {
return 'SEVERE_CYSTIC_ACNE';
}
// 호르몬성 여드름 판별
if (Q2 === 'B' && responses.question4 === 'D' && responses.question12 === 'D') {
return 'HORMONAL_ACNE';
}
// 심상성 여드름 계열로 진행
return 'ACNE_VULGARIS_CLASSIFICATION';
}function acneVulgarisClassification(responses) {
const Q6 = responses.question6; // 피부 상태
const Q8 = responses.question8; // 치료 경험
const Q10 = responses.question10; // 치유 시간
const Q11 = responses.question11; // 세안 후 느낌
// 경증 여드름 판별
if (Q10 <= 'B' && (Q8 === 'C' || Q8 === 'D' || Q8 === 'E') && Q6 === 'A') {
return 'MILD_ACNE_VULGARIS';
}
// 중등도 여드름 판별
if (Q10 === 'B' && (Q8 === 'A' || Q8 === 'B') && (Q6 === 'B' || Q6 === 'C')) {
return 'MODERATE_ACNE_VULGARIS';
}
// 복합성 트러블
return 'MIXED_TYPE';
}function confidenceScore(responses, result) {
let confidence = 0;
const weights = {
'primary_symptoms': 0.3,
'location_match': 0.25,
'pattern_consistency': 0.2,
'treatment_history': 0.15,
'additional_factors': 0.1
};
// 각 영역별 일치도 계산
confidence += calculatePrimaryMatch(responses, result) * weights.primary_symptoms;
confidence += calculateLocationMatch(responses, result) * weights.location_match;
confidence += calculatePatternMatch(responses, result) * weights.pattern_consistency;
confidence += calculateTreatmentMatch(responses, result) * weights.treatment_history;
confidence += calculateAdditionalMatch(responses, result) * weights.additional_factors;
return Math.round(confidence * 100); // 백분율로 반환
}function exceptionHandling(responses, initialResult, confidence) {
// 신뢰도가 낮은 경우 (70% 미만)
if (confidence < 70) {
return {
result: 'MIXED_TYPE',
note: '복합적 양상으로 전문의 상담 권장',
alternatives: suggestAlternativeTypes(responses)
};
}
// 모순되는 응답 패턴 감지
const contradictions = detectContradictions(responses);
if (contradictions.length > 0) {
return {
result: initialResult,
note: '일부 응답이 모순적이므로 재검토 필요',
contradictions: contradictions
};
}
return {
result: initialResult,
confidence: confidence,
note: '진단 신뢰도가 높음'
};
}<!-- Tally 폼 내부 JavaScript 예시 -->
<script>
// 응답 수집 및 분석
function analyzeResponses() {
const formData = new FormData(document.querySelector('form'));
const responses = {};
// 모든 응답 수집
for (let [key, value] of formData.entries()) {
responses[key] = value;
}
// 1단계: 기본 분류
let primaryResult = primaryClassification(responses);
// 2단계: 세부 분류 (필요시)
let finalResult = primaryResult;
if (primaryResult === 'ACNE_VULGARIS_CLASSIFICATION') {
finalResult = acneVulgarisClassification(responses);
}
// 3단계: 신뢰도 계산
const confidence = confidenceScore(responses, finalResult);
// 4단계: 예외 처리
const analysis = exceptionHandling(responses, finalResult, confidence);
// 결과 페이지로 리다이렉트
redirectToResult(analysis);
}
// 결과별 리다이렉트 URL 설정
function redirectToResult(analysis) {
const baseURL = 'https://your-domain.com/results/';
const resultURLs = {
'MILD_ACNE_VULGARIS': baseURL + 'mild-acne',
'MODERATE_ACNE_VULGARIS': baseURL + 'moderate-acne',
'SEVERE_CYSTIC_ACNE': baseURL + 'severe-acne',
'FUNGAL_FOLLICULITIS': baseURL + 'fungal-folliculitis',
'BACTERIAL_FOLLICULITIS': baseURL + 'bacterial-folliculitis',
'HORMONAL_ACNE': baseURL + 'hormonal-acne',
'MIXED_TYPE': baseURL + 'mixed-type'
};
// URL 파라미터로 신뢰도와 추가 정보 전달
const params = new URLSearchParams({
confidence: analysis.confidence,
note: analysis.note,
timestamp: Date.now()
});
window.location.href = resultURLs[analysis.result] + '?' + params.toString();
}
</script>시작
↓
Q1,Q2,Q3 응답 분석
↓
├─ 헤어라인 + 가려움 → 진균성 모낭염
├─ 모공염증 + 가려움 → 세균성 모낭염
├─ 큰낭종 + 깊음 → 중증 낭종성
├─ U존 + 호르몬주기 → 호르몬성 여드름
└─ 기타 → 심상성 여드름 분류
↓
├─ 경미 + 빠른치유 → 경증
├─ 중등도 + 치료경험 → 중등도
└─ 혼재양상 → 복합성
↓
신뢰도 검증 (70% 이상)
↓
├─ 높음 → 최종 결과 제시
├─ 보통 → 주의사항과 함께 결과 제시
└─ 낮음 → 복합성으로 재분류 + 전문의 상담 권장
↓
맞춤 결과 페이지 이동<div class="diagnosis-header">
<h1>[피부 타입명]</h1>
<div class="confidence-score">진단 신뢰도: [X]%</div>
<div class="severity-indicator">[경증/중등도/중증]</div>
</div>**지금 당장 해야 할 3가지**
1. [즉시 중단] ❌ 현재 사용 중단해야 할 제품/행동
2. [오늘부터 시작] ✅ 바로 적용 가능한 케어법
3. [1주일 내] 📅 구매하거나 준비해야 할 것들**4주 집중 관리 플랜**
- 1주차: 적응기 (순한 제품으로 시작)
- 2주차: 안정기 (루틴 정착)
- 3주차: 강화기 (활성 성분 도입)
- 4주차: 평가기 (효과 판단 후 다음 단계 결정)| 예산대 | 클렌저 | 토너/세럼 | 크림 | 선케어 | 총 예산 |
|--------|--------|-----------|------|--------|---------|
| 경제형 | A제품 | B제품 | C제품 | D제품 | 8만원 |
| 표준형 | E제품 | F제품 | G제품 | H제품 | 15만원 |
| 프리미엄 | I제품 | J제품 | K제품 | L제품 | 30만원 |**즉시 병원 방문이 필요한 경우**
🚨 발열 (38도 이상) + 피부 병변
🚨 급속한 악화 (3일 내 2배 이상 증가)
🚨 심한 통증으로 일상생활 지장
🚨 2주 치료 후에도 전혀 개선 없음// 문항별 실시간 검증 및 동적 질문 조정
function dynamicQuestionAdjustment(currentQ, responses) {
// Q1에서 낭종성을 선택한 경우
if (currentQ === 1 && responses.Q1 === 'D') {
// Q3의 선택지를 낭종 관련으로 특화
updateQuestion3Options([
'단단하고 깊숙한 결절 (1cm 이상)',
'액체가 찬 것 같은 낭종',
'여러 개가 합쳐진 큰 병변',
'만지면 매우 아픈 깊은 염증'
]);
// Q7 가려움 질문을 통증 질문으로 변경
updateQuestion7({
text: '병변 부위의 통증 정도는?',
options: [
'통증 없음',
'약간 뻐근함',
'만지면 아픔',
'심한 통증으로 일상 지장',
'극심한 통증'
]
});
}
// Q2에서 헤어라인을 선택한 경우
if (currentQ === 2 && responses.Q2 === 'C') {
// Q5를 헤어 제품 관련으로 특화
updateQuestion5Options([
'새로운 샴푸/린스 사용 (1개월 내)',
'헤어 오일/세럼 사용 시작',
'모자 착용 빈도 증가',
'헤어 염색/파마 (3개월 내)',
'특별한 변화 없음'
]);
}
}// 각 문항별 가중치 및 점수 매트릭스
const scoringMatrix = {
FUNGAL_FOLLICULITIS: {
Q1: { C: 3, A: 1, B: 1, D: 0, E: 0 },
Q2: { C: 4, A: 1, B: 1, D: 2, E: 1 },
Q3: { C: 4, A: 1, B: 1, D: 0, E: 1 },
Q5: { A: 3, B: 4, C: 2, D: 1, E: 0 },
Q7: { D: 4, C: 3, B: 2, A: 0, E: 1 },
Q11: { C: 2, D: 3, A: 1, B: 1, E: 1 }
},
BACTERIAL_FOLLICULITIS: {
Q1: { C: 3, A: 2, B: 1, D: 1, E: 0 },
Q2: { D: 3, C: 2, A: 1, B: 1, E: 1 },
Q3: { C: 4, A: 2, B: 1, D: 1, E: 1 },
Q5: { C: 4, D: 2, A: 1, B: 1, E: 0 },
Q7: { C: 3, D: 2, B: 2, A: 1, E: 1 },
Q12: { C: 3, B: 2, A: 1, D: 1, E: 0 }
},
// ... 다른 타입들도 동일하게 정의
};
function calculateTypeScore(responses, type) {
const matrix = scoringMatrix[type];
let totalScore = 0;
let maxPossibleScore = 0;
for (let question in matrix) {
if (responses[question]) {
totalScore += matrix[question][responses[question]] || 0;
}
maxPossibleScore += Math.max(...Object.values(matrix[question]));
}
return (totalScore / maxPossibleScore) * 100;
}// 사용자 피드백을 통한 분기 로직 개선
class DiagnosisImprovement {
constructor() {
this.feedbackData = [];
this.accuracyThreshold = 85; // 85% 이상 정확도 목표
}
// 사용자 피드백 수집
collectFeedback(userId, responses, predictedType, actualType, satisfaction) {
this.feedbackData.push({
userId,
responses,
predicted: predictedType,
actual: actualType,
satisfaction,
timestamp: Date.now()
});
// 100개 피드백마다 모델 업데이트
if (this.feedbackData.length % 100 === 0) {
this.updateWeights();
}
}
// 가중치 자동 조정
updateWeights() {
const misclassifications = this.feedbackData.filter(
item => item.predicted !== item.actual
);
// 잘못 분류된 케이스 분석하여 가중치 조정
misclassifications.forEach(case => {
this.adjustWeightsForCase(case);
});
}
// 정확도 모니터링
getCurrentAccuracy() {
const recent100 = this.feedbackData.slice(-100);
const correct = recent100.filter(
item => item.predicted === item.actual
).length;
return (correct / recent100.length) * 100;
}
}// 문항별 지연 로딩
function lazyLoadQuestions() {
// 현재 문항만 렌더링, 다음 문항은 pre-fetch
const currentQuestion = getCurrentQuestion();
const nextQuestion = getNextQuestion(currentQuestion);
// 현재 문항 렌더링
renderQuestion(currentQuestion);
// 다음 문항 백그라운드 준비
preloadQuestion(nextQuestion);
}
// 결과 페이지 사전 생성
function preGenerateResults(partialResponses) {
const possibleTypes = getPossibleTypes(partialResponses);
// 가능성 높은 결과 2-3개만 사전 로드
possibleTypes.slice(0, 3).forEach(type => {
preloadResultPage(type);
});
}/* 모바일 친화적 UI */
@media (max-width: 768px) {
.question-container {
padding: 15px;
margin-bottom: 20px;
}
.option-button {
font-size: 16px; /* iOS 줌 방지 */
padding: 15px 20px;
margin-bottom: 10px;
touch-action: manipulation; /* 터치 지연 제거 */
}
.progress-bar {
position: sticky;
top: 0;
z-index: 100;
backdrop-filter: blur(10px);
}
}// 스마트 진행률 표시
function updateProgressWithContext(currentStep, responses) {
const progress = (currentStep / totalSteps) * 100;
const estimatedType = getEstimatedType(responses);
// 진행률과 함께 예상 결과 힌트 제공
updateProgressBar(progress, {
message: `${Math.round(progress)}% 완료`,
hint: estimatedType ? `${estimatedType} 가능성이 높습니다` : '',
remainingQuestions: totalSteps - currentStep
});
}
// 응답 신뢰도 실시간 피드백
function showConfidenceIndicator(responses) {
const confidence = calculateCurrentConfidence(responses);
const indicator = document.getElementById('confidence-indicator');
indicator.innerHTML = `
<div class="confidence-bar" style="width: ${confidence}%"></div>
<span>진단 정확도: ${confidence}%</span>
`;
// 낮은 신뢰도시 추가 질문 제안
if (confidence < 70) {
showAdditionalQuestionSuggestion();
}
}// 응답 일관성 검사
function validateResponseConsistency(responses) {
const inconsistencies = [];
// 예: 가려움 없다고 했는데 진균성 의심 부위 선택
if (responses.Q7 === 'A' && responses.Q2 === 'C') {
inconsistencies.push({
type: 'logical_conflict',
message: '헤어라인 부위 문제는 보통 가려움을 동반합니다',
suggestion: '7번 문항을 다시 확인해주세요'
});
}
// 예: 심한 여드름인데 치료 경험 없음
if (responses.Q1 === 'D' && responses.Q8 === 'E') {
inconsistencies.push({
type: 'severity_mismatch',
message: '중증 여드름에도 치료 시도가 없는 경우는 드뭅니다',
suggestion: '혹시 놓친 치료 경험이 있는지 확인해주세요'
});
}
return inconsistencies;
}
// 의료진 검토 큐 시스템
function flagForMedicalReview(responses, result, confidence) {
const flagCriteria = [
confidence < 60, // 낮은 신뢰도
result === 'SEVERE_CYSTIC_ACNE', // 중증 케이스
detectRareCombination(responses), // 희귀한 조합
hasRedFlags(responses) // 위험 신호
];
if (flagCriteria.some(criteria => criteria)) {
addToMedicalReviewQueue({
responses,
result,
confidence,
flagReason: getFlagReason(flagCriteria),
timestamp: Date.now()
});
}
}// A/B 테스트 결과 분석
class ABTestAnalyzer {
constructor() {
this.testGroups = {
'friendly': { completionRate: 0, satisfaction: 0, accuracy: 0 },
'professional': { completionRate: 0, satisfaction: 0, accuracy: 0 },
'empathetic': { completionRate: 0, satisfaction: 0, accuracy: 0 },
'mixed': { completionRate: 0, satisfaction: 0, accuracy: 0 }
};
}
analyzePerformance() {
return {
bestCompletionRate: this.getBestPerformer('completionRate'),
highestSatisfaction: this.getBestPerformer('satisfaction'),
mostAccurate: this.getBestPerformer('accuracy'),
recommendedVersion: this.getOverallRecommendation()
};
}
getOverallRecommendation() {
// 가중치: 완료율 40%, 만족도 35%, 정확도 25%
const weights = { completionRate: 0.4, satisfaction: 0.35, accuracy: 0.25 };
let bestScore = 0;
let bestVersion = '';
Object.keys(this.testGroups).forEach(version => {
const score = Object.keys(weights).reduce((sum, metric) => {
return sum + (this.testGroups[version][metric] * weights[metric]);
}, 0);
if (score > bestScore) {
bestScore = score;
bestVersion = version;
}
});
return { version: bestVersion, score: bestScore };
}
}// 진단 후 추적 관리
class FollowUpManager {
scheduleCheckups(userId, skinType, severity) {
const schedules = {
'MILD_ACNE_VULGARIS': [7, 21, 42], // 1주, 3주, 6주 후
'MODERATE_ACNE_VULGARIS': [5, 14, 28, 56], // 더 자주
'SEVERE_CYSTIC_ACNE': [3, 7, 14, 21, 28], // 매우 자주
'FUNGAL_FOLLICULITIS': [7, 14, 28], // 치료 반응 확인
'BACTERIAL_FOLLICULITIS': [3, 7, 14], // 감염 치료 모니터링
'HORMONAL_ACNE': [14, 28, 56, 84], // 호르몬 주기 고려
'MIXED_TYPE': [7, 21, 42, 84] // 복합적 관리
};
schedules[skinType].forEach(days => {
this.createReminder(userId, days, this.getCheckupType(days, skinType));
});
}
createReminder(userId, days, type) {
// 푸시 알림, 이메일, SMS 등으로 리마인더 발송
const reminderDate = new Date(Date.now() + days * 24 * 60 * 60 * 1000);
scheduleNotification({
userId,
date: reminderDate,
type,
message: this.getReminderMessage(type),
actionUrl: `https://your-domain.com/followup/${userId}`
});
}
}// 향후 AI 이미지 분석 기능 준비
class AIImageAnalysis {
async analyzeImage(imageFile, questionnaireResult) {
// 이미지 전처리
const preprocessed = await this.preprocessImage(imageFile);
// AI 모델 추론
const aiResult = await this.runInference(preprocessed);
// 설문 결과와 AI 결과 교차 검증
const combinedResult = this.combineResults(questionnaireResult, aiResult);
return {
confidence: combinedResult.confidence,
finalDiagnosis: combinedResult.diagnosis,
recommendations: combinedResult.recommendations,
needsHumanReview: combinedResult.confidence < 85
};
}
combineResults(questionnaireResult, aiResult) {
// 두 결과가 일치하면 높은 신뢰도
if (questionnaireResult.type === aiResult.type) {
return {
confidence: Math.min(95, (questionnaireResult.confidence + aiResult.confidence) / 2 + 15),
diagnosis: questionnaireResult.type
};
}
// 불일치시 낮은 신뢰도로 복합형 제안
return {
confidence: 60,
diagnosis: 'MIXED_TYPE',
note: '설문과 이미지 분석 결과가 달라 전문의 상담을 권장합니다'
};
}
}이렇게 완성된 시스템으로 정확하고 사용자 친화적인 피부 진단 서비스를 구축할 수 있습니다. 추가로 궁금한 부분이나 특정 기능에 대한 세부 구현이 필요하시면 언제든 말씀해 주세요!